File Manager
Pro
/data/web/virtuals/8819/virtual/www/plugins/system/muscol
PHP 7.4.33
Linux
/data/web/virtuals/8819/virtual/www/plugins/system/muscol/muscol.php
1.3 KB
0640
Back
<?php // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.plugin.plugin' ); //new for Joomla 3.0 if(!defined('DS')){ define('DS',DIRECTORY_SEPARATOR); } class plgSystemMuscol extends JPlugin { function __construct(& $subject, $config) { parent::__construct($subject, $config); } function onAfterInitialise() { $document = JFactory::getDocument(); $uri = JFactory::getURI(); $document->addScriptDeclaration("var base = \"".$uri->getScheme()."://".$uri->getHost()."\";"); $document->addScriptDeclaration("var extrabase = \"".$this->params->get('extrabase')."\";"); } public function onAfterRender() { $app = JFactory::getApplication(); if ($app->getName() != 'site' || $app->get('sef') == '0') { return true; } // Replace src links. $base = JUri::base(true) . '/'; $buffer = $app->getBody(); $search = array( 'href="'.$this->params->get('extrabase').'/{{link}}"', 'href="'.$this->params->get('extrabase').'/{{url}}"', 'href="'.$this->params->get('extrabase').'/{{download_link}}"', 'href="'.$this->params->get('extrabase').'/{{buy_link}}"'); $replace = array( 'href="{{link}}"', 'href="{{url}}"', 'href="{{download_link}}"', 'href="{{buy_link}}"'); $buffer = str_replace($search, $replace, $buffer); $app->setBody($buffer); return true; } }
Cancel
Download
Save changes
File Manager Pro · single-file PHP 7.4.33 on Linux · paths encrypted in URL (AES-256-CTR)