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 \<\<\>\>\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $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') . '");');
?>
<?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 \<\<\>\>\:\;\"\'\,\.\?\/\~\`\!\@\#\$\%\^\&\*\(\)\_\-\+\=]*\>/', '', $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') . '");');
?>