Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Search box  (Read 3370 times)

0 Members and 1 Guest are viewing this topic.

eviljoker7075

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Search box
« on: June 01, 2006, 04:50:32 pm »

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
« Last Edit: June 04, 2006, 01:31:24 pm by GauGau »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Search box
« Reply #1 on: June 01, 2006, 05:05:22 pm »

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):
Code: [Select]
        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.
Logged

eviljoker7075

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Search box
« Reply #2 on: June 04, 2006, 01:42:55 am »

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Search box
« Reply #3 on: June 04, 2006, 08:13:31 am »

Code: [Select]
<form target="_blank">

Dr Preacox

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 122
  • Is the Matrix...
    • Dynamic Creations
Re: Search box
« Reply #4 on: June 04, 2006, 09:41:49 am »

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

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Search box
« Reply #5 on: June 04, 2006, 07:11:43 pm »

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.
Logged

Dr Preacox

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 122
  • Is the Matrix...
    • Dynamic Creations
Re: Search box
« Reply #6 on: June 04, 2006, 07:17:28 pm »

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

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

Nibbler

  • Guest
Re: Search box
« Reply #7 on: June 04, 2006, 07:47:41 pm »

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

Dr Preacox

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 122
  • Is the Matrix...
    • Dynamic Creations
Re: Search box
« Reply #8 on: June 05, 2006, 07:08:46 am »

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

Page created in 0.024 seconds with 20 queries.