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 at Reddit & Hackernews

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About