With this tutorial applied, all your member will have to do, is post a link to a video supported by the media tag, and it will automatically be parsed as a video.
Open ./admin/sources/classes/bbcode/core.php
Find: (Around line 1450)
Find:
Open ./admin/sources/classes/bbcode/core.php
Find: (Around line 1450)
//----------------------------------------- // Auto parse URLs (only if this is full sweep) //-----------------------------------------Add above
/**
* (IM) Auto parse media tags
*/
if( !$_code AND $cur_method == 'display' )
{
$media = $this->cache->getCache( 'mediatag' );
if( is_array($media) AND count($media) )
{
foreach( $media as $type => $r )
{
if( preg_match( "#(^|\s|>|\](?<!\[media\]))(" . $r['match'] . "[^,\s\<\[]+)#", $txt, $matches ) )
{
$txt = preg_replace_callback( "#(^|\s|>|\](?<!\[media\]))(" . $r['match'] . "[^,\s\<\[]+)#", array( $this, '_autoParseMedia' ), $txt );
}
}
}
}
Find:
private function _autoParseUrls( $matches )
{
return $this->parseBbcode( $matches[1] . '[url]' . $matches[2] . '[/url]', 'display', 'url' );
}
Add below
/**
* (IM) Auto parse media tags
*
* Callback to auto parse media tags
*
* @access private
* @param array Matches from the regular expression
* @return string Converted text
*/
private function _autoParseMedia( $matches )
{
return $this->parseBbcode( $matches[1] . '[media]' . $matches[2] . '[/media]', 'display', 'media' );
}













