Forums / Templates, Stylesheets, Page Layout / display banner group 3 on login page only

display banner group 3 on login page only

Views: 878

Results 1 to 6 of 6
20 Feb 2014, 2:23 PM
#1
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

display banner group 3 on login page only

Hi

For zen cart 1.3.9b, I need to be able to show banner group three on the login page only. I've been searching the forum and web but haven't found just the right code solution to allow this.

I have tried different variations but no success.

To display on login page only:

altering this php if ($this_is_home_page) { to this php if ($this_is_login) { or this ```php
if ($this_is_login_page) {



This next code works to disable banner group three on some pages but it seems the long way around plus I can't get it to work for the home page, ez pages or manufacturers filtering pages


```php
<?php
if (!in_array($current_page_base,explode(",",'site_map,product_reviews_info,privacy,account,products_all,products_new,specials,featured_products,shopping _cart,checkout_shipping,checkout_payment,checkout_ confirmation,checkout_success')) || ($this_is_home_page == 'false')) {
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
}}}
?>

Please, any help would be appreciated.
buildingblocks

20 Feb 2014, 3:02 PM
#2
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: display banner group 3 on login page only

moving the banner three code to the tpl_login_default.php file works to confine the banner to the login page but there must be a better way.

20 Feb 2014, 3:11 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: display banner group 3 on login page only

You could customize the file:
tpl_main_page.php

with the page(s) you want to show the banner 3 with the code in RED:

  if ([B]($_GET['main_page'] == FILENAME_LOGIN) &&[/B] $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {

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!

20 Feb 2014, 3:52 PM
#4
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: display banner group 3 on login page only

perfect! Thank you so much. It worked.

Now, for future reference, if for example I wanted to display the banner on a second page would I separate with comma like this?

if (($_GET['main_page'] == FILENAME_LOGIN,FILENAME_CREATE_ACCOUNT) && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
20 Feb 2014, 4:36 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: display banner group 3 on login page only

No, each one has to be set separately ...

if ((($_GET['main_page'] == FILENAME_LOGIN) || ($_GET['main_page'] == FILENAME_CREATE_ACCOUNT)) && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {  

Or, you could get a little fancier with the code if you wanted to in order to make it shorter ...

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!

20 Feb 2014, 4:38 PM
#6
buildingblocks avatar

buildingblocks

Totally Zenned

Join Date:
Jun 2008
Posts:
629
Plugin Contributions:
0

Re: display banner group 3 on login page only

ok, thank you. Your help is very much appreciated. :-)