Log in

View Full Version : Including vb3 navbar outside of vb3


lem
05-30-2005, 07:28 PM
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
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 (http://www.pineappletechnologies.com)

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
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
<?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...

$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
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...

{
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
Am I supposed to replace "external_articles" with something else?

Yes, it s/b your new php module's name.

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?