shahed Posted September 10, 2002 Share Posted September 10, 2002 I like to have a search box in header.php, I tried to modified searchbox but couldnt do it, is there a easy way? how do I modify this code to a simple search box and submit button . <tr> <td> $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_SEARCH ); new infoBoxHeading($info_box_contents, false, false); $hide = tep_hide_session_id(); $info_box_contents = array(); $info_box_contents[] = array('form' => '<form name="quick_find" method="get" action="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">', 'align' => 'center', 'text' => $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>' ); new infoBox($info_box_contents); </td> </tr> Link to comment Share on other sites More sharing options...
mattice Posted September 11, 2002 Share Posted September 11, 2002 It should not be hard at all. The problem lies in the fact that the search box is using the boxes class and therefor will look like a box. The easiest way is to create a regular html form (with exisitng osC tech) in your header where you want the search: Not tested, from the top of my head: <?php $hide = tep_hide_session_id(); echo '<form name="quick_find" method="get" action="' . tep_href_link FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; echo $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>' ; echo '</form>'; ?> "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
shahed Posted September 11, 2002 Author Share Posted September 11, 2002 Thanks, I'm getting this error, may be missing a comma or something "Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /xx/xxx/public_html/shop/includes/header.php on line 26 " This is line 26 echo '<form name="quick_find" method="get" action="' . tep_href_link FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; Link to comment Share on other sites More sharing options...
Jan0815 Posted September 11, 2002 Share Posted September 11, 2002 Add an opening ( after tep_href_link. You can't have everything. That's why trains have difficulty crossing oceans, and hippos did not adapt to fly. -- from the OpenBSD mailinglist. Link to comment Share on other sites More sharing options...
desmo8 Posted September 12, 2002 Share Posted September 12, 2002 is there also a way to put a search form outside of oscomm? however the results should be in oscomm :wink: thanks for all feedback Link to comment Share on other sites More sharing options...
mattice Posted September 12, 2002 Share Posted September 12, 2002 Yes, that's possible Site A has the form (without all the osC functions etc) and calls the advanced_search_results.php on your site (B). "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
Snowman Posted September 12, 2002 Share Posted September 12, 2002 whats the easiest way to use this but with have a categories drop down menu between the input box and the search button??? any ideas??? Link to comment Share on other sites More sharing options...
mattice Posted September 12, 2002 Share Posted September 12, 2002 You mean an adaption from advanced_search.php ? So you can select WHERE it should search? It basically the same method. Take the form bit from advanced_search.php and start throwing out what you don't need... Or... the good old trick: Look at the rendered HTML page's SOURCE to understand what's the output of the functions. Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
Guest Posted March 10, 2004 Share Posted March 10, 2004 What's the BEST way to change the size and color of text in the search box? For example, I would like to make the "view all products" larger and red. Link to comment Share on other sites More sharing options...
tvieira24 Posted May 12, 2005 Share Posted May 12, 2005 What's the BEST way to change the size and color of text in the search box? For example, I would like to make the "view all products" larger and red. <{POST_SNAPBACK}> This is a very old thread, but I am also in the process of inserting th esearch bar in my header and I am having an issue putting the actual search form as well as the "Search" image into the middle of the cell itself. The image as well as search box is too far up and I'd like it to be in the middle opposed to the top. Anyone have any suggestions? Link to comment Share on other sites More sharing options...
Guest Posted May 12, 2005 Share Posted May 12, 2005 I'm still trying to figure it out also. Link to comment Share on other sites More sharing options...
moo22 Posted April 10, 2007 Share Posted April 10, 2007 Hi all I'm getting an error after performing the search Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/freeyour/www/includes/header.php:201) in /home/freeyour/www/includes/boxes/categories.php on line 13 What causes it and how do you resolve it? Thanks in advance Link to comment Share on other sites More sharing options...
tecno Posted October 11, 2007 Share Posted October 11, 2007 What's the BEST way to change the size and color of text in the search box? For example, I would like to make the "view all products" larger and red. I am trying to do this too, I cant figure out the php coding for box width in includes/boxes/search.php Link to comment Share on other sites More sharing options...
tecno Posted October 11, 2007 Share Posted October 11, 2007 I found how to do it pretty easily, and if you want to align and width text boxes this is how: find in manufacturers box or search box..... $info_box_contents[] = array('form' => tep_draw_form or something similar near the end where it says to draw the box, then youll see style=width etc and change it :lol: and add/change ,'align' => 'center', if you want to center it Link to comment Share on other sites More sharing options...
kevinb84 Posted November 20, 2007 Share Posted November 20, 2007 <?php /* $Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ ?> <!-- search //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SEARCH); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'), 'align' => 'center', 'text' => tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- search_eof //--> I would just like a simple search field and button, would I be able to alter the existing text to do so? Link to comment Share on other sites More sharing options...
levikay Posted December 4, 2007 Share Posted December 4, 2007 Thanks it worked this is what i added <?php $hide = tep_hide_session_id(); echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; echo $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>' ; echo '</form>'; ?> Link to comment Share on other sites More sharing options...
Qim Posted December 5, 2007 Share Posted December 5, 2007 Hi! Please, advice me on this, I'm a newbie to both OSc and coding :'( I've managed to tweak a bit, so my shop look lik this www.ji-fashion.com/butik I have copied the code for languages etc and removed tags <tr> <td> tags naming the copies languages_header and so on. Now I have a missaligment problem as you can see. What I would like to do is to change colors, box heights and width and having the search just as a simple search. (The original search/advanced search box I will later insert in the right column). I have searched in forums and found your advice on a similar question, and don't understand this piece: style="width: ' . (BOX_WIDTH-30) . 'px"' What does actually mean? Is okay to simply have it like this? style="width: ' . (BOX_WIDTH-xyz) . 'px"' where xyz is any number? Hoping for your help Best whishes from Sweden Qim Link to comment Share on other sites More sharing options...
Qim Posted December 8, 2007 Share Posted December 8, 2007 Hey gal... its like this. In an empty room, enjoy your company.. :-" Well, I fixed most of it. Remaining is How do I move languages and currencies to the headers far right? I'm lost in header.php Talking to myself where are all the nice people who know the solution to this??? :blink: Best whishes from Sweden Qim Link to comment Share on other sites More sharing options...
HSMagic Posted December 8, 2007 Share Posted December 8, 2007 From header.php: <table border="0" width="100%" cellspacing="0" cellpadding="0" height="125"> <tr class="header"> <td align="right" valign="bottom" bgcolor="#0099ff" class="search" background="/images/longlogo.png"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .'<input type="submit" name="Submit" value="Search">' . '</form>'; ?> <br><br> <?php echo $breadcrumb->trail(' » '); ?> <br><br> </td> </tr> </table> It's been so long since I implemented this that I don't remeber the source to credit. See how it looks at my site: Hot Shot Magic Link to comment Share on other sites More sharing options...
Stephie Posted January 7, 2008 Share Posted January 7, 2008 using this code <?php $hide = tep_hide_session_id(); echo '<form name="quick_find" method="get" action="' . tep_href_link (FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false) . '">'; echo $hide . '<input type="text" name="keywords" size="10" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'; echo '</form>'; ?> What do I take out to not have the words use advance keywords for your search Link to comment Share on other sites More sharing options...
bigbuba0 Posted February 18, 2008 Share Posted February 18, 2008 Just adding that I implemented this code and it works great. Here is a snapshot of the first table in the header tag. (this is from the default oscommerce load, hence the oscommerce.gif still there) <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td> <td align="right" valign="middle" class="search"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .'<input type="submit" name="Submit" value="Search">' . '</form>'; ?> </tr> </table> Link to comment Share on other sites More sharing options...
always_confused Posted March 5, 2008 Share Posted March 5, 2008 Thanks heaps, this works a charm. I was in all sorts of trouble before I got to this post. Just adding that I implemented this code and it works great. Here is a snapshot of the first table in the header tag. (this is from the default oscommerce load, hence the oscommerce.gif still there) <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td> <td align="right" valign="middle" class="search"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .'<input type="submit" name="Submit" value="Search">' . '</form>'; ?> </tr> </table> Link to comment Share on other sites More sharing options...
Draeisme Posted March 24, 2008 Share Posted March 24, 2008 <td align="right" valign="top"><form name="search" action="http://www.yoursite.com/catalog/advanced_search_result.php" method="get"><input type="hidden" name="search_in_description" value="1"><input type="text" name="keywords" size="10" maxlength="30" style="width: 100px"> <input type="image" src="includes/languages/english/images/buttons/button_search.gif" border="0" alt="BOX_HEADING_ADVSEARCH" title=" BOX_HEADING_ADVSEARCH " align="middle"></form></td> I put this code directly into my sts template to get it to work. You have to edit the "yoursite" to match your url. A demo of this can be seen at www.raysebookshop. com Link to comment Share on other sites More sharing options...
xecutech Posted April 7, 2008 Share Posted April 7, 2008 ' . BOX_SEARCH_TEXT . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.