[Solved]: Sending Search Results [Solved]: Sending Search Results
 

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

[Solved]: Sending Search Results

Started by uk_martin, March 27, 2009, 02:14:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

uk_martin

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

Nibbler

thumbnails.php?album=search&search=whatever

uk_martin

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 ...?

Nibbler

You can't specify an AND search in the url.

uk_martin

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

Nibbler

Edit include/search.inc.php, change


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


to


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


Then use


thumbnails.php?album=search&type=AND&search=joe+bloggs

uk_martin

Thanks Nibbler, that's great  :)