Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 Re: Core development » New parser » 2011-12-07 19:05:22

ridgerunner
jejeje wrote:

... i only was after highlighting the codebox ...

Adding syntax highlighting was one of the motivating reasons behind the new parser!

Unfortunately, the highlighting script I chose (SyntaxHighlighter - one of the most popular on the net), has at least one major problem. I wrote an article detailing a fix here: Fixing the SyntaxHighlighter 3.0.83 Parser Bug (the new parser code version of the script implements this fix). Unfortunately, it appears that this script is no longer being developed.

In hindsight, (and after reviewing numerous other script options), I would implement a much simpler and quicker highlighting script along the lines of this one: McLexer an McHighlight: Lexical analyzers and syntax-highlighters in JavaScript

Note also that SyntaxHighlighter is not deeply embedded into the code of the new parser - it would be a trivial matter to replace it with an alternative script (or remove it altogether).

#2 Re: Core development » New parser » 2011-12-05 21:53:01

ridgerunner
jejeje wrote:

No you missed my point im going to compare both fluxbb code and your modded code (each file) and add them manually to my php files, it will take time but this method will allow me to read your modifications and try to understand a little bit about it.

Theoretically it should work, right ?

And surely its much better if your release a mod about it, i think anyone up here will be interested in it.

My parser.php file is a complete re-write from scratch and has very little resemblance to the original. You'll want to study each file separately on their own (a diff between them will look like pure gobblety-gook!). Also, pay close attention to the new bbcd_source.php and bbcd_readme.txt files. These contain the key to understanding how the BBCode-to-HTML translations are done from an administration point of view.

Be aware that understanding how the parser works under the hood requires a pretty deep knowledge of regular expressions. The parser applies a rather complex recursive regex in a recursive manner, and processes nested tags from the outside-in. Note also that this technique goes completely against what most computer scientists would recommend, i.e. "Don't use regex to parse BBCode". They may be right, but I absolutely love working with regex and thoroughly enjoyed putting this thing together. Its works pretty darn good too.

Sheez, now you guys have gone and pointed my old OCD brain back into this thing... D'oh!

#3 Re: Core development » New parser » 2011-12-05 05:01:59

ridgerunner
jejeje wrote:

Hello ridgerunner, im interested on using your new parser on 1.4.7 fluxbb, i've visited github and downloaded the files that contained a message"New Parser Code. [ridgerunner]" the only that thing im not sure is with this file db_update.php can i just remove all other functions and keep the one that says new parser and then run this file ?

Or there is another safe way that i can use your new parser. If you can release this as a mod it would perfect.

Thx.

Unfortunately, the new parser cannot be installed by simply copying some files on top of version 1.4.7. The temporary GIT repository I created was a special mirror of the FluxBB repository with one extra commit containing all the new code. At the time of my last update, Flux was at version 1.4.5. I have not updated it since (and have not been following the Flux development since). I was hoping at that time that it would simply be incorporated into the main 1.4 branch but it was not. A mod could be created but would take a bit of time to put together.

If you would like to play with the new parser, (at Flux version 1.4.5) you need to download the entire FluxBB package from the fluxbb_jmr_dev download page (click on either one of the .ZIP or .TAR.GZ buttons.) This archive contains all the necessary files.

If there were more interest, I might be convinced to create a mod.

#4 Re: General support (1.4) » [SOLVED] Error trying to install 1.4.7 - preg_replace() Compilation » 2011-12-04 19:42:10

ridgerunner
Franz wrote:

Thanks for the explanation. Care to create a ticket and fix that, Jeff? I'd appreciate it. smile

Sorry, but no. Its been a while since I've used GIT and you guys have messed with the branching since I last did a COMMIT so it would take me quite a while just to figure out how to do it without harming anything.

#5 Re: General support (1.4) » [SOLVED] Error trying to install 1.4.7 - preg_replace() Compilation » 2011-12-04 18:29:34

ridgerunner

The phpinfo page from your site shows that your host is using a recent PHP version 5.2.17 which is built with an OLD version of PCRE (Version 5.0 13-Sep-2004). This is probably the root cause of the problem. (PCRE is currently at version 8.)

I'm running an older PHP version (5.2.14) on my Win32 development box, yet it was built with a much more recent PCRE version - 8.02 2010-03-19. Your host appears to not have their act together!

As Visman correctly points out, the fix mentioned in the other thread should correct the problem:

Visman wrote:
     // Remove control characters
    $array = preg_replace('/[\x{00}-\x{08}\x{0b}-\x{0c}\x{0e}-\x{1f}]/', '', $array);

-->

     // Remove control characters
    $array = preg_replace('/[\x00-\x08\x0b-\x0c\x0e-\x1f]/', '', $array);

