Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2004, 11:08 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 01-30-2004, 11:11 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you going to be using the vB template system or no?
Reply With Quote
  #3  
Old 01-30-2004, 11:13 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 01-30-2004, 11:24 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #5  
Old 01-30-2004, 11:27 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 02-02-2004, 09:22 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!!!
Reply With Quote
  #7  
Old 02-02-2004, 09:25 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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') . '";');

Reply With Quote
  #8  
Old 02-02-2004, 09:35 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 02-02-2004, 09:38 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 02-02-2004, 10:03 AM
mossyuk mossyuk is offline
 
Join Date: Jul 2002
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


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 01: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.04475 seconds
  • Memory Usage 2,268KB
  • 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
  • (1)bbcode_html
  • (1)bbcode_php
  • (2)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_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