Tweak

InsaneJournal

Tweak says, "I have misplaced my pants."

Username: 
Password:    
Remember Me
  • Create Account
  • IJ Login
  • OpenID Login
Search by : 
  • View
    • Create Account
    • IJ Login
    • OpenID Login
  • Journal
    • Post
    • Edit Entries
    • Customize Journal
    • Comment Settings
    • Recent Comments
    • Manage Tags
  • Account
    • Manage Account
    • Viewing Options
    • Manage Profile
    • Manage Notifications
    • Manage Pictures
    • Manage Schools
    • Account Status
  • Friends
    • Edit Friends
    • Edit Custom Groups
    • Friends Filter
    • Nudge Friends
    • Invite
    • Create RSS Feed
  • Asylums
    • Post
    • Asylum Invitations
    • Manage Asylums
    • Create Asylum
  • Site
    • Support
    • Upgrade Account
    • FAQs
    • Search By Location
    • Search By Interest
    • Search Randomly

Ally -- are you already gone? ([info]wastintime) wrote in [info]rp_tutorials,
@ 2011-10-22 18:27:00

Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:tools: general, tools: html

Random Image Grabber



Refresh this page and this image will change to a random pick of nine images.

The first thing you need to do is rename all of your files of the same file type to be a file prefix (optional) followed by a incrementing number. Then, upload them to a directory online the preserves the file name (Photobucket, FileDen, etc.) Finally, use the following code to fetch the random image script which will return the URL of a random image.

The Code


YOUR_DIRECTORY → the directory where you've uploaded your image files
YOUR_FILE_PREFIX → the prefix you've put on each file (optional)
YOUR_BEGINNING_NUMBER → the lowest/highest number in your series of images
YOUR_ENDING_NUMBER → the highest/lowest number in your series of images
YOUR_FILE_EXTENSION → the file extension on your files

What can you do with this? Well, my purpose for it was to make a header on a journal that changes every time you refresh. You can see an example here, but I'm sure you can find oodles of other uses for the trick. Have fun! If anyone wants the actual PHP script file, let me know in the comments.

Questions/Feedback? Leave a comment to this post.


(Post a new comment)


[info]asphyxiated
2011-10-23 12:30 am UTC (link)
I've wanted to know how to do this a million times, but was always too lazy to figure it out myself. Thank you so much. ♥

(Reply to this) (Thread)


[info]wastintime
2011-10-23 12:36 am UTC (link)
You're welcome! Now, my goal is figure out something that will make the image reload every X seconds without reloading the page. WHICH WOULD BE REALLY EASY IF WE COULD USE JAVASCRIPT. :[

(Reply to this) (Parent)


[info]standonthat.livejournal.com
2011-10-23 02:10 pm UTC (link)
This is excellent, thank you!

(Reply to this)


[info]muirnin
2011-10-25 07:19 pm UTC (link)
I have wanted this for YEARS. Thank you!

(Reply to this)


[info]fadesmod
2011-10-29 06:39 am UTC (link)
thank you for this!

(Reply to this)


[info]townsquare
2011-11-27 02:08 pm UTC (link)
Nevermind, I got it to work, thank you so much! I typically use a few different images with the same theme to advertise, so this is a great help in not having to pick different files for different comms. And people can see all the ads in just one comm.

I'm using it here and in ad comms like here.

(Reply to this)


[info]townsquare
2012-02-15 03:49 pm UTC (link)
Hello! I was wondering if you could upload the zip of the script, so that I could upload it to my own server? Thank you so much!

(Reply to this)


[info]too_much
2012-05-15 02:22 am UTC (link)
Is there a way to edit this, so instead of photos it's text?

(Reply to this)

pandan
[info]passing123
2012-07-10 07:43 am UTC (link)
Thank you ve S810 Smart Phone
ry much this article well written, learned a lot, and later continue to monitor, there are some recomasdasdmended Maryland, and its common stock is listed on the New York Stock Exchang

(Reply to this)


[info]ex_nikkis925
2012-07-20 05:50 am UTC (link)
Where do you put this code?

(Reply to this)



Home | Site Map | Manage Account | TOS | Privacy | Support | FAQs