Forums / Bug Reports / Header Positions Problem

Header Positions Problem

Locked

Started by kotp on 9 Sep 2006, 5:41 PM · Views: 4,727

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
9 Sep 2006, 5:41 PM
#1
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Header Positions Problem

It seems that the checks for wether the banners are on or off isn't working when you set the Multiple Banner Groups in the Header Positions under Admin > Layout Settings > Banner Display Groups - Header Position 1.

My current entry is CPC:Wide-Banners for Header Position 1, which is allowing the banners that are off to display.

I have all Wide Banners off, except for 2, and I am getting banners that are supposed to be inactive coming up.

But they don't appear in the footer position 3.

I have not done extensive testing.

9 Sep 2006, 6:23 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

I set the setting to Wide-Banners ...

I go to Banner Manager and set all status to OFF or RED icon ...

Banners that were displaying vanish ...

Make sure that you only have the 1 Banner Group in the:
Banner Display Groups - Header Position 1

Check the code in:
/includes/templates/template_default/common/tpl_main_page.php

Make sure it is current and up to date and that you do not have an override that is missing the settings for:

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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 7:10 PM
#3
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

I set the setting to Wide-Banners ...

I go to Banner Manager and set all status to OFF or RED icon ...

Banners that were displaying vanish ...

Make sure that you only have the 1 Banner Group in the:
Banner Display Groups - Header Position 1
[/PHP]
The point was that I did want more than one group to show, and it was showing the second group fine, except with the ones that were off also showing (unwanted behaviour).

Ajeh:

Check the code in:
/includes/templates/template_default/common/tpl_main_page.php

Make sure it is current and up to date and that you do not have an override that is missing the settings for:

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

Verified the code is there, this file is not one that an override exists for.

9 Sep 2006, 8:09 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

What are the names of your Banner Groups ... and how do you have that filled in for the:
Banner Display Groups - Header Position 1

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 8:36 PM
#5
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

What are the names of your Banner Groups ... and how do you have that filled in for the:
Banner Display Groups - Header Position 1

I had it filled in CPC:Wide-Banners

I have it testing on Footers for now... here is the setting

Banner Display Groups - Footer Position 1 CPC:Wide-Banners

All the zencart/slashbox/etc is off. (Red Dot)

There is only one banner in CPC and only 2 turned on in Wide-Banners

9 Sep 2006, 8:48 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Does this mean it is or isn't working?

I have no idea what banner is from what banner group :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Sep 2006, 9:05 PM
#7
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

Does this mean it is or isn't working?

I have no idea what banner is from what banner group :smile:

Good question... As I wrote in the previous post, I only have 2 banners activated.

Well, to give an idea... I have pasted from the Banner Manager page:

Banners  	Groups  	Displays / Clicks  	Status  	New Window  	Show SSL  	Sort
Order 	Action 
View Banner CPC Company Home Page! 	SideBox-Banners 	1585 / 9 	Status - Enabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics  
View Banner Custom PC and Consulting, Inc. Home 	CPC 	314 / 4 	Status - Enabled 	Open New Window - Disabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner if you have to think ... you haven't been Zenned! 	Wide-Banners 	6 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner Johns Twin Ports Recycling 	Wide-Banners 	595 / 3 	Status - Enabled 	Open New Window - Enabled 	Show on Secure Pages - Disabled 	0 	Statistics Info 
View Banner Sashbox.net - the ultimate e-commerce hosting solution 	BannersAll 	35 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	20 	Statistics Info 
View Banner Sashbox.net - the ultimate e-commerce hosting solution 	Wide-Banners 	13 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner Start Accepting Credit Cards For Your Business Today! 	Wide-Banners 	16 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner The Jersey Frog 	Wide-Banners 	677 / 3 	Status - Enabled 	Open New Window - Enabled 	Show on Secure Pages - Disabled 	0 	Statistics Info 
View Banner Zen Cart 	Wide-Banners 	16 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner Zen Cart the art of e-commerce 	SideBox-Banners 	44 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	10 	Statistics Info 
View Banner Zen Cart the art of e-commerce 	SideBox-Banners 	31 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
View Banner Zen Cart the art of e-commerce 	SideBox-Banners 	39 / 0 	Status - Disabled 	Open New Window - Enabled 	Show on Secure Pages - Enabled 	0 	Statistics Info 
9 Sep 2006, 9:53 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Things look odd ... perhaps I could peek in your Admin ... if so, how about a PM for URL and access ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 3:01 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Try this ...

Edit the file:
/includes/functions/banner.php

And edit line 229:

      $new_banner_search = ' and ' . $new_banner_search;

Change to read:

      $new_banner_search = ' and (' . $new_banner_search . ')';

Does this resolve the banners issue for you?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 2:18 PM
#10
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

Try this ...

Edit the file:
/includes/functions/banners.php

And edit line 229:

  $new_banner_search = ' and ' . $new_banner_search;
