Advanced search  


cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.

Pages: [1]   Go Down

Author Topic: Latest images fetch; need to specify category  (Read 84 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine frequent poster
  • ***
  • Country: us
  • Offline Offline
  • Gender: Female
  • Posts: 130
  • webstar
Latest images fetch; need to specify category
« on: June 12, 2018, 05:30:58 pm »

Hi all!. I have been using this amazing set up for fetching images from Coppermine in HTML. However, now I need some assistance to specify category from where to fetch latest images:

Code: [Select]
define('IN_COPPERMINE', true);
define('INDEX_PHP', true);

//How many items you want to show in your get_photo script
if(isset($_GET['nb'])) {
} else {
     $thumb_per_page = 36;
$thumb_count = 36;
$lower_limit = 0;

    $album = $_GET['album'];

//If it is a numeric album get the name and set variables
if ((is_numeric($album))){
     $album_name_keyword = get_album_name($album);
     $CURRENT_CAT_NAME = $album_name_keyword['title'];
     $ALBUM_SET = "AND aid IN (".(int)$_GET['album'].")".$ALBUM_SET;
     //Set the album to last uploaded
     [b]$album = 'lastup';[/b]

//If the album is not set set it to lastup - this is the default
     $album = 'lastup';

//Changes these to point to your site if the following is not giving correct results.
$link_url = $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url = $CONFIG['ecards_more_pic_target']."albums/";

$data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);

foreach($data AS $picture) {
    $thumb_url = "$image_url$picture[filepath]$CONFIG[thumb_pfx]$picture[filename]";
    $description = '<a target="_blank" href="' . $link_url . $picture['pid'] . '"><img class="gallery" width="90" src="' . $thumb_url . '" border="0" alt="Photos"/></a> ';
    echo $description;



The BOLD is where I tried to simply add &cat=89 as it goes in the URL, but it won't work. I hope it does not take too long to help me get this code to grab lastup IN THE cat 89 (for example). Thank you in advance!
Pages: [1]   Go Up

Page created in 0.018 seconds with 20 queries.