Forums

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

You are not logged in.

#1 2013-03-03 19:11:31

cyberman
Member
From: Germany
Registered: 2010-01-11
Posts: 233
Website

The parser and HTML input

For a special use I want to use a WYSIWYG editor for text areas.

What have I to do so the parser lets pass all html without any modification?

Can I get some RegEx help, pls?

Offline

#2 2013-03-06 08:16:16

cyberman
Member
From: Germany
Registered: 2010-01-11
Posts: 233
Website

Re: The parser and HTML input

Come on guys - this topic was readed 33 times now and no idea?

Other ideas to use a WYSIWYG Editor? An empty parser.php file?

Offline

#3 2013-03-06 08:26:07

Studio384
Developer
From: Belgium
Registered: 2012-04-11
Posts: 641
Website

Re: The parser and HTML input

Well, it's hard to change the way FluxBB works without changing something. I think you should take a look at the Resources page on the site and try to find there a WYSIWYG editor.


FluxBB Community Benelux - ModernBB 3.4
Profile Plus: A new FluxBB profile interface

Offline

#4 2013-03-16 01:00:06

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,848
Website

Re: The parser and HTML input

Sorry for the late reply, I forgot about this topic.

Basically, you have to make sure the posts are not preparsed when submitting them, and not actually parsing the BBCode when displaying them. Basically, search for occurrences of the preparse_bbcode() and parse_message() functions.

Be careful, though - you should filter the contents for things like JavaScript tags!


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#5 2013-03-20 01:09:03

fungku
Member
Registered: 2013-03-19
Posts: 44
Website

Re: The parser and HTML input

I'm trying to add ckeditor right now and running into this issue.

Currently, I am just inserting these 2 script tag sets around the textarea in post.php  (edit.php is next, when I get this working.

<script src="ckeditor/ckeditor.js"></script>
<textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($orig_message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>
<script>
    CKEDITOR.replace( 'req_message' );
</script>

However when the message is posted it shows up with the html tags showing in the posts...

There must be a way to make the parser allow just certain tags like: <p>, <span>, <em>, <blockquote>, <h1>, etc..., right?

I'd also still like posters to have the ability to use bbcode since people are so used to using it now.

Last edited by fungku (2013-03-20 01:28:29)


Canadian Lumberjack

Offline

#6 2013-03-20 03:40:50

fungku
Member
Registered: 2013-03-19
Posts: 44
Website

Re: The parser and HTML input

Just found out ckeditor has a bbcode plugin.

However, I'm working with SCEditor at the moment, as it seems a little "lighter" than ckeditor and also has a BBCode version.

It hides the textarea and uses an iframe with the buttons, but I can't figure out how to make it populate the original textarea with the stuff I'm writing sad


edit: Got it all figured out big_smile   I'm recording any changes I needed to make in order to get it to work, so maybe I can make a mod out of it?

Here are the parts of the files I changed to make this work. You can see what file by the comments: http://paste.laravel.com/kUl

Last edited by fungku (2013-03-20 08:32:23)


Canadian Lumberjack

Offline

#7 2013-03-20 23:52:56

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,848
Website

Re: The parser and HTML input

Glad you got it working!

A mod would be awesome indeed. big_smile


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#8 2013-03-21 02:48:53

cyberman
Member
From: Germany
Registered: 2010-01-11
Posts: 233
Website

Re: The parser and HTML input

+1

Offline

#9 2013-03-25 02:39:35

fungku
Member
Registered: 2013-03-19
Posts: 44
Website

Re: The parser and HTML input

So, is this the standard way of making a mod?

Have folder including any required files to be uploaded and include a readme.txt in this format?

I am new to fluxbb and have never installed a mod before.

Last edited by fungku (2013-03-25 02:40:11)


Canadian Lumberjack

Offline

#10 2013-03-25 02:48:10

quy
Developer
From: California
Registered: 2008-05-09
Posts: 847

Re: The parser and HTML input

Please check out our modifications page and download the FluxBB MDK.

Offline

#11 2013-03-25 02:56:53

fungku
Member
Registered: 2013-03-19
Posts: 44
Website

Re: The parser and HTML input

Thanks.

Also, one more quick question open to anyone. I removed the onsubmit attributes of the <form> tags to put them as part of the js script in the header (otherwise they over-ride any of my submit handlers).

I never really looked at it, but now taking a closer look at it, isn't

this.submit.disabled = true;
if ( process_form(this) ) {
    return true;
}
else {
    this.submit.disabled = false;
    return false;
}

have the same functionality as

return process_form(this);

  o_O??

Last edited by fungku (2013-03-25 03:00:27)


Canadian Lumberjack

Offline

#12 2013-03-25 09:03:15

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,848
Website

Re: The parser and HTML input

Apart from disabling the submit button, yes.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#13 2013-03-25 16:00:40

fungku
Member
Registered: 2013-03-19
Posts: 44
Website

Re: The parser and HTML input

It is located in submit handler. So it will also disable the submit button.

e.g. submit button disabled

$(#submit-button).submit(function() {
    return false;
});

Last edited by fungku (2013-03-25 16:01:23)


Canadian Lumberjack

Offline

#14 2013-03-26 10:07:11

Jack
Member
Registered: 2010-12-24
Posts: 458
Website

Re: The parser and HTML input

a little post just to support this modification, very interesting wink

J


Sorry I don't speak English smile
FluxBB Italy

Offline

Board footer

Powered by FluxBB 1.5.6