If this is your first visit, check our documentation. To post, register or login.

round corners

Locked

Started by oxicottin on 26 Aug 2007, 5:34 PM · Views: 20,004

Results 61 to 80 of 102
This thread is locked. New replies are disabled.
1 Feb 2010, 10:06 PM
#61
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

round corners

gjh42:

See post 53 for the spacing answer.
If you don't add back the leftBoxContainer class to the div, you need to add its properties to the .xsnazzy {} class rule.

Hi Thanks again

I have added the leftBoxContainer to the div class as follows

<div class="xsnazzy .leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">

but it didnt make a difference

kobra:

New threads on a specific titled topic allows others to locate previous assistance issues much easier

Sorry - should I start a new thread?

2 Feb 2010, 3:19 PM
#62
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Hi Glen

Ive finally managed to do it.

I added some padding to .xsnazzy and its worked fine.

I will post all of the coding below just in case someone else would like to do it also.

One thing is that I want to make this work for the right hand sidebox and also the centre box. I will attempt it later but not a 100% sure i will be able to do the centre box. ALso the php functions to call the category sidebox details for the right hand sidebox might be somewhat different so may need some help. If you will knbow what to do with the coding and where to add it then please let me know..]

I know the right hand sidebox will require editing the tpl_box_default_right.php

Ok so here go's

This is the css coding that I added in the stylesheet.css

I added the coding after

.rightBoxContainer {
margin: 0em;
border: 2px none #0000CC;
border-right: 2px groove #2554C7;
border-left: 2px groove#2554C7;
border-bottom: 3px solid #2554C7;
border-top: 1px groove #2554C7;
margin-top: 1.5em;
}
My css coding for the above container will be different to yours. Im not sure if I have added the css coding in the right place. I was on the understanding that it can be added anywhere but just to keep it organized I added it here.

Heres the coding used

.xsnazzy h1, .zsnazzy h1 {
margin:0; 
font-size:1.2em; 
padding:0 10px 5px 10px; 
border-bottom:1px solid #444;
}
.xsnazzy p, .zsnazzy p {
margin:0; 
padding:5px 10px; 
font-size:10px;
}
.xsnazzy {
background: transparent; 
width:240px; 
float:left; 
margin:0 3px;
padding-top: 1.5em;
}

.xtop, .xbottom {
display:block; 
background:transparent; 
font-size:1px;
}
.xb1, .xb2, .xb3, .xb4 {
display:block; 
overflow:hidden;
}
.xb1, .xb2, .xb3 {
height:1px;
}
.xb2, .xb3, .xb4 {
background:#fff; 
border-left:1px solid #444;
border-right:1px solid #444;
}
.xb1 {
margin:0 5px; 
background:#444;
}
.xb2 {
margin:0 3px;
border-width:0 2px;
}
.xb3 {
margin:0 2px;
}
.xb4 {
height:2px; 
margin:0 1px;
}

.xboxcontent {
display:block; 
border:0 solid #444; 
border-width:0 1px; 
height:auto;
}
* html .xboxcontent {
height:1px;
}

.color_a {
background:#2554C7;
color:#fff;
}
.color_b {
background:#d4d8bd; 
color:#000;
}
.color_c {
background:#758279; 
color:#fff;
}
.color_d {
background:#b2ab9b; 
color:#000;
}

I then edited the includes>templates>MYTEMPLATE>common>tpl_box_default_left.php file

This is how this file looks

<?php
/**
 * Common Template - tpl_box_default_left.php
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_box_default_left.php 2975 2006-02-05 19:33:51Z birdbrain $
 */

// choose box images based on box position
  if ($title_link) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
//
?>
<!--// bof: <?php echo $box_id; ?> //-->

<div class="xsnazzy .leftBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>

<h3 class="leftBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo $title; ?></h3>
<div class="xboxcontent">
<?php echo $content; ?>
</div><!--this closes the xboxcontent div-->
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
<b class="xb2"></b><b class="xb1"></b></b>

</div>

<!--// eof: <?php echo $box_id; ?> //-->

Thats it - It took ages to figure out but with the help of Glen we managed to get there.

once again Glen thanks for your help and please advise if I have done something wrong in terms of coding. Also if possible good you give me a hand with the centre box and righ box.

thanks once again

abs

2 Feb 2010, 3:36 PM
#63
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Ok I have done the right sidebox also.

This is the code that I added to tpl_box_default_right.php again in the includes>templates>MYTEMPLATE>common folder

<?php
/**
 * Common Template - tpl_box_default_right.php
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_box_default_right.php 2975 2006-02-05 19:33:51Z birdbrain $
 */

// choose box images based on box position
  if ($title_link) {
    $title = '<a href="' . zen_href_link($title_link) . '">' . $title . BOX_HEADING_LINKS . '</a>';
  }
