Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Custom Search Link  (Read 5299 times)

0 Members and 1 Guest are viewing this topic.

wakedave

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Custom Search Link
« on: January 23, 2008, 09:32:04 am »

I'm looking for a solution to a problem I'm having... For example, I want to search for "big apple" and I use:

thumbnails.php?album=search&search=big+apple

But it returns me all the images that either has "big" OR "apple". Is there a way I can change the link that will search ONLY images that has "big" AND "apple" ?

Also is there a way to change the link that will search within a specific album no.?

I know I can do all this from the Search page, but I would like to be able to have one link address, so I can email to someone and they can go directly to the search results page based on the search keywords I have specified.

Thanks in advance.

PS. I posted this question on what i thought was a similar thread, but I've been told not to hijack it, so I'm starting a new thread. So sorry if this is a repeat.
Logged

Pacjack

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
Re: Custom Search Link
« Reply #1 on: May 23, 2008, 11:39:19 am »

I'm also interested in building a link to search for keyword AND keyword. Anyone?
Logged

Zwerg-im-Bikini

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Custom Search Link
« Reply #2 on: June 03, 2009, 08:22:37 am »

I'm stuck with the same problem, I need to create search links with more than one word and don't know how. I tried to add "&type=AND" to the link, but it still doesn't work.

Help would be very appreciated :)
Logged

Nibbler

  • Guest
Re: Custom Search Link
« Reply #3 on: June 03, 2009, 05:07:11 pm »

If you want &type=AND to work you need to change include/search.inc.php

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

to

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

Zwerg-im-Bikini

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Custom Search Link
« Reply #4 on: June 03, 2009, 09:03:59 pm »

It works, thanks a lot!
Logged

Zwerg-im-Bikini

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Custom Search Link
« Reply #5 on: June 04, 2009, 11:17:18 am »

Sorry, too fast..

Now I noticed that the search results for those links show the correct thumbnails, but when I click on them they link to the wrong pictures. I checked my thumbnails, but they work fine in the album view, so the problem must be the change in the search file.
When I use the coppermine search with single words it works fine, but it doesn't work anymore with more than one word :(. Is there something else I have to change in this file?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

Zwerg-im-Bikini

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Custom Search Link
« Reply #7 on: June 04, 2009, 07:27:54 pm »

This is the link to the gallery (not official yet... I'm still working on it and hope noone will see it here because it sould be a surprise ;) ):

http://www.planearium.de/galerie/

I need the search-links for certain episodes. Every picture will have the title of the episode where it's from.
For example when I search for "103 - Volcano" the correct thumbnails are shown, but they link to the worng pictures.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Custom Search Link
« Reply #8 on: June 04, 2009, 07:37:53 pm »

I suggest upgrading before doing anything else.
Logged

sharpo

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Re: Custom Search Link
« Reply #9 on: June 06, 2009, 01:06:26 am »

If you want &type=AND to work you need to change include/search.inc.php

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

to

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

I've made the above alteration in my test gallery, what I was hoping it would do is only show images that included "both" search strings. Try this:-

http://www.sharpos-world.co.uk/testing/cpg1424test/thumbnails.php?album=search&search=t99%20t2

Only 1 image includes t99 and t2, which is the result I wanted, but it also shows another image which has just t99.

Is there a solution to this, please.
Logged
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25

sharpo

  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 332
Logged
Sharpo (not an expert, just a Coppermine user)
3 live galleries, first started in 2006.
http://www.sharpos-world.co.uk/BB3cpg/ with over 8,000 images.
http://www.sharpos-world.co.uk/cpg/ with over 25,000 images. 1.6.25
http://www.sharpos-world.co.uk/kc/ with over 300 images. 1.6.25
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.