PDA

View Full Version : Help with BbCodeParser please.


rstan
10-19-2007, 08:40 AM
Basicly I have a table with 2 columns. Loot and Looter, I want to use gitemstats (https://vborg.vbsupport.ru/showthread.php?t=141177) on the loot column on a non vpage and display the tooltips. The item bbcode is working fine in my forums.

Ive got the BbCodeParser working on a non vb page. I cant figure out how to apply it to a loop tho, it gives the first record in the result and stops. <? $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$pagetext = $parser->do_parse($row_something['loot'], $do_bbcode = true);
?>

<? do { ?>
<tr>
<td><? echo $pagetext ?></td>
<td><? echo $row_something['looter']; ?></td>
</tr>
<? } while ($row_something = mysql_fetch_assoc($something2)); ?>

Ive searched all over and tried a bunch of differnt things but Im getting nowhere slowly. I dont think Im going in the right direction. Can someone help me out please?

Opserty
10-19-2007, 09:34 AM
Try something along the lines of:

$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
while ($row_something = mysql_fetch_assoc($something2))
{
$pagetext = $parser->do_parse($row_something['loot'], true);
echo
'<tr>
<td>'. $pagetext .'</td>
<td>'. $row_something['looter'] .'</td>
</tr>';
unset($pagetext);
}

rstan
10-20-2007, 01:20 AM
excellent! thanks so much! its skipping the first record tho, from google'n i think i need an if in there somewhere?

edit: nevermind, i was calling $row_something = mysql_fetch_assoc($something2)) earlier up in the page...took it out and woot!

Thanks again Opserty!!!