Please help with php tag. PLEASE READ CODERS.?

  • Thread starter Thread starter Decoj
  • Start date Start date
D

Decoj

Guest
Trying to add this PHP header code into an existing page:
<?php
require('include/config.php');
require('include/function.php');
if( $config['enable_package'] == 'yes' && isset($_SESSION['UID']) ) {
STemplate::assign('pack', $pack['0']);}
STemplate::assign('head_bottom', 'homelinks.tpl');
STemplate::display('head1.tpl');

Below is the coding of the page and how I added the header code into the existing page (just added the code to the beginning) I have tried a lot of spots but it never comes out right. Can some one tell me how come it doesn't work and what am I doing wrong?

<?php
require('include/config.php');
require('include/function.php');
if( $config['enable_package'] == 'yes' && isset($_SESSION['UID']) ) {
STemplate::assign('pack', $pack['0']);}
STemplate::assign('head_bottom', 'homelinks.tpl');
STemplate::display('head1.tpl');


/**
* MercuryBoard
* Copyright (c) 2001-2005 The Mercury Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* $Id: index.php,v 1.72 2006/07/17 19:42:12 jon Exp $
**/


$time_now = explode(' ', microtime());
$time_start = $time_now[1] + $time_now[0];

srand((double)microtime() * 1234567);

require './settings.php';
require './func/constants.php';
require './lib/' . $set['dbtype'] . '.php';
require './global.php';
require './lib/perms.php';
require './lib/user.php';

if (!$set['installed']) {
header('Location: ./install/index.php');
}

set_error_handler('error');

error_reporting(E_ALL);
set_magic_quotes_runtime(0);

$modules = array(
'active',
'cp',
'email',
'forum',
'help',
'login',
'members',
'mod',
'pm',
'post',
'printer',
'profile',
'register',
'search',
'topic',
'new_posts'
);

if (!isset($_GET['a']) || !in_array($_GET['a'], $modules)) {
$module = 'board';
} else {
$module = $_GET['a'];
}

require './func/' . $module . '.php';

$mercury = new $module;
$mercury->pre = $set['prefix'];

if (!get_magic_quotes_gpc()) {
$mercury->set_magic_quotes_gpc($mercury->get);
$mercury->set_magic_quotes_gpc($mercury->post);
$mercury->set_magic_quotes_gpc($mercury->cookie);
}

$mercury->db = new database($set['db_host'], $set['db_user'], $set['db_pass'], $set['db_name'], $set['db_port'], $set['db_socket']);

if (!$mercury->db->connection) {
error(MERCURY_ERROR, 'A connection to the database could not be established and/or the specified database could not be found.', __FILE__, __LINE__);
}

$mercury->get['a'] = $module;
$mercury->sets = $mercury->get_settings($set);

if ($mercury->sets['output_buffer'] && isset($mercury->server['HTTP_ACCEPT_ENCODING']) && stristr($mercury->server['HTTP_ACCEPT_ENCODING'], 'gzip')) {
ob_start('ob_gzhandler');
}

header( 'P3P: CP="CAO PSA OUR"' );
session_start();

$mercury->user_cl = new user($mercury);
$mercury->user = $mercury->user_cl->login();
$mercury->lang = $mercury->get_lang($mercury->user['user_language'], $mercury->get['a']);
$mercury->session['id'] = session_id();

if (!isset($mercury->get['skin'])) {
$mercury->skin = $mercury->user['skin_dir'];
} else {
$mercury->skin = $mercury->get['skin'];
}

$mercury->perms = new permissions;
$mercury->perms->db = &$mercury->db;
$mercury->perms->pre = &$mercury->pre;
$mercury->perms->get_perms($mercury->user['user_group'], $mercury->user['user_id'], ($mercury->user['user_perms'] ? $mercury->user['user_perms'] : $mercury->user['group_perms']));

$mercury->temps = $mercury->get_templates($mercury->get['a']);

$mercury->table = eval($mercury->template('MAIN_TABLE'));
$mercury->etable = eval($mercury->template('MAIN_ETABLE'));

$server_load = $mercury->get_load();

$mercury->tree($mercury->sets['forum_name'], $mercury->self);

if ($mercury->is_banned()) {
error(MERCURY_NOTICE, $mercury->lang->main_banned);
}

$reminder = null;
$reminder_text = null;

if ($mercury->sets['closed']) {
if (!$mercury->perms->auth('board_view_closed')) {
if ($mercury->get['a'] != 'login') {
error(MERCURY_NOTICE, $mercury->sets['closedtext'] . "<br /><hr />If you are an administrator, <a href='$mercury->self?a=login&s=on'>click here</a> to login.");
}
} else {
$reminder_text = $mercury->lang->main_reminder_closed . '<br />"' . $mercury->sets['closedtext'] . '"';
}
}

if ($mercury->user['user_group'] == USER_AWAIT) {
$reminder_text = "{$mercury->lang->main_activate}<br /><a href='{$mercury->self}?a=register&s=resend'>{$mercury->lang->main_activ
 
Back
Top