vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Including vb3 navbar outside of vb3 (https://vborg.vbsupport.ru/showthread.php?t=82265)

lem 05-30-2005 07:28 PM

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

Andreas 05-30-2005 07:40 PM

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().

lem 05-30-2005 08:19 PM

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

Andreas 05-30-2005 08:27 PM

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.

PanelCrafters 05-30-2005 09:25 PM

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

lem 05-30-2005 10:34 PM

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

Andreas 05-30-2005 10:40 PM

Can you post lines 930-940 of your functions.php?

lem 05-30-2005 10:46 PM

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

PanelCrafters 05-30-2005 10:48 PM

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

Andreas 05-30-2005 10:54 PM

Hmm, where did you incorporate this?
Maybe the other script uses the same variable name for it's DB class?


All times are GMT. The time now is 01:12 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.01208 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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