When i install the plugin everything is ok. it is installed properly with all the files and directories. The problem is that i can't see the content i am trying to input. For example: it uses a $text variable for example {[youtube]}AjHSu4wNTyw{/[youtube]} and it fails to work...
I have read some articles and tried to change some configs in the plugin_jw_allvideos.php.
Code: Select all
<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
$_MAMBOTS->registerFunction( 'onPrepareContent', 'AllVideos_group_one' );
function AllVideos_group_one( $published, &$row, &$params, $page=0 ) {
global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_session_type, $mainframe, $database;
$query = "SELECT id FROM #__mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'";
$database->setQuery( $query );
$id = $database->loadResult();
$mambot = new mosMambot( $database );
$mambot->load( $id );
$param =& new mosParameters( $mambot->params );
$allvideos_css = $param->get('allvideos_css', 'allvideos');
$width = 'width:'.$param->get('width', 400).'px;';
$height = 'height:'.$param->get('height', 323).'px;';
$top_margin = 'margin-top:'.$param->get('top_margin', 8).'px;';
$bottom_margin = 'margin-bottom:'.$param->get('bottom_margin', 8).'px;';
$video_align = 'text-align:'.$param->get('video_align', 'center').';';
$video_folder = $param->get('video_folder', 'images/stories/videos/');
$video_transparency = $param->get('video_transparency', 'transparent');
$video_bg = $param->get('video_bg', '');
$autostart = '&'.$param->get('autostart', 'autostart=false');
$audio_folder = $param->get('audio_folder', 'images/stories/audio/');
$ifilmwidth = 'width:'.$param->get('ifilmwidth', 400).'px;';
$ifilmheight = 'height:'.$param->get('ifilmheight', 323).'px;';
$metacafewidth = 'width:'.$param->get('metacafewidth', 400).'px;';
$metacafeheight = 'height:'.$param->get('metacafeheight', 323).'px;';
$cwidth = $param->get('width', 400);
$cheight = $param->get('height', 323);
$awidth = 'width:'.$param->get('awidth', 300).'px;';
$aheight = 'height:'.$param->get('aheight', 20).'px;';
(....)
// prepend and append code
$startcode = "\n\n<!-- JW AllVideos Plugin (v2.4) starts here -->\n<div style=\"clear:both;".$video_align.$top_margin.$bottom_margin."\" class=\"".$allvideos_css."\">\n";
$endcode = "\n</div>\n<!-- JW AllVideos Plugin (v2.4) ends here -->\n\n";
if ( !$published ) {
foreach ($regex as $key => $value) {
$row->text = preg_replace( $regex[$key][1], '', $row->text );
}
return;
}
foreach ($regex as $key => $value) { // searching for marks
if (preg_match_all($regex[$key][1], $row->text, $matches, PREG_PATTERN_ORDER) > 0) {
foreach ($matches[0] as $match) {
$match = preg_replace("/{.+?}/", "", $match);
$code = str_replace("***code***", $match, $regex[$key][0] );
//$row->text = preg_replace( "#{".$key."}".$match."{/".$key."}#s", $startcode.$code.$endcode , $row->text );
$row->text = preg_replace("#{".preg_quote($key)."}".preg_quote($match)."{/".preg_quote($key)."}#s", $startcode.$code.$endcode , $row->text );
}
}
}
}
From:
Code: Select all
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
Code: Select all
defined('_JEXEC' ) or die( 'Restricted access' );
Code: Select all
$_MAMBOTS->registerFunction( 'onPrepareContent', 'AllVideos_group_one' );
Code: Select all
$mainframe->registerEvent( 'onPrepareContent', 'AllVideos_group_one' );