forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: Jaero on November 09, 2004, 12:10:28 am

Title: Adding the Title of Last Uploaded to Albums in Album View
Post by: Jaero on November 09, 2004, 12:10:28 am
I have two galleries. Each is for two things.

http://gallery.planetmeo.com/index.php is for images from the game, as well as multimedia downloads (video, audio, etc).
http://forums.planetmeo.com/fanart/ is for both fan art (images) and fan fiction (documents).

My request is this: In each gallery, for both the downloads and the fiction, in the Album list I would like to be able to list the title of the last file uploaded to that album. For example, under "1 files, last one added on Nov 06, 2004" having a line that says "Most Recent: Official Trailer 1".

Also, if it's possible, I want this only occur in certain albums or categories (being the Multimedia and Fan Fiction cats). Is it possible to designate a feature like this based on category or album number(s)?

Any help would be greatly appreciated. For the purposes of both galleries, having only a thumbnail in albums that don't host images but documents and other media instead doesn't tell the viewers much.
Title: Re: Adding the Title of Last Uploaded to Albums in Album View
Post by: Jaero on November 09, 2004, 12:15:58 am
Eek, I apologize - I think I put this in the wrong forum.  :-[ Please spare my life, gaugau.
Title: Re: Adding the Title of Last Uploaded to Albums in Album View
Post by: Casper on November 09, 2004, 12:37:32 am
Eek, I apologize - I think I put this in the wrong forum.  :-[ Please spare my life, gaugau.

ROFLMFAO

I will move this to the support board for you.
Title: Re: Adding the Title of Last Uploaded to Albums in Album View
Post by: Nibbler on November 09, 2004, 01:00:54 pm
In your index.php, find the first occurence of:

Code: [Select]
// Prepare everything

and replace with

Code: [Select]
       // Prepare everything
$aidstr = '(2,3)';
$catstr = '(0,1,4,2)';
if (isset($alb_stat['last_pid'])) {
$res = db_query("SELECT p.title FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a WHERE pid = ".$alb_stat['last_pid'] . " AND p.aid in $aidstr OR (p.aid = a.aid AND category in $catstr)");
if (mysql_num_rows($res)) {
$row = mysql_fetch_row($res);
$recent = '<br />Most recent: <a href="displayimage.php?pos=-'.$alb_stat['last_pid'].'">'.$row[0] . '</a>';
} else $recent = "";
mysql_free_result($res);
}

and alter

Code: [Select]
$alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "");

to

Code: [Select]
$alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) . $recent : "");

a few lines down.

Change the numbers in brackets to suit which albums and cats to enable the display for.