Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stripping out box code but keeping the content


jimbeeer

Recommended Posts

Posted

Let's say for example i have the search box, with the boxes.php module and the search.php it produces the following code:

 

 <!-- search //-->

	 <tr>
		<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td width="100%" height="14" class="infoBoxHeading">  Quick Find</td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1" class="infoBox">
 <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="3" class="infoBoxContents">

 <tr>
 </tr>
 <tr>
<td align="center" class="boxText"><form name="quick_find" action="advanced_search_result.php" method="get"><input type="text" name="keywords" size="10" maxlength="30" style="width: 95px"> <input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="Quick Find" title=" Quick Find "><br>Use keywords to find the product you are looking for.<br><a href="advanced_search.php<b>Advanced Search</b></a></form></td>
 </tr>
 <tr>
<td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="1"></td>
 </tr>

</table>
</td>
 </tr>
</table>
		</td>
	  </tr>
<!-- search_eof //-->

 

 

All i want it to produce is:

 

<form name="quick_find" action="advanced_search_result.php" method="get"><input type="text" name="keywords" size="10" maxlength="30" style="width: 95px"> <input type="image" src="includes/languages/english/images/buttons/button_quick_find.gif" border="0" alt="Quick Find" title=" Quick Find "><br>Use keywords to find the product you are looking for.<br><a href="advanced_search.php<b>Advanced Search</b></a></form>

 

Can anyone help?

 

-James

Posted

Unfortunately all of the infoboxes run through the tablebox class to turn the output into a nice array of nested tables and such to make it all work.

 

If you install STS however, you can modify the infobox style with a simple template.

That's the best option.

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted
Unfortunately all of the infoboxes run through the tablebox class to turn the output into a nice array of nested tables and such to make it all work.

 

If you install STS however, you can modify the infobox style with a simple template.

That's the best option.

 

Rob

 

I'm not sure that option will be sufficient as i have to completely move over the search text box and put it into the header, along with the manufacturers box and a categories dropdown box, so i can't have any td or tr tags around it at all.

 

I don't mind completely butchering boxes.php as it won't actually be used at all. I just need to completely strip it down to its bare elements so it shows nothing more than the contents

Posted
I'm not sure that option will be sufficient as i have to completely move over the search text box and put it into the header, along with the manufacturers box and a categories dropdown box, so i can't have any td or tr tags around it at all.

 

I don't mind completely butchering boxes.php as it won't actually be used at all. I just need to completely strip it down to its bare elements so it shows nothing more than the contents

If you want the search box in the header lets say to the right of the my account, cart contents and checkout links, add this

	<td valign="middle" class="headerNavigation" align="right"><?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . BOX_HEADING_SEARCH . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?></td>

That will take it out of the infox class and put in <td></td> tags of the <tr></tr> that you want.

Posted
If you want the search box in the header lets say to the right of the my account, cart contents and checkout links, add this

	<td valign="middle" class="headerNavigation" align="right"><?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . BOX_HEADING_SEARCH . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?></td>

That will take it out of the infox class and put in <td></td> tags of the <tr></tr> that you want.

 

 

Absolutely brilliant, exactly what i wanted. Many thanks to you and your family for raising such a smart person.

 

I actually needed it for the manufacturers box as well as the search box.

 

the code i've used for the manufacturers box is:

 

<?php $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");$manufacturers_array = array();
  if (MAX_MANUFACTURERS_LIST < 2) {
	$manufacturers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
  }

  while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
	$manufacturers_name = ((strlen($manufacturers['manufacturers_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($manufacturers['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $manufacturers['manufacturers_name']);
	$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
								   'text' => $manufacturers_name);
  };echo tep_draw_form('manufacturers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get') . tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($HTTP_GET_VARS['manufacturers_id']) ? $HTTP_GET_VARS['manufacturers_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id(); ?>

  • 1 year later...
Posted

If you want the search box in the header lets say to the right of the my account, cart contents and checkout links, add this

	<td valign="middle" class="headerNavigation" align="right"><?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . BOX_HEADING_SEARCH . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?></td>

That will take it out of the infox class and put in <td></td> tags of the <tr></tr> that you want.

 

 

Hi Brian,

 

I know you posted this a while back, but I was if could tell me exactly how to edit header.php to put the search box to the right of checkout in the header. If I simply paste this line under line 67 of a stock layout,

 

<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 

 

then my account, cart contents, and checkout get moved to the center.

 

Thanks,

 

Nick

Posted

Hi Brian,

 

I know you posted this a while back, but I was if could tell me exactly how to edit header.php to put the search box to the right of checkout in the header. If I simply paste this line under line 67 of a stock layout,

 

<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

 

 

then my account, cart contents, and checkout get moved to the center.

 

Thanks,

 

Nick

Try changing

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

to

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> | <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . BOX_HEADING_SEARCH . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?>   </td>

Posted

Try changing

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>

to

   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> | <?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . BOX_HEADING_SEARCH . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH-30) . 'px"') . ' ' . tep_hide_session_id() . tep_draw_hidden_field('search_in_description' , '1') . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '</form>';?>   </td>

 

Thanks Brian! I know I can't be the first to have that question, so I think your post will prove very useful to a lot of people. Just one quick question: the default image button_quick_find.gif doesn't seem to line up with the search box as it's slightly raised. I'm going to switch out this lame button later on anyways, but is there anything I need to do in the coding to get things lined up or will I just take care of that in photoshop or the oscButton generator website? Thanks again for your help,

 

Nick

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...