Search field in themes index Search field in themes index
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Search field in themes index

Started by JayBachatero, February 28, 2005, 09:28:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JayBachatero

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.
KEVMUNDIAL.COM .::Lo Mejor De Aqui Y Alla.::.
:.:LiL_J:.:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fkevmundial.com%2Fimages%2Fliljsignature.jpg&hash=21bd34685ff1c68fbb20c425a72d9c7485cd6abd)

Tranz

Add the following to template.html
<!-- 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

JayBachatero

#2
sis thanks it works.
KEVMUNDIAL.COM .::Lo Mejor De Aqui Y Alla.::.
:.:LiL_J:.:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fkevmundial.com%2Fimages%2Fliljsignature.jpg&hash=21bd34685ff1c68fbb20c425a72d9c7485cd6abd)

Joachim Müller


ypp

...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;)

Nibbler

Adjust the code in template to use a placeholder instead

<input type="submit" value="{SEARCH_TEXT}">

Then treat it as a custom header in theme.php


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);
}

ypp

...coooool, it works ;D
Thank you Nibbler  :D

ypp

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 :)

Nibbler

Copy the pageheader function from the sample theme into your theme's theme.php and modify it as above.

ypp

Great Nibbler,THANK YOU SO MUCH...!!! :D

will

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 ???

Joachim Müller


wfs

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.

will

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

Nibbler


will

#15
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

wfs

Hi will,

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

thank you so much.