Jump to content
Sign in to follow this  
spooks

Graphical Borders

Recommended Posts

Aww lummee, I can only get it to put the "_main" border around the other border at the moment, rather than replace it.

 

 

Without you saying precisly what your doing its hard to give a precise answer.

 

If you examine the functions you will see its starting with <td valign="top"> if that doesnt fit your table structure either modify that or the functions


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.

Share this post


Link to post
Share on other sites

Without you saying precisly what your doing its hard to give a precise answer.

I just want all boxes in the main central column (new products, search results, selected items, specials, etc) to use the "_main" borders.

I thought I had it nailed when I found this in product_listing:

 

$Tborder = (!$gborders ? '<div class="infoBoxList" style="width:100%;">' : mws_boxHeader('<b>'.$title_name.'</b>'));

$Tborderend = (!$gborders ? '</div>' : mws_boxFooter ());

 

And changed it to this:

 

$Tborder = (!$gborders ? '<div class="infoBoxList" style="width:100%;">' : mws_header_main('<b>'.$title_name.'</b>'));

$Tborderend = (!$gborders ? '</div>' : mws_footer_main ());

 

But alas that had the result you can see right now at the URL I've PMd to you.

Share this post


Link to post
Share on other sites

 

 

 

Yes, because if you examine the functions you will see its starting with <td valign="top"> why did you ignore that?


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.

Share this post


Link to post
Share on other sites

Er, sorry, that was because reading this as a novice it didn't mean much:

 

If you examine the functions you will see its starting with <td valign="top"> if that doesnt fit your table structure either modify that or the functions

 

 

I realise now that you mean this, in mws_functions:

 

