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: special search function  (Read 2956 times)

0 Members and 1 Guest are viewing this topic.

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
special search function
« on: November 24, 2011, 11:15:56 pm »

I would like to have a search function like this:

I want to have a clickable text, or a button (in or next to a user-field). That shows (makes a search for) all photos with the same word in the same user field (and search this user-field only).

I'd like to have one button, or clickable text on each user-field , searching only in these user-fields for the exact phrase.



I don't know how to code at all, but as much as I can guess it's sounds like simple logics so it should be quite easy to acchieve this thing?



I hope it's OK for me to make a suggestion for a plugin like this here. To me it sounds like a very simple code to produce, but as I wrote above: I don't know anything about coding.

Kind Regards

Morgan Larsson
SWEDEN

Here's my site:  http://echinopsis.eu


PS.   The reason why I want this funtion is to have my users to be able to browse, between sibblings of hybrid plants, in an easy way (and also browse through plants between different producers, in an easy way).
Logged

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: special search function
« Reply #1 on: November 24, 2011, 11:38:35 pm »

Custom fields for image description

That is, I wrote user-field in my request above.


Morgan Larsson
SWEDEN
Logged

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: special search function
« Reply #2 on: November 25, 2011, 12:44:03 am »

I found the search string to be input and its:

http://echinopsis.eu/thumbnails.php?search=    (insert data from user-field)    &submit=s%C3%B6k&album=search&newer_than=&older_than=&type=AND&user1=on

for a search in only user-field 1


Is it possible to just add some code inside displayimage.php, in the area of the user-field, to make a clickable link to a search like this?


Morgan Larsson
http://echinopsis.eu

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: special search function
« Reply #3 on: November 25, 2011, 12:06:45 pm »

You want to add those buttons to the "File information" box, right?


Moving to themes board, as I doubt anybody will create a plugin for this. But it should be quite easy to modify your theme accordingly.
Logged

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: special search function
« Reply #4 on: November 25, 2011, 01:20:29 pm »

Yes, you're right about file information box, thank you André!


Morgan Larsson
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: special search function
« Reply #5 on: November 25, 2011, 02:18:04 pm »

Open displayimage.php, find
Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = make_clickable($CURRENT_PIC_DATA['user' . $i]);and replace with
Code: [Select]
$info[$CONFIG['user_field' . $i . '_name']] = "<a href=\"thumbnails.php?album=search&amp;type=AND&amp;user{$i}=on&amp;search=".urlencode($CURRENT_PIC_DATA['user' . $i])."\">".$CURRENT_PIC_DATA['user' . $i]."</a>";
Logged

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: special search function
« Reply #6 on: November 25, 2011, 03:07:29 pm »

Thank you a thousand times André!!!

Really great, exactly what I wanted.  :)


Wish I could help you back, my profession is cooking so it'll be hard for me to do anything for you on distance! Though I want you to know that I appreciate your help!


Morgan Larsson
http://echinopsis.eu
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: special search function
« Reply #7 on: November 25, 2011, 03:14:05 pm »

You could at least
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.
;)
Logged

metamog

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: special search function
« Reply #8 on: November 25, 2011, 03:33:31 pm »

Oops, didn't know there was such a button!

Fix it now, thank you again!

Morgan

 :D  ;D  :)  ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 21 queries.