42 users online (1 members and 41 guests)  

Thread: Random Images


  Results 1 to 2 of 2

Related

  1. Random Images using CSS files    Forum: CSS Forum
    Replies: 3
  2. Random Boxes?? Help!    Forum: Myspace Forum
    Replies: 0
  3. Random Images Advanced    Forum: HTML Forum
    Replies: 4
  4. multiple random images    Forum: PHP Forum
    Replies: 21
  5. random images php script    Forum: PHP Forum
    Replies: 3
  1. #1
    jboy10332010's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2011
    Posts
    2

    Random Images

    Hey everyone, so the site that I am managing currently has the following code for it's imaging:

    <ul class="gallery-items ib-fix">
    <?
    if (!empty($items_q)) {
    foreach ($items_q as $item) {
    list($w,$h) = @getimagesize(ROOT.$item['image']);
    echo "<li class=\"item\"><div>\n"
    ."<a href=\"".ROOT."/gallery/item/{$item['slug']}\" class=\"item-image\" style=\"width:".$w."px; height:".$h."px; margin-top: ".(160-$h)."px;\">"
    ."<img src=\"".ROOT."{$item['image']}\" alt=\"".str_replace('"',"'",$item['name'])."\" />"
    .(($item['sold']{0} != '0')? "<span class=\"sold-ribbon\"></span>": "")
    ."</a>\n"
    ."<a href=\"".ROOT."/gallery/item/{$item['slug']}\" class=\"item-name\">{$item['name']}</a>\n"
    .(($all)?"<div class=\"item-category\"><span><a href=\"".ROOT."/gallery/{$item['cslug']}\" title=\"View all items in the {$item['category']} category.\">{$item['category']}</a></span></div>\n":"")
    ."</div></li>";
    }
    } else {
    echo "<p class=\"no-items\">Sorry, there are no items in the {$active_category['category_name_plural']} category.</p>";
    }
    ?>
    </ul>


    I have been having trouble changing the code so that it only shows one item, chosen at random, for each category. Every time I change it, it also changes the individual category pages. Any suggestions?

  2. #2
    jboy10332010's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2011
    Posts
    2

    Re: Random Images

    I took over the website from another manager, so I'm not familiar with her coding. The page I am currently updating is danielbuckappraisals.com/home/gallery.php