> 
> Change to read:
> ```php
      $new_banner_search = ' and (' . $new_banner_search . ')';

Does this resolve the banners issue for you?

This worked fine... for reference, it should be /includes/functions/banner.php (without it being plural)

Thank you very much.

I kind of thought it was shared code somewhere, but didn't know where to look.

10 Sep 2006, 2:22 PM
#11
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

Things look odd ... perhaps I could peek in your Admin ... if so, how about a PM for URL and access ... :smile:

OK, you said things look odd... what other things were looking odd? :blink:

10 Sep 2006, 2:40 PM
#12
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Well, I ran a test entry on the admin > layouts > Banner Display Groups - Side Box banner_box SideBox-Banners

When I changed the entry, the whole (right) column disappeared. I changed it back (cut and paste) to the previous default entry, and it stayed disappeared. It did appear when I went to login as a customer.

Found a problem that may be preventing the side banners from coming up...

Fatal error: Call to undefined function: zen_get_upcoming_date_range() in /home/customp3/public_html/shop/includes/modules/upcoming_products.php on line 15
10 Sep 2006, 2:45 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

kotp:

OK, you said things look odd... what other things were looking odd? :blink:

The part where things were not logically working ... but that was resolved with the missing parens ...

This appeared to be an issue on the Banner Positions when more than one Banner Group was used as the emphasis on status = 1 what not set regardless of the Banner Group name ...

Took me a few to find that little quirk and why "some" things listened and others did not ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 2:47 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Check that the /includes/functions/functions_lookup.php is up to date ... that function is located down near the bottom below the function zen_get_new_date_range ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 3:30 PM
#15
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

Check that the /includes/functions/functions_lookup.php is up to date ... that function is located down near the bottom below the function zen_get_new_date_range ...

The patch that was in the fixes forum area? Yeah, that was when it broke.

Something is not right... I copy/pasted the replacement code.

Now I have this.

// build date range for new products
  function zen_get_new_date_range($time_limit = false) {
    if ($time_limit == false) {
      $time_limit = SHOW_NEW_PRODUCTS_LIMIT;
    }

    // 120 days; 24 hours; 60 mins; 60secs
    $date_range = time() - ($time_limit * 24 * 60 * 60);
// echo 'Now:      '. date('Y-m-d') ."<br />";
// echo $time_limit . ' Days: '. date('Ymd', $date_range) ."<br />";
    $zc_new_date = date('Ymd', $date_range);
    switch (true) {
    case (SHOW_NEW_PRODUCTS_LIMIT == 0):
      $new_range = '';
      break;
    case (SHOW_NEW_PRODUCTS_LIMIT == 1):
      $zc_new_date = date('Ym', time()) . '01';
      $new_range = ' and p.products_date_added >=' . $zc_new_date;
      break;
    default:
      $new_range = ' and p.products_date_added >=' . $zc_new_date;
    }
    return $new_range;
  }

for that block of code.

10 Sep 2006, 3:43 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Be sure that you deleted the old function completely and replaced it with the new one ...

If you are unsure ... restore the original file:
/includes/functions/functions_lookups.php

from a clean Zen Cart v1.3.5 download ... and then replace that function again ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 3:57 PM
#17
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

Be sure that you deleted the old function completely and replaced it with the new one ...

If you are unsure ... restore the original file:
/includes/functions/functions_lookups.php

from a clean Zen Cart v1.3.5 download ... and then replace that function again ...

Yep, with the original code, I have the problem with all products showing as new, but the right side column works. When I put in the 'fix' code, it breaks.

The right side column disappears.

10 Sep 2006, 4:35 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

It looks like you are wiping out the function below the function zen_get_new_date_range ... :eek:

There is another function before the end of the file:

// build date range for upcoming products
  function zen_get_upcoming_date_range() {
    // 120 days; 24 hours; 60 mins; 60secs
    $date_range = time();
// echo 'Now:      '. date('Y-m-d') ."<br />";
// echo 'Upcoming Days: '. date('Ymd', $date_range) ."<br />";
    $zc_new_date = date('Ymd', $date_range);
    $new_range = ' and p.products_date_available >=' . $zc_new_date;
//    $new_range = ' and ' . EXPECTED_PRODUCTS_FIELD . ' <=' . $zc_new_date;

    return $new_range;
  }

Don't touch that function ...

Only change the function zen_get_new_date_range with the new function ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Sep 2006, 4:45 PM
#19
kotp avatar

kotp

New Zenner

Join Date:
Jun 2006
Location:
Minnesota
Posts:
38
Plugin Contributions:
0

Re: Header Positions Problem

Ajeh:

It looks like you are wiping out the function below the function zen_get_new_date_range ... :eek:

There is another function before the end of the file:

// build date range for upcoming products
function zen_get_upcoming_date_range() {
// 120 days; 24 hours; 60 mins; 60secs
$date_range = time();
// echo 'Now: '. date('Y-m-d') ."<br />";
// echo 'Upcoming Days: '. date('Ymd', $date_range) ."<br />";
$zc_new_date = date('Ymd', $date_range);
$new_range = ' and p.products_date_available >=' . $zc_new_date;
// $new_range = ' and ' . EXPECTED_PRODUCTS_FIELD . ' <=' . $zc_new_date;

return $new_range;

}

> 
> Don't touch that function ...
> 
> Only change the function zen_get_new_date_range with the new function ...

You are correct.  I read too much into the "at the bottom" of the code. :blush: 

It is fixed.
10 Sep 2006, 4:47 PM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Header Positions Problem

Thanks for the update and glad all of the code is functioning correctly for you on both the banners and the New Product dates ... :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!