Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-17-2008, 01:52 PM
John3971 John3971 is offline
 
Join Date: Sep 2007
Location: Sweden
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Navbar doesn?t show

hey i use this script to show a page from a custom template and it does work but when i go to ?p=add it is showing up everything exept navbar. can someone help me with this? i have add $navbar in that template

Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'index');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
    'vbnewsbit',
    'vbnewslist',
	'vbaddnews',
);

// ######################### REQUIRE BACK-END ############################
GLOBAL $parser;
require_once('./includes/class_bbcode.php');
require_once('./global.php');
$parser 	=& new vB_BbCodeParser($vbulletin, fetch_tag_list());

// ######################## START MAIN SCRIPT ############################
$newslimit	=	$vbulletin->input->clean($vbulletin->options['newslimit'], TYPE_INT);

	$getnews = $db->query_read("SELECT * FROM vb_news ORDER BY id DESC LIMIT 0, $newslimit");

	while($news = $db->fetch_array($getnews))
	{
		$news['title']			=	preg_replace('/\<[a-zA-Z0-9 \&lt;\<\>\&gt;\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $news['title']);
		$news['title']			=	unhtmlspecialchars($news['title']);
		$news['date']			=	vbdate($vbulletin->options['dateformat'], $news['dateline']);
		$news['time']			=	vbdate($vbulletin->options['timeformat'], $news['dateline']);
		$news['poster']	        =	$news['poster'];
		$news['pagetext'] 	    =	$parser->do_parse($news['pagetext'], 1, 1, 1, 1);
	

		if (!isset($vbnewsbit))
		{
			eval('$vbnewsbit .= "' . fetch_template('') . '";');
		}

		if (isset($vbnewsbit))
		{
			eval('$vbnewsbit .= "' . fetch_template('vbnewsbit') . '";');
		}
	}
	
if ($_REQUEST['p'] == 'add')
{
    eval('print_output("' . fetch_template('vbaddnews') . '");');
} 
	
$navbits = array();
$navbits[$parent] = 'Home';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('$vbnewslist .= "' . fetch_template('vbnewslist') . '";');
eval('print_output("' . fetch_template('vbnewslist') . '");');
?>
Reply With Quote
  #2  
Old 01-17-2008, 03:09 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

remove or rewrite
PHP Code:
if ($_REQUEST['p'] == 'add')
{
    eval(
'print_output("' fetch_template('vbaddnews') . '");');


the above code tells the system to print the page before the navbar info is fetched
Reply With Quote
  #3  
Old 01-17-2008, 03:16 PM
John3971 John3971 is offline
 
Join Date: Sep 2007
Location: Sweden
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok but i want a page on index.php and another one in index.php?p=add so what code do i user to be able to have navbar on that page?
Reply With Quote
  #4  
Old 01-19-2008, 07:54 PM
John3971 John3971 is offline
 
Join Date: Sep 2007
Location: Sweden
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump

--------------- Added [DATE]1200839405[/DATE] at [TIME]1200839405[/TIME] ---------------

Nobody that can help me?
Reply With Quote
  #5  
Old 01-22-2008, 05:28 PM
John3971 John3971 is offline
 
Join Date: Sep 2007
Location: Sweden
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BUMP again
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 09:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06413 seconds
  • Memory Usage 2,198KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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