Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Right Column Won't Display

Right Column Won't Display

Locked

Views: 2,148

Results 21 to 38 of 38
This thread is locked. New replies are disabled.
13 May 2010, 1:56 PM
#21
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Right Column Won't Display

Everyone, first thanks for all your help on this problem - its been very frustrating.

I just did a WinMerge comparison of my tpl_main_page file (default / custom) and noticed a distinct difference between the lines that (I'm assuming -not a ZC or php expert yet) control the left and right columns.

For the left I have:

if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {

For the RIGHT I have:

if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' && $_SESSION['customers_authorization'] != 0)) {

If I replace the RIGHT column code with the left, it should fix the problem right? I will wait until I hear from you guys until I do this.

Thanks you for sticking with me on this :smile:

13 May 2010, 2:18 PM
#22
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

Good news - bad news.

Good news is I replaced the RIGHT column line with the left (since that is default code), this way I know that the code is right.

Bad news is it DID NOT fix the problem, which now leaves me really stumped because it does not seem that the problem is tpl_main_page.php. From what I've read on the forums, I guess tpl_main_page.php controls the flow of the page.

13 May 2010, 2:30 PM
#23
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Right Column Won't Display

I really wouldn't recommend changing those lines. They're that way for a reason and applying the settings for the left column to the right column can only cause confusion.

The purpose of the file comparison is not to compare different bits of your template, but rather to find what's different between your template which doesn't work and either classic or the template_default which do.

The tpl_main_page.php file doesn't control the flow of the page. It merely provides structure and limited control over the page's output. This is only the final step in the page's flow which is way more complicated.

However, you don't have to worry about most of that flow, since it works fine with classic. Which is why we're pointing you towards that part of your code which doesn't work (at least in respect of displaying the RH column), i.e. your template and any module files that have been overridden for it.

13 May 2010, 2:45 PM
#24
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

I never really looked at them, so I thought they'd be the same for both, I'll grab the code from my backups and replace the right column code.

For module files, that would be includes/modules/MY_TEMPLATE, right?

13 May 2010, 2:48 PM
#25
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Right Column Won't Display

Yes .

13 May 2010, 2:51 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Right Column Won't Display

Not really ... the Left Column code is for the Left Column and the Right Column code is for the Right Column ...

You need to find the real problem here not just fudge things ... in the future you would be hard pressed to make things work correctly with upgrades and updates when you start fudging code ...

See if using the original code for the right column of:

if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {

fixes anything ... it probably will not have any affect on this one, but it is different from the original code in v1.3.9 ...

13 May 2010, 2:52 PM
#27
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

kuroi,

Could you do me a huge favor? I went to my backups and I'm not sure if I mistakenly did something to this particular file but I have the same code as before in my backups as I did in the live file.

Can you compare it for me against yours? Here is the code from my backup, is it correct?

if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {

Thanks very much

13 May 2010, 2:58 PM
#28
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

Ajeh, you must have posted as I was writing mine. Anyway took your code and pasted it for the right column and still have same problem.

Does this eliminate the problem from being tpl_main_page.php or should I continue to look at it?

Would it help you guys at all if I just paste my entire tpl_main_page.php here? I don't have the expert eye

13 May 2010, 3:03 PM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Right Column Won't Display

No it doesn't rule out this file from being the problem as there are a lot more lines of code to that file that could be altered ...

13 May 2010, 3:08 PM
#30
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

Here is my entire tpl_main_page.php (custom)

I haven't really touched it except for the comments at the top. I had decided to do that stuff via css BUT kuroi told me that that is not good for the search engines, so I will be replacing that code.

If you guys can take a quick glance and let me know if something is out of place.

<?php
/**
 * Common Template - tpl_main_page.php
 *
 * Governs the overall layout of an entire page<br />
 * Normally consisting of a header, left side column. center column. right side column and footer<br />
 * For customizing, this file can be copied to /templates/your_template_dir/pagename<br />
 * example: to override the privacy page<br />
 * - make a directory /templates/my_template/privacy<br />
 * - copy /templates/templates_defaults/common/tpl_main_page.php to /templates/my_template/privacy/tpl_main_page.php<br />
 * <br />
 * to override the global settings and turn off columns un-comment the lines below for the correct column to turn off<br />
 * to turn off the header and/or footer uncomment the lines below<br />
 * Note: header can be disabled in the tpl_header.php<br />
 * Note: footer can be disabled in the tpl_footer.php<br />
 * <br />
 * $flag_disable_header = true;<br />
 * $flag_disable_left = true;<br />
 * $flag_disable_right = true;<br />
 * $flag_disable_footer = true;<br />
 * <br />
 * // example to not display right column on main page when Always Show Categories is OFF<br />
 * <br />
 * if ($current_page_base == 'index' and $cPath == '') {<br />
 *  $flag_disable_right = true;<br />
 * }<br />
 * <br />
 * example to not display right column on main page when Always Show Categories is ON and set to categories_id 3<br />
 * <br />
 * if ($current_page_base == 'index' and $cPath == '' or $cPath == '3') {<br />
 *  $flag_disable_right = true;<br />
 * }<br />
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 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_main_page.php 7085 2007-09-22 04:56:31Z ajeh $
 */

//list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces 
//the following IF statement can be duplicated/modified as needed to set additional flags
//from line 44 below btween '' contact_us,discount_coupon,gv_faq,shopping_cart,checkout_shipping,checkout_payment,checkout_confirmation,checkout_success
  if (in_array($current_page_base,explode(",",'')) ) {
    $flag_disable_right = true;
	$flag_disable_left = true;//added code
  }
//turns off right column on category listing pages
//code below can be duplicated here for left column, for any page
  if (in_array($cPath,explode(",",'')) ) {
    $flag_disable_right = true;
  }


  $header_template = 'tpl_header.php';
  $footer_template = 'tpl_footer.php';
  $left_column_file = 'column_left.php';
  $right_column_file = 'column_right.php';
  $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
<?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

<div id="mainWrapper">
<?php
 /**
  * prepares and displays header output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_header = true;
  }
  require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" id="contentMainWrapper">
  <tr>
<?php
if (COLUMN_LEFT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_left
  $flag_disable_left = true;
}
if (!isset($flag_disable_left) || !$flag_disable_left) {
?>

 <td id="navColumnOne" class="columnLeft" style="width: <?php echo COLUMN_WIDTH_LEFT; ?>">
<?php
 /**
  * prepares and displays left column sideboxes
  *
  */
?>
<div id="navColumnOneWrapper" style="width: <?php echo BOX_WIDTH_LEFT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?></div></td>
<?php
}
?>
    <td valign="top">
<!-- 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 } ?>
<!-- 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>
<?php
    }
  }
