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: Change lastalb function to display album thumbnail?  (Read 6898 times)

0 Members and 1 Guest are viewing this topic.

rap.nospam

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Change lastalb function to display album thumbnail?
« on: July 26, 2007, 08:39:56 am »

Hi,

I have activated the lastalb display on my galleries main page (http://www.pollai.at) and it works fine, the only thing I notice it that it somehow randomly chooses the picture it displays as thumb for the album (or possible it uses the last modified picture). My question would be if you guys could give me a hint where to start if I want to modify this behaviour to have it display the defined album thumbnail?

Thanks and regards, Robert
« Last Edit: July 26, 2007, 09:30:50 am by Nibbler »
Logged

Nibbler

  • Guest
Re: Change lastalb function to display album thumbnail?
« Reply #1 on: July 26, 2007, 08:42:45 am »

Take a look at the 'lastalb' case in get_pic_data (include/functions.inc.php). Changing the sql query should be enough, but I don't have a test setup.
Logged

rap.nospam

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Change lastalb function to display album thumbnail?
« Reply #2 on: July 26, 2007, 09:20:11 am »

Hi Nibbler,

Thanks for the prompt reply, that worked.

In case anybody is interested in that modification, I changed the second query (line 1274 in 1.4.10) to:

$query = "SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.pid = {$CONFIG['TABLE_ALBUMS']}.thumb AND {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $META_ALBUM_SET ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";

The modifications are adding the check for the album thumb in the WHERE clause and removing the GROUP BY clause.

Regards, Robert
Logged

fvalka

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Change lastalb function to display album thumbnail?
« Reply #3 on: September 14, 2008, 10:02:45 am »

Please note the your modification will only display the album in the lastalb overview if it has a thumbnail set.

I used the following Hack to display the album thumbnail if there is any, if not do as before:

$query = "SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' AND {$CONFIG['TABLE_PICTURES']}.pid LIKE IF({$CONFIG['TABLE_ALBUMS']}.thumb=0,'%',{$CONFIG['TABLE_ALBUMS']}.thumb) $META_ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";

Maybe it will help someone.

Tested it on 1.4.19.

Greetings
Fabian
               
Logged

shivas

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
  • I love you, you love I?
    • Photosmile
Re: Change lastalb function to display album thumbnail?
« Reply #4 on: June 28, 2009, 04:19:23 pm »

Could someone post the same thing for 1.4.22(stable), because i searched the lines and couldnt find it...
Logged
Get on your Dancing shoes!

shivas

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
  • I love you, you love I?
    • Photosmile
Re: Change lastalb function to display album thumbnail?
« Reply #5 on: June 28, 2009, 04:35:35 pm »

Thats ok i fixed it! Tested on 1.4.22 aswell and it works.
You can find this on line 1318 in the /include/functions.inc.php
You just add the following code in bold letters
Please note the your modification will only display the album in the lastalb overview if it has a thumbnail set.

I used the following Hack to display the album thumbnail if there is any, if not do as before:

$query = "SELECT *,{$CONFIG['TABLE_ALBUMS']}.title AS title,{$CONFIG['TABLE_ALBUMS']}.aid AS aid FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' AND {$CONFIG['TABLE_PICTURES']}.pid LIKE IF({$CONFIG['TABLE_ALBUMS']}.thumb=0,'%',{$CONFIG['TABLE_ALBUMS']}.thumb) $META_ALBUM_SET GROUP BY {$CONFIG['TABLE_PICTURES']}.aid ORDER BY {$CONFIG['TABLE_PICTURES']}.ctime DESC $limit";

Maybe it will help someone.

Tested it on 1.4.19.

Greetings
Fabian
               
Logged
Get on your Dancing shoes!

Zer0

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 13
    • Party25 - Fotogalerie
Re: Change lastalb function to display album thumbnail?
« Reply #6 on: September 03, 2011, 03:10:44 pm »

Could someone post the same thing for 1.5.16 pls...
Thx
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 20 queries.