Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need help with boxes.php file please ....


Guest

Recommended Posts

Ok I give up :lol: ? I need help please!!!

 

I have been working on modify the specials box, feature box and the new products box on the default page ? but I cannot seem to get them to look as I need them too. Can someone please show me how to make these boxes look at another boxes.php file?

 

I think this would allow me to fix them my messing with that file as opposed to messing up my current info boxes.

 

Many many thanks in advance!!! :D

 

DreamWolf

Link to comment
Share on other sites

My side columns have a different style background then what I want on the bigger boxes ? there is also major differences with the table widths. There is also a background in the heading in the bigger boxes then in the side info boxes.

 

Not sure if that explains what you are asking ? but I hope so. :)

 

DreamWolf

Link to comment
Share on other sites

ok I have messed with them throught the day ... and I am not seeing something that I should be within the code because the heading table is not taking like the other codes are for the box edits. Basically it is still grabbing the infoboxHeading instead of infoboxHeading1 like it should.

 

I'm also not getting the backgrounds to show up in the second table even tho it is not there ... my thinking is because I just don't have the file in the right spot, but it is coppie to both the images/infobox and directly under /catalog/ as well as being under /catalog/images/ ... any suggestions?

 

The code I have is posted below. Many Many thanks for any help!!!

 

featured.php file

<?php

/*

 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

 

 Featured Products V1.1

 Displays a list of featured products, selected from admin

 For use as an Infobox instead of the "New Products" Infobox  

*/

?>

<!-- featured_products //-->

<?php

if(FEATURED_PRODUCTS_DISPLAY == true)