?>

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

<?php
 /**
  * prepares and displays center column
  *
  */
 $zc_template = $template;//these next 3 lines of code replace: require($body_code);
 require($body_code);
 $template = $zc_template; ?>

<?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>

<?php
if (COLUMN_RIGHT_STATUS == 0 || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  // global disable of column_right
  $flag_disable_right = true;
}
if (!isset($flag_disable_right) || !$flag_disable_right) {
?>

<td id="navColumnTwo" class="columnRight" style="width: <?php echo COLUMN_WIDTH_RIGHT; ?>">
<?php
 /**
  * prepares and displays right column sideboxes
  *
  */
?>
<div id="navColumnTwoWrapper" style="width: <?php echo BOX_WIDTH_RIGHT; ?>"><?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?></div></td>
<?php
}
?>
  </tr>
</table>

<?php
 /**
  * prepares and displays footer output
  *
  */
  if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
    $flag_disable_footer = true;
  }
  require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
?>

</div>
<!--bof- parse time display -->
<?php
  if (DISPLAY_PAGE_PARSE_TIME == 'true') {
?>
<div class="smallText center">Parse Time: <?php echo $parse_time; ?> - Number of Queries: <?php echo $db->queryCount(); ?> - Query Time: <?php echo $db->queryTime(); ?></div>
<?php
  }
?>
<!--eof- parse time display -->
<!--bof- banner #6 display -->
<?php
  if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>
