Search box Search box
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Search box

Started by eviljoker7075, June 01, 2006, 04:50:32 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

eviljoker7075

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

Paver

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" />
            &gt; <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.

eviljoker7075

Excellent, that worked a treat! Just on question... how do I make the form open the results page in a new window?

Stramm

<form target="_blank">

Dr Preacox

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
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

Paver

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.

Dr Preacox

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.
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD

Nibbler

target="_blank" is fine for transitional but not for strict.

Dr Preacox

In that case Im going to muder w3c whose xhtml markup checker keeps telling me otherwise!  :'(
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD