forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: martinkatz on April 09, 2008, 05:44:01 pm

Title: bbcode dynamic search with boolean operators "AND" / "OR"
Post by: martinkatz on April 09, 2008, 05:44:01 pm
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!
Title: Re: bbcode dynamic search with boolean operators "AND" / "OR"
Post by: martinkatz on April 09, 2008, 06:00:50 pm
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
Title: Re: bbcode dynamic search with boolean operators "AND" / "OR"
Post by: Nibbler on April 09, 2008, 06:08:36 pm
If you want to use type in the url like that then you need to change that $_POST to $_REQUEST.
Title: Re: bbcode dynamic search with boolean operators "AND" / "OR"
Post by: martinkatz on April 11, 2008, 08:35:28 pm
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..
Title: Re: bbcode dynamic search with boolean operators "AND" / "OR"
Post by: okiem on December 13, 2009, 11:34:29 pm
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