Tweak

InsaneJournal

Tweak says, "As you wish..."

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.


(Read comments) - (Post a new comment)


[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)


(Read comments) -


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