Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2011
    Posts
    89
    Plugin Contributions
    0

    Default Banner set to No new window not working

    Hello,
    My site:
    www.earthscauldron.com
    I have all the banners (banners are a slide show on the home page) set to NOT open in a new window. They are all opening in a new window.
    Any suggestions on what may be going on here?
    Thanks so much!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Banner set to No new window not working

    in your admin > toold > banner manager screen - do all of your banners have a red "X" in the "New Window" box??
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2011
    Posts
    89
    Plugin Contributions
    0

    Default Re: Banner set to No new window not working

    Quote Originally Posted by kobra View Post
    in your admin > toold > banner manager screen - do all of your banners have a red "X" in the "New Window" box??
    Yes they do. Every one of them. I'm not sure what is happening.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Banner set to No new window not working

    you need to look at the code that generates the slideshow. the html <a> link has a target of _blank which most browsers will cause to open in a new window or tab.

    i am unfamiliar with this template and more specifically the construction of the slideshow, but i would search for where _target is in the code and more specifically in the construction of that slideshow.

    from your home page:

    HTML Code:
    <li class="slide-2 activeslide" style="visibility: visible; opacity: 1;">
    <a href="http://earthscauldron.com/index.php?main_page=redirect&amp;action=banner&amp;goto=17&amp;zenid=7bi8jr7oshlssc96i86q2ka7c1" target="_blank">    
    <img src="http://earthscauldron.com/images/banners/slide4.jpg" style="width: 1840px; height: 956.8px; left: 0px;">
    </a>
    </li>
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Feb 2011
    Posts
    89
    Plugin Contributions
    0

    Default Re: Banner set to No new window not working

    I found the line of code in includes/functions/banner.php
    This:
    Line #142 : $banner_string = '<a href="' . zen_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner->fields['banners_id']) . '" target="_blank">' . zen_image(DIR_WS_IMAGES . $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';

    How would I go about this. Do I comment it out or type something else there? Do I delete "target=_blank" altogether? I'm not sure what to do. Nothing else seems to be working that I've tried. Except breaking the slide show a few times

  6. #6
    Join Date
    Feb 2011
    Posts
    89
    Plugin Contributions
    0

    Default Re: Banner set to No new window not working

    I also found this on line 42:
    if ($banner->fields['banners_open_new_windows'] == '1')
    Does that '1' have anything to do with it?

  7. #7
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Banner set to No new window not working

    My suspicion is that there is nothing wrong with the zc files, but that the slide-show script is the culprit. From what I can decipher, the script defaults all links to be target="blank"

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Banner set to No new window not working

    I would agree that it is not the php code of ZC, though looking at least at one of the more recent versions there are more possibilities that target="_blank" and not that...

    Another thought though kobra asked about the current state, can you confirm that the state can change of the banner, and then also compare the resulting source code differences to help further the troubleshoot.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,688
    Plugin Contributions
    9

    Default Re: Banner set to No new window not working

    the OP confirmed that the banners are turned off in the banner manager. perhaps EC's banners function has changed; perhaps it never worked in V1.5.1. i do not know.

    the code the OP listed on line 42 suggests that the template may honor the flag associated with the banners opening in a new window; however if the banner link construction is being done on line 142, my guess is that the 100 lines of code is far too many for them to be related.

    EC, i would compare your code to the following code around your line 142:

    PHP Code:
    if ($banner->fields['banners_open_new_windows'] == '1') {
        
    $banner_string '<a href="' zen_href_link(FILENAME_REDIRECT'action=banner&goto=' $banner->fields['banners_id']) . '" target="_blank">' zen_image(DIR_WS_IMAGES $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';
    } else {
        
    $banner_string '<a href="' zen_href_link(FILENAME_REDIRECT'action=banner&goto=' $banner->fields['banners_id']) . '">' zen_image(DIR_WS_IMAGES $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';

    this is how it looks under v1.5.4 and it would seem to honor the flags mentioned above. if your code does not look like this, you should copy this code to replace your line 142 and see if that works.

    line 42 should be left alone.... although i'm not really sure what it is doing up there.

    on your single line, you code just change the following, but then your flags would not work (which is what is currently happening anyway):

    PHP Code:
    //original line
    $banner_string '<a href="' zen_href_link(FILENAME_REDIRECT'action=banner&goto=' $banner->fields['banners_id']) . '" target="_blank">' zen_image(DIR_WS_IMAGES $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>';

    //new line
    $banner_string '<a href="' zen_href_link(FILENAME_REDIRECT'action=banner&goto=' $banner->fields['banners_id']) . '" >' zen_image(DIR_WS_IMAGES $banner->fields['banners_image'], $banner->fields['banners_title']) . '</a>'
    good luck!
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Banner set to No new window not working

    No, the op confirmed that the admin reflected an off condition... That is different than 1) transitioning from off to on or back, and 2) how the front end and this "non-functioning" feature relate...

    As to the code provided above by the OP that is the code from ZC 1.5.1. http://github.com/zencart/zencart/bl...ons/banner.php. It does seem that one "solution" would be to upgrade (at least to take advantage of other options), but not likely to resolve this issue. Further, it seems as if the issue is more either in a javascript file (.js) or a database entry meaning that any developer's toolkit searches should target files other than .php for that content...

    Also, by copying just the text of the identified line numbers would/could end up affecting operation to where if the option(s) aren't tracking properly then more issues could result... One issue is/would be is that if only those lines were duplicated then when the image should be popup it wouldn't do so because the target variable would still be empty... Reverse trouble...

    Also, there is no indication about the history of this installation in particular the remaining parts of the posting tips...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Flash banner not working in New I.E - Fine in mozzila
    By Orchard_Direct in forum General Questions
    Replies: 1
    Last Post: 11 Nov 2009, 05:01 PM
  2. Banner New Window
    By cadi1999 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 May 2008, 12:14 PM
  3. Image link "open in new window" not working
    By kevinmc3 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 22 Mar 2008, 02:57 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