Clickable keywords above or below intermediate image Clickable keywords above or below intermediate image
 

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

Clickable keywords above or below intermediate image

Started by nickelas, August 10, 2011, 01:00:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickelas

I would like to put the keywords as links always showing above or below the intermediate picture (just like the file information but a bit more visible and without the other info). Is there any way of grabbing the linked keywords (and then assign them to a token)?
Thanks
Bilder av Uppsala
Human

ΑndrĂ©

You could use this code from displayimage.php to create the keyword links:
    if ($CURRENT_PIC_DATA['keywords'] != '') {
        if ($CONFIG['keyword_separator'] == ' ') {
            $info[$lang_common['keywords']] = '<span class="alblink">'
                . preg_replace("/([^{$CONFIG['keyword_separator']}]+)/"
                        , '<a href="thumbnails.php?album=search&amp;keywords=on&amp;search=$1">$1</a>'
                        , $CURRENT_PIC_DATA['keywords'])
                . '</span>';
        } else {
            $keyword_links = '';
            foreach (explode($CONFIG['keyword_separator'], $CURRENT_PIC_DATA['keywords']) as $keyword) {
                $keyword_links .= ($keyword_links ? ' '.$CONFIG['keyword_separator'].' ' : '')
                        . '<a href="thumbnails.php?album=search&amp;keywords=on&amp;search='
                        . str_replace(' ', '+', $keyword)
                        . '">' . $keyword . '</a>';
            }
            $info[$lang_common['keywords']] = '<span class="alblink">'
                . $keyword_links
                . '</span>';
        }
    }

nickelas

Thanks!
So if anyone else is interested I put the code above in theme_html_picture. Then assigned a var to $info[$lang_common['keywords']], and put that var in a token in template_display_media
If I knew how to code plugins I'd do it that way but the hack above appears to be working :)
Human