Help with converting ie6 popup script :(

I have this plugin for joomla cms and it is used to popup a message if a user is using ie6… I would like this to popup if they are using ie6, 7 or 8 not just ie 6 any help?

[php]<?php
/**

  • @version $Id: plg_iewarning.php 10709 2009-03-21 09:58:52Z juanparati $
  • @package Joomla
  • @copyright Copyright © 2009 Terrasolutions.es. All rights reserved.
  • @license GNU/GPL, see LICENSE.php
  • Joomla! is free software. This version may have been modified pursuant
  • to the GNU General Public License, and as distributed it includes or
  • is derivative of works licensed under the GNU General Public License or
  • other free or open source software licenses.
  • See COPYRIGHT.php for copyright notices and details.
    */

// no direct access
defined( ‘_JEXEC’ ) or die( ‘Restricted access’ );

jimport( ‘joomla.plugin.plugin’ );

class plgSystemSevenup extends JPlugin
{

function plgSystemSevenup(& $subject, $config)
{			
parent::__construct($subject, $config);
	
	//load the translation
	//$this->loadLanguage( );

}


function onAfterInitialise()
{
  global $mainframe;
  	 		  	 		  
$document = &JFactory::getDocument();

if ($this->isIE6() || $this->params->get('showToAllBrowsers',0)==1 ) {
     
    $document->addScript(JURI::base().'plugins/system/sevenup/js/sevenup.0.3.min.js'); 
    
    if ($this->params->get('useBlackPlugin',1)==1) {
    	$document->addScript(JURI::base().'plugins/system/sevenup/js/sevenup_black.0.3.min.js');     	  
    }    	    
  
}           	       

}

function onAfterRender()
{
  	 		     
if ($this->isIE6() || $this->params->get('showToAllBrowsers',0)==1 ) {
     
    $buffer = JResponse::getBody();
     
    $buffer = preg_replace('/<\/body>/', ($this->params->get('showToAllBrowsers',0)==1?'':' <!--[if lte IE 6]> ') . '     

        <script type="text/javascript">     
        
	        var options = {
					  enableClosing: ' . ($this->params->get('enableClosing', 0)==1 ? 'true' : 'false') . ', 
					  enableQuitBuggingMe: ' . ($this->params->get('enableQuitBuggingMe', 0)==1?'true':'false') . ', 
					  overlayColor: "' . $this->params->get('overlayColor') . '" , 
					  lightboxColor: "' . $this->params->get('lightboxColor') . '" , 
					  borderColor: "' . $this->params->get('borderColor') . '" , 
					  showToAllBrowsers: ' . ($this->params->get('showToAllBrowsers',0)==1?'true':'false') . ' 
	 				};

	        var callback = function() {
					  // Switch IE-specific content
					  // AJAX call to map IP to "IE6 user" status
					  // etc.
					}       
                 
          window.addEvent(\'domready\', function(){ sevenUp.' . ($this->params->get('useBlackPlugin',1)==1?'plugin.black.':'') . 'test(options, null); });    
             
        </script>

        ' . ($this->params->get('showToAllBrowsers',0)==1?'':' <![endif]--> ') . ' </body>', $buffer);
             	       
      JResponse::setBody($buffer);
             
}           	       

return true;
}


function isIE6 () { // Deprecated?  

	$msie='/msie\s(5\.[5-9]|[6]\.[0-9]*).*(win)/i';
	return isset($_SERVER['HTTP_USER_AGENT']) &&
		preg_match($msie,$_SERVER['HTTP_USER_AGENT']) &&
		!preg_match('/opera/i',$_SERVER['HTTP_USER_AGENT']);
}

}
[/php]

I would just go over the joomla forums, you’ll get a better answer. But i would just change the pattern in isIE6() so that it’ll match [6-8] instead of just [6].

Sponsor our Newsletter | Privacy Policy | Terms of Service