How to avoid album thumbnail repetition inside the album? How to avoid album thumbnail repetition inside the album?
 

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

How to avoid album thumbnail repetition inside the album?

Started by celandine, August 25, 2008, 12:54:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

celandine

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
QuoteRe: 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?

Gizmo

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
<a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>

In place of
{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.
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

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

Gizmo

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

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:

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

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

                $query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";


replace with:

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