{

 $featured_products_category_id = $new_products_category_id;

 $cat_name_query = tep_db_query("select categories_name from categories_description where categories_id = '" . $featured_products_category_id . "' limit 1");

 $cat_name_fetch = tep_db_fetch_array($cat_name_query);

 $cat_name = $cat_name_fetch['categories_name'];

 $info_box_contents = array();



 if ( (!isset($featured_products_category_id)) || ($featured_products_category_id == '0') ) {

   $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS) . '">' . TABLE_HEADING_FEATURED_PRODUCTS . '</a>');

   $featured_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 } else {

   $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));

   $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

 }



 $row = 0;

 $col = 0; 

 $num = 0;

 while ($featured_products = tep_db_fetch_array($featured_products_query)) {

   $num ++; if ($num == 1) { new contentBoxHeading($info_box_contents); }

   $featured_products['products_name'] = tep_get_products_name($featured_products['products_id']);

   if($featured_products['specstat']) {

     $info_box_contents[$row][$col] = array('align' => 'center',

                                          'params' => 'class="smallText" width="33%" valign="top"',

                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br><s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . 

                                          $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');

   } else {

     $info_box_contents[$row][$col] = array('align' => 'center',

                                          'params' => 'class="smallText" width="33%" valign="top"',

                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . $featured_products['products_name'] . '</a><br>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));

   }    

   $col ++;

   if ($col > 2) {

     $col = 0;

     $row ++;

   }

 }

 if($num) {

     

     new contentBox1($info_box_contents);

 }

} else // If it's disabled, then include the original New Products box

{

  include (DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);

}

?>

<!-- featured_products_eof //-->

 

boxes.php

<?php

/*

 $Id: thema_boxes.php,v 1.1 2002/11/29 22:41:29 wilt Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



 class tableBox {

   var $table_align = 'center';

var $table_border = '0';

   var $table_width = '80%';

   var $table_cellspacing = '0';

   var $table_cellpadding = '0';

   var $table_parameters = '';

   var $table_row_parameters = '';

   var $table_data_parameters = '';



// class constructor

   function tableBox($contents, $direct_output = false) {

     $tableBox_string = '<table align="' . $this->table_align . '" valign="' . $this->table_valign . '" border="' . $this->table_border . '" bordercolor="' . $this->table_bordercolor . '" background="' . $this->table_background . '" width="' . $this->table_width . '" cellspacing="' . $this->table_cellspacing . '" cellpadding="' . $this->table_cellpadding . '"';

     if ($this->table_parameters != '') $tableBox_string .= ' ' . $this->table_parameters;

     $tableBox_string .= '>' . "n";



     for ($i=0; $i<sizeof($contents); $i++) {

       if ($contents[$i]['form']) $tableBox_string .= $contents[$i]['form'] . "n";

       $tableBox_string .= '  <tr';

       if ($this->table_row_parameters != '') $tableBox_string .= ' ' . $this->table_row_parameters;

       if ($contents[$i]['params']) $tableBox_string .= ' ' . $contents[$i]['params'];

       $tableBox_string .= '>' . "n";



       if (is_array($contents[$i][0])) {

         for ($x=0; $x<sizeof($contents[$i]); $x++) {

           if ($contents[$i][$x]['text']) {

             $tableBox_string .= '    <td';

             if ($contents[$i][$x]['align'] != '') $tableBox_string .= ' align="' . $contents[$i][$x]['align'] . '"';

             if ($contents[$i][$x]['params']) {

               $tableBox_string .= ' ' . $contents[$i][$x]['params'];

             } elseif ($this->table_data_parameters != '') {

               $tableBox_string .= ' ' . $this->table_data_parameters;

             }

             $tableBox_string .= '>';

             if ($contents[$i][$x]['form']) $tableBox_string .= $contents[$i][$x]['form'];

             $tableBox_string .= $contents[$i][$x]['text'];

             if ($contents[$i][$x]['form']) $tableBox_string .= '</form>';

             $tableBox_string .= '</td>' . "n";

           }

         }

       } else {

         $tableBox_string .= '    <td';

         if ($contents[$i]['align'] != '') $tableBox_string .= ' align="' . $contents[$i]['align'] . '"';

         if ($contents[$i]['params']) {

           $tableBox_string .= ' ' . $contents[$i]['params'];

         } elseif ($this->table_data_parameters != '') {

           $tableBox_string .= ' ' . $this->table_data_parameters;

         }

         $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "n";

       }



       $tableBox_string .= '  </tr>' . "n";

       if ($contents[$i]['form']) $tableBox_string .= '</form>' . "n";

     }



     $tableBox_string .= '</table>' . "n";



     if ($direct_output) echo $tableBox_string;



     return $tableBox_string;

   }

 }



 class infoBox extends tableBox {

   function infoBox($contents) {

     $info_box_contents = array();

     $info_box_contents[] = array('text' => $this->infoBoxContents($contents));

  $this->table_width = '100%';

     $this->table_cellpadding = '1';

     $this->table_parameters = 'class="infoBox"';

     $this->tableBox($info_box_contents, true);

   }



 function infoBoxContents($contents) {

    $this->table_width = '75%';

     $this->table_cellpadding = '0';

     $this->table_parameters = 'class="infoBoxContents"';

     $info_box_contents = array();

     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

     for ($i=0; $i<sizeof($contents); $i++) {

       $info_box_contents[] = array(array('align' => $contents[$i]['align'], 'form' => $contents[$i]['form'], 'params' => 'class="boxText"', 'text' => $contents[$i]['text']));

     }

     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

     return $this->tableBox($info_box_contents);

   }

 }



 class infoBox1 extends tableBox {

   function infoBox1($contents) {

     $info_box_contents = array();

     $info_box_contents[] = array('text' => $this->infoBoxContents1($contents));

  $this->table_width = '100%';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '1';

  $this->table_border = '1';

  $this->table_bordercolor = '#39394A';

  $this->table_background = 'whitemainbox.jpg';

     $this->table_parameters = 'class="infoBox1"';

     $this->tableBox($info_box_contents, true);

   }



function infoBoxContents1($contents) {

    $this->table_width = '95%';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '4';

  $this->table_border = '0';

     $this->table_parameters = 'class="infoBoxContents1"';

     $info_box_contents = array();

     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

     for ($i=0; $i<sizeof($contents); $i++) {

       $info_box_contents[] = array(array('align' => $contents[$i]['align'], 'form' => $contents[$i]['form'], 'params' => 'class="boxText"', 'text' => $contents[$i]['text']));

     }

     $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));

     return $this->tableBox($info_box_contents);

   }

 }



 class infoBoxHeading extends tableBox {

   function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {

  $this->table_cellpadding = '0';



     if ($left_corner) {

       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif');

     } else {

       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif');

     }

     if ($right_arrow) {

       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';

     } else {

       $right_arrow = '';

     }

     if ($right_corner) {

       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right.gif');

     } else {

       $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');

     }



     $info_box_contents = array();

     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', 'text' => $left_corner),

                                  array('params' => 'width="100%" height="14" class="infoBoxHeading"', 'text' => $contents[0]['text']),

                                  array('params' => 'height="14" class="infoBoxHeading"', 'text' => $right_corner));

     $this->tableBox($info_box_contents, true);

   }

 }

 

 class infoBoxHeading1 extends tableBox {

   function infoBoxHeading1($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {

  $this->table_background = 'topmainboxbar.jpg';

  $this->table_align = 'center';

  $this->table_width = '100%';

  $this->table_border = '0';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '0';



     if ($left_corner) {

       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif');

     } else {

       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif');

     }

     if ($right_arrow) {

       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';

     } else {

       $right_arrow = '';

     }

     if ($right_corner) {

       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right.gif');

     } else {

       $right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');

     }



     $info_box_contents = array();

     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading1"', 'text' => $left_corner),

                                  array('params' => 'width="100%" height="14" class="infoBoxHeading1"', 'text' => $contents[0]['text']),

                                  array('params' => 'height="14" class="infoBoxHeading1"', 'text' => $right_corner));

     $this->tableBox($info_box_contents, true);

   }

 }



 class contentBox extends tableBox {

   function contentBox($contents) {

     $info_box_contents = array();

     $info_box_contents[] = array('text' => $this->contentBoxContents($contents));

     $this->table_cellpadding = '1';

     $this->table_parameters = 'class="infoBox"';

     $this->tableBox($info_box_contents, true);

   }

 

   function contentBoxContents($contents) {

     $this->table_cellpadding = '4';

     $this->table_parameters = 'class="infoBoxContents"';

     return $this->tableBox($contents);

   }

 }



 class contentBox1 extends tableBox {

   function contentBox1($contents) {

     $info_box_contents = array();

     $info_box_contents[] = array('text' => $this->contentBoxContents1($contents));

     $this->table_width = '100%';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '1';

  $this->table_border = '1';

  $this->table_bordercolor = '#39394A';

  $this->table_background = 'whitemainbox.jpg';

     $this->table_parameters = 'class="infoBox1"';

     $this->tableBox($info_box_contents, true);

   }

 

   function contentBoxContents1($contents) {

     $this->table_width = '95%';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '4';

  $this->table_border = '0';

     $this->table_parameters = 'class="infoBoxContents1"';

     return $this->tableBox($contents);

   }

 }

 

 class contentBoxHeading extends tableBox {

   function contentBoxHeading($contents) {

     $this->table_width = '100%';

     $this->table_cellpadding = '0';



     $info_box_contents = array();

     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif')),

                                  array('params' => 'height="14" class="infoBoxHeading" width="100%"', 'text' => $contents[0]['text']),

                                  array('params' => 'height="14" class="infoBoxHeading"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif')));

     $this->tableBox($info_box_contents, true);

   }

 }



 class contentBoxHeading1 extends tableBox {

   function contentBoxHeading($contents) {

     $this->table_background = 'topmainboxbar.jpg';

  $this->table_align = 'center';

  $this->table_width = '100%';

  $this->table_border = '0';

  $this->table_cellspacing = '0';

  $this->table_cellpadding = '0';



     $info_box_contents = array();

     $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading1"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_left.gif')),

                                  array('params' => 'height="14" class="infoBoxHeading1" width="100%"', 'text' => $contents[0]['text']),

                                  array('params' => 'height="14" class="infoBoxHeading1"', 'text' => tep_image(DIR_WS_IMAGES . 'infobox/thema/' . SITE_THEMA . '/corner_right_left.gif')));

     $this->tableBox($info_box_contents, true);

   }

 }

 

 class errorBox extends tableBox {

   function errorBox($contents) {

     $this->table_data_parameters = 'class="errorBox"';

     $this->tableBox($contents, true);

   }

 }

?>

Link to comment
Share on other sites

Guess what? Playing a game and then putting kids to bed actually help you relax and see code again :lol:

 

I finally figured it all out ... just forgot one number when editing the code and also found out that doubling the background in css and within the table can cause it not to show :oops:

 

Anyway, just wanted to say thanks again for the help!! :D

 

DreamWolf

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...