Breadcrumbs and album keywords Breadcrumbs and album keywords
 

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

Breadcrumbs and album keywords

Started by sjordan, April 12, 2006, 09:14:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sjordan

I do like the album keyword features that allows it to appear as if a picture has been uploaded to multiple albums when in fact it has only been uploaded to one ...

QuoteIn 1.4.x the Album Keyword is no longer being used for searching purposes, but, rather, to link images from other album into another. Using this method, files/images can be displayed in various albums while the file itself need only exists in one album on your webserver. You simply upload a file to one album as you would normally do, then assign one or more keywords to the file. The keyword function reads blank spaces between words as a 'break' and assumes that these words are separate words. If you must use phrases for your keywords, connect them with an underscore or by using the ascii space holder ctrl+Alt+0160 (NOTE: the latter option only works with latin based character sets.) Each album can only have ONE (1) keyword or keyword phrase. All pictures residing in different albums that you would like to be displayed in this album must have the same keyword or keyword phrase in their respective keyword fields. Pictures, unlike albums can have multiple keywords or keyword phrases separated by spaces. This provides you with the option to display pictures in many albums. For the visitor of these albums, it will appear as if the file/image had been uploaded to each.

However, I have one question.

As an example ...

I have a picture of a lion. I have three albums 1) cats, 2) animals, and 3) Africa.

I assign the keyword 'cats' to the cats album. I assign the keyword 'animals' to the animals album. And I assign the keyword 'africa' to the Africa album.

I upload the lion picture to the cats album and assign the keywords 'cats', 'animals', and 'africa' to the picture.

Now when I click on the cats album from the home page, the thumbnail of the lion appears on the resulting page and the breadcrumb along the top appears as
QuoteHome > Cats

when I click on the animals album from the home page, the thumbnail of the lion appears on the resulting page and the breadcrumb along the top appears as
QuoteHome > Animals

when I click on the Africa album from the home page, the thumbnail of the lion appears on the resulting page and the breadcrumb along the top appears as
QuoteHome > Africa

Clicking on the thumbnail takes me to the displayimage.php page with the picture's full details. And regardless of the path I followed to get to displayimage.php (ex. through clicking cats, animals, or africa album) the breadcrumb along the top of displayimage.php appears as
QuoteHome > Cats

Hence, my question. How do I maintain true nature/spirit of breadcrumbs to display the actual path followed to the detailed info page? (i.e How do I maintain the illusion that the lion picture is in all three albums?)

Thank you in advance.


sjordan

Any of the developers, moderators, or experienced CPG users got any thoughts on the above?

Thanks

sjordan

I'm scratching my head (still) and would really like to hear your insights (NOT incites). :-)

Paver

I think I got it.  Search for the following lines in displayimage.php:
// Retrieve data for the current album
if (isset($CURRENT_PIC_DATA)) {
    $result = cpg_db_query("SELECT title, comments, votes, category, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$CURRENT_PIC_DATA['aid']}' LIMIT 1");

and add in a line before the last one and modify the last one as shown:
// Retrieve data for the current album
if (isset($CURRENT_PIC_DATA)) {
    $ref_album = (is_numeric($album) ? $album : $CURRENT_PIC_DATA['aid']);
    $result = cpg_db_query("SELECT title, comments, votes, category, aid FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid='{$ref_album}' LIMIT 1");

sjordan

Paver,

Thank you very much. That seems to do the trick.

Thank you again.

Paver

You're welcome.  Marking thread "solved".

You were right to say this is not "proper" breadcrumb behavior.  I'm going to add it to the 'devel' branch, but I need to make sure there aren't any weird side-effects.  I don't think there are but I can see a case where someone sets different comments & votes permissions for 2 albums with the same linked photo and since the comments and votes are added to the photo, you would have seemingly contradictory access to the photo's comments & votes.  But I think this would be "normal" operation for having linked photos.

If you have any experience with this while using my mod, please say so.