[Tool] phpBB 2.0.11 to phpBB 2.0.12 Code Changes

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
77
71%
Very Good
13
12%
Good
7
6%
Fair
4
4%
Poor
8
7%
 
Total votes: 109

User avatar
DragonMaster1
Registered User
Posts: 994
Joined: Tue Aug 17, 2004 11:04 am
Name: Terry
Contact:

Post by DragonMaster1 »

-jm- wrote:
DragonMaster1 wrote:No....but the index_body.tpl is not in the ACP

[edit: you figured it while .I was writing :) ]

it should add infos about the latest phpbb version and your version


I did add it but now I get an error:

Version Information

Unable to open connection to phpBB Server, reported error is:
Connection refused

For the latest information on updates to phpBB, why not subscribe to our mailing list.

Powered by phpBB 2.0.12 © 2001 phpBB Group


Otherwise looks ok
Got to get to bed so I will answer in about 8 hours.
Thanx for the reply.
Guess I was too tired when I looked at that
ChronosPL
Registered User
Posts: 3
Joined: Thu Feb 17, 2005 9:06 pm
Location: Poland

Post by ChronosPL »

[quote="-jm]you should able to do something like this.

Code: Select all

#
#-----[ FIND ]---------------------------------------------
# Line 696
			$tables = array(

# (this is a partial search, the full line is longer)

#
#-----[ IN - LINE FIND ]---------------------------------------------
# 
	 'words'

#
#-----[ IN-LINE AFTER ADD ]---------------------------------------------
# 
, 'confirm'

It seems to me that it should be an array containing many names of system tables in your database.
[/quote]

But problem is that there's nothing, what looks like this, in source code. Is it important part of update this changing in admin_db_utillities.php?
User avatar
-jm-
Former Team Member
Posts: 2025
Joined: Fri Jul 16, 2004 10:56 am
Location: Inside the mind of the machine
Contact:

Post by -jm- »

ok ... Figured out :)
added confirm table to admin_db utilities.php


since that mod allows you to full backup your database, you don't need to have the list of default tables for backup
-jm- (a.k.a. juanm) - *NO* private support
Hacked?
With so many beautiful colors in the world it’s a shame to make everything black and white - Dennis R. Little
my links: tips&stuff :: stuff only
Sjeejdie
Registered User
Posts: 4
Joined: Tue Feb 22, 2005 1:07 pm

Post by Sjeejdie »

I get this error after installing 2.0.12

Code: Select all

Parse error: parse error, unexpected $ in /home/.sites/85/site23/web/common.php on line 213
but when I go looking in common.php the only thing on line 213 is

Code: Select all

?>
any idea what might be wrong?
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

I have CH 2.0.10 running and when I update to 2.0.12, I get the following error after making the changes to common.php

Code: Select all

Parse error: parse error, unexpected $ in mercuryserver/forums/common.php on line 298
oddly enough, line 298 is the last line of the page :?

-e-
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

^^ what timing :lol:

-e-
User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 »

Either a missing bracket somewhere, or you have a space after ?>
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

drumstix42 wrote: Either a missing bracket somewhere, or you have a space after ?>


neither of the two, I made the changes word for word as per the update sheet....

-e-
User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 »

post your common.php here in code tags.
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

Code: Select all

<?php
//-- mod : attachmod -----------------------------------------------------------
//-- mod : categories hierarchy ------------------------------------------------
/***************************************************************************
 *                                common.php
 *                            -------------------
 *   begin                : Saturday, Feb 23, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: common.php,v 1.74.2.14 2004/11/18 17:49:34 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");
}

//-- mod : categories hierarchy ------------------------------------------------
//-- add
$starttime = microtime();
$trc_loc_start = $trc_loc_end = 0;
//-- fin mod : categories hierarchy --------------------------------------------

//
error_reporting  (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime

// The following code (unsetting globals) was contributed by Matt Kavanagh

// PHP5 with register_long_arrays off?
if (!isset($HTTP_POST_VARS) && isset($_POST))
{
	$HTTP_POST_VARS = $_POST;
	$HTTP_GET_VARS = $_GET;
	$HTTP_SERVER_VARS = $_SERVER;
	$HTTP_COOKIE_VARS = $_COOKIE;
	$HTTP_ENV_VARS = $_ENV;
	$HTTP_POST_FILES = $_FILES;

	// _SESSION is the only superglobal which is conditionally set
	if (isset($_SESSION))
	{
		$HTTP_SESSION_VARS = $_SESSION;
	}
}

if (@phpversion() < '4.0.0')
{
	// PHP3 path; in PHP3, globals are _always_ registered
	
	// We 'flip' the array of variables to test like this so that
	// we can validate later with isset($test[$var]) (no in_array())
	$test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL);

	// Loop through each input array
	@reset($test);
	while (list($input,) = @each($test))
	{
		while (list($var,) = @each($$input))
		{
			// Validate the variable to be unset
			if (!isset($test[$var]) && $var != 'test' && $var != 'input')
			{
				unset($$var);
			}
		}
	}
}
else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
	// PHP4+ path
	$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');	
	
	// Not only will array_merge give a warning if a parameter
	// is not an array, it will actually fail. So we check if
	// HTTP_SESSION_VARS has been initialised.
	if (!isset($HTTP_SESSION_VARS))
	{
		$HTTP_SESSION_VARS = array();
	}

	// Merge all into one extremely huge array; unset
	// this later
	$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);

	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}

//
// addslashes to vars if magic_quotes_gpc is off
// this is a security precaution to prevent someone
// trying to break out of a SQL statement.
//
if( !get_magic_quotes_gpc() )
{
	if( is_array($HTTP_GET_VARS) )
	{
		while( list($k, $v) = each($HTTP_GET_VARS) )
		{
			if( is_array($HTTP_GET_VARS[$k]) )
			{
				while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
				{
					$HTTP_GET_VARS[$k][$k2] = addslashes($v2);
				}
				@reset($HTTP_GET_VARS[$k]);
			}
			else
			{
				$HTTP_GET_VARS[$k] = addslashes($v);
			}
		}
		@reset($HTTP_GET_VARS);
	}

	if( is_array($HTTP_POST_VARS) )
	{
		while( list($k, $v) = each($HTTP_POST_VARS) )
		{
			if( is_array($HTTP_POST_VARS[$k]) )
			{
				while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
				{
					$HTTP_POST_VARS[$k][$k2] = addslashes($v2);
				}
				@reset($HTTP_POST_VARS[$k]);
			}
			else
			{
				$HTTP_POST_VARS[$k] = addslashes($v);
			}
		}
		@reset($HTTP_POST_VARS);
	}

	if( is_array($HTTP_COOKIE_VARS) )
	{
		while( list($k, $v) = each($HTTP_COOKIE_VARS) )
		{
			if( is_array($HTTP_COOKIE_VARS[$k]) )
			{
				while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
				{
					$HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
				}
				@reset($HTTP_COOKIE_VARS[$k]);
			}
			else
			{
				$HTTP_COOKIE_VARS[$k] = addslashes($v);
			}
		}
		@reset($HTTP_COOKIE_VARS);
	}
}

//
// Define some basic configuration arrays this also prevents
// malicious rewriting of language and otherarray values via
// URI params
//
$board_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
$nav_links = array();
$gen_simple_header = FALSE;

include($phpbb_root_path . 'config.'.$phpEx);

if( !defined("PHPBB_INSTALLED") )
{
	header("Location: install/install.$phpEx");
	exit;
}

include($phpbb_root_path . 'includes/constants.'.$phpEx);
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// include($phpbb_root_path . 'includes/template.'.$phpEx);
//-- add
include($phpbb_root_path . 'includes/class_template.'.$phpEx);
//-- fin mod : categories hierarchy --------------------------------------------
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
include($phpbb_root_path . 'includes/auth.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);

//
// Obtain and encode users IP
//
// I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as
// private range IP's appearing instead of the guilty routable IP, tough, don't
// even bother complaining ... go scream and shout at the idiots out there who feel
// "clever" is doing harm rather than good ... karma is a great thing ... :)
//
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
$user_ip = encode_ip($client_ip);

//
// Setup forum wide options, if this fails
// then we output a CRITICAL_ERROR since
// basic forum information is not available
//
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $sql = "SELECT *
//	FROM " . CONFIG_TABLE;
// if( !($result = $db->sql_query($sql)) )
// {
//	message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
// }
//
// while ( $row = $db->sql_fetchrow($result) )
// {
//	$board_config[$row['config_name']] = $row['config_value'];
// }
//-- add
// include basic classes def
include($phpbb_root_path . 'includes/class_config.' . $phpEx);
include($phpbb_root_path . 'includes/class_groups.' . $phpEx);

// get config
$config = new config_class();
$config->read();
$board_config = &$config->data;

// let's run the upgrade script
if ( !defined('IN_LOGIN') && !defined('IN_INSTALL') && ($config->data['mod_cat_hierarchy'] != '2.1.0f') )
{
	header('Location: ./install_cat/install.' . $phpEx);
	exit;
}

// user objects
include($config->url('includes/class_user'));
include($config->url('includes/class_auth'));

// instantiate some objects
$user = new user();
$censored_words = new words();
$icons = new icons();
$navigation = new navigation();
$themes = '';
$smilies = new smilies();

// People never read achievement messages after after having seen "Succesfull !", tss tss :)
if ( file_exists('install_cat') && !defined('IN_LOGIN') && !defined('IN_INSTALL') )
{
	message_die(GENERAL_MESSAGE, 'Please ensure the install_cat/ directory is deleted');
}

// messages queue
$message_queue = '';
@include($config->url('includes/class_message'));
$message_queue = !defined('CH_message_queue') ? '' : new message_queue();
//-- fin mod : categories hierarchy -------------------------------------------

//-- mod : attachmod -----------------------------------------------------------
//-- add
include($config->url('attach_mod/attachment_mod'));
//-- fin mod : attachmod -------------------------------------------------------

if (file_exists('install') || file_exists('contrib'))
{
	message_die(GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted');
}

//
// Show 'Board is disabled' message if needed.
//
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
{
	message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
}
if ( is_robot() ) define('IS_ROBOT', true);

?>

below are the changes as stated in the installer

Code: Select all

# 
#-----[ OPEN ]--------------------------------------------- 
# 
common.php

#
#-----[ FIND ]---------------------------------------------
# Line 56
	$test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL);

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	$test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL);

#
#-----[ FIND ]---------------------------------------------
# Line 75
else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
{
	// PHP4+ path

#
#-----[ AFTER, ADD ]---------------------------------------------
# 
	$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');

#
#-----[ FIND ]---------------------------------------------
# Line 92
	unset($input['input']);
	
	while (list($var,) = @each($input))
	{
		unset($$var);
	}

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
	unset($input['input']);
	unset($input['not_unset']);

	while (list($var,) = @each($input))
	{
		if (!in_array($var, $not_unset))
		{
			unset($$var);
		}
	}

#
#-----[ FIND ]---------------------------------------------
# Line 207
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );

#
#-----[ REPLACE WITH ]---------------------------------------------
# 
$client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
User avatar
ArchY
Registered User
Posts: 42
Joined: Sat Nov 03, 2001 10:34 am
Location: Saint Germain en Laye

Post by ArchY »

thanx, It works perfect !
Sjeejdie
Registered User
Posts: 4
Joined: Tue Feb 22, 2005 1:07 pm

Post by Sjeejdie »

encryption wrote:
drumstix42 wrote:Either a missing bracket somewhere, or you have a space after ?>


neither of the two, I made the changes word for word as per the update sheet....

-e-

same here

I'm not gonna copy my common.php here cuz it seems to be exactly the same problem so it only would take up extra space :)
Head_Hunter
Registered User
Posts: 1
Joined: Fri Sep 10, 2004 1:42 pm
Location: Texas
Contact:

Post by Head_Hunter »

I dont post a whole lot, mainly read, but i would like to give props to all the Mods who help the phpBB community. Especially when others dont support modded versions. Thanks for all the help and support to all who contribute as well.
Network Security Admin
NetworkSecurityTech.com
superjoost
Registered User
Posts: 46
Joined: Fri Nov 08, 2002 12:22 am

Post by superjoost »

I cannot execute this part:
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_db_utilities.php

#
#-----[ FIND ]---------------------------------------------
# Line 696
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');

#
#-----[ REPLACE WITH ]---------------------------------------------
#
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm');


because I simply don't have the code in my file. I don't know which mod edited this.

Is this bad?
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

the only thing extra in that line is highlighted in red below, look for $tables = array('auth in your admin/admin_db_utilities.php file and make the change in red
superjoost wrote: I cannot execute this part:
#
#-----[ OPEN ]---------------------------------------------
#
admin/admin_db_utilities.php

#
#-----[ FIND ]---------------------------------------------
# Line 696
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');

#
#-----[ REPLACE WITH ]---------------------------------------------
#
$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words', 'confirm');


because I simply don't have the code in my file. I don't know which mod edited this.

Is this bad?
Post Reply

Return to “[2.0.x] MOD Database Releases”