How is the flash bbcode suppose to work?

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
CyberMartyr
Registered User
Posts: 9
Joined: Fri Oct 07, 2005 2:25 pm
Location: Bellwood, IL. Favorite Band: Fear Factory
Contact:

Re: How is the flash bbcode suppose to work?

Post by CyberMartyr »

I have the latest CVS and I still can't figure out how to form the flash tags.
Gumfuzi
Registered User
Posts: 232
Joined: Wed Apr 26, 2006 7:04 pm

Re: How is the flash bbcode suppose to work?

Post by Gumfuzi »

I tested it this way:

Code: Select all

[flash=300,400]http://www.domain.com/test.swf[/flash]
1. write link
2. set flash-tag
3. write dimensions after the "="

Then I got a Link in the Post, shown as "[ flash ]" and linked to the URL

If I turn on to see flash in postings (via UCP - preferences - viewing posts) nothing at all will be displayed.

Maybe there are more parameter missing?
ElbertF
Registered User
Posts: 583
Joined: Fri Dec 03, 2004 4:35 pm
Location: tracing..
Contact:

Re: How is the flash bbcode suppose to work?

Post by ElbertF »

I don't thinks so, here's the regex:

Code: Select all

'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#'
Yoda_IRC
Registered User
Posts: 158
Joined: Tue Mar 01, 2005 10:19 pm

Re: How is the flash bbcode suppose to work?

Post by Yoda_IRC »

spambot wrote:

Code: Select all

(.*?)
This look odd to anyone else?
Unfortunatly there are a number of differant Regex formats, but in my understanding:
. = any charcter
* = any number of the previous item
? = 0 or 1 of the previous set
so .* means any number of any characters (including 0)
so what would be the point of optionally having that? nothing would match that rule anyway wouldn't it?

Anyone know why its done like that? Or is there something about PHP's regex that behaves differantly to how I think regex behaves?
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: How is the flash bbcode suppose to work?

Post by naderman »

The ? in .*? makes the .* ungreedy else it would eat the [/flash] part and the pattern wouldn't match anything.
http://de.php.net/manual/en/reference.pcre.pattern.syntax.php wrote: By default, the quantifiers are "greedy", that is, they match as much as possible (up to the maximum number of permitted times), without causing the rest of the pattern to fail. The classic example of where this gives problems is in trying to match comments in C programs. These appear between the sequences /* and */ and within the sequence, individual * and / characters may appear. An attempt to match C comments by applying the pattern /\*.*\*/ to the string /* first comment */ not comment /* second comment */ fails, because it matches the entire string due to the greediness of the .* item.

However, if a quantifier is followed by a question mark, then it ceases to be greedy, and instead matches the minimum number of times possible, so the pattern /\*.*?\*/ does the right thing with the C comments. The meaning of the various quantifiers is not otherwise changed, just the preferred number of matches. Do not confuse this use of question mark with its use as a quantifier in its own right. Because it has two uses, it can sometimes appear doubled, as in \d??\d which matches one digit by preference, but can match two if that is the only way the rest of the pattern matches.

If the PCRE_UNGREEDY option is set (an option which is not available in Perl) then the quantifiers are not greedy by default, but individual ones can be made greedy by following them with a question mark. In other words, it inverts the default behaviour.
ElbertF
Registered User
Posts: 583
Joined: Fri Dec 03, 2004 4:35 pm
Location: tracing..
Contact:

Re: How is the flash bbcode suppose to work?

Post by ElbertF »

With ?:

[flash=x,x]url[/flash]
[flash=x,x]url[/flash]

Without ?:

[flash=x,x]url[/flash]
[flash=x,x]url
[/flash]

Bold text is the match..
Gumfuzi
Registered User
Posts: 232
Joined: Wed Apr 26, 2006 7:04 pm

Re: How is the flash bbcode suppose to work?

Post by Gumfuzi »

mmmh, so how i can display a flash file http://www.domain.com/file.swf" target="_blank direct into a posting?
ElbertF
Registered User
Posts: 583
Joined: Fri Dec 03, 2004 4:35 pm
Location: tracing..
Contact:

Re: How is the flash bbcode suppose to work?

Post by ElbertF »

It doesn't work.

Code: Select all

[flash=200,300]http://adventonegraphics.com/flash/BigRedButton.swf[/flash]
Test:

---

---

The code seems to be parsed, but the result is just empty space. This bug has been reported a while ago.
Gumfuzi
Registered User
Posts: 232
Joined: Wed Apr 26, 2006 7:04 pm

Re: How is the flash bbcode suppose to work?

Post by Gumfuzi »

ok, many thanks for your info!
User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: How is the flash bbcode suppose to work?

Post by Highway of Life »

This is interesting, as a Registered Member, where you post the flash, it shows nothing... zilch!
But as a guest, you get to see this:
Attachments
Flash
Flash
flash.gif (6.55 KiB) Viewed 5916 times
Image
Post Reply