vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with BbCodeParser please. (https://vborg.vbsupport.ru/showthread.php?t=160568)

rstan 10-19-2007 08:40 AM

Help with BbCodeParser please.
 
Basicly I have a table with 2 columns. Loot and Looter, I want to use gitemstats 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.
Code:

<? $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$pagetext =  $parser->do_parse($row_something['loot'], $do_bbcode = true);
?>

Code:

  <? 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:
PHP Code:

$parser =& new vB_BbCodeParser($vbulletinfetch_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!!!


All times are GMT. The time now is 11:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01086 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete