Zitat von "bazillus" post=3014in meinem alten phpBB2
Videos auch per BBCode einbetten können.
Funktioniert zwar noch nicht für alle möglichen Youtube-Urls, aber
ich hab mir da was eigenes gebaut
[uT|M0w8sOeL…eQ|||||]
oder
[uT|M0w8sOeL…eQ|640|480|23|right|]
Code
function bbcode($messagetext)
{ global $tit,$description;
$messagetext=' '.$messagetext;
while( $pos1 = strpos($messagetext,"[uT|") )
{
$pos2 = strpos($messagetext,']',$pos1+1);
$cut = substr($messagetext,$pos1,$pos2-$pos1);
unset($cutTOK);
$cutTOK= explode('|',$cut);
$uTPx=425;
$uTPy=344;
if ( $cutTOK[2] && !$cutTOK[3] )
{
$uTPy=$uTPy*$cutTOK[2]/$uTPx;
$uTPx=$cutTOK[2];
}
if ( (int)$cutTOK[4] ) $AS='&autoplay=1&start='.(int)$cutTOK[4];
if ( $cutTOK[5] ) $FLO=' style="float:'.$cutTOK[5].';"'; else $FLO='';
$cutTOK[2]=$uTPx;
$cutTOK[3]=$uTPy;
$uTP =' <object'.$FLO.' width="'.$cutTOK[2].'" height="'.$cutTOK[3].'"><param name="movie" value="https://beispiel.rocks/beispiel.rocks/www.youtube.com/v/'.$cutTOK[1].$AS.'&hl=de&fs=1&color1=0x006699&color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://beispiel.rocks/beispiel.rocks/www.youtube.com/v/'.$cutTOK[1].$AS.'&hl=de&fs=1&color1=0x006699&color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="'.$cutTOK[2].'" height="'.$cutTOK[3].'"></embed></object> ';
$messagetext = str_replace($cut.']', $uTP, $messagetext);
}
return $messagetext;
}
Alles anzeigen