MyBB Community Forums

Full Version: YouTube Widget BBCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, 

I am wanting to have basically the YouTube bbcode channel and ytid tags on my mybb forum.  How would you do that?

If you don't know what I mean look at this http://damnlag.com/threads/list-of-site-widgets.31312/ it is the first 2 widgets bbcode things they talk about.

If you could help me add them it would be good.

Regards

Wayne Rayner
Hi WAZY,

it's pretty straightforward. You have to add this line
<script src="https://apis.google.com/js/platform.js"></script>

to the "headerinclude" template. (Templates & Themes -> Templates -> Default -> Templates without Group -> Headerinclude)


Then create two new MyCodes.

One with this regular expression:

\[ytid\](.*?)\[/ytid\]
And that replacement:

<div class="g-ytsubscribe" data-channel="$1" data-layout="full" data-count="default"></div>



And another one with this regular expression:
\[channel\](.*?)\[/channel\]
And the replacement:

<div class="g-ytsubscribe" data-channelid="$1" data-layout="full" data-count="default"></div>


That should be it.