![]() |
hey i ned help on BBcode
hey , i wanna use bbcode on my script (textarea)
i wanna allow visitors to make text bold and add photos , things like that so how can i do that ?? i really need help on that thanks !! |
The basic process is fairly straightforward - your script just searches for the BBCode tag and replaces it with the HTML equivelent.
For example, for bold it would search for [b] and replace it with <strong>.It can get complex when you start dealing with complex BBCode (for example, Invision Board's BBCode parser comes in at just under 4,000 lines of code) but don't worry about that for now :-) Also, there is a BBCode extension which may help - PHP: BBCode - Manual Alan |
thanks im using this code but it didnt succeed =>
$t=str_replace("[b]", "<b>", $text); $text = htmlentities($tuto['message']); if($v = eregi('<' , $string)){ echo "no html cods"; } and the output i show it on another page , but it give blank page |
Here is a nice BBcode class - with documentation :)
|
ah i tried this class but i think i didnt know how to use even of the documentation
could you explain to me how to use this class i did that => require_once 'stringparser_bbcode.class.php'; and i copy everything to my folder but nothing :s |
I sent you a PM with an answer.
|
Ahh, do you mean a WYSIWYG editor?
|
Gareth, unless there's any particular reason why the answer needs to be private, I'm sure it would benefit the whole community if all answers were posted publicly. It provides a flow of conversation and an archive of information for people coming back to look at this topic in the future.
|
Quote:
|
If you want a WYSIWYG editor I would recomend using - TinyMCE Javascript Content Editor by Moxiecode Systems AB - it's fully functional with plenty of documentation and example code :-)
Alan |
Well, if you end up using simple function (or someone else need help whit it) here is one simple parser.
PHP Code:
PHP Code:
This is example text whit google link. =) |
Wow, great job marxx! I've got to try this.
|
| All times are GMT. The time now is 08:15 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0