Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • farhady Friend
    #158082

    Hello,

    I modified my header.php to call the ie6-warning if a user is signed-in (and not if he uses ie6)
    [PHP]
    <?php
    $user = JFactory::getUser();
    if($user->get(‘guest’) == 0) : ?>
    <?php $this->showBlock(‘ie6/ie6warning’) ?>

    <?php endif; ?>
    [/PHP]

    The ie6-warning apperas but if I check mark “NOT SHOW AGAIN”, close the warning and reload my site, then the warning shows again. I look at your code but can’t see an error with the cookies.

    [PHP]
    <?php
    /*
    # ————————————————————————
    # JA T3v2 Plugin – Template framework for Joomla 1.5
    # ————————————————————————
    # Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
    # @license – GNU/GPL V2, http://www.gnu.org/licenses/gpl2.html. For details
    # on licensing, Please Read Terms of Use at http://www.joomlart.com/terms_of_use.html.
    # Author: JoomlArt.com
    # Websites: http://www.joomlart.comhttp://www.joomlancers.com.
    # ————————————————————————
    */
    ?>
    <?php
    define (‘SHOW_IE6_WARNING’, ‘close’);
    /*
    Setting for this message. Clear cookie if you change this setting.
    ‘none’: Not show warning
    ‘once’: Show one time only
    ‘close’: Show until user check box “Not show again” and close the message
    ‘always’: Always show this message
    */

    if (!SHOW_IE6_WARNING || SHOW_IE6_WARNING==’none’) return;
    $this->addParamCookie (‘ie6w_notshowagain’);
    if (SHOW_IE6_WARNING!=’always’ && $this->getParam (‘ie6w_notshowagain’,0)) return;
    ?>
    <link rel=”stylesheet” href=”<?php echo T3Path::getUrl(“blocks/ie6/ie6warning.css”); ?>” type=”text/css” />
    <div style=”” id=”ie6-warning” class=”wrap”>
    <div class=”main”><div class=”inner clearfix”>

    <p class=”note”><img src=”plugins/system/jat3/base-themes/default/blocks/ie6/note.png” title=”” alt=”” align=”left” /></p>
    <ul>
    <li><a class=”firefox-download” href=”http://www.mozilla.com/firefox/” target=”_blank” title=”Download Firefox”> </a></li>
    <li><a class=”chrome-download” href=”http://www.google.com/chrome” target=”_blank” title=”Download Chrome”> </a></li>
    <li><a class=”safari-download” href=”http://www.apple.com/safari/download/” target=”_blank” title=”Download Safari”> </a></li>
    <li><a class=”opera-download” href=”http://www.opera.com/download/” target=”_blank” title=”Download Opera”> </a></li>
    <li><a class=”ie-download” href=”http://www.microsoft.com/windows/Internet-explorer/default.aspx” target=”_blank” title=”Download Internet Explorer 8 NOW!”> </a></li>
    </ul>

    <div class=”close”>
    <a href=’#’ onclick=’ie6w_hide(); return false;’ title=”<?php JText::_(‘Close this notice’)?>”> </a>
    <?php if (SHOW_IE6_WARNING==’close’):?>
    <label for=”ie6w_notshowagain”><?php echo JText::_(“Do not show this message again”)?>    </label>
    <input type=”checkbox” name=”ie6w_notshowagain” id=”ie6w_notshowagain” value=”0″>
    <?php endif; ?>
    </div>
    </div></div>
    </div>

    <script type=”text/javascript”>
    function ie6w_show() {
    var fx = new Fx.Elements ([$(‘ie6-warning’), $(‘ja-wrapper’)]);
    var obj = {};
    obj[0]={‘height’:[285]};
    obj[1]={‘margin-top’:[285]};
    fx.start(obj);
    }
    function ie6w_hide() {
    var fx = new Fx.Elements ([$(‘ie6-warning’), $(‘ja-wrapper’)]);
    fx.stop();
    var obj = {};
    obj[0]={‘height’:0};
    obj[1]={‘margin-top’:0};
    fx.start(obj);
    if ($(“ie6w_notshowagain”) && $(“ie6w_notshowagain”).checked) {
    createCookie (“<?php echo $this->template?>_ie6w_notshowagain”, 1, 365);
    }
    }
    <?php if (SHOW_IE6_WARNING==’once’):?>
    createCookie (“<?php echo $this->template?>_ie6w_notshowagain”, 1, 365);
    <?php endif; ?>
    setTimeout(ie6w_show,2000);
    </script>
    [/PHP]

    I’m not sure but is it because your are using $this -> in your code and I always creating a new object after reloading?

    Have you an idea?

    Khanh Le Moderator
    #369500

    You need make some modification to get this work. At the top code block:
    [php]
    <?php
    define (‘SHOW_IE6_WARNING’, ‘close’);
    /*
    Setting for this message. Clear cookie if you change this setting.
    ‘none’: Not show warning
    ‘once’: Show one time only
    ‘close’: Show until user check box “Not show again” and close the message
    ‘always’: Always show this message
    */

    if (!SHOW_IE6_WARNING || SHOW_IE6_WARNING==’none’) return;
    $this->addParamCookie (‘ie6w_notshowagain’);
    if (SHOW_IE6_WARNING!=’always’ && $this->getParam (‘ie6w_notshowagain’,0)) return;
    ?>
    [/php]

    Replace with:
    [php]
    <?php
    define (‘SHOW_IE6_WARNING’, ‘close’);
    /*
    Setting for this message. Clear cookie if you change this setting.
    ‘none’: Not show warning
    ‘once’: Show one time only
    ‘close’: Show until user check box “Not show again” and close the message
    ‘always’: Always show this message
    */

    if (!SHOW_IE6_WARNING || SHOW_IE6_WARNING==’none’) return;
    //$this->addParamCookie (‘ie6w_notshowagain’);
    if (SHOW_IE6_WARNING!=’always’ && JRequest::getVar($this->template.’_ie6w_notshowagain’,”,’COOKIE’)) return;
    ?>
    [/php]

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Khanh Le 13 years, 4 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum