I found this page, but didnt work,. i have made some changes on the code. I hope this will fix your problem.
Add this on your search.php
$search = $wp_query->get('s');
$keywords = preg_replace('/\+/',' ',$search);
if (function_exists ('ngg_get_search_pictures')) { // function from functions.php
$nggpictures = ngg_get_search_pictures($keywords, ''); // put the number of pictures by row you want, if you don't want "4"
if ($nggpictures) {
echo "
Bilder
";
echo $nggpictures;
}
}
Add this to your functions.php
/**
** Function to do searchs on gallery pics from NextGen Gallery plugin
**
** @keywords keywords, usually gave by the standard search query from wordpress
** @numberPicCol number of pic by row. If null, it takes 4 by default
*/
function ngg_get_search_pictures ($keywords, $numberPicRow = NULL) {
global $wpdb;
$count=1;
if (!$numberPicRow) { $numberPicRow = "4"; }
$nngquery = $wpdb->prepare( "
SELECT pid,description,alttext
FROM " .$wpdb->prefix. "ngg_pictures
WHERE MATCH (description, filename, alttext) AGAINST (%s IN BOOLEAN MODE)
AND exclude != 1
","*".$keywords."*");
$pictures = $wpdb->get_results($nngquery, ARRAY_A);
if ($pictures) foreach($pictures as $pic) {
$out .= '
';
$out .= '
';
$out .= "\n";
if ($count == 0) {
$out .= "";
}
++$count;
$count%=$numberPicRow;
}
return $out;
};