Advanced search  

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

Pages: [1]   Go Down

Author Topic: Search field in themes index  (Read 18656 times)

0 Members and 1 Guest are viewing this topic.

JayBachatero

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 19
  • SMF Rules.
    • Kevmundial.com
Search field in themes index
« 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.
« Last Edit: February 28, 2005, 10:50:14 pm by TranzNDance »
Logged
KEVMUNDIAL.COM .::Lo Mejor De Aqui Y Alla.::.
:.:LiL_J:.:
(http://kevmundial.com/images/liljsignature.jpg)

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Search field in themes index
« Reply #1 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
Logged

JayBachatero

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 19
  • SMF Rules.
    • Kevmundial.com
Re: Search field in themes index
« Reply #2 on: February 28, 2005, 10:32:56 pm »

sis thanks it works.
« Last Edit: March 01, 2005, 07:33:00 pm by LiL_J »
Logged
KEVMUNDIAL.COM .::Lo Mejor De Aqui Y Alla.::.
:.:LiL_J:.:
(http://kevmundial.com/images/liljsignature.jpg)

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Search field in themes index
« Reply #3 on: March 01, 2005, 08:22:24 am »

bro -> sis !

Joachim
Logged

ypp

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Search field in themes index
« Reply #4 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;)
Logged

Nibbler

  • Guest
Re: Search field in themes index
« Reply #5 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);
}
Logged

ypp

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Search field in themes index
« Reply #6 on: November 17, 2005, 06:42:39 pm »

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

ypp

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Search field in themes index
« Reply #7 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 :)
Logged

Nibbler

  • Guest
Re: Search field in themes index
« Reply #8 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.
Logged

ypp

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Search field in themes index
« Reply #9 on: November 29, 2005, 12:48:08 am »

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

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Search field in themes index
« Reply #10 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 ???
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Search field in themes index
« Reply #11 on: February 26, 2006, 09:35:13 pm »

read this thread then
Logged

wfs

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
Re: Search field in themes index
« Reply #12 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.
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Search field in themes index
« Reply #13 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
Logged

Nibbler

  • Guest
Re: Search field in themes index
« Reply #14 on: July 06, 2006, 02:55:40 pm »

<div style="align:center">
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: Search field in themes index
« Reply #15 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
« Last Edit: July 10, 2006, 10:41:21 am by will »
Logged

wfs

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 95
Re: Search field in themes index
« Reply #16 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.033 seconds with 20 queries.