PDA

View Full Version : Parse bbcode


2shae
07-12-2007, 12:03 PM
Currently i use this code to extract posts from the forum db to place into a news page located in the forum directory
$result2 = mysql_query('SELECT * FROM `post` WHERE `postid` = "'.$row{"firstpostid"}.'" ');
while ($row2 = mysql_fetch_array($result2,MYSQL_ASSOC)) {
$i = $i.'<tr>
<td class="tcat">'.$row{"title"}.'</td>
</tr>
<tr>
<td class="alt1">'.$row2{"pagetext"}.'</td>
</tr>';

}
My question is though is their anyway to use the bbcode php file to parse the bbcodes that appear on this news page?
The news page is located at http://teentribes.com/forum/con.php?do=site

Sorry, i actually managed to find a piece of code after searching through loads of pages.
https://vborg.vbsupport.ru/showthread.php?t=149872&highlight=parse+bbcode+outside+forum
This should help anyone else who needs it, it works very well.

EnIgMa1234
07-12-2007, 12:48 PM
Incluse this in your file
require_once('./includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$variable = $parser->do_parse($variable,1, 1, 1, 1, 1);