Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 66
  1. #11
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Thanks

    Here is the info you need

    Zen Cart 1.3.7
    Database Patch Level: 1.3.7
    PHP Version 4.4.7
    Template - Gloss Black

    Site link
    www.fantasy############srus.co.uk

    Hope this is enough info

    The Welcome greeting is currently in the Header 3 position

    Many Thanks

  2. #12
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: How do i make banner ads appear on the front page only

    That's helpful but puzzling. The version of Zen Cart that you are using supports the $this_is_home_page variable, and Gloss Black plays nicely with it and doesn't over-ride the tpl_main_page file, so I'm puzzled as to where the code that you posted earlier came from, unless you have amended it yourself.

    Also, I can see no reason why the code posted earlier shouldn't work, or evidence on your site of the error that you reported. Could you post the change that you made and a few lines before and after it and detail the circumstances in which the error occurs.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #13
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Here is the change that i made

    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {

    Changed to

    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2) && $this_is_home_page) {

    which gave me this error

    Fatal error: Call to a member function on a non-object in /home/jane776/public_html/shop/includes/templates/template_default/common/tpl_main_page.php on line 102

    Which appeared as the only text in the centre column (it stopped everything else in the centre column from appearing)

    I have removed the modification now as the site is in its busy time of day, but i really do appriciate your perseverance with this - thanks alot

  4. #14
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: How do i make banner ads appear on the front page only

    This doesn't make sense. The code that you say you changed is in the Gloss Black or template_default tpl_header.php (you didn't say which you changed), but the error has been generated by your template_default tpl_main_page.php file.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #15
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Quote Originally Posted by kuroi View Post
    In default Zen Cart you would find the line in your tpl_main_page.php that is identical to the line to which I referred in my original post, except for referring to SET3 instead of SET2 and make the change that I recommended.
    I changed the code for Header SET3 in template_default tpl_main_page.php file

    SET3 doesn't appear in the tpl_header.php

    Sorry for not saying which file earlier, but it would appear that the error does make sense given the changes i made

    Kind Regards

  6. #16
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Sorry just realised you asked for the changes with a few lines either side of it so here it is

    ?>
    <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
    *
    */
    require($body_code); ?>


    I changed the section you instructed to this


    if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3) && $this_is_home_page) {

    Kind Regards

  7. #17
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Any more ideas on what the problem might be Kuroi?

    Or is there anyone else out there who has had this problem before?

    Thanks in advance

  8. #18
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Ok i have a little more information now i have been trying out a few different things.

    IF I CHANGE

    if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {

    TO

    if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3) && $this_is_home_page) {

    In the template_default tpl_main_page.php file, I get this error relating to the file i have changed

    Fatal error: Call to a member function on a non-object

    But the error is only present on the main page, all the other pages function perfectly without displaying the Header in SET3

    As a test i did the same modification to SET2 in the tpl_header.php and had the same result - Main page wouldn't work but all the others were perfectly normal with the Header in SET2 missing just like it should be.

    It appears that this added piece of code '&& $this_is_home_page' is performing as it should, in other words it is preventing the headers appearing outside the main page, but i can't seem to understand why the main page is displaying an error.

    It seems that i am so close yet maybe not lol

    I am trying to learn all i can about this error and its meaning, but i'm not getting anywhere fast

    Does anyone out there know exactly what this error means

    'Fatal error: Call to a member function on a non-object'

    Many Thanks

    Mat

  9. #19
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: How do i make banner ads appear on the front page only

    Sorry, to make clear to PHP exactly what we're doing, we need to modify that code very slightly to either
    if (SHOW_BANNERS_GROUP_SET3 != '' && ($banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) && $this_is_home_page) {
    or my preferred version
    if (SHOW_BANNERS_GROUP_SET3 != '' && $this_is_home_page && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    But it should still be done in an over-ride file and not the template_default version.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #20
    Join Date
    May 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    I've been following this thread as I want a banner only on the main page. I tried both changes that have been suggested, however the banner still shows on all pages. Is there something small I have overlooked? Another setting somewhere? I have the banner turned on in banner manager and all banners OFF in layout box controller.

    Thanks!

 

 
Page 2 of 7 FirstFirst 1234 ... LastLast

Similar Threads

  1. v154 Make Category description only appear on page 1?
    By Feznizzle in forum General Questions
    Replies: 3
    Last Post: 1 Oct 2015, 09:48 PM
  2. Replies: 1
    Last Post: 14 Mar 2012, 03:31 AM
  3. Better arrangement for my 4 Banner Ads at the bottom of Front Page
    By AZUKI in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Nov 2007, 05:09 PM
  4. How do I make my logo only appear on the main page
    By CafePrima in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 27 Oct 2007, 07:00 PM
  5. How do I make the 'Best Sellers' box appear on every page?
    By Winks in forum Basic Configuration
    Replies: 1
    Last Post: 15 Mar 2007, 03:45 PM

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