I have done several searches and cannot seem to find the answer to my question. How can I add a simple field that will search my gallery to a page outside coppermine?
I don't need any advanced options, just a simple search all keywords/title/description search box to add to another page of my site (same server).
Thanks
This has been mentioned on the themes board for adding a quick-search box to your Coppermine theme. I don't see why it can't work for external pages. I mentioned this in the README.txt file for the "Search Album" plugin.
Add this code to your PHP file (or remove the first and last line for HTML files):
echo <<<EOT
<form method="get" action="thumbnails.php" name="searchcpg">
<input type="hidden" name="album" value="search" />
<input type="hidden" name="type" value="full" />
<input type="hidden" name="plugin_search_album" value="true" />
<input type="input" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="Quick Search" />
> <a href="search.php">Advanced Search</a>
</form>
<script language="javascript" type="text/javascript">
<!--
document.searchcpg.search.focus();
-->
</script>
EOT;
You can remove the hidden field "plugin_search_album" if you are not using that plugin.
Excellent, that worked a treat! Just on question... how do I make the form open the results page in a new window?
<form target="_blank">
Ahh sweet, this works better than my home made one, gonna implement this. I was using a exert from the old SSI.php image include script....yucky i know. Thanks Stramm
As a note, target="_blank" is not XHTML-compliant (from what I've read). Opening a new window or putting results into another window is considered to be a client-side responsibility so a proper way to do this would be using something like JavaScript. There's another thread that discusses this in particular with a code solution.
This is relelated and also non related at the same time, btw post is for Paver
I have noticed half of the submitted themes including some of the themes you download with coppermine are not of the "standards complaince mode" meaning some templates have code above the
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
as well as some themes all together ignoring to add a doctype and xhtml link off, I think this needs to be addressed somehow, wether it be an actual requirement for newly submitted themes, these days your complaince is becoming more and more important as we move into the w3 mode of browsing, IE application websites.
Im going to split this post off and address it the coppermine coding board.
target="_blank" is fine for transitional but not for strict.
In that case Im going to muder w3c whose xhtml markup checker keeps telling me otherwise! :'(