forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: antisa33 on June 01, 2007, 12:50:24 am

Title: random thumb in anycontent ?
Post by: antisa33 on June 01, 2007, 12:50:24 am
Hello all people

I need to see a random thumbnail in the anycontent.php file.

Is there a way to do it easily ?

Best regards

Title: Re: random thumb in anycontent ?
Post by: antisa33 on June 01, 2007, 01:45:50 am
I have found this one

<?
    $randoms = 1;
    for($i=0; $i < $randoms; $i++){
      $image = get_pic_data('random', $count, $album_name, 0, 1, false);
      $image = current($image);
      $random_images = "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
                     "<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
                     "class=\"leftmenuimage\"\></a><br /><br />";
    }

echo "$random_images";
?>

But i need a thumb from only the categorie 3, how can i do it ?

Thanks
Title: Re: random thumb in anycontent ?
Post by: antisa33 on June 01, 2007, 02:35:51 am
Sorry for my post but i dont find the "edit" option  :-\

I cant do what i want  with cpmfetch because I need in anycontent.php, to select by rand() a swf file from the categorie 3 with a lot of albums for example.
Then i need to play with this swf file on the anycontent and i have to see a link to this swf file in his album.

Is it possible?

Thanks a lot
Title: Re: random thumb in anycontent ?
Post by: Gephri on January 24, 2008, 10:32:25 pm
The following code (posted earlier) works great for pulling a single random image onto anycontent.php - but how can it be tweaked to pull in 5 random images horizontally?
Please.
Code: [Select]
<?
    $randoms = 1;
    for($i=0; $i < $randoms; $i++){
      $image = get_pic_data('random', $count, $album_name, 0, 1, false);
      $image = current($image);
      $random_images = "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
                     "<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
                     "class=\"leftmenuimage\"\></a><br /><br />";
    }

echo "$random_images";
?>
Title: Re: random thumb in anycontent ?
Post by: Joachim Müller on January 25, 2008, 08:05:39 am
Code: [Select]
<?
    $randoms = 5;
    for($i=0; $i < $randoms; $i++){
      $image = get_pic_data('random', $count, $album_name, 0, 1, false);
      $image = current($image);
      $random_images .= "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
                     "<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
                     "class=\"leftmenuimage\"\></a>";
    }

echo "$random_images";
?>
Title: Re: random thumb in anycontent ?
Post by: Gephri on January 25, 2008, 10:18:55 am
thanks a bunch
Title: Re: random thumb in anycontent ?
Post by: Alfinators on February 21, 2008, 11:43:38 pm
Super! And how i make picture with border=0?
Title: Re: random thumb in anycontent ?
Post by: Alfinators on February 22, 2008, 02:19:50 am
  ;)
Code: [Select]
<?
    $randoms = 1;
    for($i=0; $i < $randoms; $i++){
      $image = get_pic_data('random', $count, $album_name, 0, 1, false);
      $image = current($image);
      $random_images .= "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
                     "<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
                     "class=\"leftmenuimage\" border=\"0\"\></a>";
    }

echo "$random_images";
?>