Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Box help


carlp

Recommended Posts

Hi,

 

I've intergrated includes/boxes/search.php and includes/boxes/manufacturers.php into the one file search.php to help make the site layout look good.

 

My Code Below:

<!-- search //-->

         <tr>

           <td>

<?php

 $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"])) . '" style="width: ' . (BOX_WIDTH-30) . 'px"><br>' . tep_image_submit('but_search.gif', BOX_HEADING_SEARCH) . '<br>' . '<br><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a>'

                             );

 new infoBox($info_box_contents);

// Search EOF

// Manufacturers SOF

 $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");



 if (tep_db_num_rows($manufacturers_query) <= MAX_DISPLAY_MANUFACTURERS_IN_A_LIST) {

// Display a list

   $manufacturers_list = '';

   while ($manufacturers_values = tep_db_fetch_array($manufacturers_query)) {

     $manufacturers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_values['manufacturers_id'], 'NONSSL') . '">' . substr($manufacturers_values['manufacturers_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</a><br>';

   }



   $info_box_contents = array();

   $info_box_contents[] = array('align' => 'left',

                                'text'  => $manufacturers_list);

 } else {

// Display a drop-down

   $select_box = '<select name="manufacturers_id" onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%">';

   if (MAX_MANUFACTURERS_LIST < 2) {

     $select_box .= '<option value="">' . PULL_DOWN_DEFAULT . '</option>';

   }

   while ($manufacturers_values = tep_db_fetch_array($manufacturers_query)) {

     $select_box .= '<option value="' . $manufacturers_values['manufacturers_id'] . '"';

     if ($HTTP_GET_VARS['manufacturers_id'] == $manufacturers_values['manufacturers_id']) $select_box .= ' SELECTED';

     $select_box .= '>' . substr($manufacturers_values['manufacturers_name'], 0) . '</option>';

   }

   $select_box .= "</select>";

   $select_box .= tep_hide_session_id();



   $info_box_contents = array();

   $info_box_contents[] = array('form'  => '<form name="manufacturers" method="get" action="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false) . '">',

                                'align' => 'left',

                                'text'  => $select_box);

 }



 new infoBox($info_box_contents);

?>

           </td>

         </tr>

<!-- search_eof //-->

 

When I upload this and disable manufacturers in coloum_left.php I have a very slim black line inbetween the two fields, which indicates its still pulling them as two boxes. If I change the code

    var $table_cellspacing = '0';

   var $table_cellpadding = '2';

   var $table_parameters = '';

   var $table_row_parameters = '';

   var $table_data_parameters = '';

in /includes/classes/boxes.php to say

var $table_cellpadding = '0';

I loose the line! but then, I also loose all other lines around the boxes.

 

Anyone have any ideas?

 

Regards,

 

Carl Pickering

Kindest Regards,

 

Carl Pickering

 

If there is light at the end of the tunnel, switch it off. I have to save on my electricity bill

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...