function mws_header_main ($msg='') {
   $output = '
   <td valign="top">
     <table border="0" width="100%" cellspacing="0" cellpadding="0">
       <tr>
         <td>' . tep_image(DIR_WS_IMAGES . 'infobox_main/upper_left.gif','') . '</td>
         <td class="mws_boxTop_main" align="center" valign="middle" width="100%">' . $msg . '</td>
         <td>' . tep_image(DIR_WS_IMAGES . 'infobox_main/upper_right.gif','') . '</td>
       </tr>
       <tr>
         <td class="mws_boxLeft_main"></td>
         <td class="mws_boxCenter_main">
           <table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>';
   return $output;

 

But don't really see what I have to do to get to my goal. It seemed such a simple goal with probably a simple answer... :(

Edited by MattReid

Share this post


Link to post
Share on other sites

The valign="top" doesn't seem to be anything to do with my goal, or my current knackered looking and misplaced box problem. I'll keep mucking about with that function and try try try againing, I guess.

 

 

Edit: I think I see what I have to do now, which is sort of adjust mws_header_main to look like mws_boxHeader. Apologies, it felt too rude to say "Your grammar's iffy mate, I can't understand a word." Have a nice weekend.

Edited by MattReid

Share this post


Link to post
Share on other sites

The valign="top" doesn't seem to be anything to do with my goal, or my current knackered looking and misplaced box problem. I'll keep mucking about with that function and try try try againing, I guess.

 

 

Edit: I think I see what I have to do now, which is sort of adjust mws_header_main to look like mws_boxHeader.

 

 

OK, if you don't understand you must say, if you just say that did'nt work it tells us nothing. huh.gif

 

When you say you are a novice I assumed that ment you were a novice to osC, not to web design in general, we have to assume people come here with at least a good knowledge of html.

 

I though you would realise that since refering structural elements you would realise you need to remove if they don't apply!!

 

Perhaps you need to look at HTML Tuition http://www.w3schools...tml/default.asp wink.gif

 

"Your grammar's iffy mate, I can't understand a word."

 

This is a technical subject & forum, grammer is irrelavent, syntax is all. biggrin.gif

Edited by spooks

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.

Share this post


Link to post
Share on other sites

No, I'm not a novice with HTML, but I am taking on a lot at the same time for an old dog, and that was the end of a tired Friday. Thanks again for your help Sam.

 

 

 

Now then, how come shopping_cart and advanced_search and 'There are no products to list in this category' are still using mws_boxHeader rather than mws_header_main?

 

:-" Don't feel you have to answer that, once more unto the brain-scrambling code I go...

Edited by MattReid

Share this post


Link to post
Share on other sites

Heh, a week later and I've found everything except "Your shopping cart is empty!" is still displayed in a type 1 box. Throw me a bone before I go mental?

 

From shopping_cart.php ...

<?php
     }
   }
 } else {
?>
     <tr>
       <td align="center" class="main"><?php new infoBox(array(array('text' => TEXT_CART_EMPTY))); ?></td>
     </tr>

 

I'm sure it's achingly obvious, but not to me I'm afraid Sam. >_<

Share this post


Link to post
Share on other sites

Hey Sam,

 

Wicked add-on buddy! Makes a big difference! I hav noticed a couple of things that don't have a border around like on the product info page at the bottom where the add to cart button is, and also in the "your basket is empty" page, but not the bit with that text in, the bit with the continue button in. Is there a way to change these?

 

Thanks!

Share this post


Link to post
Share on other sites

Hi there,

 

I installed your great contribution following your instructions exactly.

Still, only the corners and the frame work, not the title. The formatting is off too.

 

Could it be because I worked on the stylesheet before? I deleted the infobox header definition

in the stylesheet although it didn't say so in your readme file. I thought maybe you know this problem

already and there is an easy solution that would save me tons of time.

 

please, please have a look soon as we're about to go online in a few days.

 

http://www.usfanshop.at/osCommerce

 

 

Thanks in advance!

Share this post


Link to post
Share on other sites

You're using incorrect comments in the stylesheet.

 

These lines:

 

// Graphical boxes
// Graphical boxes end

 

Need to be:

 

/* Graphical boxes */
/* Graphical boxes end */

 

If you make these changes it works OK in FF.

 

I can't say for sure about IE, though...

:-"

 

Sometimes after changing the stylesheet in order to see any change you have to hold the <Ctrl> key down while doing a page refresh in the browser to force the browser to reload all contents from the server, including the newly changed stylesheet.

 

This works with IE and Firefox.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

This works great for nearly all boxes, but I can't get it working for the module featured products. It does show correct in Internet Explorer and Google Chrome, but it doesn't in Firefox.

Someone got this working for this module??

Share this post


Link to post
Share on other sites

Solved previous quesiton myself, but I hope someone has a solution for the product_listing? The heading-text appears outside the table-header and I can't manage to fix that:

 

 

wqvhts.png

 

 

How do I get this heading-text inside the table-header? I didn't change a thing in product_listing.php..

Share this post


Link to post
Share on other sites

Hi I was wondering if it's possible to wrap the border around the individual products in the listing, rather than wrapping around all products?

 

Please see http://www.azteconline.co.uk/index.php?cPath=32_55

 

includes/classes/boxes.php

 

// Graphical Borders
 class productListingBox extends tableBox {
   function productListingBox($contents) {
     global $mws_headerText;
     echo mws_boxHeader ($mws_headerText);
     $this->table_parameters = 'class="productListing"';
     $this->tableBox($contents, true);
     $mws_headerText = '';
     echo mws_boxFooter ();
   }
 }

// Graphical Borders - end modification

 

includes/mws_functions.php

 

 

 //**product listing**//




 function mws_boxHeader ($msg='') {
   $output = '
      <table align="center" width="608" height="123" border="0" cellpadding="0" cellspacing="0">
<tr>

</tr>
<tr>
<td>
<table  align="center" width="608" height="88" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="../images/listings/thumblist_top.jpg" width="608" height="9" alt="" /></td>
   </tr>
<tr>
<td  background="../images/listings/thumblist_left.jpg"><img src="../images/listings/thumblist_left.jpg" width="6" height="64" alt="" /></td>
<td width="595" height="64" valign="top">
   <table width="595" border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top" colspan="2"></td>';
   return $output;
 }

 function mws_boxFooter ($msg='') {
   $output = '


<td background="../images/listings/thumblist_right.jpg"><img src="../images/listings/thumblist_right.jpg" width="7" height="64" alt=""></td>
</tr>
<tr>
<td align="center" colspan="3"><img src="../images/listings/thumblist_bottom.jpg" width="608" height="15" alt=""></td>
</tr>
</table> 
</tr>
</table>
';
   return $output;
 }


 //**product listing**//

 

 

Thanks!

Share this post


Link to post
Share on other sites

No, this works on osC 2.2. Making it work on 2.3 would require a complete rewrite.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Olá, sou do Brasil Português

 

Os amigos poderia mim ajudar? queria redondar como que faço? não quero instalar contribuição queria

só redondar tem como?

 

Veja a imagem

post-299220-0-59280500-1323710696_thumb.gif

 

 

Hello, I'm from Brazil Portuguese

The friends could help me? wanted round like I do? contribution would not want to install only has the round?

 

See the picture

Share this post


Link to post
Share on other sites

My frontpage is mess up after installation of this nice contrib. look at www.dk-toys.dk and http://www.dk-toys.dk/brainbox-c-90.html but this page work fine http://www.dk-toys.dk/brainbox-construction-set-c-90_102.html

 

What am i doing wrong?

 

Use 2.2RC2

 

My includes/classes/boxes.php look like this:

 

<?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 = '2';
   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 infoBox extends tableBox {
// Graphical Borders
   function infoBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->mws_infoBoxContents($contents));
  $this->tableBox($info_box_contents, true);
   }
   function mws_infoboxcontents($contents) {
  global $mws_headerText, $mws_headerLink, $mws_TxtLink;
  if ($mws_TxtLink) $mws_headerText = '<a href="' . $mws_TxtLink . '" class="mws_boxTop">' . $mws_headerText . '</a>';
  $this->table_cellpadding = '0';
  $this->align = 'center';
  $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'] : '')));
  }
  $output = '
  <table cellspacing="0" cellpadding="0" border="0">
    <tr>
	  <td>' . tep_image(DIR_WS_IMAGES . 'infobox/upper_left.gif','') . '</td>
	  <td class="mws_boxTop" width="100%">' . $mws_headerText;
	    if ($mws_headerLink != false) {
		  $output .= '  <a href="' . $mws_headerLink . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
	    }
	    $output .= '</td>
	  <td>' . tep_image(DIR_WS_IMAGES . 'infobox/upper_right.gif','') . '</td>
    </tr>
    <tr>
	  <td class="mws_boxLeft"></td>
	  <td class="mws_boxCenter">' . $this->tableBox($info_box_contents) . '</td>
	  <td class="mws_boxRight"></td>
    </tr>
    <tr>
	  <td>' . tep_image(DIR_WS_IMAGES . 'infobox/lower_left.gif','') . '</td>
	  <td class="mws_boxBottom"></td>
	  <td>' . tep_image(DIR_WS_IMAGES . 'infobox/lower_right.gif','') . '</td>
    </tr>
  </table>';
  $mws_headerText = ''; $mws_headerLink = ''; $mws_TxtLink = '';
  return $output;
   }
