Jump to content

adding php code or to include a page with php code into a .tpl page


legohead6

Recommended Posts

ok,i am trying to work around doing this by adding the required php code in the php pages, i have modified the index page so that to save time trying to merge my "members" database with the "phpbb_users" i have created a code at the beginning that checks if there is an account on both with the same username and password, if there is i made it so it should login and if there isnt it makes one in the phpbb_users to match the one in my "members" database. now i keep comming up with errors. i had to bypass the whole "hacking atempt" system because it wasnt liking my code and know im getting "Fatal error: Call to a member function on a non-object in /home2/mattsweb/public_html/forum/main/includes/page_header.php on line 62" since im not all that familiar with the phpbb system of coding and have been kinda figuring it out as i go i can figure out whats is wrong. here is page_header.php up to that line!

 

<?php
/***************************************************************************
*                              page_header.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : [email protected]
*
*   $Id: page_header.php,v 1.106.2.25 2005/10/30 15:17:14 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   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.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}

define('HEADER_INC', TRUE);

//
// gzip_compression
//
$do_gzip_compress = FALSE;
if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();

$useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT');

if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
{
	if ( extension_loaded('zlib') )
	{
		ob_start('ob_gzhandler');
	}
}
else if ( $phpver > '4.0' )
{
	if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
	{
		if ( extension_loaded('zlib') )
		{
			$do_gzip_compress = TRUE;
			ob_start();
			ob_implicit_flush(0);

			header('Content-Encoding: gzip');
		}
	}
}
}
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
); //this is line 65//

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.