Another possible fix is to add the: 'u' UTF-8 mode modifier to the regex pattern like so:

     // Remove control characters
    $array = preg_replace('/[\x{00}-\x{08}\x{0b}-\x{0c}\x{0e}-\x{1f}]/u', '', $array);

PCRE versions prior to Version 6.5 (01-Feb-06), (which is what your host is running) required the 'u' UTF-8 modifier to be set in order to use the '\x{...}' syntax (with curly braces). Thus, adding the 'u' modifier should correct the problem.

IMHO, the first solution is the cleanest. The regex should have been written without the curly braces in the first place, because curly braces are only required if the hex code point value is greater than 255 (and none of the values in this regex are greater than 255).

#6 Re: Core development » New parser » 2011-04-13 19:28:03

ridgerunner
Jack wrote:

... There is no reason to put an "alt" attribute and a "title" attribute. Expecially if they are filled with the same text, it is less accessible.

J

The ALT attribute always needs to be there to be displayed when the graphic is not available. In previous versions of Flux/Pun, the URL of the image was placed in the ALT attribute. However, this is not very descriptive, so the latest version of Flux allows an attribute to be specified with the IMG BBcode tag, which is then placed in the ALT attribute of the HTML IMG tag.

When specified, my new parser also adds this to the TITLE attribute, so that this "message" is displayed as a tooltip when the user hovers the mouse over an image. This enables the creator of the post to add additional expressive metadata (i.e. deliver richer content) to the reader of the message.

I don't think that duplicating this data in both attributes makes it any less accessible. Why do you think so?

#7 Re: Core development » New parser » 2011-04-13 01:52:58

ridgerunner
quy wrote:

The parser is returning an empty value for width and height attributes which causes the image to not display properly on IE.

[img=FluxBB logo]http://fluxbb.org/forums/img/test.png[/img]

parses as:

<img src="http://fluxbb.org/forums/img/test.png" alt="FluxBB logo" title="FluxBB logo" width="" height="" />

Thanks for the bug report!
Its fixed now.

#8 Re: Core development » New parser » 2011-04-04 04:35:53

ridgerunner

Ok those (quite serious) bugs are fixed. All error messages are now passed through htmlspecialchars() before post.ph and edit.php see them so that that sort of exploit is now closed off.

Thanks again. (I really appreciate a fresh set of (highly qualified) eyes taking a cold, hard look at this code.)

#9 Re: Core development » New parser » 2011-04-04 02:58:47

ridgerunner

@Smartys - Many Thanks! This is the kind of feedback required to get it right.

#10 Re: Core development » New parser » 2011-04-03 23:07:49

ridgerunner
053+ wrote:

... variety of BBCode is nice.

And lack of variety is nice too, for people who are minimalists. This is one of the nice features of the new parser design; you can easily disable (or completely remove) any BBCodes you don't want.

p.s. I am back working on this. But, unfortunately, there are some higher priority jobs that i need to complete first. In the meantime, I would really like it if people could play around with it, try to break it, and give some more critical feedback: positive or negative.

#11 Re: General support (1.4) » Image resizer [img] » 2011-04-01 21:19:12

ridgerunner
jejeje wrote:

Solved just add this line to your css

.postmsg img { max-width: 100% }

lol it works

That is an amazingly simple and elegant solution. Well done!

#12 Re: General support (1.4) » Image resizer [img] » 2011-04-01 17:38:41

ridgerunner
jejeje wrote:

ah found it but it contains alot of changes/features could you post how to only change the the image size ?

No, this parser is an all-or-nothing proposition. I'd turn it into a mod if there were enough interest.

#14 Re: General support (1.4) » Image resizer [img] » 2011-04-01 16:15:07

ridgerunner

My new parser does this.

#15 Re: Core development » New parser » 2011-03-26 22:20:53

ridgerunner

Not sure when (or if) I'll be getting back to this...
Sorry. sad

#16 Core development » How to use the ticket system? » 2011-03-24 23:38:29

ridgerunner
Replies: 2

I am not familiar with how the ticket system works and would like some guidance. I am looking at recent repo changes to the parser using Gitk and I'd like to look at ticket #314 referenced by this commit message (from 2011-03-22):

#314: Provide a regex fallback if unicode-properties aren't enabled.

I went to the http://fluxbb.org/development/core/tickets/ page and am trying to find ticket #314. I do not see a field where I can enter a ticket number. I type 314 into the search box and "No tickets to display". I can see that active tickets have their number in the URL (e.g. http://fluxbb.org/development/core/tickets/367/ ) but substituting 314 into the url yields: "404 Not Found"  How do I search for and display a known ticket number? (It is probably closed but does that mean it can no longer be viewed?)

I am confused and a bit frustrated. This should be simple yes?

