forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: JayBachatero on February 28, 2005, 09:28:26 pm

Title: Search field in themes index
Post by: JayBachatero on February 28, 2005, 09:28:26 pm
I would like to know how can i add the search field into the inde page so users can search the gallery directly from the main page and not have to go to search page.
Title: Re: Search field in themes index
Post by: Tranz on February 28, 2005, 09:49:30 pm
Add the following to template.html
Code: [Select]
<!-- add search box -->

<div style="position:absolute; top:2px; right:0">
<form method="get" action="thumbnails.php" name="searchcpg">
<input type="hidden" name="album" value="search">
<input type="hidden" name="type" value="full">
<input type="text" style="width: 150px" name="search" maxlength="255" value="" class="textinput">
<input type="submit" value="search files">
</form>
</div>
edit styles accordingly
Title: Re: Search field in themes index
Post by: JayBachatero on February 28, 2005, 10:32:56 pm
sis thanks it works.
Title: Re: Search field in themes index
Post by: Joachim Müller on March 01, 2005, 08:22:24 am
bro -> sis !

Joachim
Title: Re: Search field in themes index
Post by: ypp on November 17, 2005, 11:28:20 am
...it's really cool the search field in the home but how can I have the search button with its "search" text translated for every language? ::)

I'm trying to do it but I'm not a php expert...
Thank you people;)
Title: Re: Search field in themes index
Post by: Nibbler on November 17, 2005, 06:02:22 pm
Adjust the code in template to use a placeholder instead

Code: [Select]
<input type="submit" value="{SEARCH_TEXT}">
Then treat it as a custom header in theme.php

Code: [Select]
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;
    global $lang_main_menu; // Added

    $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array('{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => $CONFIG['gallery_name'] . ' - ' . $section,
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{MAIN_MENU}' => USER_IS_ADMIN ? theme_main_menu() : '',
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
'{SEARCH_TEXT}' => $lang_main_menu['search_lnk'] // Added
        );

    echo template_eval($template_header, $template_vars);
}
Title: Re: Search field in themes index
Post by: ypp on November 17, 2005, 06:42:39 pm
...coooool, it works ;D
Thank you Nibbler  :D
Title: Re: Search field in themes index
Post by: ypp on November 28, 2005, 07:35:20 pm
hello nibbler, could you tell me where/how I've to do it in the "theme.php" of the 1.4.1 version?
I've tried to do it alone but I'm little confused ??? ::)

thank you :)
Title: Re: Search field in themes index
Post by: Nibbler on November 28, 2005, 08:46:40 pm
Copy the pageheader function from the sample theme into your theme's theme.php and modify it as above.
Title: Re: Search field in themes index
Post by: ypp on November 29, 2005, 12:48:08 am
Great Nibbler,THANK YOU SO MUCH...!!! :D
Title: Re: Search field in themes index
Post by: will on February 25, 2006, 11:52:09 pm
Hi Nibbler

Added it to my template.html page but it keeps showing up in the top righthand corner and i want it under the admin menu:

http://cdcoverhideout.com/gallery ???
Title: Re: Search field in themes index
Post by: Joachim Müller on February 26, 2006, 09:35:13 pm
read this thread then
Title: Re: Search field in themes index
Post by: wfs on July 06, 2006, 09:35:12 am
Hi,

I'm trying to design a new page, but I would like to have the search box in a particular spot of the page.

Do I use the same code to use and how do I get ensure that the serach box comes up at the particular spot?

pse help.

thanks.
Title: Re: Search field in themes index
Post by: will on July 06, 2006, 02:54:00 pm
Got this to work with my custom theme, how do I center it as its aligned right.

The following code is what I added:

Quote
<div style="center:0">
                     <form method="get" action="thumbnails.php" name="searchcpg">
                     <input type="hidden" name="album" value="search">
                     <input type="hidden" name="type" value="full">
                     <input type="text" style="width: 300px" name="search" maxlength="255" value="" class="textinput">
                     <input type="submit" value="Search">
                     </form>
            </div>

I've added center but its still aligned right.

Any help will be great.

Thanks, will
Title: Re: Search field in themes index
Post by: Nibbler on July 06, 2006, 02:55:40 pm
<div style="align:center">
Title: Re: Search field in themes index
Post by: will on July 06, 2006, 03:15:24 pm
I've been playing around and got it centered but when align center when you search nothing comes up even tho you have them in the gallery:

This is how I have it now aligned left & search results appear!
Quote
<div style="align:center">
   <form method="get" action="thumbnails.php" name="searchcpg">
   <input type="hidden" name="album" value="search">
   <input type="hidden" name="type" value="full">
   <input type="text" style="width: 400px" name="search" maxlength="400" value="" class="textinput">
   <input type="submit" value="Search">
   </form>
      </div>

If I take out the style after div, the search box is aligned center but no search results appear!!
Quote
<div="align:center">
   <form method="get" action="thumbnails.php" name="searchcpg">
   <input type="hidden" name="album" value="search">
   <input type="hidden" name="type" value="full">
   <input type="text" style="width: 400px" name="search" maxlength="400" value="" class="textinput">
   <input type="submit" value="Search">
   </form>

Hope you can understand

Regards, will
Title: Re: Search field in themes index
Post by: wfs on July 10, 2006, 08:31:46 am
Hi will,

got the same problem you described.
tried your variation.
worked out perfectly !

thank you so much.