View Full Version : vbcode
Ninth Dimension
08-18-2002, 10:51 PM
what would I need to do to make text going into a database vbcode??
i.e. i want my interactive story to have full vbcode support, so what do I need to run in order for all the nessacery checking, url converting, etc... to be preformed b4 it goes into the database.
I need the same for when it's pulled from the database and displayed.
NTLDR
08-19-2002, 12:00 PM
You want to look at the bbcodeparse() function in fuctions.php this will allow you to use vBcode on your pages.
Ninth Dimension
08-19-2002, 01:20 PM
thank you, i'll look into it :)
Ninth Dimension
08-20-2002, 04:45 PM
<font size="4">AAAAAAARRRRRRRRRRGGGGGGGGHHHHHHHHH!!!!!!</font>
This bbcode thing is giving me a major headache, I can't work out what i need to do to text before adding it to the database, or what I need to do once I've pulled it out of the databse.
Can anyone maybe save me from this major headache and give me the code that would be needed?
cheers. :bunny: <-- look, a cute bunny!!!!
NTLDR
08-20-2002, 05:04 PM
Originally posted by danielhollands
[BI can't work out what i need to do to text before adding it to the database, or what I need to do once I've pulled it out of the databse.[/B]
Nothing needs to be done before adding it to the db, if :abc: is vBcode then you put it into the db as :abc: its when you display it on the page that the vBcode needs to be parsed.
$output=bbcodeparse(a,b,c)
A: is the text with vBcode to be parsed;
B: is the forumid of the post;
C: 1 to allow smilies, 0 to disallow
(at least thats my understanding of the bbcodeparse() function)
Ninth Dimension
08-20-2002, 05:14 PM
I've just seen on another thread (here: https://vborg.vbsupport.ru/showthread.php?s=&threadid=38990&highlight=bbcodeparse) that when pulling info from the database, and you know how you want it displayed, you can bypass bbcodeparse and skip directly to bbcodeparse2 :)
I think that as long as I use addslashes() when inputting text, and htmlspecialchars() if viewing the text in a text box, then I should be OK.
but please, someone correct me if I'm wrong.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.