forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: embert on January 27, 2004, 03:26:16 am

Title: Custom fields clickable
Post by: embert on January 27, 2004, 03:26:16 am
I am building a digital photography website, and have enabled the 4 extra fields to store such info as photographer, camera type etc

What I would really love is to make these field contents clickable. eg if an image is taken with a Nikon 885, click on the "Nikon 885" to find ALL photos taken with that camera.

I know users can search for items in fileds, but a clickable option would make this very slick.

Is this possible?
Title: Custom fields clickable
Post by: Casper on January 27, 2004, 09:29:17 am
So what you want is for all words (or phrases) in the fields to count as keywords.

I will look into that.
Title: Custom fields clickable
Post by: Casper on January 27, 2004, 04:36:31 pm
There it was, in the faq all the time  :wink:

http://coppermine.sourceforge.net/faq.php?q=linksInCustomFields#linksInCustomFields
Title: Re: Custom fields clickable
Post by: alien_coder on December 08, 2004, 03:48:18 pm
Hi,
what in the FAQ stands,  is not exact that, that was needed.
Try this one:
in displayimage.php find (if you have 4 user fields):

    for ($i = 1; $i <= 4; $i++) {
        if ($CONFIG['user_field' . $i . '_name'] ) {
            if ($CURRENT_PIC_DATA['user' . $i] != "") {


add after this:

$info[$CONFIG['user_field'.$i.'_name']] = '<span class="alblink">' . preg_replace("/(\S+)/", "<a href=\"thumbnails.php?album=search&type=full&search=\\1\">\\1</a>" , $CURRENT_PIC_DATA['user' . $i]) . '</span>';
                     

that's all.
All the field will be clickable. If you want some of them to be not clickable check for i  ( if (i==1 or i==2), etc)  in the for-loop.