Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: random thumb in anycontent ?  (Read 4089 times)

0 Members and 1 Guest are viewing this topic.

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
random thumb in anycontent ?
« 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

« Last Edit: January 25, 2008, 10:22:59 am by Joachim Müller »
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: random thumb in anycontent ?
« Reply #1 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
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: random thumb in anycontent ?
« Reply #2 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
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: random thumb in anycontent ?
« Reply #3 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";
?>
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: random thumb in anycontent ?
« Reply #4 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";
?>
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: random thumb in anycontent ?
« Reply #5 on: January 25, 2008, 10:18:55 am »

thanks a bunch
Logged

Alfinators

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • My Page
Re: random thumb in anycontent ?
« Reply #6 on: February 21, 2008, 11:43:38 pm »

Super! And how i make picture with border=0?
Logged

Alfinators

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • My Page
Re: random thumb in anycontent ?
« Reply #7 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";
?>
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.