vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   There you are: Flash regex for the ones that need it (https://vborg.vbsupport.ru/showthread.php?t=11503)

Mas*Mind 03-15-2001 08:08 PM

This adds a new bbcode option to include flash-files in posts

syntax:

[swf height="x" width="x"]http://domein.com/path/to/swf.swf[/swf]

Instructions (Note: The instructions in the attachment on the next post are more accurate since there seems to be a bug with \\; \\5 gets replaced by\\1)
  1. Backup admin/functions.php
  2. Open admin/functions.php
  3. after: "/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/siU",

    add:

    "/(\[)(swf)( +height=)(['\"]?)([^\"']*)(\\4)( +width=)(['\"]?)([^\"']*)(\\8)(])(.*)(\[\/swf\])/siU",
  4. after: "[ code ]\\5[ /code ]",

    NB! Note the spaces between [ code ] and [ /code ] -> They need to be removed!

    add:

    "<embed src=\"\\12\" quality=\"high\" width=\"\\9\" height=\"\\5\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>",
  5. after: "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/esiU",

    add:

    "/(\[)(swf)( +height=)(['\"]?)([^\"']*)(\\4)( +width=)(['\"]?)([^\"']*)(\\8)(])(.*)(\[\/swf\])/siU",
  6. after: "stripbrsfromcode('\\5')",

    add:

    "<embed src=\"\\12\" quality=\"high\" width=\"\\9\" height=\"\\5\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>",

That's it! Let me know if it works (didn't used it at my server)

[edit]For some strange reason \\5 gets replaced with \\1, so \\1 should be: \\5[/edit]

03-15-2001 08:36 PM

1 Attachment(s)
this get's a little complicated (strange bug \\1 gets replaced with \\5), see my attachment for valid instructions:

03-16-2001 10:01 AM

hmz....First it gets requested a couple of times and now no-one needs it?

03-16-2001 11:25 AM

I'll give it a try

03-16-2001 05:26 PM

You don't need to do that at all, you can simply create a bb code from the control panel using the {option} I've done it and it worked great!

03-16-2001 05:50 PM

yeah, I know that (I've written that utitity myself), but there is a limitation on that and that's that it doesn't accept more than 1 parameter. For this bbcode there are 2 parameters necessary: width and height..

I may rewrite the custom-bbcode thingy some day to allow this...

03-16-2001 07:17 PM

i'm trying it out right now. seems to work fine

03-17-2001 12:52 AM

Quote:

Originally posted by Mas*Mind
yeah, I know that (I've written that utitity myself), but there is a limitation on that and that's that it doesn't accept more than 1 parameter. For this bbcode there are 2 parameters necessary: width and height..

I may rewrite the custom-bbcode thingy some day to allow this...

The code I'm using accept all flash parameters, it doesn't make you use them though, you cna use only the movie src, but if you want to add any othe parameter it works as well.
I even tested with transparent backgrounds!

03-17-2001 10:30 AM

yeah, but then you probably do it like this

[swf parameters="width=50 height=10 this=dat"]swf/url[/swf]

It's a solution, but not the nicest solution..

03-18-2001 07:47 AM

actually no, the way I have set up you would use a code like this:

Code:

[swf=http://yoursite.com/yourmovie.swf wmode=transparent height=# width=# anyotherparams][/swf]
and it works fine you can also limit the parameters or have none, and display the movie on its custom size just by having this code:
Code:

[swf=http://yoursite.com/yourmovie.swf][/swf]
Here's what I have on the bb code:

vB code tag: swf

vB Code replacement:
Code:

<embed src={option} type=application/x-shockwave-flash></embed>
Code example is above ;)


All times are GMT. The time now is 08:40 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01270 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete