Bobbot20 Posted December 14, 2003 Share Posted December 14, 2003 Is there a code I can cut and post, to add a search box, without an info box, to the header of my site? Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2003 Share Posted December 14, 2003 yes, from includes/boxes/search.php Link to comment Share on other sites More sharing options...
Bobbot20 Posted December 14, 2003 Author Share Posted December 14, 2003 Can a PHP wiz please give me the exact code so it doesn't have a box around it. I'd really appreciate it. THANKS! Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2003 Share Posted December 14, 2003 this should be it, but you have to edit it in a form tag 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>'); tom Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2003 Share Posted December 14, 2003 try pasting just this: 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>' you could remove BOX_SEARCH_ADVANCED_SEARCH . '</b> for no advanced search link haven't tried it tom Link to comment Share on other sites More sharing options...
Guest Posted December 14, 2003 Share Posted December 14, 2003 You need to add a </form> at the end as well. The infoBox adds this automatically. Hth, Matt Link to comment Share on other sites More sharing options...
Guest Posted December 15, 2003 Share Posted December 15, 2003 I have it working, but it looks weird. I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up. The php 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="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ; echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH); echo '</form>'; ?> The HTML it outputs <form name="quick_find" method="get" action="http://www.myurl.co.uk/advanced_search_result.php"> <input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg" border="0" alt="Quick Find" title=" Quick Find "></form> The finished result, note the unalignment. Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript. Link to comment Share on other sites More sharing options...
Guest Posted December 15, 2003 Share Posted December 15, 2003 I have it working, but it looks weird. I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up. The php 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="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ; echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH); echo '</form>'; ?> The HTML it outputs <form name="quick_find" method="get" action="http://www.myurl.co.uk/advanced_search_result.php"> <input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg" border="0" alt="Quick Find" title=" Quick Find "></form> The finished result, note the unalignment. Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript. Link to comment Share on other sites More sharing options...
Guest Posted December 16, 2003 Share Posted December 16, 2003 I have it working, but it looks weird. I am adding a search box to the top of each of my pages, but it looks weird. It looks ok if you use a standard grey boring submit button. But if i use a custom image, it doesnt line them up. The php 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="15" maxlength="30" value="' . htmlspecialchars(StripSlashes(@$HTTP_GET_VARS["keywords"])) . '"> ' . '' ; echo tep_image_submit('button_quick_find.jpg', BOX_HEADING_SEARCH); echo '</form>'; ?> The HTML it outputs <form name="quick_find" method="get" action="http://www.myurl.co.uk/advanced_search_result.php"> <input type="text" name="keywords" size="15" maxlength="30" value=""> <input type="image" src="button_quick_find.jpg" border="0" alt="Quick Find" title=" Quick Find "></form> The finished result, note the unalignment. Any ideas how I can fix this, so the box and button line up? I suppose I could use a text link, but this would mean using javascript. Link to comment Share on other sites More sharing options...
Guest Posted December 16, 2003 Share Posted December 16, 2003 Sorry for the multiple posts, I kept getting page not found error, and the ability to delete posts is not available for some reason! Can a mod delete my extra posts please. thnx Link to comment Share on other sites More sharing options...
Tariq Posted December 16, 2003 Share Posted December 16, 2003 I added this... BEWARE, the colors are edited to my site... It doesnt add any funky tables or extra lines aronud it since I edited it around. Just the Search box, and the Advanced search link <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); ?> </td> <td align="center" class="headerNavigation"> <table border="0" cellspacing="0" cellpadding="0"> <td class="headerNavigation" align="center"><?php echo ''; ?></td> <td align="center"><?php echo tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 75px"') . tep_hide_session_id(); ?></td> <td align="center"><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH); ?></td> <td class="headerNavigation" align="center"> <?php echo '<A href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><font color="#ffffff">Advanced Search</font></A>'; ?></td> </table> </form> You can see it Here ::is WAY proud of self for getting it IN the Header bar :) :: Hope that helps some! One of these days, I will actually understand what I just changed... But reading the Manual DEFINATELY helps... Link to comment Share on other sites More sharing options...
Guest Posted December 18, 2003 Share Posted December 18, 2003 That works great, but I cant get it to fit in with my css design :( Does anyone know how I can convert this to fit into a part of the design which is full CSS? Link to comment Share on other sites More sharing options...
korsh Posted December 18, 2003 Share Posted December 18, 2003 Hey Tariq, I like what you did with the search box. Where do you paste the code to get it into the header bar? <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); ?> </td> <td align="center" class="headerNavigation"> <table border="0" cellspacing="0" cellpadding="0"> <td class="headerNavigation" align="center"><?php echo ''; ?></td> <td align="center"><?php echo tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: 75px"') . tep_hide_session_id(); ?></td> <td align="center"><?php echo tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH); ?></td> <td class="headerNavigation" align="center"> <?php echo '<A href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><font color="#ffffff">Advanced Search</font></A>'; ?></td> </table> </form> James Link to comment Share on other sites More sharing options...
Melinda Posted December 18, 2003 Share Posted December 18, 2003 james, /catalog/includes/header.php. I wanted it at the end of the header bar instead of in the middle so I put it after Checkout. Melinda Link to comment Share on other sites More sharing options...
korsh Posted December 19, 2003 Share Posted December 19, 2003 Thanks Melinda, I put the search box in the header bar and changed the white background to the colour of the header bar and used the white text it looks terrific. cheers James Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.