Custom fields clickable Custom fields clickable
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Custom fields clickable

Started by embert, January 27, 2004, 03:26:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

embert

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?

Casper

So what you want is for all words (or phrases) in the fields to count as keywords.

I will look into that.
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

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

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.