vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   navbar on none vb page (https://vborg.vbsupport.ru/showthread.php?t=60957)

mossyuk 01-30-2004 11:08 AM

navbar on none vb page
 
Im not sure how hard this is to do, but the vb3 index.php doesnt seem to like me trying to hack it out. I have seen it included in vBindex so its do-able.

Im trying to create my own start page for a custom project, so this really would help me a lot! thanks

Zachery 01-30-2004 11:11 AM

Are you going to be using the vB template system or no?

mossyuk 01-30-2004 11:13 AM

Well I was hoping I could just pull that one template from the database. It is a PHP page im working on. Basically its an amalgamation of the last10threads script that was released for vB2 with hopefully the navbar on to make the entire thing consistant.

mossyuk 01-30-2004 11:24 AM

I followed a link on your signature and managed to write a little script that pulls out the navbar. However, it is missing all its colour (presuming thats to do with a style sheet problem?) and the options are a bit wonky too - ie/ the drop down quick links menu doesnt work and the links all point to the wrong places. hmmmmmmmmmm!

Zachery 01-30-2004 11:27 AM

Quote:

Originally Posted by mossyuk
I followed a link on your signature and managed to write a little script that pulls out the navbar. However, it is missing all its colour (presuming thats to do with a style sheet problem?) and the options are a bit wonky too - ie/ the drop down quick links menu doesnt work and the links all point to the wrong places. hmmmmmmmmmm!

you also need to include the headinclude template ;)

mossyuk 02-02-2004 09:22 AM

I'm still having fun with this. If I do the following:

$globaltemplates = array(
'navbar,headinclude'
);

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once("./global.php");

// ## this calls to print out one main template ##
eval('print_output("' . fetch_template('navbar') . '");');
eval('print_output("' . fetch_template('headinclude') . '");');

I get a grey screen outputted.

If I do:

$globaltemplates = array(
'headinclude,navbar'
);

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once("./global.php");

// ## this calls to print out one main template ##
eval('print_output("' . fetch_template('navbar') . '");');
eval('print_output("' . fetch_template('headinclude') . '");');

I get my nav bar outputted but without the formatting. Im very confused. I have looked in the vb3 index.php and cant find the section where it might call the navbar. Arghhhhhhhhhhh!!!

Zachery 02-02-2004 09:25 AM

eval('print_output("' . fetch_template('navbar') . '");');

will just print out the whole template :) and we dont want that now do we?

you want to eval them :)

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$h_include = "' . fetch_template('headinclude') . '";');

:)

mossyuk 02-02-2004 09:35 AM

what exactly is the 'eval' doing though? I have never worked that one out. Forgive my ignorance, I'm a n00b with PHP really - as though you couldnt have guessed.

This is what I have so far:


$globaltemplates = array(
'navbar,headinclude'
);

require_once("./global.php");

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$h_include = "' . fetch_template('headinclude') . '";');


That returns a grey screen - so although something is working, that something is not the something I want! :)

Thanks for your quick reply.

Zachery 02-02-2004 09:38 AM

Quote:

Originally Posted by mossyuk
what exactly is the 'eval' doing though? I have never worked that one out. Forgive my ignorance, I'm a n00b with PHP really - as though you couldnt have guessed.

This is what I have so far:


$globaltemplates = array(
'navbar,headinclude'
);

require_once("./global.php");

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$h_include = "' . fetch_template('headinclude') . '";');


That returns a grey screen - so although something is working, that something is not the something I want! :)

Thanks for your quick reply.

when you use print_output

that makes vB print out the whole template, making them varibles will allow you to use them in your code wherever

HTML Code:

<html>
<head>
<title>test</title>
$h_include
</head>
 
<body>
This is a test
 
$navbar
 
end of the test
 </body>
</html>

like so

mossyuk 02-02-2004 10:03 AM

cheers, this is my code for any one else who wants it:
PHP Code:

<?php
// ## Changes Directory so it can accesss vBulletin IF we are outside the forums folder, if not this is not nessary ##
chdir("./../vb303");

// ## Error Reporting ( we use error reporting in php so we can control the display of error messages
// ## we will use this because all vBulletin files follow the same error reporting rules) ##
error_reporting(E_ALL & ~E_NOTICE);

// ## this action here cache's the templates so that everytime their needed a querry wont be needed to run 
// ## the names in there are just the template names :), there must be a comma after everyone but the last ##
$globaltemplates = array(
'headinclude',
'navbar',
'header'
);

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once("./global.php");

// ## this calls to print out one main template ##
//eval('print_output("' . fetch_template('navbar') . '");');
//eval('print_output("' . fetch_template('headinclude') . '");');
eval('$navbar = "' fetch_template('navbar') . '";');
eval(
'$h_include = "' fetch_template('headinclude') . '";');
eval(
'$front_header = "' fetch_template('header') . '";');

echo 
$navbar;
echo 
$h_include;
echo 
$front_header;
?>

It needs tweaking but I hope it helps someone.

Now to figure out why Im getting JScript errors! :(


All times are GMT. The time now is 01:46 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.01117 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (2)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