forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: uk_martin on March 27, 2009, 02:14:43 pm

Title: [Solved]: Sending Search Results
Post by: uk_martin on March 27, 2009, 02:14:43 pm
Hi

I was wondering if it is possible to send search results by means of URL syntax?

What 'd like to do is to embed images in web pages that link to Coppermine, in such a way that if someone clicks on an image of "Joe Bloggs", it will send the user to the Coppermine Gallery, at a page that has done a search for all Joe Bloggs images, and is displaying them as if a manual search for Joe Bloggs has been done. So somehow, the URL has to program Coppermine to do the search.

Is there a suitable URL syntax that can be used in this way?

Thanks in advance

Martin
Title: Re: Sending Search Results
Post by: Nibbler on March 27, 2009, 02:25:06 pm
thumbnails.php?album=search&search=whatever
Title: Re: Sending Search Results
Post by: uk_martin on March 27, 2009, 02:33:39 pm
Excellent, thanks for that.

Just to be sure about something though, would it be  "thumbnails.php?album=search&search=joe+bloggs" or "thumbnails.php?album=search&search=joe&bloggs", or ...?
Title: Re: Sending Search Results
Post by: Nibbler on March 27, 2009, 02:59:30 pm
You can't specify an AND search in the url.
Title: Re: Sending Search Results
Post by: uk_martin on March 27, 2009, 04:46:30 pm
Hi Nibbler

Thanks for the reply. Oh dear...I have a "Phil Hart" and a "John Hart", and I have a "Harry Bastable" and a "Steve Bastable" Any suggestions about how to search for Phil Hart's photos without getting any John Hart photos, how to get Harry Bastable photos but not Steve Bastable's?

Thanks

Martin
Title: Re: Sending Search Results
Post by: Nibbler on March 27, 2009, 04:55:06 pm
Edit include/search.inc.php, change

Code: [Select]
$type = $_POST['type'] == 'AND' ? " AND " : " OR ";

to

Code: [Select]
$type = $_REQUEST['type'] == 'AND' ? " AND " : " OR ";

Then use

Code: [Select]
thumbnails.php?album=search&type=AND&search=joe+bloggs
Title: Re: Sending Search Results
Post by: uk_martin on March 27, 2009, 09:27:11 pm
Thanks Nibbler, that's great  :)