[Plugin: NextGEN Gallery] Nextgen Search Refining?
-
I have a search set up and working with Nextgen Gallery, but I need it to search specific galleries rather than all of them. How would this be achieved? My code is the usual modification, as listed below…
function ngg_get_search_pictures ($keywords, $numberPicRow = NULL) { global $wpdb; $count=1; if (!$numberPicRow) { $numberPicRow = "4"; } $nngquery = " SELECT pid,description,alttext FROM wp_ngg_pictures WHERE MATCH (description, filename, alttext) AGAINST ('*$keywords*' IN BOOLEAN MODE) AND exclude = '0' UNION SELECT pid,description,alttext FROM wp_ngg_pictures, wp_terms, wp_term_relationships WHERE pid = object_id and term_id = term_taxonomy_id and MATCH (name) AGAINST ('*$keywords*' IN BOOLEAN MODE) AND exclude = '0' "; $pictures = $wpdb->get_results($nngquery, ARRAY_A); if ($pictures) foreach($pictures as $pic) { $out .= '<a href="'.nggGallery::get_image_url($pic[pid]).'" title="'.stripslashes($pic[description]).'" rel="gallery'.$pic[pid].'">'; $out .= '<img class="ngg-gallery" style="border: .1em solid #FFFFFF" src="'.nggGallery::get_thumbnail_url($pic[pid]).'" alt="'.stripslashes($pic[alttext]).'" title="'.stripslashes($pic[alttext]).'" />'; $out .= "</a>\n"; if ($count == 0) { $out .= ""; } ++$count; $count%=$numberPicRow; } return $out; };
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘[Plugin: NextGEN Gallery] Nextgen Search Refining?’ is closed to new replies.