Simple Machines Community Forum

SMF Support => Converting to SMF => phpBB => Topic started by: PML100 on March 20, 2014, 07:53:25 AM

Title: Screencast BBCode from PhpBB
Post by: PML100 on March 20, 2014, 07:53:25 AM
I have successfully converted my PhpBB forum onto an SMF forum.

But one of the main things that I can't replicate is being able to embed Screencast videos into the forum which I achieved on my PhpBB forum via a custom BBCode.

This was the BBCode I used:

[SCT]{TEXT}[/SCT]

The HTML 'replacement':

<iframe class="tscplayer_inline embeddedObject" name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="{TEXT}" height="480" width="640" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

It doesn't appear you can create custom BBCodes in the same way on SMF and after a search I couldn't find a mod that achieved this (either being able to create a custom BBCode or directly embed a Screencast video).

Would appreciate any help in this regard.

Title: Re: Screencast BBCode from PhpBB
Post by: margarett on March 20, 2014, 08:48:13 AM
What do you usually add as {TEXT} there? I assume a custom BBC with the same content should be able to work.
Title: Re: Screencast BBCode from PhpBB
Post by: PML100 on March 20, 2014, 08:53:47 AM
Quote from: margarett on March 20, 2014, 08:48:13 AM
What do you usually add as {TEXT} there? I assume a custom BBC with the same content should be able to work.

It's just the specific video http link specified by Screencast i.e. unique for each video. An example being (with some changes for privacy etc):

http://www.screencast.com/users/xxxx/39eaebfb-7f66-48e5-b23a-9992afdfdd/embed
Title: Re: Screencast BBCode from PhpBB
Post by: margarett on March 20, 2014, 09:04:08 AM
And a custom BBC can't handle that? I think it should be able to...
Title: Re: Screencast BBCode from PhpBB
Post by: PML100 on March 20, 2014, 09:27:56 AM
Quote from: margarett on March 20, 2014, 09:04:08 AM
And a custom BBC can't handle that? I think it should be able to...

I'm new to SMF and I couldn't find a way you could create custom BBCodes like you can in PhpBB i.e. this is how I would do it in PhpBB?

Title: Re: Screencast BBCode from PhpBB
Post by: margarett on March 20, 2014, 10:10:19 AM
Unfortunately there isn't such a tool in SMF. You have to do it in code, really.

Something like:
Sources/Subs.php, find:

array(
'tag' => 'u',
'before' => '<span class="bbc_u">',
'after' => '</span>',
         ),

Add after:

array(
'tag' => 'sct',
'type' => 'unparsed_content',
'before' => '<iframe class="tscplayer_inline embeddedObject" name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="',
'after' => '" height="480" width="640" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',
),

Warning: highly untested :P
Title: Re: Screencast BBCode from PhpBB
Post by: PML100 on March 20, 2014, 11:42:05 AM
Quote from: margarett on March 20, 2014, 10:10:19 AM
Unfortunately there isn't such a tool in SMF. You have to do it in code, really.

Something like:
Sources/Subs.php, find:

array(
'tag' => 'u',
'before' => '<span class="bbc_u">',
'after' => '</span>',
         ),

Add after:

array(
'tag' => 'sct',
'type' => 'unparsed_content',
'before' => '<iframe class="tscplayer_inline embeddedObject" name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="',
'after' => '" height="480" width="640" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',
),

Warning: highly untested :P

Thanks, tested and I just get a blank screen when I use the BBCode.

Many thanks for trying to help though.
Title: Re: Screencast BBCode from PhpBB
Post by: margarett on March 20, 2014, 11:47:39 AM
Something I did wrong, of course :P

Can you please PM me a valid screencast link so that I can test it?
Title: Re: Screencast BBCode from PhpBB
Post by: margarett on March 20, 2014, 08:04:03 PM
Here ya go:

array(
'tag' => 'sct',
'type' => 'unparsed_content',
'content' => '<div style="text-align:center;margin:auto;padding:5px;">&nbsp;
<iframe name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="$1" height="400" width="640" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>',
'block_level' => true,
),


This should allow you to have your previous videos embedded. Some notes:
* It triggers a "post empty" error if you just post an embedded link (no idea why :P )
* Everyone can use this
* And there is no verification of user input (dangerous). But, according to your phpBB screen above, it wasn't performed also :P
Title: Re: Screencast BBCode from PhpBB
Post by: PML100 on March 21, 2014, 09:45:33 AM
Quote from: margarett on March 20, 2014, 08:04:03 PM
Here ya go:

array(
'tag' => 'sct',
'type' => 'unparsed_content',
'content' => '<div style="text-align:center;margin:auto;padding:5px;">&nbsp;
<iframe name="tsc_player" scrolling="no" frameborder="0" type="text/html" style="overflow:hidden;" src="$1" height="400" width="640" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>',
'block_level' => true,
),


This should allow you to have your previous videos embedded. Some notes:
* It triggers a "post empty" error if you just post an embedded link (no idea why :P )
* Everyone can use this
* And there is no verification of user input (dangerous). But, according to your phpBB screen above, it wasn't performed also :P

Many thanks, works perfectly.  :)