PDA

View Full Version : New Posting Features - Flash BBCode with size option


Dustin_a31
09-25-2008, 10:00 PM
I've been looking for a way to get flash embedded for awhile now with the option to enter in the width and height. after getting nowhere (searched alot) and turning up nothing I started looking at the code and realized that the {param} area or option area can be inside the actual url to the file itself. by putting the paramater field into the embeds parameter field you can not only increase the width and hight but set it however you want. autoplay or quality, etc.

I realize that this may be a security risk so it would be a good idea to restrict it to a certain usergroup who can use it that you trust or disable it and not use it completely. This can be only done in 3.6.8 via this mod: https://vborg.vbsupport.ru/showthread.php?t=122942&page=13 but as of right now it looks like 3.7.3 doesn't work with it. although some users do report being able to make it work in that thread with 3.7.x but I will not support this as it is not my code and its for an older version of vbulletin. I thought that since alot of people seem to be looking for this that it might be useful to some. Enjoy but use at your own risk.

If there was another mod similar I am sorry. please let me know and I will react accordingly.

Edit: changed the param and option tags around so that the url to the file would be the inbetween lines and the flash options (width, height, etc) would be the options. This makes more sense from a coding point of view to me and the users as well. as most vb code usually had the link to the actual media in the middle of the tags.

Name:
Flash embedding with size options

Description
Adds flash BBcode with ability to add resizing option

Options
Width and Height go into options area

Install time: 1 min
Install level: Easy

Installation
Step 1: Open bbcode manager and add this following bbcode:

Name: Flash

Tag: flash

Replacement:



<object><embed src="{param}" {option} allowScriptAccess ="never" type="application/x-shockwave-flash"></embed></object>


Example: http://www.somesite.com/flashfile.swf

Description: Flash video to embed

Use Option: Yes

Button image: http://www.videogamedc.org/forum/images/misc/flash.gif



Change Log

1.0.2 - added allowScriptAccess = "never" to code to limit the scripting from the flash objects a little. not perfect but a step in the right direction. flash still works. only scripts cannot be executed on updated flash players in most browsers.
1.0.1 - reversed option and parameter tag to give more bbcode style look

Copyright
None. Go nuts.

beduino
09-26-2008, 02:44 AM
Thanks Dustin!
Where is the button?
all the best
beduino

Dustin_a31
09-26-2008, 03:38 AM
Thanks Dustin!
Where is the button?
all the best
beduino
Added and you're welcome!

TonySkullz
09-26-2008, 03:56 AM
I used the same method for embedding DivX videos. One problem with it though, that if a thread is started with that bbcode, the thread's preview text will be the width and height info between the tags.

Dustin_a31
09-26-2008, 04:03 AM
This is true, I'm sure there must be some way around that but as right now in my forum it's not that big of a deal. But I will see if I can come up with a solution of sorts.

Also the option and parameters fields can be switched around in the replacement box. so if you like the options can be width = and height = and the param will be the link to the media, with the media link showing in the preview. as for showing something completely different i'm not sure about that.

you know what... I think I will change the params and option around it doesnt look right the way it is.

baghdad4ever
09-26-2008, 08:07 AM
thanks

reserved

baghdad4ever
09-26-2008, 08:31 AM
i try it now

how to choose width and hight??

because there is no such option appear to me

siddal
09-26-2008, 12:10 PM
edit BBcodes:
Use {option} click on "yes"

When you then need to import a flash file to a thread you?ll see the javascript dialogue asking you to enter your options which you?ll enter like this:
width=600 height=400
click OK

and then enter the URL of your file like this:
http:www.anysite.com/anyoldflash.swf

Should do it, I reckon.

SEOvB
09-26-2008, 01:06 PM
you do realize the major security issues you've opened up for not only you and your forums, but also your members by allowing anyone to post flash videos right?

Dustin_a31
09-26-2008, 01:31 PM
you do realize the major security issues you've opened up for not only you and your forums, but also your members by allowing anyone to post flash videos right?

yes. in fact I have stated that issue specifically in the originol post. I didn't say it was for everyone. Just for the few who would be looking for this if they need it in some way. limit the tag to certain usergroups or don't use it at all. If you are willing to take the risk then so be it. If not don't bother.

apiasto
09-26-2008, 02:34 PM
how can we limit to certain groups?

Dustin_a31
09-26-2008, 02:58 PM
how can we limit to certain groups?

Sorry about that I originally assumed that this was supported in 3.7.3 turns out it's not, details in original post. As of right now. the choice is yours.

baghdad4ever
09-26-2008, 05:35 PM
edit BBcodes:
Use {option} click on "yes"

When you then need to import a flash file to a thread you?ll see the javascript dialogue asking you to enter your options which you?ll enter like this:
width=600 height=400
click OK

and then enter the URL of your file like this:
http:www.anysite.com/anyoldflash.swf

Should do it, I reckon.


hi

i do exactly what is found in installation instruction

but there is no asking for width and hight

and the url like this pic

in attach






can you help please?

siddal
09-26-2008, 06:36 PM
look at post 8 :

http:www.anysite.com/anyoldflash.swf

Dustin_a31
09-26-2008, 07:25 PM
hi

i do exactly what is found in installation instruction

but there is no asking for width and hight

and the url like this pic

in attach






can you help please?

Hi. you seem to be using the older code. use the new replacement and follow those instructions. then in order to have the flash file show correctly follow the screen shots. the first screen shot is what you should see after you click the flash Icon in the WYSIWYG. After that you need to put the path to the actual flash file inbetween the brackets, Like a URL tag. then it should work.

baghdad4ever
09-27-2008, 05:41 PM
thank you very mutch

is there any chance to modify it.

because most user prefer to input only numbers

ie: the popup ask what is the width and we put numbers and press ok

then another popup ask about hight

it is more easy

thanks

puansanid
09-28-2008, 06:09 PM
thanks

REVHEAD
10-18-2008, 10:31 PM
I installed this mod, was trying to embed a purepwnage movie it would come up under preview but when I post it would not have the movie in there?

I had a mess around with it trying and trying then my forums went funny, and I had to log out and back in, now for some reason no bb code works, URL, PHP,Bold, Italic, Smilies nothing .

Any ideas?

Turbe
01-12-2009, 07:31 PM
What about forcing this to use a local directory on the server for the flash files (force it to use a specific directory for the flash sources)?

Obviously, a directory that only an Admin could place/upload/write the files.

Then, you wouldn't have to worry about locking down this custom bb code with another mod (that doesn't work on 3.7x)



So, instead of:
http://www.somesite.com/flashfile.swf
(The above link would never work because the local path would be added...)

it could be:
flashfile.swf

Just the file name...

I'm not sure how this could be configured in the Customer BB Code in the Admin CP....:confused:

Anyone?????

Turbe
01-12-2009, 08:08 PM
Ok, I think I got it...

This works

Custom BB Code:
<object><embed src="http://www.yoursite.com/flash/{param}" {option} allowScriptAccess ="never" type="application/x-shockwave-flash"></embed></object>
(All flash files placed under HTMLroot/Flash)

In post:
header_tv[1].swf

Am I missing something here... wouldn't this be secure (only allowing this custom BB Code to use flash files at a specific location)?

lostgirl815
06-19-2009, 01:05 AM
If I can ask a stupid question... is it a security risk if it's your own flash game?