News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Stage6 BBC

Started by Metal_13, September 27, 2007, 05:57:41 PM

Previous topic - Next topic

Metal_13


falguni1

Hello I am confused is this a video player
can you give a live demo

means users can upload video files and watch it online with this mod ???

karlbenson

no, it means you can take a link from stage6 and embed it into your forum via special stage6 bbcode. (which is alot safer than allowing your users to embed anything via the html option [where they couldnt embed dangerous content])

So this doesnt allow uploading directly, they would need to upload to stage6 first, then use the bbcode to embed the link they get.

Paddy

I can't seem to get this to work.  Which URL do you paste between the tags?  Is it just the address bar URL?
I'd complain, but who'd listen?

Metal_13

#4
VIDEO LINK:
http://stage6.divx.com/user/funny_bunny/video/1583495/Smurfs-Director%5C's-Cut-(Funny)

ID FROM VIDEO LINK:
1583495

BBC:
[stage6=425,350] VIDEO ID HERE [/stage6]



BBC + VIDEO:
[stage6=425,350]1583495[/stage6]

Clocks

#5
I've installed the mod on 1.1.3 and when I use the [stage6] tags nothing happens.

It appears just like this:

[stage6]1234567[/stage6]

*edit*

I have fixed the main problem (I was using a non-default theme) by editing the file mv_bbc_xhtml_1.3.xml to change any reference to "$themedir/" to "$themes_dir/YOUR_THEME_DIRECTORY_NAME/" (got the idea from this post: http://www.simplemachines.org/community/index.php?topic=127053.msg1090432#msg1090432

I also had to upload the .gif to the /image/bbc folder in my new theme.

The bare bones [stage6] [/stage6] still doesn't work, however [stage6=425,350] [/stage6] does work.  I assume "425,350" is a size.


Metal_13

#6
sorry about that..it must be with sizes...i have updated the mod description

[stage6=425,350] VIDEO ID HERE [/stage6]





i think it only works on the default theme and bloc's themes
If it does not work you'll have to install it manually..

- by uploading the stage6.gif file to your CURRENT THEME/images/bbc/stage6.gif
- and by installing this


<search position="before" regexp="false" whitespace="exact">
- <![CDATA[ array(
'tag' => 'hr',
'type' => 'closed',
'content' => '<hr />',
'block_level' => true,
),

  ]]>
  </search>
- <add>
- <![CDATA[ array(
                'tag' => 'stage6',
                'type' => 'unparsed_commas_content',
                'test' => '\d+,\d+\]',
                'content' => '<object codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" height="272" width="640" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"><embed type="video/divx" src="http://video.stage6.com/$1/.divx" pluginspage="http://go.divx.com/plugin/download/" showpostplaybackad="false" custommode="Stage6" autoplay="false" width="$2" height="$3" /></object>


</a> ',
                'validate' => create_function('&$tag, &$data, $disabled', '
if (isset($disabled[\'url\']))
$tag[\'content\'] = \'$1\';'),
'disabled_content' => '<a href="$1" target="_blank">$1</a>',
),

  ]]>
  </add>
  </operation>
  </file>
- <file name="$themedir/Post.template.php" error="fatal">
- <operation error="fatal">
- <search position="before" regexp="false" whitespace="exact">
- <![CDATA[ 'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),

  ]]>
  </search>
- <add>
- <![CDATA[ 'stage6' => array('code' => 'stage6', 'before' => '[stage6=425,350]', 'after' => '[/stage6]', 'description' => $txt['stage6']),

  ]]>
  </add>
  </operation>
  </file>
- <file name="$themedir/languages/Modifications.english.php" error="fatal">
- <operation error="fatal">
  <search position="end" regexp="false" whitespace="exact" />
- <add>
- <![CDATA[ $txt['stage6'] = 'stage6 insert Number';

  ]]>
  </add>






karlbenson

Metal13,
If you don't mind I would like to give you some feedback as to your first mod and explain some of the bugs.
Since other mod'ers gave me some help and advise when I started making mods for smf (and through that it improved the quality of my mods no end).

I actually have my own stage6 mod awaiting approval and which does many of the following things. (although its by no means perfect)

Please don't be disheartened. As the list looks exhaustive.

1) The stage6.gif you have chosen is 16px x 16px.  It doesnt always position correctly in all browsers along with the other bbcode images because they have some 'transparency' around them and are actually 23px x 22px.

2) The sizes occur TWICE.

'content' => '<object codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" height="272" width="640" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"><embed type="video/divx" src="http://video.stage6.com/$1/.divx" pluginspage="http://go.divx.com/plugin/download/" showpostplaybackad="false" custommode="Stage6" autoplay="false" width="$2" height="$3" /></object>


As one set is altered by the sizes specified and the other isn't.  It could some vast differences in different browsers in the size of the object.

3) Also I believe the standard sizes/proportions are 480x640 for Stage6. The sizes added when you click the bbc button are [stage6=425,350] which if I'm not mistaken are the sizes of Youtube.  This will also impact because of the difference in proportion will result in either skewed resolution or (if the video player is clever enough, it will resize it smaller).

4) The data which you put through $1 is not validated.  It is a good (recommended) idea to check what data is there using preg_match.  Since you've only allowed the video id it is easy enough to match to check that the $1 is a number from 1-10 digits in length.
When creating mods it also has to be assumed that someone will try to expose vulnerabilties where data is not sanitized and validated.  What this means is, potentially someone can put ANYTHING between your [stage6][/stage6] and it will appear in the line.

Heres how my stage6 mod does it

'validate' => create_function('&$tag, &$data, $disabled', '
// JUST A VIDEO ID?
// JUST A VIDEO ID?
if (preg_match(\'#^([0-9]{1,11})#i\', trim($data[0]), $matches)) {
$data[0] = $matches[1];
} else {
// FULL URL/PARTIAL URL
if (preg_match(\'#/video/([0-9]{1,10})/#i\', trim($data[0]), $matches)) {
$data[0] = $matches[1];
} else {
global $txt;
$tag[\'content\'] = $txt[\'stage6_invalid\'];
}
}


5) In your mod in the mv_bbc_html_1.3.xml and package-info.xml
where you have    <id>Metal13:stage6 BBC Tag </id>
The SMF Modification Standards. ask that spaces NOT be used in the id.
Once a mod is submitted you can't change the id.  You would have to PM the customization team to get them to alter it.
Before you could reupload the mod with the new id.  But to be honest, I wouldn't worry about that for this mod.  Just for future mods ;)

It can also be useful to add a name tag although not required
eg <name>Stage6 BBC Mod</name>

---------------------------
Ok some tips
- Look at some similar modifications and maybe use them as a base/improve your understanding of smf code.
Alot of what I learnt was from looking at other mods by Grudge/Jerm/Winrules/Sleepy/Jay and others.

Now I use some of my own mods as a base eg my youtube mod was a base for my stage6 mod.

I'd recommend you have a look at SMF Modification Standards.

Apllicmz

Nice Work Translate Portuguese and brazilian

when update puty

</file>
<file name="$themedir/languages/Modifications.portuguese.php">
                <operation>
                        <search position="end"></search>
                        <add><![CDATA[
$txt['stage6'] = 'Número inserir stage6';
]]></add>
                </operation>
        </file>
<file name="$themedir/languages/Modifications.brazilian.php">
                <operation>
                        <search position="end"></search>
                        <add><![CDATA[
$txt['stage6'] = 'Número inserir stage6';
]]></add>
                </operation>
        </file>



nick09

This BBcode would not work anymore because the stage6 video site is no more.

Apllicmz




karlbenson

Yes unfortunately stage 6 is no more.

Advertisement: