WordPress.org

Ready to get started?Download WordPress

Forums

random pictures (8 posts)

  1. arcticreaver
    Member
    Posted 8 years ago #

    i had this posted a while back but i couldn't find where i posted the topic, but here goes again.

    basically i had to delete everything and start a new site because there was just so much crap spam everywhere on the site. i couldn't take it. so you guessed it. i lost all my files and yes i did back up but you know what, my hard drive went dead on me. yeah, it's was swell.

    so now i'm trying to rebuild the site, it's super plain at the moment and i'm trying to add some pictures on the site. i want to add a place where i have some pictures but only i want them random. either i can refresh the page and a new picture is there or actually i can actually get something that changes similar to this - http://spaces.msn.com/members/samyang7/

    i want something like the photo album. so is there some kind of code that i could use or those wordpress have something similar?

  2. jwurster
    Member
    Posted 8 years ago #

    For putting random images in my sidebar, I used http://www.prissed.com/2005-04/plugin-multiple-random-images/.
    See if that is what you want.

  3. arcticreaver
    Member
    Posted 8 years ago #

    yeah something like that. could you please share you code?

  4. slambert
    Member
    Posted 8 years ago #

    This guy has a good randomizing script:

    http://andersdrengen.dk/projects/randomize/

  5. Could also always go the old fashioned hard-coded way:

    <?php

    $images = array([1] => 'image1.jpg', [2] => 'image2.gif', [3] => 'foobar.png');

    echo '<img src="' . $images[rand(1, count($images))] . '" alt="Random Image" />';

    ?>

  6. techwench
    Member
    Posted 8 years ago #

    jwurster, that link is defunct now. Here's the new link:

    http://www.techwench.com/04-2005/plugin-multiple-random-images/

  7. arcticreaver
    Member
    Posted 8 years ago #

    i'm getting this error when i activate the plugin -

    Database error: [Table 'samsblog_database.wp_Randomize' doesn't exist]
    SELECT posted FROM wp_Randomize ORDER BY posted ASC

    Database error: [Table 'samsblog_database.wp_Randomize' doesn't exist]
    SELECT posted FROM wp_Randomize ORDER BY posted DESC

    what's up with that?

  8. andemad
    Member
    Posted 8 years ago #

    >> what's up with that?

    I dunno? That's weird...
    It's when you press 'activate'?

    Can you check with a MySQL-viewer of some kind if a '(something)Randomize' table is present?

Topic Closed

This topic has been closed to new replies.

About this Topic