I recode the some parts of mambot to define captions to videos
Basic Usage
{youtube}JUOgNdqEA-k|Murat Net{/youtube} //Caption located at the top of video by default
{youtube}JUOgNdqEA-k|Murat Net|bottom{/youtube} //Caption located at the bottom of video
Recoded part:
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);
//Hacked By SaVaTaGe
if (strpos($match,'|'))
{
$parts = explode('|',$match);
$match2 = $parts[0];
$caption = $parts[1];
$caption_text = '<div style="text-align: center; font-weight: bold; font-size: 14px;">'.$caption.'</div>';
if ($parts[2] && $parts[2] = 'bottom')
{
$endcode2 = $caption_text.$endcode;
}
else
{
$startcode2 = $startcode.$caption_text;
}
}
else
{
$match2 = $match;
$startcode2 = $startcode;
$endcode2 = $endcode;
}
//End of Hack
$code = str_replace("***code***", $match2, $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 );
//Hacked By SaVaTaGe
$row->text = preg_replace("#{".preg_quote($key)."}".preg_quote($match,'|')."{/".preg_quote($key)."}#s", $startcode2.$code.$endcode2, $row->text );
}
}
}
There is a small bug in this code, which causes nested DIVs, I try to find it but not found yet, anyone noticed what causes it, please inform me...
Bug explanation:
<div class="allvideos" .............>
video 1 code
<div class="allvideos" .............>
video 2 code
</div>
</div
Must be right below:
<div class="allvideos" .............>
video 1 code
</div>
<div class="allvideos" .............>
video 2 code
</div