
Untitled
By: a guest on
May 15th, 2012 | syntax:
None | size: 1.14 KB | hits: 13 | expires: Never
<?php $photosearch = $_POST['photoSearchInput']; ?>
<div class="photoSearch">
<form name="photoSearchName" action="<?php bloginfo('url'); ?>/multimedia/photo-gallery/" method="post">
<label for="photoSearchInput">Search:</label><input type="text" name="photoSearchInput" id="photoSearchInput" value="<?php echo $photosearch; ?>"/>
<input type="submit" value="submit"/>
</form>
</div>
<?php
if(isset($photosearch)){
// Start of NextGen Gallery search
$search = $wp_query->get('photoSearchInput');
echo $photosearch;
echo $search;
$keywords = preg_replace('/\+/',' ',$photosearch);
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"
echo "<h2>Pictures</h2>";
if ($nggpictures) {
echo $nggpictures;
echo '<div class="clear"> </div>';
}
else {
echo '<p>No pictures were found.</p>';
}
}
// End of NextGen Gallery search
}else{
echo "not searching";
}//end else from if(isset($photosearch))
?>