Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Adding the Title of Last Uploaded to Albums in Album View  (Read 3643 times)

0 Members and 1 Guest are viewing this topic.

Jaero

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • http://me.warcry.com
Adding the Title of Last Uploaded to Albums in Album View
« 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.
Logged
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com

Jaero

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
    • http://me.warcry.com
Re: Adding the Title of Last Uploaded to Albums in Album View
« Reply #1 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.
Logged
Jaero - jaero@warcry.com
Site Manager - ME Warcry
http://me.warcry.com

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Adding the Title of Last Uploaded to Albums in Album View
« Reply #2 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.
Logged
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

  • Guest
Re: Adding the Title of Last Uploaded to Albums in Album View
« Reply #3 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 22 queries.