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: How to avoid album thumbnail repetition inside the album?  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

celandine

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
How to avoid album thumbnail repetition inside the album?
« on: August 25, 2008, 12:54:43 pm »

Just set up album thumbnails which I understood to become 'cover icons' to identify each of my main albums.
Opened each album to find the cover thumbnail on the inside. Is there a means to prevent this repetition?

I searched for this and found
Quote
Re: Icon for Album Name on Thumpages appears twice
but the code referred to in theme.php is no longer there in my (latest) version.

Or will the album thumbnail be sent to the back and become lost as more images are added to each album?
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: How to avoid album thumbnail repetition inside the album?
« Reply #1 on: August 25, 2008, 02:55:00 pm »

If you set the album cover pic as in the instructions then this pic will always be used. If you wish to have a cover pic but not have this pic appear in the album then you will need to copy these two variables ($template_album_list and $template_album_list_cat) from the sample theme theme.php and paste them into your template theme.php before the end ?> then edit the line
Code: [Select]
<a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
In place of
Code: [Select]
{ALB_LINK_PIC}
add an image tag with the pic link of your choice. I'm not where I can be more specific until later today if you need more info but this should get you going.
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

celandine

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: How to avoid album thumbnail repetition inside the album?
« Reply #2 on: August 26, 2008, 10:47:23 am »

Thanks for responding Gizmo.
Added both variables as suggested before adding the image tag with 'no apparent change in the result. But even if it had worked, by adding the img tag as you suggest wouldn't that simply upload the same image for all my album covers? (I've got ten very different albums).
Logged

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: How to avoid album thumbnail repetition inside the album?
« Reply #3 on: August 26, 2008, 06:16:21 pm »

Yes you are right and I apologize for that. I was working from my handheld and wasn't able to test it at the time. In order to do what you want, you will need to write code to apply a different image to each album.

As a side note the right format to use is
Code: [Select]
<a href="{ALB_LINK_TGT}" class="albums"><img class="image" height="X" width="Y" border="0" alt="some text here" src="image location"/><br /></a>
[EDIT] Check out this post on album thumbnails. This looks very promising for what you want to do.
« Last Edit: August 26, 2008, 06:50:59 pm by Gizmo »
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision

Gizmo

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1015
    • BullsEye Photos
Re: How to avoid album thumbnail repetition inside the album?
« Reply #4 on: August 26, 2008, 10:45:31 pm »

I wanted to get to the bottom of this so here's the instructions for getting this done.

in functions.inc.php (CPG v1.4.19)
find on line 956:
Code: [Select]
                $query = "SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE ((aid='$album' $forbidden_set_string ) $keyword) $approved $ALBUM_SET ORDER BY $sort_order $limit";

replace with:
Code: [Select]
                $query = "SELECT $select_columns from {$CONFIG['TABLE_PICTURES']} WHERE title <> 'Album Thumbnail Only' AND ((aid='$album' $forbidden_set_string ) $keyword) $approved $ALBUM_SET ORDER BY $sort_order $limit";

then find on line 1232:
Code: [Select]
                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";

replace with:
Code: [Select]
                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE title <> 'Album Thumbnail Only' AND approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";

Now if the image you want to use isn't in the album yet, upload it as usual. Using the Album Admin Menu > Edit Files change the Title to Album Thumbnail Only. Now the pic won't show in the album or in the Random Files. If you have statistics turn on for albums it will show 3 files but only 2 will be visible.

To make the image viewable again in the album, remove Album Thumbnail Only from the title.

Pretty cool!  ;D
Logged
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.