Tutorial for add Youtube bbcode (General)

by Aradina @, Saturday, April 25, 2009, 14:38 (5483 days ago)

Hello,

I have code a Mod for MLF Version: 2.0 beta 19 for a youtube bbcode and it's functionally great.

I wish to share my knowledge with all others users :-)

#####################################################################
Mod: add Youtube bbcode

File: /templates/<template>/posting.tpl.inc

Search Code:
<input class="bbcode-button" style="color: #0000ff; text-decoration: underline;" type="button" name="link" value="{#bbcode_link_marking#}"
title="{#bbcode_link_title#}" onclick="insert_link('postingform',
'text','{#bbcode_link_linktext#}','{#bbcode_link_url#}');" /><br />

After add:
<input class="bbcode-button" type="button" name="youtube" value="{#bbcode_youtube_marking#}" title="{#bbcode_youtube_title#}" onclick="bbcode('postingform','text','youtube');" /><br />

-> Save and Close!

################################################################################

File: /lang/english.lang

Search Code:
bbcode_list_title = Insert list:

  • list item

After add:
bbcode_youtube_marking = Youtube
bbcode_youtube_title = Add Youtube Video: [youtube]ae73jju9[/youtube]

-> Save and Close!

*** For German Forums ***
File: /lang/german.lang

Search Code:
bbcode_list_title = Liste einfügen:

  • Listenpunkt

After add:
bbcode_youtube_marking = Youtube
bbcode_youtube_title = Youtube Video hinzufügen: [youtube]ae73jju9[/youtube]

-> Save and Close!

################################################################################

File: /includes/functions.inc.php

Search Code:
$bbcode->addCode ('msg', 'usecontent?', 'do_bbcode_msg', array ('usecontent_param' => 'default'), 'link', array ('listitem', 'block', 'inline', 'quote'), array ('link'));

After add:
$bbcode->addCode ('youtube', 'simple_replace', null, array ('start_tag' => '<embed src="http://www.youtube.com/v/', 'end_tag' => '&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed>'), 'inline', array ('listitem', 'block', 'inline', 'link', 'quote', 'pre', 'monospace'), array ());

-> Save and Close!


Have fun :-)

Greetz,
Aradina


Complete thread:

 RSS Feed of thread