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: [Solved]: Sending Search Results  (Read 3978 times)

0 Members and 1 Guest are viewing this topic.

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
[Solved]: Sending Search Results
« 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
« Last Edit: March 27, 2009, 10:09:26 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Sending Search Results
« Reply #1 on: March 27, 2009, 02:25:06 pm »

thumbnails.php?album=search&search=whatever
Logged

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Sending Search Results
« Reply #2 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 ...?
Logged

Nibbler

  • Guest
Re: Sending Search Results
« Reply #3 on: March 27, 2009, 02:59:30 pm »

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

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Sending Search Results
« Reply #4 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
Logged

Nibbler

  • Guest
Re: Sending Search Results
« Reply #5 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
Logged

uk_martin

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 186
Re: Sending Search Results
« Reply #6 on: March 27, 2009, 09:27:11 pm »

Thanks Nibbler, that's great  :)
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 21 queries.