vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Trying to use parse_bbcode2 (https://vborg.vbsupport.ru/showthread.php?t=73086)

Lancelow Dowell 12-19-2004 04:52 PM

Trying to use parse_bbcode2
 
Hi, I'm trying to parse a bit of code using the bbcode2 function. Whenever I run my code, I'm getting this error....

Database error in vBulletin :

Invalid SQL:
SELECT bbcodetag, bbcodereplacement, twoparams
FROM TABLE_PREFIXbbcode

mysql error: Table 'crucib1.TABLE_PREFIXbbcode' doesn't exist

mysql error number: 1146

Date: Sunday 19th of December 2004 11:49:31 AM
Script: http://www.bane-online.comSCRIPTPATH
Referer: REFERRER
IP Address: IPADDRESS

So my question is, why is table_prefix showing up instead of my real table prefix? Here is my code that's trying to do all of this....

PHP Code:

        require_once('/u/htdocs/crucib1/vbulletin/includes/config.php');    
    require_once(
'/u/htdocs/crucib1/vbulletin/includes/db_mysql.php');

    
$DB_site = new DB_Sql_vb;
    
    
$DB_site->appname 'vBulletin';
    
$DB_site->appshortname 'vBulletin (' VB_AREA ')';
    
$DB_site->database $dbname;
    
    
$DB_site->connect($servername$dbusername$dbpassword$usepconnect);

    require_once(
"/u/htdocs/crucib1/vbulletin/includes/functions.php");
    require_once(
"/u/htdocs/crucib1/vbulletin/includes/functions_bbcodeparse.php");

    echo 
parse_bbcode2($row["pagetext"], 000101); 

Thanks!

filburt1 12-19-2004 04:59 PM

You need to define the constant TABLE_PREFIX, which (I believe) is in config.php.

Lancelow Dowell 12-19-2004 05:06 PM

Quote:

Originally Posted by filburt1
You need to define the constant TABLE_PREFIX, which (I believe) is in config.php.

it is defined in config.php, which is included on the first line of code i posted....

Paul M 12-19-2004 05:51 PM

Quote:

Originally Posted by Lancelow Dowell
it is defined in config.php, which is included on the first line of code i posted....

Not exactly it isn't, the variable is defined in config.php - the constant is defined, using this variable, in init.php.

Lancelow Dowell 12-20-2004 07:23 PM

hmmm, ok... so what do I need to do to get this working then? Thanks for the help!

Link14716 12-21-2004 02:15 AM

define('TABLE_PREFIX', $tableprefix);

Lancelow Dowell 12-21-2004 06:51 PM

Ok, that fixed it so that it's not erroring out anymore.... but now it's not changing all the bbcode to html. It's still outputting tags, like [ b] and [ /b] instead of < b> and < /b>. You can see what it's doing at http://www.bane-online.com/new. Here's the latest version of the code...

PHP Code:

require('/u/htdocs/crucib1/vbulletin/includes/config.php');    
    require(
'/u/htdocs/crucib1/vbulletin/includes/db_mysql.php');
    
    
define('TABLE_PREFIX'$tableprefix);
    
$DB_site = new DB_Sql_vb;
    
    
$DB_site->appname 'vBulletin';
    
$DB_site->appshortname 'vBulletin (' VB_AREA ')';
    
$DB_site->database $dbname;    
        
    
$DB_site->connect($servername$dbusername$dbpassword$usepconnect);
            
    require_once(
"/u/htdocs/crucib1/vbulletin/includes/functions.php");
    require_once(
"/u/htdocs/crucib1/vbulletin/includes/functions_bbcodeparse.php");
    
    echo 
parse_bbcode2($row["pagetext"], 000101); 

'

Thanks for the help!


All times are GMT. The time now is 03:49 AM.

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.01564 seconds
  • Memory Usage 1,738KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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