Hi,
Using 3.8 and trying to parse bbcode on a non-vb page at
http://www.defend.net/activetopic-new.php
Could someone please let me know how to correct this code so that the bbcode will be parsed? I've already searched and read and tried some things but couldn't get it working.
PHP Code:
<?php
$cwd = getcwd();
chdir('./deluxeforums');
require_once('./global.php');
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$num_active = 5;
$num_topicchars = 110;
$db=mysql_connect("localhost","user","pass");
mysql_select_db("database");
$querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active";
$resultlatest = mysql_query($querylatest,$db);
?>
<table width="100%" align="center" cellpadding="2" cellspacing="0">
<?php
while ($latest_array = mysql_fetch_array($resultlatest)) {
// Get Forum Infomation
$query_forum = "select * from forum where forumid='$latest_array[forumid]'";
$result_forum = mysql_query($query_forum,$db);
$forum_info_array = mysql_fetch_array($result_forum);
// split the date up a bit
$datestr1 = substr($latest_array["dateline"],0,10);
$datetime = substr($latest_array["dateline"],11,8);
?>
<tr>
<td align="left"><b class="rightTxt1"><?php echo $forum_info_array["title"]; ?>:<br />
<?php echo $latest_array["title"]; ?></b></td>
</tr>
<?php
$querythread="select * from post where threadid='$latest_array[threadid]' order by dateline desc limit 1";
$result_thread_text= mysql_query($querythread,$db);
$result_thread_array = mysql_fetch_array($result_thread_text);
$pagetext = substr(strip_tags($result_thread_array[pagetext]),0,$num_topicchars);
$pagetext = $bbcode_parser->do_parse("$pagetext", false, true, true, true, true, false)
?>
<tr>
<td width="100%"><p align="left" class="rightTxt1"><img src="/deluxeforums/images/statusicon/forum_new.gif" alt="New Forum Post" /> <?php echo "$pagetext"; ?>... <a href="/deluxeforums/showthread.php?threadid=<?php echo "$latest_array[threadid]"; ?>">(more)</a></p>
<p align="left" class="rightTxt1">Started By: <?php echo "$latest_array[postusername]"; ?> <br />
Last Post By: <?php echo "$latest_array[lastposter]"; ?> </p>
<hr align="center" width="80%" /></td>
</tr>
<?php
}
?>
</table>