PDA

View Full Version : Navbar doesn?t show


John3971
01-17-2008, 01:52 PM
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

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

Princeton
01-17-2008, 03:09 PM
remove or rewrite

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

John3971
01-17-2008, 03:16 PM
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?

John3971
01-19-2008, 07:54 PM
Bump

--------------- Added 1200839405 at 1200839405 ---------------

Nobody that can help me?

John3971
01-22-2008, 05:28 PM
BUMP again