search.php syntax search.php syntax
 

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]

Main Menu

search.php syntax

Started by wim, November 25, 2006, 05:30:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wim

Hi,

I have put extra fields for the file-info: Country and Location.
I want to make a search for pictures with Location = "Bukk". I thought that it be is possible to use the syntax http://www.naturephotography.nl/photogallery/thumbnails.php?album=search&search=Bukk&type=match

There is something strange with it. It don't work until I go to http://www.naturephotography.nl/photogallery/search.php and set Location=on and put Bukk in the search field. When I cut and past the first mentiond syntax again it works fine. It looks that then the search syntax works with a catch or something like that.

My question is..... Witch syntax I must use to get what I want?
I want use that syntax / direct link for a direct link on one off my webpages.

Thanks in advance...

Wim

Nibbler

You need to make your custom field a default search field by modifying the code in include/search.inc.php


if (!isset($USER['search']['params'])){
        $USER['search']['params']['title'] = $USER['search']['params']['caption'] = $USER['search']['params']['keywords'] = $USER['search']['params']['filename'] = 1;
}


Your Location is user2, so the code becomes


if (!isset($USER['search']['params'])){
        $USER['search']['params']['title'] = $USER['search']['params']['caption'] = $USER['search']['params']['keywords'] = $USER['search']['params']['filename'] = $USER['search']['params']['user2'] = 1;
}


After that you can use http://www.naturephotography.nl/photogallery/thumbnails.php?album=search&search=Bukk

wim

Hi Nibbler

I am very grateful that you have helped me with this problem. It works exactly as I wanted.
Thanks again...

Kind Regards
Wim
www.naturephotography.nl