Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 05-30-2005, 07:28 PM
lem's Avatar
lem lem is offline
 
Join Date: May 2005
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Including vb3 navbar outside of vb3

Hello,

I am trying to include my VB3 navigation bar in my articles program(which is obviously outside of my forum). How do I do this?


Here is what I have tried so far. I have included this php file into my articles program's template. This file is located in my root directory.


PHP Code:

<?php
chdir
("/home/truckent/public_html/forums/");

require( 
'./global.php' );

eval( 
"dooutput( \"" gettemplate'navbar2' ) . "\" );" );

?>
But I keep getting this error:
Fatal error: Call to undefined function: query_first() in /home/truckent/public_html/forums/includes/functions.php on line 938

If you look at www.truckimprovement.com/articles/ you might see what I"m trying to do.

The Articles program I am using is Lore by Pineapple Technologies

Thank you for your help,


Lem
Reply With Quote
  #2  
Old 05-30-2005, 07:40 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dooutput() and gettemplate() do not exist in vB3.
You might be looking for print_output() and fetch_template(), furthermore you will most likely need construct_navbits().
Reply With Quote
  #3  
Old 05-30-2005, 08:19 PM
lem's Avatar
lem lem is offline
 
Join Date: May 2005
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So, that is code for vbulletin 2?

How would I put together the code that you suggest? The above code I gathered from other threads.

Thanks for your reply,

Lem
Reply With Quote
  #4  
Old 05-30-2005, 08:27 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php
define
('THIS_SCRIPT''external_articles');
define('NO_REGISTER_GLOBALS'1);

$specialtemplates  = array();
$globaltemplates = array();
$actiontemplates = array();
$phrasegroups = array();

chdir('/path/to/forum');

require_once(
'./global.php');

$navbits = array();
$navbits construct_navbits($array);

eval(
'print_output("' fetch_template('navbar') . '");');
?>
... if this is what you want.
But keep in mind that navbar is not a complete HTML Document.
Reply With Quote
  #5  
Old 05-30-2005, 09:25 PM
PanelCrafters PanelCrafters is offline
 
Join Date: Mar 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
PHP Code:
<?php
define
('THIS_SCRIPT''external_articles');
define('NO_REGISTER_GLOBALS'1);

$specialtemplates  = array();
$globaltemplates = array();
$actiontemplates = array();
$phrasegroups = array();

chdir('/path/to/forum');

require_once(
'./global.php');

$navbits = array();
$navbits construct_navbits($array);

eval(
'print_output("' fetch_template('navbar') . '");');
?>
Under 'require_once' here's what I did, and it works like a champ. Note the addition of the module name, so it shows up in the Navbar...
Quote:
$navbits = array();
$navbits[$parent] = 'Info_Request';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
......
eval('print_output("' . fetch_template('info_request') . '");');
exit();
And inside the 'info_request' template, $navbar is used.

HTH,
....jc
Reply With Quote
  #6  
Old 05-30-2005, 10:34 PM
lem's Avatar
lem lem is offline
 
Join Date: May 2005
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Guys,
Thank you soo much for trying to help me. Here is what I put...
PHP Code:
<?php
define
('THIS_SCRIPT''external_articles');
define('NO_REGISTER_GLOBALS'1);

$specialtemplates  = array();
$globaltemplates = array();
$actiontemplates = array();
$phrasegroups = array();

chdir('/home/truckent/public_html/forums');

require_once(
'./global.php');

$navbits = array();
$navbits construct_navbits($array);

eval(
'print_output("' fetch_template('navbar2') . '");');
?>
And I'm still getting this error...

Fatal error: Call to undefined function: query_first() in /home/truckent/public_html/forums/includes/functions.php on line 938

The Navigation bar I am trying to put in there is a custom template if that makes any difference.

Am I supposed to replace "external_articles" with something else?

PanelCrafters,
I'm not sure I understand, am I supposed to create a module? What is info_request?

Thanks,

Lem
Reply With Quote
  #7  
Old 05-30-2005, 10:40 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you post lines 930-940 of your functions.php?
Reply With Quote
  #8  
Old 05-30-2005, 10:46 PM
lem's Avatar
lem lem is offline
 
Join Date: May 2005
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is lines 929-940...
PHP Code:
    {
        return 
$usercache["$userid"];
    }

    
// no cache available - query the user
    
if (!isset($vbphrase))
    {
        
$DB_site->reporterror 0;
    }
    
$user $DB_site->query_first("
        SELECT " 
.
        
iif(($option 16), ' administrator.*, ') . 
Thanks!

Lem
Reply With Quote
  #9  
Old 05-30-2005, 10:48 PM
PanelCrafters PanelCrafters is offline
 
Join Date: Mar 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Am I supposed to replace "external_articles" with something else?
Yes, it s/b your new php module's name.

Quote:
I'm not sure I understand, am I supposed to create a module? What is info_request?
There is probably more than 1 way to add to vB, but I created a new template, and it's named: info_request. My PHP file is also named: info_request.
....jc
Reply With Quote
  #10  
Old 05-30-2005, 10:54 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, where did you incorporate this?
Maybe the other script uses the same variable name for it's DB class?
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 07:09 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.06336 seconds
  • Memory Usage 2,265KB
  • Queries Executed 11 (?)
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
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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