Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 12-19-2004, 04:52 PM
Lancelow Dowell Lancelow Dowell is offline
 
Join Date: Aug 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 12-19-2004, 04:59 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to define the constant TABLE_PREFIX, which (I believe) is in config.php.
Reply With Quote
  #3  
Old 12-19-2004, 05:06 PM
Lancelow Dowell Lancelow Dowell is offline
 
Join Date: Aug 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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....
Reply With Quote
  #4  
Old 12-19-2004, 05:51 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 12-20-2004, 07:23 PM
Lancelow Dowell Lancelow Dowell is offline
 
Join Date: Aug 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm, ok... so what do I need to do to get this working then? Thanks for the help!
Reply With Quote
  #6  
Old 12-21-2004, 02:15 AM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

define('TABLE_PREFIX', $tableprefix);
Reply With Quote
  #7  
Old 12-21-2004, 06:51 PM
Lancelow Dowell Lancelow Dowell is offline
 
Join Date: Aug 2003
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08295 seconds
  • Memory Usage 2,231KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete