miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Master Class
/
Pure HTML in posts?..
Anonymous
Guest
#1
|
Posted: 9 Mar 2005 13:47
Hello
I installed your board and must say I'm impressed! But there is one problem. When I use simple html it isn't converted to BBcode automaticly. My users do those quizzilla things and they just post their results but those come out as pure HTML. Now, I've seen the function deCodeBB(string) so can't I use that to automate the HTML to BB? And where should I put it? I know some php, but this is a bit too much for me...
Team
#2
|
Posted: 9 Mar 2005 13:54
We are using only BB codes for processing HTML results.
However, you can edit bb_codes.php functions and create some new replacements which will automate direct HTML processing.
Example:
$pattern[]="/<b>(.+?)<\/b>/s";
$replacement[]='<b>\\1</b>';
will enable <b></b> code.
Anonymous
Guest
#3
|
Posted: 9 Mar 2005 14:59
I put that code in the deCodeBB() function but it still doesn't work when I use <b>blah</b>
Could it be that the text isn't processed? Could it be that it has something to do with the smilie2 plugin I installed?
Team
#4
|
Posted: 9 Mar 2005 15:04
You should put it in
enCodeBB()
. deCodeBB() is used for DEcoding - when editing the message. But for HTML tags, I think, it is not necessary to put something here.
Anonymous
Guest
#5
|
Posted: 9 Mar 2005 15:58
Hmm, putting your code in the enCodeBB() function worked, I even made a br variant. I'm still having troubles with the a tag and the img tag... I never used regex before so I guess I'll have to try and try...
Thank you for your help!
Team
Guest
#6
|
Posted: 9 Mar 2005 16:07
You don't need to make <br> variant, since all newlines (pressed by "Enter") are automatically converted to <br>.
As about <IMG> tag - in default version, it's much better to use BB code. Because, in general, <img> requries border, alt attributes and it is really hard for usual users.
Anonymous
Guest
#7
|
Posted: 9 Mar 2005 16:18
Yes, I know that, but the users are just taking those tests and putting the code in the message. It's that code that contains the html tags, like <br> and <img>. And they don't know all that BB code, they just want to copy/paste...
Here is an example of that code:
<img src="http://someserver.com/blah.gif" border="0" alt="text"><br>somemoretext.
<br><br><a href="http://someserver.com/"> <font size="-1">againsometext</font></a><BR> <font size="-3">some <a href="http://someserver.com">link</a></font>
So all the normal html tags have to be replaced and that's what I'm trying to do now...
Team
#8
|
Posted: 9 Mar 2005 16:24
The main difficulty is that user can enter this information different way. For example:
<img src="http://someserver.com/blah.gif" border="0" alt="text">
<img src="http://someserver.com/blah.gif" border="0">
<img border=0 src="http://someserver.com/blah.gif">
<img src="http://someserver.com/blah.gif" alt="text" border=0>
<img src="http://someserver.com/blah.gif" alt = "text" border = "0">
etc. is the same code for an image, but not the same for the processing script. Probably, you need to handle not the code itself, but just check for opening and closing HTML tags.
Anonymous
Guest
#9
|
Posted: 9 Mar 2005 16:33
Yes, I know, but I saw all the code I posted earlier has the same layout, even if it are diffrent tests. So my guess was to put those specific codes in it and it should work for every test.
I tried replacing a regular <img src="blah"> tag with the correct BB code with this in the enCodeBB() :
$pattern[]="/<img src=\"(.+?)\">/s";
$replacement[]="[img]\\1[/img]";
It won't work though and frankly I don't have any idea what I'm doing/should do with that regex code...
I'm going to read some regex tutorials... Guess I'll need that.
miniBB Support Forums
/
Master Class
/ Pure HTML in posts?..
↑
Top
Your Reply
Short link for this topic:
?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, make sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
The Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Features
Requirements
Demo
Download
Showcase
Gallery of Arts
Compiler
Premium Extensions
Premium Support
License
Contacts
Check-up your forums instantly without missing any new posting
using the
Forums Checker add-on
!