Guest Posted July 3, 2007 Share Posted July 3, 2007 Some time ago the search function was removed from my site, which I now regret and need to re-add it. Could anyone tell me which file I will need to edit in order to put the search tool to the right of my "Currencies" tool, and where I can find the code? My site is here, if you have time to take a look. http://www.tractormad.co.uk/ Link to comment Share on other sites More sharing options...
Guest Posted July 3, 2007 Share Posted July 3, 2007 Was the search box simply disabled or commented out or were the files pertaining to search deleted? Presumably, one would only need to comment out the call for the search box in column_left.php or column_right.php...wherever it shows up in the stock install of OSC, in order to disable search. If that's all that happened...you should take a look at the Contributions section. The contrib called Search In Header comes to mind. Link to comment Share on other sites More sharing options...
Guest Posted July 4, 2007 Share Posted July 4, 2007 Was the search box simply disabled or commented out or were the files pertaining to search deleted? Presumably, one would only need to comment out the call for the search box in column_left.php or column_right.php...wherever it shows up in the stock install of OSC, in order to disable search. If that's all that happened...you should take a look at the Contributions section. The contrib called Search In Header comes to mind. Thanks for your help, I will give the SearchInHeader contribution a go. Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 Thanks for your help, I will give the SearchInHeader contribution a go. Ok I have now tried using the searchinheader contribution, but I am unable to get it to appear correctly within my site, as it takes up too much space vertically. What I really need is put use the original search comes as oscommerce default...... but I need to know which code to use to put it back into my site. Could anyone point me in the right direction? Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 In catalog/includes/column_left.php add this line just before the closing ?> require(DIR_WS_BOXES . 'search.php'); Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 In catalog/includes/column_left.php add this line just before the closing ?> require(DIR_WS_BOXES . 'search.php'); I want the search to be in header, not column_left. However, I have made some fantastic progress with it this afernoon, and Im literally a pixel away from being hapy with it! My search.php now contains the following; <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_input_field('keywords', '', 'size="15" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>'; ?> It appears perfectly....EXCEPT that the little search button "button_quick_find.gif", appears UNDER the search box, and not to the right of it. I've been messing with the code for a good hour, but cant seem to get the search gif to appear to the right of the search box. If anyone can answer this one it would be a massive help.... Im sure someone can make head or tail of the above code and see what going on. My site is at www.tractormad.co.uk if you want to see the....er problem in action. Thanks Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 I guess I missed the header part. :blush: Nice site btw. For currencies you have <td><img src="images/m09.gif" width="1" height="40" border="0" alt=""></td> <td width="257" align="center"> <span class="tx">Currencies:</span> <form name="currencies" action="http://tractormad.co.uk//index.php" method="get"><select name="currency" onChange="this.form.submit();" class="se1"><option value="EUR">Euro</option><option value="GBP" SELECTED>British Pound</option><option value="USD">US Dollar</option></select></form> </td> But for the search you have <td width="100" align="right"> <form name="quick_find" action="http://tractormad.co.uk//advanced_search_result.php" method="get"><input type="text" name="keywords" size="15" maxlength="30" style="width: 95px"><input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="BOX_HEADNG_SEARCH" title=" BOX_HEADNG_SEARCH "></form> </td> I would try changing the width to 200 "<td width="100" align="right">"and see what happens because later you have the box width as "95px style="width:" 95px". Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 I guess I missed the header part. :blush: Nice site btw. For currencies you have <td><img src="images/m09.gif" width="1" height="40" border="0" alt=""></td> <td width="257" align="center"> <span class="tx">Currencies:</span> <form name="currencies" action="http://tractormad.co.uk//index.php" method="get"><select name="currency" onChange="this.form.submit();" class="se1"><option value="EUR">Euro</option><option value="GBP" SELECTED>British Pound</option><option value="USD">US Dollar</option></select></form> </td> But for the search you have <td width="100" align="right"> <form name="quick_find" action="http://tractormad.co.uk//advanced_search_result.php" method="get"><input type="text" name="keywords" size="15" maxlength="30" style="width: 95px"><input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="BOX_HEADNG_SEARCH" title=" BOX_HEADNG_SEARCH "></form> </td> I would try changing the width to 200 "<td width="100" align="right">"and see what happens because later you have the box width as "95px style="width:" 95px". You've been a massive help. I've changed the code so that search now more closely matches Currencies as per your suggestion. The search gif has now at least moved onto the same row, but I cant quite get it to align with the search box. If you have any ideas that would be great, or should I look at altering the GIF to hack around it? Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 Not sure if this would work but try "width: 95px"> . . <input type="image" Just to spread things out with. Try resizing the image in windows Paint (make more space at the top of the image) and you might be able to fake the alignment as I have had the same issue with some buttons and weird code in the past. Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 Not sure if this would work but try "width: 95px"> . . <input type="image" Just to spread things out with. Try resizing the image in windows Paint (make more space at the top of the image) and you might be able to fake the alignment as I have had the same issue with some buttons and weird code in the past. I just cant seem to get the spacing right, I've noticed that the search box is lower down than all the other boxes, as well as the issue with the image.... here is my header.php, if anyone can suggest where I am going wrong it would be great....site is at www.tractormad.co.uk <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <table border="0" cellspacing="0" cellpadding="0" width="759" align="center"> <tr><td valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=tep_image(DIR_WS_IMAGES.'tractormadlogo.gif')?></a></td></tr> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=Tep_Image_Button('m02.gif')?></a><a href="<?=tep_href_link('products_new.php')?>"><?=Tep_Image_Button('m03.gif')?></a><a href="<?=tep_href_link('specials.php')?>"><?=Tep_Image_Button('m04.gif')?></a><a href="<?=tep_href_link('account.php')?>"><?=Tep_Image_Button('m05.gif')?></a><a href="<?=tep_href_link('contact_us.php')?>"><?=Tep_Image_Button('m06.gif')?></a></td></tr> </table> <table border="0" cellspacing="0" cellpadding="0"> <tr><td><?=tep_image(DIR_WS_IMAGES.'m07.gif')?></td> <td width="745" bgcolor="#6FAD00"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td width="100" align="center" nowrap="nowrap"><span class="tx"><?=BOX_HEADING_MANUFACTURERS?>:</span></td><td width="4"></td><td align="left" width="140" class="se"><? echo tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT), 'get'); include(DIR_WS_BOXES . 'manufacturers.php'); echo '</form>'; ?> </td> <td><?=tep_image(DIR_WS_IMAGES.'m09.gif')?></td> <td width="257" align="center"> <span class="tx"><?=BOX_HEADING_CURRENCIES?>:</span> <? echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="se1"') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td> <td><img src="images/m09.gif" width="1" height="40" border="0" alt=""></td> <td width="257" align="center"> <span class="tx">Search:</span> <?php require(DIR_WS_BOXES . 'search.php'); ?> </td> <td width="142" style=" padding-top:4px;"> </td> </tr> </table> </td> <td><?=tep_image(DIR_WS_IMAGES.'m08.gif')?></td></tr> <tr><td height="5" colspan="3"></td></tr> </table> </td></tr> Link to comment Share on other sites More sharing options...
Guest Posted July 5, 2007 Share Posted July 5, 2007 I just cant seem to get the spacing right, I've noticed that the search box is lower down than all the other boxes, as well as the issue with the image.... here is my header.php, if anyone can suggest where I am going wrong it would be great....site is at www.tractormad.co.uk <?php /* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <table border="0" cellspacing="0" cellpadding="0" width="759" align="center"> <tr><td valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=tep_image(DIR_WS_IMAGES.'tractormadlogo.gif')?></a></td></tr> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=Tep_Image_Button('m02.gif')?></a><a href="<?=tep_href_link('products_new.php')?>"><?=Tep_Image_Button('m03.gif')?></a><a href="<?=tep_href_link('specials.php')?>"><?=Tep_Image_Button('m04.gif')?></a><a href="<?=tep_href_link('account.php')?>"><?=Tep_Image_Button('m05.gif')?></a><a href="<?=tep_href_link('contact_us.php')?>"><?=Tep_Image_Button('m06.gif')?></a></td></tr> </table> <table border="0" cellspacing="0" cellpadding="0"> <tr><td><?=tep_image(DIR_WS_IMAGES.'m07.gif')?></td> <td width="745" bgcolor="#6FAD00"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td width="100" align="center" nowrap="nowrap"><span class="tx"><?=BOX_HEADING_MANUFACTURERS?>:</span></td><td width="4"></td><td align="left" width="140" class="se"><? echo tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT), 'get'); include(DIR_WS_BOXES . 'manufacturers.php'); echo '</form>'; ?> </td> <td><?=tep_image(DIR_WS_IMAGES.'m09.gif')?></td> <td width="257" align="center"> <span class="tx"><?=BOX_HEADING_CURRENCIES?>:</span> <? echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="se1"') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td> <td><img src="images/m09.gif" width="1" height="40" border="0" alt=""></td> <td width="257" align="center"> <span class="tx">Search:</span> <?php require(DIR_WS_BOXES . 'search.php'); ?> </td> <td width="142" style=" padding-top:4px;"> </td> </tr> </table> </td> <td><?=tep_image(DIR_WS_IMAGES.'m08.gif')?></td></tr> <tr><td height="5" colspan="3"></td></tr> </table> </td></tr> bump Link to comment Share on other sites More sharing options...
Guest Posted July 6, 2007 Share Posted July 6, 2007 Most of this issue has been solved via PM, there were some missing and improperly nested tags in the tables. The image is the part that still needs to be sorted out. <table border="0" cellspacing="0" cellpadding="0" width="759" align="center"> <tr><td valign="top"> <table border="0" cellspacing="0" cellpadding="0"> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=tep_image(DIR_WS_IMAGES.'tractormadlogo.gif')?></a></td></tr> <tr><td><a href="<?=tep_href_link('index.php')?>"><?=Tep_Image_Button('m02.gif')?></a><a href="<?=tep_href_link('products_new.php')?>"><?=Tep_Image_Button('m03.gif')?></a><a href="<?=tep_href_link('specials.php')?>"><?=Tep_Image_Button('m04.gif')?></a><a href="<?=tep_href_link('account.php')?>"><?=Tep_Image_Button('m05.gif')?></a><a href="<?=tep_href_link('contact_us.php')?>"><?=Tep_Image_Button('m06.gif')?></a></td></tr> </table> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><?=tep_image(DIR_WS_IMAGES.'m07.gif')?></td> <td width="745" bgcolor="#6FAD00"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="100" align="center" nowrap="nowrap"><span class="tx"><?=BOX_HEADING_MANUFACTURERS?>:</span></td> <td width="4"></td> <td align="left" width="140" class="se"><? echo tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT), 'get'); include(DIR_WS_BOXES . 'manufacturers.php'); echo '</form>';?></td> <td><?=tep_image(DIR_WS_IMAGES.'m09.gif')?></td> <td width="257" align="center"> <span class="tx"><?=BOX_HEADING_CURRENCIES?>:</span> <? echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'); reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="se1"') . $hidden_get_variables . tep_hide_session_id(); echo '</form>'; ?> </td> <td><img src="images/m09.gif" width="1" height="40" border="0" alt=""></td> <td width="257" align="center"> <span class="tx">Search:</span> <?php require(DIR_WS_BOXES . 'search.php'); ?> </td> <td width="142" style=" padding-top:4px;"> </td> </tr> </table> </td> <td><?=tep_image(DIR_WS_IMAGES.'m08.gif')?></td></tr> <tr><td height="5" colspan="3"></td></tr> </tr> </table> </td></tr> </table> Link to comment Share on other sites More sharing options...
Qim Posted November 30, 2007 Share Posted November 30, 2007 Hi, pls forgive me if I am posting my question the wrong way, but you seems to know quite a bit of what I am trying to achieve: In the header after my logo, I want to have "Languages, Currencys, Search, Shopping Cart". I have searched for about ten days now but haven't found a crisp clear solution. Languages and Currencys I would like to have as clickable images and Searcg plus Shopping cart as per the OSc standard. My site is a fashion site and it must be minimalistic and simple www.ji-fashion.com/butik. I am into fashion not coding, but to my surprise I have, almost I should say, ready to go live with my shop. :) I would be very pleased if you would be so kind and help me out. Kind regards from a dizzy Qim Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.