// Graphical Borders - end modification
   function infoBoxContents($contents) {
  $this->table_cellpadding = '3';
  $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);
   }
 }
// Graphical Borders
 class infoBoxHeading extends tableBox {
   function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false, $title_link = false) {
  global $mws_headerText, $mws_headerLink, $mws_TxtLink;
  $mws_headerText = $contents[0]['text'];
  $mws_headerLink = $right_arrow;
  $mws_TxtLink = $title_link;
   }
 }
// Graphical Borders - end modification
// Graphical Borders
 class contentBox extends tableBox {
   function contentBox($contents) {
 $this->table_cellpadding = '0';
 $this->table_cellspacing = '3';
 $this->table_data_parameters = 'class="noborderBox"';
 $this->tableBox($contents, true);
 echo mws_boxFooter ();
   }
  function contentBoxContents($contents) {
  $this->table_cellpadding = '4';
  $this->table_parameters = 'class="infoBoxContents"';
  return $this->tableBox($contents);
   }
 }
// Graphical Borders - end modification
// Graphical Borders
class contentBoxHeading extends tableBox {
   function contentBoxHeading($contents, $head = true) {
 echo mws_boxHeader ($contents[0]['text']);
 }
 }
// Graphical Borders - end modification
 class errorBox extends tableBox {
   function errorBox($contents) {
  $this->table_data_parameters = 'class="errorBox"';
  $this->tableBox($contents, true);
   }
 }
// Graphical Borders
 class productListingBox extends tableBox {
   function productListingBox($contents) {
  global $mws_headerText;
  echo mws_boxHeader ($mws_headerText);
  $this->table_parameters = 'class="productListing"';
  $this->tableBox($contents, true);
  $mws_headerText = '';
  echo mws_boxFooter ();
   }
 }
 class noborderBox extends tableBox {
 function noborderBox($contents) {
   $this->table_cellpadding = '0';
   $this->table_cellspacing = '3';
   $this->table_data_parameters = 'class="noborderBox"';
   $this->tableBox($contents, true);
  }
}
// Graphical Borders - end modification
?>

Edited by DK-Toys.dk

Share this post


Link to post
Share on other sites

I`ve not looked through your above but viewing your site you have invalid table nesting

 

http://validator.w3.org/check?uri=http%3A//www.dk-toys.dk/brainbox-construction-set-c-90_102.html

 

Whenever you have that any addition can make the layout change drastically, even when that addition has no errors whatever. Fix your table issues on your site in general, then its likely this issue will disappear.


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×