//
?>
<!--// bof: <?php echo $box_id; ?> //-->
<div class="xsnazzy rightBoxContainer" id="<?php echo str_replace('_', '-', $box_id ); ?>" style="width: <?php echo $column_width; ?>">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>
<h3 class="rightBoxHeading" id="<?php echo str_replace('_', '-', $box_id) . 'Heading'; ?>"><?php echo $title; ?></h3>
<div class="xboxcontent">
<?php echo $content; ?>
</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
<b class="xb2"></b><b class="xb1"></b></b>
</div>
<!--// eof: <?php echo $box_id; ?> //-->

I also removed the style for the right sidebox from the stylesheet.

I will now attemp the centre box which will be much more tricky. i dont even know which file to edit but lets see


I havnt got the slightest idea which file to edit in order to get the rounded affect on the centre box.

Glen any chance of having a look please

thanks

11 Feb 2010, 10:22 AM
#64
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

clydejones:

This one is a bit more complicated:

open includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

find this line of code:

<!-- bof breadcrumb -->

Just above this add the following:

<div class="xsnazzy"> <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"> </b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b> <div class="xboxcontent">

Now find the following section of code:

<?php /** * prepares and displays center column * */ require($body_code); ?> <?php if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div> <?php } } ?></td>

Just before the </td> add:

</div> <b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b> </div>

Hi I have attempted to do what is suggested above however I just can not make the code work. I either get a rounded container which is half of the size of the actual container.

I have 3 images in my centre boxes - thats 3 images side by side however when I try this coding it shows all the images but the container is is not showing correct. It only covers like 1 and a half images and not all.

I attempted to play around with the coding. I made a backup of the files so it wasnt going to hurt. I managed to get a full rounded affect but it was displayed near the define_main_page area.

I then had another go and it would show just above the footer.

When I get it into the correct area it only shows the container which again is not showing correctly but the weird thing is that it does not give a rounded affect to the centre box heading.

Any help would be appreciated.

Ive been attempting to play with this for days

Ive removed it from the site as it wasnt showing proper. If you would like me to add it then take screen shots - I can do this

thanks

11 Feb 2010, 4:46 PM
#65
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: round corners

The coding Clyde showed should be the way to do it, so I can't really offer more advice on how except to try step by step and double-check that you have done it the way he said.

11 Feb 2010, 5:30 PM
#66
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Hi Glenn
Thanks alot for the reply. I was wondering where you had been. Then it struck me that you might have thought i didnt read the entire thread. So thought i would show you how ive been trying.

would it be ok if i have another go and then post my finding so that you can help me look through the issue.

I will attempt it again today and see what I ome up with. I have however tried it 3-4 times in all different places on the same file but didnt get no luck.

I feel more confident with someone experienced like you looking over me :smile:

I know i shouldn't ask this here but just wondering if your actually a zencart moderator

cheers

11 Feb 2010, 6:33 PM
#69
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Ok ive had a play with the code.

the code that was mentioned above got me these results- in below image

I have now changed the top part of the code to read like this

<div class="xsnazzy"> <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"> </b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b> <h2 class="centerBoxHeading"</h2> <div class="xboxcontent">

it now gives me a centreBox heading which can be seen on the site

I think some php coding will also be needed in the heading part of the center box so that it can pull up the center box titles

11 Feb 2010, 7:41 PM
#70
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Ive been playing with the code alot

ive tried all sorts of variations and still no joy. the closest i have managed to get is in the image below. I have also noted the coding used below

<!-- bof  breadcrumb -->
<?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?>


<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>
<h2 class="centerBoxHeading"></h2>
<div class="xboxcontent">

<!-- eof breadcrumb -->

<?php
  if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>

<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div><div class="xsnazzy">



<?php
    }
  }
?>

<!-- bof upload alerts -->
<?php if ($messageStack->size('upload') > 0) echo $messageStack->output('upload'); ?>
<!-- eof upload alerts -->


<?php
 /**
  * prepares and displays center column
  *
  */
 require($body_code); ?>
 

<?php
  if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>


</div>
<b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
<b class="xb2"></b><b class="xb1"></b></b>
</div></td>

The only real difference is by placing the red highlighted code in this area - before it was the first part of the code

<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div><div class="xsnazzy">
12 Feb 2010, 10:38 AM
#71
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: round corners

Assuming Clyde knew what he was talking about, all of this messing around is guaranteed not to work. From everything you have showed, you are not following his instructions exactly. Here is a zip of a stock tpl_main_page.php with the xsnazzy code inserted per the directions:

12 Feb 2010, 10:47 AM
#72
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Hi Glen thanks for your help

The reason I was playing with the code is because it doesnt seem to work for me. I have added the file you have given me and I get the same results I got when I followed the code on page 1.

If you have a look at the site you will see the container is all messed up

