Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Feb 2010
    Posts
    56
    Plugin Contributions
    0

    Default Re: Showing banners just on login page

    Thank you for all your help. One final question. If I was to specify that banner 1 be shown just on the login page and home page and banner 2 on every other page. Would it look like the below?

    **Crosses fingers**

    Code:
    <?php
      if ($_GET['main_page'] == FILENAME_LOGIN && 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
        }
      }
    ?>
    
    <?php
      if( ($this_is_home_page) && 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="headerpic">
    <?php
                  if ($_GET['main_page'] == FILENAME_LOGIN && SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    if ($banner->RecordCount() > 0) {
    ?>
          <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
    	  
    	 <?php } } ?>
    </div>

  2. #12
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Showing banners just on login page

    If you want banner2 on every page, you do not want to set the reference to the login page on that:
    $_GET['main_page'] == FILENAME_LOGIN &&

    as that is making it only show on the login page ...

    On the banner1 to show on home page and login page, you can do two IF statements as you have done it or you can reference both in the same IF using:
    ($_GET['main_page'] == FILENAME_LOGIN || $this_is_home_page) &&

    where you have:
    $_GET['main_page'] == FILENAME_LOGIN &&
    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: v1.5.5]
    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!

  3. #13
    Join Date
    Feb 2010
    Posts
    56
    Plugin Contributions
    0

    Default Re: Showing banners just on login page

    OK, I want Banner 1 on homepage or login and banner 2 on every page other than those 2 pages.

    Am I close?

    Code:
    <?php
      if ($_GET['main_page'] == FILENAME_LOGIN || $this_is_home_page) && 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>
    } else { SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    if ($banner->RecordCount() > 0) {
    		<div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
    	  ?>
    Last edited by shalesey; 6 May 2010 at 04:17 PM.

  4. #14
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Showing banners just on login page

    Banner 1 code to show on login page and home page:
    Code:
    <?php
      if (($_GET['main_page'] == FILENAME_LOGIN || $this_is_home_page) && 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
        }
      }
    ?>
    Banner 2 code to not show on login page or home page
    Code:
    <?php
                  if (($_GET['main_page'] != FILENAME_LOGIN && !this_is_home_page) && SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    if ($banner->RecordCount() > 0) {
    ?>
          <div id="bannerTwo" 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: v1.5.5]
    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!

  5. #15
    Join Date
    Feb 2010
    Posts
    56
    Plugin Contributions
    0

    Default Re: Showing banners just on login page

    Ok the code is not quite working.

    If I use the below I get banner 2 and 3 on the login and home page and banner 3 on every other page.

    Code:
    <div id="headerpic">
    <?php
      if (($_GET['main_page'] == FILENAME_LOGIN || $this_is_home_page) && SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
        if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
        }
      }
    ?>
    </div>
    
    <?php
                  if (($_GET['main_page'] != FILENAME_LOGIN && !this_is_home_page) && 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 } } ?>
    
    
    <?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
        }
      }
    ?>
    If I use the below code I get banner 2 on the login and homepage and banner 3 on no pages.

    Code:
    <div id="headerpic">
    <?php
      if (($_GET['main_page'] == FILENAME_LOGIN || $this_is_home_page) && SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
        if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
        }
      }
    ?>
    </div>
    
    
    <?php
                  if (($_GET['main_page'] != FILENAME_LOGIN && !this_is_home_page) && 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 } } ?>
    To be clear I want banner 2 on the login and home page and banner 3 on every page other than those two pages.
    Last edited by shalesey; 7 May 2010 at 09:10 AM.

  6. #16
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Showing banners just on login page

    That is because of the silly little typo in *my* code that *you* did not catch ...

    Change the:
    !this_is_home_page

    to be:
    !$this_is_home_page

    It will work loads better ...
    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: v1.5.5]
    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!

  7. #17
    Join Date
    Feb 2010
    Posts
    56
    Plugin Contributions
    0

    Default Re: Showing banners just on login page

    Yup that's got it. Thanks for all your help. :)

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 Home Page banners not showing
    By bigandrew in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 8 Oct 2014, 09:31 PM
  2. when I just try to login I am still returned to the login page
    By buildingblocks in forum Upgrading from 1.3.x to 1.3.9
    Replies: 14
    Last Post: 23 Jul 2010, 11:16 PM
  3. Banners links just open new page that displays banner image!
    By teqmedia in forum Basic Configuration
    Replies: 1
    Last Post: 18 Mar 2009, 05:43 AM
  4. Banners not showing on page
    By ashton0603 in forum General Questions
    Replies: 0
    Last Post: 24 Jan 2008, 11:39 PM
  5. Adding a page just for banners?
    By ashton0603 in forum Basic Configuration
    Replies: 2
    Last Post: 23 Jun 2007, 06:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR