PDA

View Full Version : Smilie and VBB code parsing


Takara
06-05-2002, 07:19 AM
Can anyone give me a hand on how to parse smilies and VB code? What Im doing is calling a post right from the sql and outputting it elsewhere.

I am building a columns system for my site, and this is the way it works. The columnist posts a column in his or her own forum. In that forum everyone can reply to the post (but only that person can post). The persons column is then avalable without all the frills (tables and replys) on a sperate page. So I made up this php script to do it. (See Attached)

It works well and all, I still have to refine it a bit. I was able to figure out how to turn the page break ($crlf, \n etc :p) to a <p> ( $pagetext=str_replace("\n", "<p>", $row['pagetext']); ). But looking at the code everything looks so cryptic :/

Take a look at the attached file, see if you can give me a hand ^^ Oh yea, Im a sloppy coder, lol. So, dont blame me if you burn your eyes out looking at the code XD

(btw, Im not sure if this is the right spot or not. This isnt about an exisiting hack and it isnt a hack I'll be releasing. So if its in the wrong spot just let me know ^_^)

Admin
06-05-2002, 07:33 AM
Just use vBulletin's bbcodeparse2() function. :) It will parse everything.

Takara
06-05-2002, 07:48 AM
Thankies again FireFly ^_^.

Ever thought of making a FAQ in your spare time to keep idiots like me from spamming your forum? lol <^_^;;

Takara
06-05-2002, 07:53 AM
Warning: Missing argument 2 for bbcodeparse2() in /home/p0r1ng/public_html/forums/admin/functions.php on line 661

Warning: Missing argument 3 for bbcodeparse2() in /home/p0r1ng/public_html/forums/admin/functions.php on line 661

Warning: Missing argument 4 for bbcodeparse2() in /home/p0r1ng/public_html/forums/admin/functions.php on line 661

Warning: Missing argument 5 for bbcodeparse2() in /home/p0r1ng/public_html/forums/admin/functions.php on line 661

uh oh O.o Firefly, could you give me a quick howto on how to use functions like that? Im not quite sure, so what I ended up doing was $pagetext=bbcodeparse2($row['pagetext']);

But the code for the bbcodeparse2 is function bbcodeparse2($bbcode,$dohtml,$dobbimagecode,$dosmi lies,$dobbcode)

hmm. Do I even have to do the $pagetext= part? >.<

Actually, looking at it, it looks like I have to do
bbcodeparse2($row['pagetext'],0,1,1,1);But I would still know how to call it right ^_^

Admin
06-05-2002, 08:01 AM
$pagetext = bbcodeparse2($row['pagetext'], 0, 1, 1, 1);
:)

Takara
06-05-2002, 08:02 AM
lol, you beat me to it. Thanks again again, hehe