thanks

12 Feb 2010, 11:00 AM
#73
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

I have added the following line to the code to get the centerbox heading

<h2 class="centerBoxHeading"></h2>

so it now reads

<div class="xsnazzy"> <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"> </b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b> <h2 class="centerBoxHeading"></h2> <div class="xboxcontent">
12 Feb 2010, 4:12 PM
#74
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Man ive given up.

I thought i would try and do each section at a time so I tried the code in tpl_modules_feautured_products.php

Cant seem to crack it. Ive removed it now and think i will have to revert to using images for the centre box headings.

Im not really after the container look just the heading look.

12 Feb 2010, 4:52 PM
#75
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: round corners

If you want just the centerbox headings rounded, that cannot be done in tpl_main_page.php. You are right that you would use a centerbox file, but the one you want is
/includes/modules/your_template/featured_products.php. Find this section near the bottom and add the xsnazzy code after '<h2 class="centerBoxHeading"> and before </h2>'.```php
if (isset($new_products_category_id) && $new_products_category_id !=0) {
$category_title = zen_get_categories_name((int)$new_products_category_id);
$title = '<h2 class="centerBoxHeading">' . TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '') . '</h2>';
} else {
$title = '<h2 class="centerBoxHeading">' . TABLE_HEADING_FEATURED_PRODUCTS . '</h2>';
}


The added divs must all be inside the single quotes, as they are all HTML output, not PHP code.
12 Feb 2010, 5:12 PM
#76
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Hi I have added it like this

}

if ($featured_products->RecordCount() > 0) {
if (isset($new_products_category_id) && $new_products_category_id !=0) {
$category_title = zen_get_categories_name((int)$new_products_category_id);
$title = '<h2 class="centerBoxHeading"><div class="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>

<div class="xboxcontent"><b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b>' . TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '') . '</h2>'; } else { $title = '<h2 class="centerBoxHeading"><div class="xsnazzy"> <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"> </b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b> <div class="xboxcontent"><b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b>' . TABLE_HEADING_FEATURED_PRODUCTS . '</h2>'; } $zc_show_featured = true; } } ?>

it shows the rounded box with the title but not the correct size or location

i think i may have gone wrong somewhere in this statement

The added divs must all be inside the single quotes, as they are all HTML output, not PHP code.

12 Feb 2010, 6:55 PM
#77
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: round corners

You got the first part right, but the bottom code goes after the content, and just before the </h2>'.```php
$title = '<h2 class="centerBoxHeading"><div class="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>

<div class="xboxcontent">' . TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '') . '</div><b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b></div></h2>'; } else { ```You also need to close the xsnazzy and xBoxcontent divs:

'</div><b class="xbottom">

<b class="xb1"></b></b></div></h2>';

15 Feb 2010, 12:28 PM
#78
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Hi Glen
Thanks for the reply again. Im sure you must be getting frustrated with the lack of my progress.

All I can do is thank you for all your help and also your patience.

Regarding your above quote. I have made the changes however it doesnt seem to work- I think i may well be doing something wrong.

Heres how my code looks

$title = '<h2 class="centerBoxHeading"><div class="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b>

<div class="xboxcontent">' . TABLE_HEADING_FEATURED_PRODUCTS . ($category_title != '' ? ' - ' . $category_title : '') . '</div><b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b></div></h2>'; } else { $title = '<h2 class="centerBoxHeading"><div class="xsnazzy"> <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"> </b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b> ' . TABLE_HEADING_FEATURED_PRODUCTS . '<div class="xboxcontent"><b class="xbottom"><b class="xb4"></b><b class="xb3"></b> <b class="xb2"></b><b class="xb1"></b></b></div></h2>'; } $zc_show_featured = true; } } ?>

cheers

16 Feb 2010, 5:48 AM
#79
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: round corners

It is probably the second case that is actually true for you, so the (correctly coded) first case is being bypassed. You have the <div class="xboxcontent"> in the wrong place and not closed with an </div>
Try this:```php
} else {
$title = '<h2 class="centerBoxHeading"><div class="xsnazzy">
<b class="xtop"><b class="xb1"></b><b class="xb2 color_a">
</b><b class="xb3 color_a"></b><b class="xb4 color_a"></b></b><div class="xboxcontent">
' . TABLE_HEADING_FEATURED_PRODUCTS . '</div><b class="xbottom"><b class="xb4"></b><b class="xb3"></b>
<b class="xb2"></b><b class="xb1"></b></b></div></h2>';
}

16 Feb 2010, 10:37 AM
#80
abs007 avatar

abs007

Zen Follower

Join Date:
Mar 2009
Location:
Peterborough UK
Posts:
330
Plugin Contributions:
0

Re: round corners

Thanks for the reply Glen

It has certainly made a full rounded corner affect but its just not aligning correct

thanks