#17 Re: General discussion » Mozilla Firefox 4.0 is here! » 2011-03-24 16:00:15

ridgerunner
Franz wrote:

... Tough luck for them, though. One more big software release that was overshadowed by a new FluxBB version tongue ...

Good one! lol

So I guess its time to upgrade from FF 2 to 3!

But I'm an Opera kind 'o guy -  (I prefer their built-in dragonfly Javascript debugger over Firebug.)

#18 Re: FluxBB discussion » ajax » 2011-03-22 16:15:42

ridgerunner

Ajax can be good thing, but only if properly implemented (which is almost never done correctly). For one thing, the site should be designed to work correctly if Javascript is turned OFF. Like correctly implemented CSS, (where a website should work correctly even if the style sheets are turned off), a web site should also work perfectly if Javascript is turned off. Correct implementation of Ajax provides progressive enhancement and degrades gracefully. A term was coined by Jeremy Keith to describe this correct implementation: he calls it: "HIJAX".

I highly recommend Bulletprof Ajax by Jeremy Keith.

I'm all for adding Ajax to Flux, but only if it is done right (i.e. Hijax).

#19 Re: Modifications (1.4) » FluxDark Style 1.4.4 » 2011-03-17 17:17:22

ridgerunner

I don't see it either.

#20 Re: Feature requests » Quote origin » 2011-03-17 17:15:47

ridgerunner

My new parser does this. There is an option in the admin parser panel to turn this option on and off (defaults to ON).
smile

#21 Re: Modifications (1.4) » FluxDark Style 1.4.4 » 2011-03-16 23:15:57

ridgerunner

I only see a link to the download. How about a link to the demo site?

#22 Re: General support (1.4) » Put a html table in a post ? » 2011-03-13 22:07:37

ridgerunner
Mpok wrote:

... What about THEAD, TBODY and THs ?
If u implement TABLE, u have to do it fully. The tags above are REALLY important for accessibility.
U can't treat 'tables' as in 90's

To keep it simple, I implemented only the minimum tags required to make a valid table (TABLE, TR and TD).

However, this little TABLE exercise did allow a light bulb to go off over my head. I never liked the way any of the parsers handle LIST tags as a special case. To easily allow adding any new BBCode, the parser should be as generalized as possible with as little tag-specific code as possible. When adding the TABLE tags, I realized that there is a better way. All these HTML elements (UL, OL, TABLE, TR, THEAD, TBODY, etc) share a common attribute - all of them can only contain specific elements and must not contain any other text content. I also realized that it will be a relatively simple matter to add another property to the $bbcd to specify if the tag is allowed to contain text (in addition to the allowed_tags which is already implemented). This will allow replacing the LIST-specific code with generic code that will work for all these tags. This will allow easily adding such tags (THEAD, TBODY etc.) without having to hack inside the parser code.

So here's a big thanks out to popeur for turning on the lights!

p.s. You guys really need to check out the new parser! Sign up with the test/documentation forum and try to break it.

See: New 2011 FluxBB Parser

#23 Re: General support (1.4) » Put a html table in a post ? » 2011-03-12 00:09:45

ridgerunner

Ok. I was curious how the new parser would handle adding a TABLE tag so I've added it to the $bbcd array as an experiment (Just for you!). It works, but is sensitive to correct syntax. That is, will not automatically fix mistakes and may generate invalid markup if your syntax isn't valid. You can download the latest source code from here:
https://github.com/jmrware/fluxbb_jmr_dev

And you can try it out here:
http://jmrware.com/articles/2011/fluxbb_jmr_dev/

Note that it currently only handles TABLE, TR and TD tags and they must be correctly nested like so:

[table]
[tr][td]one[/td][td]two[/td][td]three[/td][/tr]
[tr][td]one[/td][td]two[/td][td]three[/td][/tr]
[tr][td]one[/td][td]two[/td][td]three[/td][/tr]
[tr][td]one[/td][td]two[/td][td]three[/td][/tr]
[/table]

Hope this helps!
smile

#24 Re: General support (1.4) » Put a html table in a post ? » 2011-03-07 04:56:55

ridgerunner

You'll need to wait until I release the new parser as a Mod. Or you can download the code and modify it yourself.

You can read about how to create a new BBCode for the new parser here

#25 Re: General support (1.4) » Put a html table in a post ? » 2011-03-03 19:23:42

ridgerunner

My new parser allows one to easily create any BBCode-to-HTML translations. With it you could define the necessary codes: [table], [tr] and [td]. However, you will need to correctly specify the dependencies: i.e. TR can only be inside TABLE, TD can only be inside TR, etc.

That said, I would strongly recommend against doing so!

Board footer

Powered by FluxBB 1.4.8