Welcome Guest, Not a member yet? Register   Sign In
HTML tag to BBcode tag
#1

[eluser]Mowgli[/eluser]
Hello,

I am creating a simple blog and i decided to add some BBcode.
I used this helper which worked fine:
http://codeigniter.com/wiki/Another_BBCo...sion/3961/

But what if i want to edit the topic/message ? Is there any (already written) function i could use to convert the HTML tags into BBcode tags ? BBcode to HTML worked just fine.

Thanks in advance.

LE: i found a solution. I simply convert the BBcode to HTML code only when i echo out (instead of storing the converted version into the database). I should've thought of it earlier. Thanks anyway.
#2

[eluser]Aken[/eluser]
Nice job thinking of that! Yeah, you should definitely store the non-HTML form of the post in the database in case it needs to be updated. You can save the HTML version as well to your database if you'd like - might save your application a bit of headache and speed if you have a lot of traffic.




Theme © iAndrew 2016 - Forum software by © MyBB