forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: wim on November 25, 2006, 05:30:48 pm

Title: search.php syntax
Post by: wim on November 25, 2006, 05:30:48 pm
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 (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 (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
Title: Re: search.php syntax
Post by: Nibbler on November 27, 2006, 10:36:30 pm
You need to make your custom field a default search field by modifying the code in include/search.inc.php

Code: [Select]
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

Code: [Select]
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
Title: Re: search.php syntax
Post by: wim on December 01, 2006, 07:31:25 pm
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 (http://www.naturephotography.nl)