Такая же проблема недавно появилась. Кто знает как исправить? Вот ссылка на сайт с ошибкой:
<?php
/*
* JW Player for Joomla! 1.5
* Author: Max
* Version: 1.1
* Last Update: 26/02/2010
*
* JW Player
* Author: Jeroen Wijering
* ULR: http://www.longtailvideo.com/players/jw-flv-player/
* Version: 4.7.811
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );
class plgContentJw_player extends JPlugin {
function plgContentJw_player( &$subject, $params ) {
parent::__construct( $subject, $params );
}
function onPrepareContent( &$article, &$params ) {
// API
$mainframe= &JFactory::getApplication();
// Assign paths
$sitePath = JPATH_SITE;
$siteUrl = substr(JURI::root(), 0, -1);
// Check if plugin is enabled
if(JPluginHelper::isEnabled('content','jw_player')==false) return;
// ------------------------------------ Prepare elements -------------------------------------
// Includes
require_once($sitePath.DS.'plugins'.DS.'content'.DS.'jw_player'.DS.'sources.php');
// Simple performance check to determine whether plugin should process further
$grabTags = str_replace("(","",str_replace(")","",implode(array_keys($tagReplace),"|")));
if(preg_match("#{(".$grabTags.")}#s",$article->text)==false) return;
// ---------------------------------- Get plugin parameters ----------------------------------
// Outside Parameters
if(!$params) $params = new JParameter(null);
$plugin = & JPluginHelper::getPlugin('content','jw_player');
$pluginParams = new JParameter( $plugin->params );
/* Video */
$videofolder = ($params->get('videofolder'))? $params->get('videofolder') : $pluginParams->get('videofolder','media/videos');
$videowidth = ($params->get('videowidth'))? $params->get('videowidth') : $pluginParams->get('videowidth',400);
$videoheight = ($params->get('videoheight'))? $params->get('videoheight') : $pluginParams->get('videoheight',300);
$transparency = $pluginParams->get('transparency','transparent');
$background = $pluginParams->get('background','#010101');
/* Audio */
$audiofolder = $pluginParams->get('audiofolder','media/audio');
$audiowidth = $pluginParams->get('audiowidth',300);
$audioheight = $pluginParams->get('audioheight',20);
/* Playlist */
$playlistsize = $pluginParams->get('playlistsize',350);
$shuffle = $pluginParams->get('shuffle',0);
/* General */
$fullscreen = ($pluginParams->get('fullscreen',0))? 'true' : 'false';
$autoplay = ($pluginParams->get('autoplay',0))? 'true' : 'false';
$downloadLink = ($params->get('downloadLink'))? $params->get('downloadLink') : $pluginParams->get('downloadLink',1);
$skin = $pluginParams->get('skin','');
$logo = $pluginParams->get('logo','');
/* Advanced */
$debugMode = $pluginParams->get('debugMode',0);
if($debugMode==0) error_reporting(0); // Turn off all error reporting
if($shuffle==1) {
$shuffle="&shuffle=true";
}
else {
$shuffle="";
}
if($skin!="") {
$skin="&skin=".$siteUrl."/plugins/content/jw_player/skins/".$skin;
}
if($logo!="") {
$logo="&logo=".$siteUrl."/".$logo;
}
$document = & JFactory::getDocument();
$document->addStyleSheet('plugins/content/jw_player/style.css');
// ------------------------------------ Render the output ------------------------------------
foreach($tagReplace as $plg_tag => $value) {
// expression to search for
$regex = "#{".$plg_tag."}(.*?){/".$plg_tag."}#s";
// process tags
if(preg_match_all($regex, $article->text, $matches, PREG_PATTERN_ORDER) > 0) {
// start the replace loop
foreach ($matches[0] as $key => $match) {
$tagcontent = preg_replace("/{.+?}/", "", $match);
$tagparams = explode('|',$tagcontent);
$tagsource = trim(strip_tags($tagparams[0]));
// source elements
$findAVparams = array(
"{SOURCE}",
"{FOLDER}",
"{WIDTH}",
"{HEIGHT}",
"{TRANSPARENCY}",
"{BACKGROUND}",
"{FULLSCREEN}",
"{AUTOPLAY}",
"{PLAYLISTSIZE}",
"{SHUFFLE}",
"{SKIN}",
"{LOGO}",
"{SITEURL}",
);
// Prepare the HTML
$output = new JObject;
// replacement elements
if(in_array($plg_tag, array("mp3","mp3remote","mp3playlist"))) {
$final_width = (@$tagparams[1])? $tagparams[1] : $audiowidth;
$final_height = (@$tagparams[2])? $tagparams[2] : $audioheight;
$final_autoplay = (@$tagparams[3])? $tagparams[3] : $autoplay;
$final_folder = $audiofolder;
if($plg_tag=="mp3playlist") {
$final_height=$final_height+$playlistsize;
}
$output->playerWidth = $audiowidth;
$output->playerHeight = $audioheight;
} else {
$final_width = (@$tagparams[1])? $tagparams[1] : $videowidth;
$final_height = (@$tagparams[2])? $tagparams[2] : $videoheight;
$final_autoplay = (@$tagparams[3])? $tagparams[3] : $autoplay;
$final_folder = $videofolder;
if($plg_tag=="videoplaylist") {
$final_height=$final_height+$playlistsize;
}
$output->playerWidth = $final_width;
$output->playerHeight = $final_height;
}
$replaceAVparams = array(
$tagsource,
$final_folder,
$final_width,
$final_height,
$transparency,
$background,
$fullscreen,
$final_autoplay,
$playlistsize,
$shuffle,
$skin,
$logo,
$siteUrl,
);
$output->player = JFilterOutput::ampReplace(str_replace($findAVparams, $replaceAVparams, $tagReplace[$plg_tag]));
if($downloadLink && (in_array($plg_tag, array("flv","mp3","mp4"))) ) {
$filesize = filesize($sitePath.'/'.$final_folder.'/'.$tagsource.'.'.$plg_tag);
$units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB');
$i = 0;
while($filesize>=1024) {
$filesize = $filesize/1024;
$i++;
}
$filesize = round($filesize, 2)."".$units[$i];
$output->downloadLink = '<a href="'.$siteUrl.'/'.$final_folder.'/'.$tagsource.'.'.$plg_tag.'" title="Download">Click</a> to download in '.strtoupper($plg_tag).' format ('.$filesize.')';
} else {
$output->downloadLink = '';
}
$getTemplate = '
<!-- JW Player Plugin (start) -->
<div class="player">
<div class="player-box">'.$output->player.'</div>
<div class="player-text">
'.$output->downloadLink.'
</div>
</div>
<!-- JW Player Plugin (end) -->
';
// Do the replace
$article->text = preg_replace("#{".$plg_tag."}".preg_quote($tagcontent)."{/".$plg_tag."}#s", $getTemplate , $article->text);
} // end foreach
} // end if
}
}
}