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
-
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.
-
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
-
sis thanks it works.
-
bro -> sis !
Joachim
-
...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;)
-
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);
}
-
...coooool, it works ;D
Thank you Nibbler :D
-
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 :)
-
Copy the pageheader function from the sample theme into your theme's theme.php and modify it as above.
-
Great Nibbler,THANK YOU SO MUCH...!!! :D
-
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 ???
-
read this thread then
-
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.
-
Got this to work with my custom theme, how do I center it as its aligned right.
The following code is what I added:
<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
-
<div style="align:center">
-
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!
<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!!
<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
-
Hi will,
got the same problem you described.
tried your variation.
worked out perfectly !
thank you so much.