Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pure CSS Image Swap On Hover For osC Buttons


spooks

Recommended Posts

I've got following error

PHP Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /usr/home/xxxxx/public_html/includes/footer.php on line 14

 

echo '<style type="text/css">' . $button_class . '</style>'
if ($sts->display_template_output) {  
 // Get content here, in case column_right is not called.
 if (!isset($sts->template['content'])) $sts->restart_capture ('content');  
} else {  
//END STS

line 14 is if ($sts->display_template_output) {

Link to comment
Share on other sites

I've got following error

PHP Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in /usr/home/xxxxx/public_html/includes/footer.php on line 14

 

echo '<style type="text/css">' . $button_class . '</style>'
if ($sts->display_template_output) {  
 // Get content here, in case column_right is not called.
 if (!isset($sts->template['content'])) $sts->restart_capture ('content');  
} else {  
//END STS

line 14 is if ($sts->display_template_output) {

 

 

because u missed off the semcolon!!!

 

echo '<style type="text/css">' . $button_class . '</style>';

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 weeks later...

Sam,

I don't know why this mod is not working for me.? I made the file changes and named my images (button_0.gif and button_0_over.gif). When I show the image it does not have a hover effect?? Am I supposed to add anything to the css file??

here is the button reference: <td><img src="http://mysite.com/includes/languages/english/images/buttons/button_0.gif"></td>

 

 

Any help would be greatly appreciated.

Hep

Link to comment
Share on other sites

  • 1 month later...

I tried various things for an hour to get this to work. Please help.

Here is my code before.

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
 function tep_image_submit($image, $alt = '', $parameters = '') {
   global $language;

	// START STS v4.4:
  global $sts;
	  $src = $sts->image_button($image,$language);
	  if ($src!='')
	    $image_submit = '<input type="image" src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';
		else 
  // END STS v4.4
   $image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

   if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

   if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

   $image_submit .= '>';

   return $image_submit;
 }

////
// Output a function button in the selected language
 function tep_image_button($image, $alt = '', $parameters = '') {
   global $language;

// START STS v4.4:
  global $sts;
	$src = $sts->image_button($image, $language, true); // 3rd parameter to tell tep_image that file check has been already done
	if ($src!='') { // Take image from template folder if exists.
	  return tep_image ($src);
	}
// END STS v4.4

   return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
 }

 

When using this code, my custom STS buttons appear. When I use either variation of your code, the default images appear. I really have very limited PHP experience, so I cannot troubleshoot the problem myself.

I am using STS 4.1

Link to comment
Share on other sites

I tried various things for an hour to get this to work. Please help.

Here is my code before.

I am using STS 4.1

 

 

OK, quite a few changes needed, this is both functions for use with STS, let me know how you get on, I don't use STS, so can't test. laugh.gif

 

 

////
// The HTML form submit button wrapper function
// Outputs a button in the selected language
function tep_image_submit($image, $alt = '', $parameters = '') {
 global $language, $button_class;

// START STS v4.4:
 global $sts;
 $src = $sts->image_button($image,$language);
 if ($src) {
   $image_src = tep_output_string($src);
  } else {
// END STS v4.4
   $image_src = tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image);
 }
 $iefix = '<a href="javascript:void(0)">'; //set to $iefix = ''; if your using an xhtml doctype
 if (file_exists($image_src)) {
  list($width, $height) = getimagesize($image_src);
  $idx = strrpos($image_src , '.'); $idd = strrpos($image_src , '/') + 1; $id = substr ($image_src,$idd,$idx-$idd);
  $hover_image = tep_output_string( substr($image_src,0,$idx) . "_over" . substr ($image_src, $idx));
  $hover = file_exists($hover_image);
 }
 $image_submit = '<input type="image" src="' . $image_src . '" border="0" alt="' . tep_output_string($alt) . '"';
 if ($hover) $image_submit = $iefix . '<img alt="" src="' . $hover_image . '" style="display:none" /><input type="submit" value="" class="' . $id . '"';
 if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';

 if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;

 $image_submit .= '>';
 if ($hover && $iefix) $image_submit .= '</a>';
 if ($hover) $button_class .= '.' . $id . ' { border: none; background: url("' . $image_src . '") no-repeat top left; width:' . $width . 'px; height:' . $height . 'px; cursor:pointer;} input.' . $id . ':hover, a:hover input.' . $id . ' { border: none; background: url("' . $hover_image . '") no-repeat top left; } ';

 return $image_submit;
}


////
////
// Output a function button in the selected language
function tep_image_button($image, $alt = '', $parameters = '') {
 global $language, $button_class;

// START STS v4.4:
 global $sts;
 $src = $sts->image_button($image, $language, true); // 3rd parameter to tell tep_image that file check has been already done
 if ($src) {
   $image_src = tep_output_string($src);
 } else {
// END STS v4.4
   $image_src = tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image);
 }  
 if (file_exists($image_src)) {
   list($width, $height) = getimagesize($image_src);
   $idx = strrpos($image_src , '.'); $idd = strrpos($image_src , '/') + 1; $id = substr ($image_src,$idd,$idx-$idd);
   $hover_image = tep_output_string( substr($image_src,0,$idx) . "_over" . substr ($image_src, $idx));
   $hover = file_exists($hover_image);
   $button = '<img alt="" src="' . $hover_image . '" style="display:none" /><img src="' . DIR_WS_IMAGES . 'pixel_trans.gif' . '" class="' . $id . '" alt="' . tep_output_string($alt) . '"';
   if (tep_not_null($alt)) $button .= ' title=" ' . tep_output_string($alt) . ' "';
   if (tep_not_null($parameters)) $button .= ' ' . $parameters;
$button .= '/>';
 }
 if ($hover) { 
   $button_class .= '.' . $id . ' { border: none; background: url("' . $image_src . '") no-repeat top left; width:' . $width . 'px; height:' . $height . 'px; cursor:pointer;} a:hover img.' . $id . ' { border: none; background: url("' . $hover_image . '") no-repeat top left; } '; 
   return $button;
 } else {
   return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters); 
 }
}
// function end

 

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

OOPS! blush.gif

 

I missed a change you'll need to the last line,

 

instead of :

 

return tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);

 