<!--eof- banner #6 display -->
</body>
13 May 2010, 3:34 PM
#31
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

I've been scanning the file against the backup and it only appears different in 3 places:

  1. The aforementioned top area, where I will be replacing the code instead of using css.

  2. In the backup there is this:

require($body_code); ?>

Where in my custom file there is:

 $zc_template = $template;//these next 3 lines of code replace: require($body_code);
 require($body_code);
 $template = $zc_template; ?>
  1. Where the code for that line of code is for the RHC. Its just a comment line.

Should I begin to look in my includes/modules/MY_TEMPLATE ?

13 May 2010, 3:49 PM
#32
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

I went to my FTP client and looked in includes/modules/MY_TEMPLATE and saw that there are only 2 files that have been modified within the the time period that I noticed the RHC missing on the homepage. They are product_listing and category_list_box. I will begin to look at them.

13 May 2010, 4:10 PM
#33
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

Ok, so what I did was I simply renamed both those files (appended a '1' to their name, to see if the RHC would display and I can narrow the problem file down.

Unfortunately that did not work. Still have the same problem.

So the files that I will be looking at are tpl_main_page.php, product_listing and category_list_box.

Any other suggestions?

13 May 2010, 4:17 PM
#34
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

I do have site backups from 4/21 and 5/5. The only problem is I can't remember exactly when I first noticed the problem. The problem only happened recently, that I do know. I can even remember noticing the problem AND probably should have stopped what I was doing and reversed what I had just done and I wouldn't have the problem now, unfortunately I didn't do that :frusty:

Honestly, I don't know what to do! I only have entry level programming know how and I am not a ZC expert yet.

What do you guys recommend - and this time I will wait until I hear from you guys because all my assuming today has just been wrong!

13 May 2010, 6:25 PM
#35
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Right Column Won't Display

You're not finding it because keep trying to compare against your own code / backups. So you're comparing one set of code which doesn't work with another which, it appears, has the same problem.

This comparison is only effective if you do it against the template_default upon which classic is based, and which works.

Happily, I think I can spare you the need. The problem looks to me to be this block that somebody has inserted into your template```php
//turns off right column on category listing pages
//code below can be duplicated here for left column, for any page
if (in_array($cPath,explode(",",'')) ) {
$flag_disable_right = true;
}

13 May 2010, 6:36 PM
#36
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

kuroi,

Success! I don't know how to thank you - really, I was absolutely stumped and I have limited skills at best with this stuff.

I actually got that code from a post in this forum, it was suppose to (I thought anyway) to take the right column off of the category listing pages.

Please bear with me one more time, I obviously was NOT understanding what you and Ajeh were trying to tell me when it comes to the template_default. Were you guys referring to comparing MY_TEMPLATE against includes/templates/TEMPLATE_DEFAULT/....??

Again thank you so very much for sticking with me and my THICK HEAD :lamo:

13 May 2010, 6:46 PM
#37
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Right Column Won't Display

autoace:

I actually got that code from a post in this forum, it was suppose to (I thought anyway) to take the right column off of the category listing pages.If there has been even one category included in the list, that piece of code would have worked, but the absence of any categories meant that it kicked in to disable the right column whenever no category had been defined ... which includes on the home page.

autoace:

Were you guys referring to comparing MY_TEMPLATE against includes/templates/TEMPLATE_DEFAULT/....??Yes, exactly.

The diagnostic process that we have been leading you through is to compare the output with your template to that with classic. As they were different this localises the problem to your template.

So since the results are different, the next step is to understand how the programming that generates them is different.

Had we have gotten that far, it would have thrown up the block that happily was spotted without a full comparison (though in effect one was done since I know that code sufficiently well that those lines (and the ones immediately above) leapt out as not belonging there.

13 May 2010, 6:54 PM
#38
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Right Column Won't Display

That's what I thought, I looked at the code and said I should have put a category in there to test it. Next time I know better.

You know, you get so used to checking your backups if you have errors, I just wasn't thinking right.

Anyway, thanks for putting up with me and many thanks for the solution!