forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: blueberg on February 01, 2010, 02:53:16 am

Title: Making a text link that searches CPG for a known keyword
Post by: blueberg 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 (http://www.birdmarks.com/coppermine/thumbnails.php?album=search&search=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  (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  (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 (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 (http://www.birdmarks.com/coppermine)
Title: Re: Making a text link that searches CPG for a known keyword
Post by: Joachim Müller 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.
Title: Re: Making a text link that searches CPG for a known keyword
Post by: blueberg 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
Title: Re: Making a text link that searches CPG for a known keyword
Post by: blueberg 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 (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
Title: Re: Making a text link that searches CPG for a known keyword
Post by: Joachim Müller on February 01, 2010, 07:42:39 am
Hasn't this been solved in search box in CPG (http://forum.coppermine-gallery.net/index.php/topic,61679.0.html) already?
Title: Re: Making a text link that searches CPG for a known keyword
Post by: blueberg 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

 
Title: Re: Making a text link that searches CPG for a known keyword
Post by: Joachim Müller 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.
Title: Re: Making a text link that searches CPG for a known keyword
Post by: blueberg 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