bbcode dynamic search with boolean operators "AND" / "OR" bbcode dynamic search with boolean operators "AND" / "OR"
 

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]

Main Menu

bbcode dynamic search with boolean operators "AND" / "OR"

Started by martinkatz, April 09, 2008, 05:44:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

martinkatz

Running under CPG 1.416. 

using  &type=AND &type=OR as parameters i always get results of the search throw OR operator, am i doing something wrong?

http://www.mkz.com.ar/photos/thumbnails.php?album=search&type=AND&search=Industria+Alimenticia (shows all images with keyword Industria + all images with keyword Alimenticia, what im looking for is just the images with "Industria Alimenticia")

I read the thread: http://forum.coppermine-gallery.net/index.php/topic,48886.msg234658.html#msg234658 that was finally solved seting AND as default (
$type = $_POST['type'] == 'AND' ? " AND " : " OR ";) but looks like in this case is not reciving type parameter neither :(
Im for four days dealing with this problem, not finding the right answer

is the parameter "type" not working ?

Thanks in advance, hope is the right board to post this thread!

martinkatz

sorry! i forgot to mention about this warning:

/include/search.inc.php
Notice line 49: Undefined index: type
Notice line 71: Undefined index: newer_than
Notice line 72: Undefined index: older_than

Nibbler

If you want to use type in the url like that then you need to change that $_POST to $_REQUEST.

martinkatz

Thanks Nibbler, i really appreciate you reply!
if i understand what you said i have to change just this line:

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

for:

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

because i did it already, and im still experiencing some troubles. The first page that matches the search is fine, but when i try to go to subsecuent pages ([2],[3],etc) i get the message "no image to display" and title search result - "" (if i cleared the cache) or search result - "[last search that worked]" (if i did a search before and i didnt cleared the cache). im triyng to understand the pattern that drives CGP into this behavior but i cant figure out what im doing wrong.


and a couple of warnings:

/plugins/final_extract/include/init2.inc.php
Warning line 29: mysql_free_result(): supplied argument is not a valid MySQL result resource
/include/search.inc.php
Notice line 51: Undefined index: type
/include/functions.inc.php
Notice line 1260: Undefined variable: rowset

I clear the cache and i test it with IE, FF and safari and after doing some serchings (sometimes with AND sometimes with OR) i have the problem i mentioned above.

any ideas? Thanks in advance, i really appreciate the effort of doing coppermine possible..

okiem

I see - that is quite old post - but problem still egsist
I mentioned this in other topic

after usuing "AND" in URL I got write thumbs but they guide to set of pictures which comming from "OR" searching (after click in thumb you got wrng intermidiate picture page, or Error)

I treyed it in FF end IE, also using polish characters and UTF - problem still egsist - I have newest version of CPG