Jump to content

IE Upgrade popup modification


sgadow

Recommended Posts

I have a joomla CMS and i downloaded this free plugin to notify viewers who have IE6 that they have an old version of IE and to upgrade etc etc.. I don't know much of anything about PHP coding and I would like this to display in IE6,7,8 not just IE6.. would someone who is more knowledgeable than me be so kind as to make the changes required?

 

<?php
/**
* @version		$Id: plg_iewarning.php 10709 2009-03-21 09:58:52Z juanparati $
* @package		Joomla
* @copyright	Copyright (C) 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']);
}

  
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.