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: Making a text link that searches CPG for a known keyword  (Read 3730 times)

0 Members and 1 Guest are viewing this topic.

blueberg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Making a text link that searches CPG for a known keyword
« on: February 01, 2010, 02:53:16 am »

When I do a search in my gallery using the search form, the URL that always returns is

Code: [Select]
http://www.birdmarks.com/coppermine/thumbnails.php
No matter what words were searched. So there is no indication in the returned URL of what words were actually searched. I want to make text links that use the keywords. I found the following info in your forum to get me started. Here is a link that will return lion thumbnails.

lion will take you to a page with lion thumbnails.

The code is this:

Code: [Select]
http://www.birdmarks.com/coppermine/thumbnails.php?album=search&search=lion

and that is returned in the URL. That is all fine. And now I know how to link a single search term to a text link.

The issue comes when I want to use 2 or more words in the link. I need it to be doing an "AND" search and every way I have tried to configure it...I still get "or" searches.

http://www.birdmarks.com/coppermine/thumbnails.php?album=search&search=lion

yields the appropriate return.

But
http://www.birdmarks.com/coppermine/thumbnails.php?album=search&search=lion+deer

which should return NO IMAGES because no pictures have both these keywords attached, instead returns all pictures of lions and all of deer.

I've seen this code work in another coppermine gallery. The only thing I can conclude is that the "thumbnails.php" page in his gallery (older gallery) might have different coding in it than the newest version of that page.

http://www.skolaiimages.com/stock/thumbnails.php?album=search&type=full&search=brown+bear
yields the appropriate thumbnails of brown bears. if you change "brown" to "black", then it returns only black bears.

Any thoughts on how I can make a text link to do a search using more than one search term?

Thanks

http://www.birdmarks.com/coppermine
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Making a text link that searches CPG for a known keyword
« Reply #1 on: February 01, 2010, 07:11:36 am »

You need to turn the method of the search form from POST to GET to see the search parameters in the URL.
Logged

blueberg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Making a text link that searches CPG for a known keyword
« Reply #2 on: February 01, 2010, 07:22:52 am »

I'll give that a try...but that's not even the main issue I'm asking about. I need to know how to configure two search terms in the search URL that will make an "AND" search.

Thanks
Logged

blueberg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Making a text link that searches CPG for a known keyword
« Reply #3 on: February 01, 2010, 07:38:13 am »

As expected...changing to "get", while it did leave the key words in the URL, still returned an "OR" search...not an "AND" search.

Here's a page with both code forms.

http://www.birdmarks.com/searchtester.htm

This one isn't an urgent post, but it would be nice to be able to make a text link to images using two or more keywords

Thanks
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Making a text link that searches CPG for a known keyword
« Reply #4 on: February 01, 2010, 07:42:39 am »

Hasn't this been solved in search box in CPG already?
Logged

blueberg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Making a text link that searches CPG for a known keyword
« Reply #5 on: February 01, 2010, 08:32:20 am »

Nope, That one is definitely solved, and I couldn't be happier. But that one required an actual text box form for the people to enter their keywords and submit.

What I would like to do is make a simple, regular hyperlink that is attributed to some text.

Like "click here" to see all the green lions

"click here" would be the actual text they would click on ... but the href would be my search string URL

Code: [Select]
http://www.birdmarks.com/coppermine/thumbnails.php?album=search&search=green+lions
If I link the text to the above code, it shows me all the lions and everything that is green. It is NOT showing me just the green lions


Like I said, this one isn't critical. The one we solved earlier was the important one. But if I could figure out why this isn't working in my gallery but it works in others, i could sleep easier

 
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Making a text link that searches CPG for a known keyword
« Reply #6 on: February 01, 2010, 09:04:31 am »

I think you're not getting the concept: if the POST form works fine for you, use that. If you want URL parameters (GET method), use them. There's a direct correlation between the input form field names and values and the URL parameters.
The keywords-system built into coppermine is based on that as well.
Logged

blueberg

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Making a text link that searches CPG for a known keyword
« Reply #7 on: February 01, 2010, 09:07:04 am »

That's what I'm going to do. The search field is by far more impotant.

thanks
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 21 queries.