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

    Default Showing banners just on login page

    Is there any way to show banners just on the login page?

    Similar to the below code to just show banners on the home page.

    Code:
    <?php if ($this_is_home_page) { ?>  
    
    <?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="headerpic">
    <?php
                  if (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 } ?>

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

    Default Re: Showing banners just on login page

    You can use the $this_is_home_page for anything ...
    Code:
    if ($this_is_home_page) {
    You can use that for any code ... if there is already an IF statement just surround the original IF with the $this_is_home_page IF statement ...
    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!

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

    Default Re: Showing banners just on login page

    I'm not sure that you answered my question. The question is as follows : -

    Is there a way to make things, such as banners, only appear on the login page? Similar to the code I posted where you can make things appear on the homepage.

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

    Default Re: Showing banners just on login page

    In a word ... no ...

    I surely did not answer your question correctly ... so let me try that again ...

    You can use:
    Code:
    if ($_GET['main_page'] == FILENAME_LOGIN) {
      // do this
    } else {
      // do that 
    }
    see if that helps you better now that I am paying attention ...
    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!

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

    Default Re: Showing banners just on login page

    Ok I have to admit that i've never coded PHP in my life and i'm mumbling this together from what i'm working out.

    I've had a go below. Can you tell me if this is how it should look for showing banner 1 on the login page and banner 2 on all other pages?

    Code:
    <?php
    	if ($_GET['main_page'] == FILENAME_LOGIN) {
    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
        }
      }
    ?>
    } else {
      <?php
                  if (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 } } ?>
    }

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

    Default Re: Showing banners just on login page

    Looking at the original code it would be easier to do this with change the code:
    Code:
      if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    To read:
    Code:
      if ($_GET['main_page'] == FILENAME_LOGIN && SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    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!

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

    Default Re: Showing banners just on login page

    Ok, is this what i'm looking for then?

    Code:
    <?php if ($this_is_home_page) { ?>  
    
    <?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
        }
      }
    ?>
    
    <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>
    
    <?php } ?>

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

    Default Re: Showing banners just on login page

    What is the:
    Code:
    <?php if ($this_is_home_page) { ?>  
    // stuff here 
    
    
    <?php } ?>
    in there for?
    Last edited by Ajeh; 5 May 2010 at 03:21 PM. Reason: recheck
    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. #9
    Join Date
    Feb 2010
    Posts
    56
    Plugin Contributions
    0

    Default Re: Showing banners just on login page

    Beacuse I don't know what i'm doing? :)

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

    Default Re: Showing banners just on login page

    Okay you don't need the test for the $this_is_main_page ... just the test for the login page, example:
    Code:
      if ($_GET['main_page'] == FILENAME_LOGIN && SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    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!

 

 
Page 1 of 2 12 LastLast

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

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