sgadow Posted March 13, 2012 Share Posted March 13, 2012 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']); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.