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: Custom fields clickable  (Read 4325 times)

0 Members and 1 Guest are viewing this topic.

embert

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Custom fields clickable
« 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?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Custom fields clickable
« Reply #1 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Custom fields clickable
« Reply #2 on: January 27, 2004, 04:36:31 pm »

Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

alien_coder

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Custom fields clickable
« Reply #3 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.