put:

 

return tep_image($image_src, $alt, '', '', $parameters); 

 

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 months later...

I have this error

 

Undefined variable: button_class in /hsphere/local/home/......../includes/footer.php on line 84

 

just after a customer is log in.

Something replaces html_output, i think, because if i'm not login work perfect.

Link to comment
Share on other sites

  • 4 weeks later...

Hello, i have a problem :

Fatal error: Call to undefined function: tep_draw_separator() in /home/toledo/public_html/includes/classes/boxes.php on line 112

 

boxes.php :

 

<?php
/*
 $Id: boxes.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class tableBox {
   var $table_border = '0';
   var $table_width = '100%';
   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 border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
     if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
     $tableBox_string .= '>' . "\n";

     for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
       if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
       $tableBox_string .= '  <tr';
       if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
       if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
       $tableBox_string .= '>' . "\n";

       if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
         for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
           if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
             $tableBox_string .= '    <td';
             if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
             if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
               $tableBox_string .= ' ' . $contents[$i][$x]['params'];
             } elseif (tep_not_null($this->table_data_parameters)) {
               $tableBox_string .= ' ' . $this->table_data_parameters;
             }
             $tableBox_string .= '>';
             if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
             $tableBox_string .= $contents[$i][$x]['text'];
             if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
             $tableBox_string .= '</td>' . "\n";
           }
         }
       } else {
         $tableBox_string .= '    <td';
         if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
         if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
           $tableBox_string .= ' ' . $contents[$i]['params'];
         } elseif (tep_not_null($this->table_data_parameters)) {
           $tableBox_string .= ' ' . $this->table_data_parameters;
         }
         $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
       }

       $tableBox_string .= '  </tr>' . "\n";
       if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
     }

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

     if ($direct_output == true) echo $tableBox_string;

     return $tableBox_string;
   }
 }
class infoBox2 extends tableBox {
   function infoBox2($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
     $this->table_cellpadding = '';
     $this->table_parameters = '';
     $this->tableBox($info_box_contents, true);
   }


   function infoBoxContents($contents) {
     $this->table_cellpadding = '';
     $this->table_parameters = '';
     $info_box_contents = array();
   //  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
     for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
       $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                          'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                          'params' => '',
                                          'text' => (isset($contents[$i]['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 infoBox extends tableBox {
   function infoBox($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
     $this->table_cellpadding = '0';
     $this->table_parameters = 'class="templateinfoBox"';
     $this->tableBox($info_box_contents, true);
   }

   function infoBoxContents($contents) {
     $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, $n=sizeof($contents); $i<$n; $i++) {
       $info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
                                          'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
                                          'params' => 'class="boxText"',
                                          'text' => (isset($contents[$i]['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 == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/corner_left.jpg');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/images/infobox/corner_left.jpg');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  tep_image(DIR_WS_IMAGES . 'images/infobox/corner_right.jpg');
     }
     if ($right_corner == true) {
       $right_corner = tep_image(DIR_WS_IMAGES . '/infobox/corner_right.jpg');
     } else {
       $right_corner = $right_arrow;
     }

     $info_box_contents = array();
   $info_box_contents[] = array(  array('params' => '',
										 'text' => ''. '<tr><td height="0"></td></tr>'.''));
     $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
                                  array('params' => 'width="100%" class="infoBoxHeadingImage" align="left" valign="middle"', 'text' => $contents[0]['text']),
                                  array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
     $this->tableBox($info_box_contents, true);
   }
 }

class infoBoxHeading_zolty extends tableBox {
   function infoBoxHeading_zolty($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/zolty/corner_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/images/infobox/zolty/corner_left.gif');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/zolty/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  tep_image(DIR_WS_IMAGES . 'images/infobox/zolty/corner_right.gif');
     }
     if ($right_corner == true) {
       $right_corner = tep_image(DIR_WS_IMAGES . '/infobox/zolty/corner_right.gif');
     } else {
       $right_corner = $right_arrow;
     }

     $info_box_contents = array();
   $info_box_contents[] = array(  array('params' => '',
										 'text' => ''. '<tr><td height="4"></td></tr>'.''));
     $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
                                  array('params' => 'width="100%" class="infoBoxHeading_zolty" align="left" valign="middle"', 'text' => $contents[0]['text']),
                                  array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
     $this->tableBox($info_box_contents, true);
   }
 }

 class infoBoxHeading_orange extends tableBox {
   function infoBoxHeading_orange($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/orange/corner_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/images/infobox/orange/corner_left.gif');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/orange/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  tep_image(DIR_WS_IMAGES . 'images/infobox/orange/corner_right.gif');
     }
     if ($right_corner == true) {
       $right_corner = tep_image(DIR_WS_IMAGES . '/infobox/orange/corner_right.gif');
     } else {
       $right_corner = $right_arrow;
     }

     $info_box_contents = array();
   $info_box_contents[] = array(  array('params' => '',
										 'text' => ''. '<tr><td height="4"></td></tr>'.''));
     $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
                                  array('params' => 'width="100%" class="infoBoxHeading_orange" align="left" valign="middle"', 'text' => $contents[0]['text']),
                                  array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
     $this->tableBox($info_box_contents, true);
   }
 }

  class infoBoxHeading_red extends tableBox {
   function infoBoxHeading_red($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/red/corner_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/images/infobox/red/corner_left.gif');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/red/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  tep_image(DIR_WS_IMAGES . 'images/infobox/red/corner_right.gif');
     }
     if ($right_corner == true) {
       $right_corner = tep_image(DIR_WS_IMAGES . '/infobox/red/corner_right.gif');
     } else {
       $right_corner = $right_arrow;
     }

     $info_box_contents = array();
   $info_box_contents[] = array(  array('params' => '',
										 'text' => ''. '<tr><td height="4"></td></tr>'.''));
     $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
                                  array('params' => 'width="100%" class="infoBoxHeading_red" align="left" valign="middle"', 'text' => $contents[0]['text']),
                                  array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
     $this->tableBox($info_box_contents, true);
   }
 }

 class infoBoxHeading_blue extends tableBox {
   function infoBoxHeading_blue($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/blue/corner_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/images/infobox/blue/corner_left.gif');
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/blue/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  tep_image(DIR_WS_IMAGES . 'images/infobox/blue/corner_right.gif');
     }
     if ($right_corner == true) {
       $right_corner = tep_image(DIR_WS_IMAGES . '/infobox/blue/corner_right.gif');
     } else {
       $right_corner = $right_arrow;
     }

     $info_box_contents = array();
   $info_box_contents[] = array(  array('params' => '',
										 'text' => ''. '<tr><td height="4"></td></tr>'.''));
     $info_box_contents[] = array(array('params' => 'class="infoBoxHeading"', 'text' => $left_corner),
                                  array('params' => 'width="100%" class="infoBoxHeading_blue" align="left" valign="middle"', 'text' => $contents[0]['text']),
                                  array('params' => 'class="infoBoxHeading"', 'text' => $right_corner));
     $this->tableBox($info_box_contents, true);
   }
 }
 class infoboxFooter extends tableBox {
   function infoBoxFooter($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/infobox_footer_left.png');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/infobox_footer_left.png');
     }
     if ($right_arrow) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow = '';
     }
     if ($right_corner) {
       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . '/infobox/infobox_footer_right.png');
     } else {
       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . '/infobox/infobox_footer_right.png');
     }

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'class="infoBoxfooter"','text' => $left_corner),
                                  array('params' => 'style="background-image: url(' . DIR_WS_IMAGES . '/infobox/infobox_footer_middle.png); background-repeat: repeat-x;\" width="100%"', 'text' => $contents[0]['text']),
				   array('params' => ' nowrap', '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 = '0';
     $this->table_parameters = 'class="templateinfoBox2"';
     $this->tableBox($info_box_contents, true);
   }

   function contentBoxContents($contents) {
     $this->table_cellpadding = '0';
     $this->table_parameters = 'class="infoBoxContents2"';
     return $this->tableBox($contents);
   }
 }

 class contentBox2 extends tableBox {
   function contentBox2($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
     $this->table_cellpadding = '0';
     $this->table_parameters = 'class="templateinfoBox3"';
     $this->tableBox($info_box_contents, true);
   }

   function contentBoxContents($contents) {
     $this->table_cellpadding = '0';
     $this->table_parameters = 'class="infoBoxContents3"';
     return $this->tableBox($contents);
   }
 }
 class contentBoxHeading extends tableBox {
   function contentBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
     } else {
       $left_corner = '';
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  '';
     }
     if ($right_corner == true) {
       $right_corner = '';
     } else {
       $right_corner = $right_arrow;

     }

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'height="49"',
                                        'text' => $left_corner),
 array('params' => 'align="center" valign="top" style="background-image: url(' . DIR_WS_IMAGES . '/infobox/background.jpg); background-repeat: repeat-x;" width="100%"  class="contentBoxHeading"',
'text' => $contents[0]['text']),
                                  array('params' => 'height="49" nowrap',
                                        'text' => $right_corner));

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

class contentBoxHeading2 extends tableBox {
   function contentBoxHeading2($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
     $this->table_cellpadding = '0';

     if ($left_corner == true) {
       $left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
     } else {
       $left_corner = '';
     }
     if ($right_arrow == true) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow =  '';
     }
     if ($right_corner == true) {
       $right_corner = '';
     } else {
       $right_corner = $right_arrow;

     }

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' => 'height="49"',
                                        'text' => $left_corner),
 array('params' => 'align="center" valign="top" style="background-image: url(' . DIR_WS_IMAGES . '/infobox/dom/cont_head2.jpg); background-repeat: repeat-x;" width="100%"  class="contentBoxHeading"',
'text' => $contents[0]['text']),
                                  array('params' => 'height="49" nowrap',
                                        'text' => $right_corner));

     $this->tableBox($info_box_contents, true);
   }
 }
 class contentBoxFooter extends tableBox {
   function contentBoxFooter($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/center_footer_left.gif');
     } else {
       $left_corner = tep_image(DIR_WS_IMAGES . '/infobox/center_footer_left.gif');
     }
     if ($right_arrow) {
       $right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . '/infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow = '';
     }
     if ($right_corner) {
       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . '/infobox/center_footer_right.gif');
     } else {
       $right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . '/infobox/center_footer_right.gif');
     }

     $info_box_contents = array();
     $info_box_contents[] = array(array('params' =>  'class="infoBoxfooter"','text' => $left_corner),
                                  array('params' => 'background="' . DIR_WS_IMAGES . '/infobox/center_footer_middle.gif" width="100%" ', 'text' => $contents[0]['text']),
						array('params' => ' nowrap', 'text' => $right_corner));

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

 class errorBox extends tableBox {
   function errorBox($contents) {
     $this->table_data_parameters = 'class="errorBox"';
     $this->tableBox($contents, true);
   }
 }

 class productListingBox extends tableBox {
   function productListingBox($contents) {
     $this->table_parameters = 'class="productListing"';
     $this->tableBox($contents, true);
   }
 }
?>

 

could u help ?

Link to comment
Share on other sites

  • 9 months later...

Hi. Did anyone ever work out how to resolve the conflict between this add-on and the thumbnail view in Product Listing Enhancements?

 

So that the 'Buy Now' and 'Details' buttons under each thumbnail can remain level in all browsers after Pure CSS Image Swap is added?

Link to comment
Share on other sites

  • 7 months later...

I don't remember putting a demo up, where are you finding it?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 months later...

OK, quite a few changes needed, this is both functions for use with STS, let me know how you get on, I don't use STS, so can't test.

 

 

Hi Spooks,

Thanks a lot for your contributions!

I'm using STS and tried your code with the change in post #33 as well. Still no visible buttons..... Any other ideas?

Kind regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...