Adding the Title of Last Uploaded to Albums in Album View Adding the Title of Last Uploaded to Albums in Album View
 

News:

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

Main Menu

Adding the Title of Last Uploaded to Albums in Album View

Started by Jaero, November 09, 2004, 12:10:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jaero

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.
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com

Jaero

Eek, I apologize - I think I put this in the wrong forum.  :-[ Please spare my life, gaugau.
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com

Casper

Quote from: 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.

ROFLMFAO

I will move this to the support board for you.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Nibbler

In your index.php, find the first occurence of:


// Prepare everything


and replace with


       // 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


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


to


$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.