View Single Post
  #1  
Old 01-26-2009, 07:52 PM
bigtime bigtime is offline
 
Join Date: Jun 2002
Location: Houston, Texas
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Parse BBCODE on non-VB page?

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($vbulletinfetch_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_textmysql_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"falsetruetruetruetruefalse)

    
?>
  <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>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01112 seconds
  • Memory Usage 1,810KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete