Advanced search  

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

Pages: [1]   Go Down

Author Topic: Make custom fields clickable  (Read 7425 times)

0 Members and 1 Guest are viewing this topic.

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Make custom fields clickable
« on: June 07, 2010, 04:41:08 pm »

I have 3 image custom fields and was wondering if it is possible to make them clickable, much the same way that the keywords work?

www.niaviation.co.uk/gallery/index.php

testuser
password2010

Many thanks in advance.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Make custom fields clickable
« Reply #1 on: June 07, 2010, 04:47:29 pm »

Take a look at the thread Clickable and Searchable image description Custom field that was written for cpg1.4.x and see if it works for cpg1.5.x as well. Please report back.
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Make custom fields clickable
« Reply #2 on: June 07, 2010, 05:34:56 pm »

I'll take a look and report back. Many thanks.
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Make custom fields clickable
« Reply #3 on: June 07, 2010, 11:34:03 pm »

The replacement code
Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = '<a href ="thumbnails.php?album=search&search='.$CURRENT_PIC_DATA['user' . $i].'">'.$CURRENT_PIC_DATA['user' . $i].'</a>';gives a url like this
http://127.0.0.1/coppermine/thumbnails.php?search=D-ABDS
but it seems that the url should be something like
http://127.0.0.1/coppermine/thumbnails.php?search=D-ABDS&user3=on
for it to work. Unfortunately I'm unable to modify the sample code above to make it so. Any help would be greatly appreciated.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Make custom fields clickable
« Reply #4 on: June 08, 2010, 08:29:53 am »

You're not capable to add that little string? ::) OK, try
Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = '<a href ="thumbnails.php?album=search&search='.$CURRENT_PIC_DATA['user' . $i].'&user3=on">'.$CURRENT_PIC_DATA['user' . $i].'</a>';
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Make custom fields clickable
« Reply #5 on: June 08, 2010, 10:23:25 am »

Sorry Joachim not a programmer :( Get an error message now.

Parse error: syntax error, unexpected '[' in C:\xampp\htdocs\coppermine\displayimage.php  on line 201
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Make custom fields clickable
« Reply #6 on: June 08, 2010, 12:58:11 pm »

Try
Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = '<a href ="thumbnails.php?album=search&search='.$CURRENT_PIC_DATA['user' . $i].'&amp;user3=on">'.$CURRENT_PIC_DATA['user' . $i].'</a>';then.
Logged

casp3r

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
Re: Make custom fields clickable
« Reply #7 on: June 08, 2010, 02:48:37 pm »

Thanks Joachim, just had to tweak it a bit so that it would work with user1, user2, user3 and user4

Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = '<a href ="thumbnails.php?album=search&search='.$CURRENT_PIC_DATA['user' . $i].'&amp;user'.$i.'=on">'.$CURRENT_PIC_DATA['user' . $i].'</a>';
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.