dracoblue.net

How to add auto-youtube-tags to SMF

Open Subs.php and alter the following things.

After:

    static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;

Add:


$message = preg_replace('/http:\/\/([^\s\.]+).(youtube.com\/watch\?v=)([A-Za-z0-9\-]+)([^\s]*)/', '[youtube]$3[/youtube]', $message);

After:

            array(
'tag' => 'b',
'before' => '<b>',
'after' => '</b>',
)

Add:

            array(
'tag' => 'youtube',
'before' => ''
),

In open source, php, smf by @ 20 Jan 2008

comments powered by Disqus

Recent Files

Advertisement

Recent Dev-Articles

Read recently

About

Blogroll