forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 themes (visuals) => Topic started by: Hanna. on June 12, 2018, 05:30:58 pm

Title: Latest images fetch; need to specify category
Post by: Hanna. 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);
require('include/init.inc.php');

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

if(isset($_GET['album'])){
    $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
if(!isset($album)){
     $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!