Tweak

InsaneJournal

Tweak says, "I LOVE THE QAFANDOM."

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
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 comment in response:

From:
( )Anonymous- this user has disabled anonymous posting.
( )OpenID
Username:
Password:
Don't have an account? Create one now.
Subject:
No HTML allowed in subject
  
Message:
 

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