First Post wrote:Example to modify and transform a existing BBCode to Auto Video Embed
http://www.4seven.de/forum/6test/viewto ... p=147#p147
Code: Select all
if (($wshh) && (strpos($preview_message, 'http://www.worldstarhiphop.com/videos/video.php?v=') !== false)){
$preview_message = preg_replace('#<a class="postlink" href="http:\/\/www.worldstarhiphop.com\/videos\/video.php\?v=(.*?)">(.*?)<\/a>#U', '<object width="525" height="350"><param name="movie" value="http://www.worldstarhiphop.com/videos/e/16711680/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.worldstarhiphop.com/videos/e/16711680/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $preview_message);}
Code: Select all
if (($wshh) && (strpos($message, 'http://www.worldstarhiphop.com/videos/video.php?v=') !== false)){
$message = preg_replace('#<a class="postlink" href="http:\/\/www.worldstarhiphop.com\/videos\/video.php\?v=(.*?)">(.*?)<\/a>#U', '<object width="525" height="350"><param name="movie" value="http://www.worldstarhiphop.com/videos/e/16711680/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.worldstarhiphop.com/videos/e/16711680/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>', $message);}
Code: Select all
if (($liveleak) && (strpos($preview_message, 'http://www.liveleak.com/view?i=') !== false)){
$preview_message = preg_replace('#<a class="postlink" href="http:\/\/www.liveleak.com\/view\?i=(.*?)">(.*?)<\/a>#U', '<object width="450" height="370"><param name="movie" value="http://www.liveleak.com/e/$1"></param><param name="wmode" value="transparent"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.liveleak.com/e/$1" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="450" height="370"></embed></object>', $preview_message);}
Code: Select all
if (($liveleak) && (strpos($message, 'http://www.liveleak.com/view?i=') !== false)){
$message = preg_replace('#<a class="postlink" href="http:\/\/www.liveleak.com\/view\?i=(.*?)">(.*?)<\/a>#U', '<object width="450" height="370"><param name="movie" value="http://www.liveleak.com/e/$1"></param><param name="wmode" value="transparent"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.liveleak.com/e/$1" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" width="450" height="370"></embed></object>', $message);}
Code: Select all
if (($youtube1) && (strpos($preview_message, 'youtu.be/') !== false)){
$preview_message = preg_replace('#<a class="postlink" href="http:\/\/youtu.be\/(.*?)">(.*?)<\/a>#U', '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $preview_message);}
Code: Select all
if (($youtube1) && (strpos($message, 'youtu.be/') !== false)){
$message = preg_replace('#<a class="postlink" href="http:\/\/youtu.be\/(.*?)">(.*?)<\/a>#U', '<iframe width="425" height="349" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>', $message);}