Thanks for sharing your solution. Has been posted already though, see "
HTML to put search field on regular web page?" or "
Wie mache ich die Suchfunktion immer sichtbar?" (German).
You don't necessarily have to use the code on Coppermine-driven pages - you can even use it on non-coppermine driven pages as well (just make sure to change the action attribute of the <form>-tag to reflect the location of the target file).
There are some minor corrections:
- you will of course not need labels for hidden fields nor do hidden fields need a style, although they need a value of course if they are suppossed to make sense
- you should avoid deprecated HTML formatting like the notorious <font>-tag like the plague
- you shouldn't use the same name for the form field to avoid collisions with the original form
So your search form should actually be something like this
<form method="post" action="thumbnails.php" name="custom_search">
<input type="text" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="Search" class="button" />
<input type="hidden" name="album" value="search" />
<input type="hidden" name="title" value="1" />
<input type="hidden" name="caption" value="1" />
<input type="hidden" name="keywords" value="1" />
<input type="hidden" name="owner_name" value="1" />
<input type="hidden" name="filename" value="1" />
<input type="hidden" name="type" value="AND" />
</form>
Doesn't qualify as an actual mod imo - after all, you just copy the ouput of the search field and pasted it in - no particular magic in this.
In an even better attempt, display your custom search field on all pages but the actual search page. Just wrap the whole enchilada into a simple if/then contruct (using PHP) to determine what page you are on:
<?php
if ($_SERVER['PHP_SELF'] != 'search.php') {
print <<< EOT
<form method="post" action="thumbnails.php" name="custom_search">
<input type="text" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="Search" class="button" />
<input type="hidden" name="album" value="search" />
<input type="hidden" name="title" value="1" />
<input type="hidden" name="caption" value="1" />
<input type="hidden" name="keywords" value="1" />
<input type="hidden" name="owner_name" value="1" />
<input type="hidden" name="filename" value="1" />
<input type="hidden" name="type" value="AND" />
</form>
EOT;
}
?>
Above code snippet could be used in anycontent.php or theme.php, but not in template.html (as PHP code can't go into template.html).