Making a text link that searches CPG for a known keyword Making a text link that searches CPG for a known keyword
 

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

Main Menu

Making a text link that searches CPG for a known keyword

Started by blueberg, February 01, 2010, 02:53:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

blueberg

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

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:

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

Joachim Müller

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

blueberg

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

blueberg

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

Joachim Müller


blueberg

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

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


Joachim Müller

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.

blueberg

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

thanks