Página 2 de 4

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 16:15
por robra
A primeira mensagem de erro refere-se a tabela thanks_table informando que a mesma não existe. parece-me estar relacionada ao MOD Thanks for post. Você tem este MOD instalado ?

A segunda mensagem de erro está informando que a tabela MCHAT_config_table não existe.
Teria de verificar no banco de dados sobre a existência destas estas tabelas.

Abraço. Imagem

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 16:17
por tucabail
Vamos aos arquivos.

FILE: includes/db/mysql.php
LINE: 175
CALL: dbal->sql_error()

Código: Selecionar todos

<?php
/**
*
* @package dbal
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx);

/**
* MSSQL Database Abstraction Layer
* Minimum Requirement is MSSQL 2000+
* @package dbal
*/
class dbal_mssql extends dbal
{
	/**
	* Connect to server
	*/
	function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
	{
		$this->persistency = $persistency;
		$this->user = $sqluser;
		$this->dbname = $database;

		$port_delimiter = (defined('PHP_OS') && substr(PHP_OS, 0, 3) === 'WIN') ? ',' : ':';
		$this->server = $sqlserver . (($port) ? $port_delimiter . $port : '');

		@ini_set('mssql.charset', 'UTF-8');
		@ini_set('mssql.textlimit', 2147483647);
		@ini_set('mssql.textsize', 2147483647);

		if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.1', '>=')))
		{
			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link);
		}
		else
		{
			$this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword);
		}

		if ($this->db_connect_id && $this->dbname != '')
		{
			if (!@mssql_select_db($this->dbname, $this->db_connect_id))
			{
				@mssql_close($this->db_connect_id);
				return false;
			}
		}

		return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error('');
	}

	/**
	* Version information about used database
	* @param bool $raw if true, only return the fetched sql_server_version
	* @param bool $use_cache If true, it is safe to retrieve the value from the cache
	* @return string sql server version
	*/
	function sql_server_info($raw = false, $use_cache = true)
	{
		global $cache;

		if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
		{
			$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);

			$row = false;
			if ($result_id)
			{
				$row = @mssql_fetch_assoc($result_id);
				@mssql_free_result($result_id);
			}

			$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;

			if (!empty($cache) && $use_cache)
			{
				$cache->put('mssql_version', $this->sql_server_version);
			}
		}

		if ($raw)
		{
			return $this->sql_server_version;
		}

		return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
	}

	/**
	* SQL Transaction
	* @access private
	*/
	function _sql_transaction($status = 'begin')
	{
		switch ($status)
		{
			case 'begin':
				return @mssql_query('BEGIN TRANSACTION', $this->db_connect_id);
			break;

			case 'commit':
				return @mssql_query('COMMIT TRANSACTION', $this->db_connect_id);
			break;

			case 'rollback':
				return @mssql_query('ROLLBACK TRANSACTION', $this->db_connect_id);
			break;
		}

		return true;
	}

	/**
	* Base query method
	*
	* @param	string	$query		Contains the SQL query which shall be executed
	* @param	int		$cache_ttl	Either 0 to avoid caching or the time in seconds which the result shall be kept in cache
	* @return	mixed				When casted to bool the returned value returns true on success and false on failure
	*
	* @access	public
	*/
	function sql_query($query = '', $cache_ttl = 0)
	{
		if ($query != '')
		{
			global $cache;

			// EXPLAIN only in extra debug mode
			if (defined('DEBUG_EXTRA'))
			{
				$this->sql_report('start', $query);
			}

			$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
			$this->sql_add_num_queries($this->query_result);

			if ($this->query_result === false)
			{
				if (($this->query_result = @mssql_query($query, $this->db_connect_id)) === false)
				{
					$this->sql_error($query);
				}

				if (defined('DEBUG_EXTRA'))
				{
					$this->sql_report('stop', $query);
				}

				if ($cache_ttl && method_exists($cache, 'sql_save'))
				{
					$this->open_queries[(int) $this->query_result] = $this->query_result;
					$cache->sql_save($query, $this->query_result, $cache_ttl);
				}
				else if (strpos($query, 'SELECT') === 0 && $this->query_result)
				{
					$this->open_queries[(int) $this->query_result] = $this->query_result;
				}
			}
			else if (defined('DEBUG_EXTRA'))
			{
				$this->sql_report('fromcache', $query);
			}
		}
		else
		{
			return false;
		}

		return $this->query_result;
	}

	/**
	* Build LIMIT query
	*/
	function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
	{
		$this->query_result = false;

		// Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows)
		if ($total)
		{
			// We need to grab the total number of rows + the offset number of rows to get the correct result
			if (strpos($query, 'SELECT DISTINCT') === 0)
			{
				$query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15);
			}
			else
			{
				$query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6);
			}
		}

		$result = $this->sql_query($query, $cache_ttl);

		// Seek by $offset rows
		if ($offset)
		{
			$this->sql_rowseek($offset, $result);
		}

		return $result;
	}

	/**
	* Return number of affected rows
	*/
	function sql_affectedrows()
	{
		return ($this->db_connect_id) ? @mssql_rows_affected($this->db_connect_id) : false;
	}

	/**
	* Fetch current row
	*/
	function sql_fetchrow($query_id = false)
	{
		global $cache;

		if ($query_id === false)
		{
			$query_id = $this->query_result;
		}

		if (isset($cache->sql_rowset[$query_id]))
		{
			return $cache->sql_fetchrow($query_id);
		}

		if ($query_id === false)
		{
			return false;
		}

		$row = @mssql_fetch_assoc($query_id);

		// I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
		if ($row)
		{
			foreach ($row as $key => $value)
			{
				$row[$key] = ($value === ' ' || $value === NULL) ? '' : $value;
			}
		}

		return $row;
	}

	/**
	* Seek to given row number
	* rownum is zero-based
	*/
	function sql_rowseek($rownum, &$query_id)
	{
		global $cache;

		if ($query_id === false)
		{
			$query_id = $this->query_result;
		}

		if (isset($cache->sql_rowset[$query_id]))
		{
			return $cache->sql_rowseek($rownum, $query_id);
		}

		return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false;
	}

	/**
	* Get last inserted id after insert statement
	*/
	function sql_nextid()
	{
		$result_id = @mssql_query('SELECT SCOPE_IDENTITY()', $this->db_connect_id);
		if ($result_id)
		{
			if ($row = @mssql_fetch_assoc($result_id))
			{
				@mssql_free_result($result_id);
				return $row['computed'];
			}
			@mssql_free_result($result_id);
		}

		return false;
	}

	/**
	* Free sql result
	*/
	function sql_freeresult($query_id = false)
	{
		global $cache;

		if ($query_id === false)
		{
			$query_id = $this->query_result;
		}

		if (isset($cache->sql_rowset[$query_id]))
		{
			return $cache->sql_freeresult($query_id);
		}

		if (isset($this->open_queries[$query_id]))
		{
			unset($this->open_queries[$query_id]);
			return @mssql_free_result($query_id);
		}

		return false;
	}

	/**
	* Escape string used in sql query
	*/
	function sql_escape($msg)
	{
		return str_replace(array("'", "\0"), array("''", ''), $msg);
	}

	/**
	* Build LIKE expression
	* @access private
	*/
	function _sql_like_expression($expression)
	{
		return $expression . " ESCAPE '\\'";
	}

	/**
	* return sql error array
	* @access private
	*/
	function _sql_error()
	{
		$error = array(
			'message'	=> @mssql_get_last_message(),
			'code'		=> ''
		);

		// Get error code number
		$result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
		if ($result_id)
		{
			$row = @mssql_fetch_assoc($result_id);
			$error['code'] = $row['code'];
			@mssql_free_result($result_id);
		}

		// Get full error message if possible
		$sql = 'SELECT CAST(description as varchar(255)) as message
			FROM master.dbo.sysmessages
			WHERE error = ' . $error['code'];
		$result_id = @mssql_query($sql);
		
		if ($result_id)
		{
			$row = @mssql_fetch_assoc($result_id);
			if (!empty($row['message']))
			{
				$error['message'] .= '<br />' . $row['message'];
			}
			@mssql_free_result($result_id);
		}

		return $error;
	}

	/**
	* Build db-specific query data
	* @access private
	*/
	function _sql_custom_build($stage, $data)
	{
		return $data;
	}

	/**
	* Close sql connection
	* @access private
	*/
	function _sql_close()
	{
		return @mssql_close($this->db_connect_id);
	}

	/**
	* Build db-specific report
	* @access private
	*/
	function _sql_report($mode, $query = '')
	{
		switch ($mode)
		{
			case 'start':
				$html_table = false;
				@mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id);
				if ($result = @mssql_query($query, $this->db_connect_id))
				{
					@mssql_next_result($result);
					while ($row = @mssql_fetch_row($result))
					{
						$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
					}
				}
				@mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id);
				@mssql_free_result($result);

				if ($html_table)
				{
					$this->html_hold .= '</table>';
				}
			break;

			case 'fromcache':
				$endtime = explode(' ', microtime());
				$endtime = $endtime[0] + $endtime[1];

				$result = @mssql_query($query, $this->db_connect_id);
				while ($void = @mssql_fetch_assoc($result))
				{
					// Take the time spent on parsing rows into account
				}
				@mssql_free_result($result);

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

				$this->sql_report('record_fromcache', $query, $endtime, $splittime);

			break;
		}
	}
}

?>

FILE: includes/functions_mchat.php
LINE: 107
CALL: dbal_mysql->sql_query()

Código: Selecionar todos

<?php
/**
*
* @package mChat
* @version $Id: functions_mchat.php
* @copyright (c) 2010 RMcGirr83 ( http://www.rmcgirr83.org/ )
* @copyright (c) 2009 phpbb3bbcodes.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

// mchat_cache
/**
* builds the cache if it doesn't exist
*/
function mchat_cache()
{
	global $cache, $db;

	// Grab the config entries in teh ACP...and cache em :P
	if (($config_mchat = $cache->get('_mchat_config')) === false)
	{
		$sql = 'SELECT * FROM ' . MCHAT_CONFIG_TABLE;
		$result = $db->sql_query($sql);
		$config_mchat = array();
		while ($row = $db->sql_fetchrow($result))	
		{
			$config_mchat[$row['config_name']] = $row['config_value'];
		}
		$db->sql_freeresult($result);

		$cache->put('_mchat_config', $config_mchat);
	}
}

// mchat_user_fix
/**
* @param $user_id the id of the user being deleted from the forum
*
*/
function mchat_user_fix($user_id)
{
	global $db;

	$sql = 'UPDATE ' . MCHAT_TABLE . '
		SET user_id = ' . ANONYMOUS . '
	WHERE user_id = ' . (int) $user_id;
	$db->sql_query($sql);

	return;
}

// mchat_session_time
/**
* @param $time the amount of time to display
*
*/
function mchat_session_time($time)
{
	global $user;
	// fix the display of the time limit
	// hours, minutes, seconds
	$chat_session = '';
	$chat_timeout = (int) $time;	
	$hours = $minutes = $seconds = 0;
		
	if ($chat_timeout >= 3600)
	{
		$hours = floor($chat_timeout / 3600);
		$chat_timeout = $chat_timeout - ($hours * 3600);
		$chat_session .= $hours > 1 ? ($hours . '&nbsp;' . $user->lang['MCHAT_HOURS']) : ($hours . '&nbsp;' . $user->lang['MCHAT_HOUR']);
	}
	$minutes = floor($chat_timeout / 60);
	if ($minutes)
	{
		$minutes = $minutes > 1 ? ($minutes . '&nbsp;' . $user->lang['MCHAT_MINUTES']) : ($minutes . '&nbsp;' . $user->lang['MCHAT_MINUTE']);
		$chat_timeout = $chat_timeout - ($minutes * 60);
		$chat_session .= $minutes;
	}
	$seconds = ceil($chat_timeout);
	if ($seconds)
	{
		$seconds = $seconds > 1 ? ($seconds . '&nbsp;' . $user->lang['MCHAT_SECONDS']) : ($seconds . '&nbsp;' . $user->lang['MCHAT_SECOND']);
		$chat_session .= $seconds;
	}		
	return sprintf($user->lang['MCHAT_ONLINE_EXPLAIN'], $chat_session);	
}

// mchat_users
/**
* @param $session_time amount of time before a users session times out
*/
function mchat_users($session_time, $on_page = false)
{
	global $auth, $db, $template, $user;

	$check_time = time() - (int) $session_time;
	
	$sql = 'DELETE FROM ' . MCHAT_SESSIONS_TABLE . ' WHERE user_lastupdate < ' . $check_time;
	$db->sql_query($sql);	
		
	// add the user into the sessions upon first visit
	if($on_page && ($user->data['user_id'] != ANONYMOUS && !$user->data['is_bot']))
	{
		mchat_sessions($session_time);
	}
	
	$mchat_user_count = 0;
	$mchat_user_list = '';
	
	$sql = 'SELECT m.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour
		FROM ' . MCHAT_SESSIONS_TABLE . ' m
		LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
		WHERE m.user_lastupdate > ' . $check_time . '
		ORDER BY u.username ASC';
	$result = $db->sql_query($sql);
	$can_view_hidden = $auth->acl_get('u_viewonline');
	while ($row = $db->sql_fetchrow($result))
	{
		if (!$row['user_allow_viewonline'])
		{
			if (!$can_view_hidden)
			{
				continue;
			}
			else
			{
				$row['username'] = '<em>' . $row['username'] . '</em>';
			}
		}
		$mchat_user_count++;
		$mchat_user_online_link = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']);
		$mchat_user_list .= ($mchat_user_list != '') ? $user->lang['COMMA_SEPARATOR'] . $mchat_user_online_link : $mchat_user_online_link;
	}
	$db->sql_freeresult($result);

	$refresh_message = mchat_session_time($session_time);	
	if (!$mchat_user_count)
	{
		return array(
			'online_userlist'	=> '',
			'mchat_users_count'	=> $user->lang['MCHAT_NO_CHATTERS'],
			'refresh_message'	=> $refresh_message,
		);
	}
	else
	{
		return array(
			'online_userlist'	=> $mchat_user_list,
			'mchat_users_count'	=> $mchat_user_count > 1 ? sprintf($user->lang['MCHAT_ONLINE_USERS_TOTAL'], $mchat_user_count) : sprintf($user->lang['MCHAT_ONLINE_USER_TOTAL'], $mchat_user_count),
			'refresh_message'	=> $refresh_message,
		);
	}
}

// mchat_sessions
/**
* @param mixed $session_time amount of time before a user is not shown as being in the chat
*/
function mchat_sessions($session_time)
{
	global $db, $user;
	
	$check_time = time() - (int) $session_time;
	$sql = 'DELETE FROM ' . MCHAT_SESSIONS_TABLE . ' WHERE user_lastupdate <' . $check_time;
	$db->sql_query($sql);
	
	// insert user into the mChat sessions table
	if ($user->data['user_type'] == USER_FOUNDER || $user->data['user_type'] == USER_NORMAL)
	{
		$sql = 'SELECT * FROM ' . MCHAT_SESSIONS_TABLE . ' WHERE user_id =' . (int) $user->data['user_id'];
		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);
		$db->sql_freeresult($result);

		if (!$row)
		{
			$sql_ary = array(
				'user_id'			=> $user->data['user_id'],
				'user_lastupdate'	=> time(),
			);
			$sql = 'INSERT INTO ' . MCHAT_SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
			$db->sql_query($sql);
		}
		else
		{
			$sql_ary = array(
				'user_lastupdate'	=> time(),
			);
			$sql = 'UPDATE ' . MCHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id =' . (int) $user->data['user_id'];
			$db->sql_query($sql);
		}
	}					
	return;
}

// mChat add-on Topic Notification
/**
* @param mixed $post_id limits deletion to a post_id in the forum
*/
function mchat_delete_topic($post_id)
{
	global $db;
	
	if (!isset($post_id) || empty($post_id))
	{
		return;
	}

	$sql = 'DELETE FROM ' . MCHAT_TABLE . ' WHERE post_id = ' . (int) $post_id;
	$db->sql_query($sql);

	return;
}

// mchat_prune
// AutoPrune Chats
/**
* @param mixed $mchat_prune_amount set from mchat config entry
*/
function mchat_prune($mchat_prune_amount)
{
	global $db;
	// Run query to get the total message rows...
	$sql = 'SELECT COUNT(message_id) AS total_messages FROM ' . MCHAT_TABLE;
	$result = $db->sql_query($sql);
	$mchat_total_messages = (int) $db->sql_fetchfield('total_messages');
	$db->sql_freeresult($result);

	// count is below prune amount?
	// do nothing
	$prune = true;
	if ($mchat_total_messages <= $mchat_prune_amount)
	{
		$prune = false;
	}

	if ($prune)
	{

		$result = $db->sql_query_limit('SELECT * FROM '. MCHAT_TABLE . ' ORDER BY message_id ASC', 1);
		$row = $db->sql_fetchrow($result);
		$first_id = (int) $row['message_id'];
		
		$db->sql_freeresult($result);
		
		// compute the delete id 
		$delete_id = $mchat_total_messages - $mchat_prune_amount + $first_id;

		// let's go delete them...if the message id is less than the delete id
		$sql = 'DELETE FROM ' . MCHAT_TABLE . '
			WHERE message_id < ' . (int) $delete_id;
		$db->sql_query($sql);
	
		add_log('admin', 'LOG_MCHAT_TABLE_PRUNED');
	}
	// free up some memory...variable(s) are no longer needed.
	unset($mchat_total_messages);
	
	// return to what we were doing
	return;
		
}
// display_mchat_bbcodes
// can't use the default phpBB one but 
// most of code is from similar function
/**
* @param mixed $mchat_prune_amount set from mchat config entry
*/
function display_mchat_bbcodes()
{
	global $db, $cache, $template, $user;

	// grab the bbcodes that aren't allowed 
	$config_mchat = $cache->get('_mchat_config');
	
	$disallowed_bbcode_array = explode('|', strtoupper($config_mchat['bbcode_disallowed']));
	preg_replace('#^(.*?)=#si','$1',$disallowed_bbcode_array);
	$default_bbcodes = array('b','i','u','quote','code','list','img','url','size','color','email','flash');
	
	// let's remove the default bbcodes
	if (sizeof($disallowed_bbcode_array))
	{
		foreach ($default_bbcodes as $default_bbcode)
		{
			$default_bbcode = strtoupper($default_bbcode);
			if (!in_array($default_bbcode, $disallowed_bbcode_array))
			{
				$template->assign_vars(array(
					'S_MCHAT_BBCODE_'.$default_bbcode => true,
				));
			}
		}
	}

	// now for the custom bbcodes
	// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
	$num_predefined_bbcodes = 22;

	$sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
		FROM ' . BBCODES_TABLE . '
		WHERE display_on_posting = 1
		ORDER BY bbcode_tag';
	$result = $db->sql_query($sql);

	$i = 0;
	while ($row = $db->sql_fetchrow($result))
	{
		$bbcode_tag_name = strtoupper($row['bbcode_tag']);
		if (sizeof($disallowed_bbcode_array))
		{	
			if (in_array($bbcode_tag_name, $disallowed_bbcode_array))
			{
				continue;
			}
		}
		// If the helpline is defined within the language file, we will use the localised version, else just use the database entry...
		if (isset($user->lang[strtoupper($row['bbcode_helpline'])]))
		{
			$row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])];
		}

		$template->assign_block_vars('custom_tags', array(
			'BBCODE_NAME'		=> "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
			'BBCODE_ID'			=> $num_predefined_bbcodes + ($i * 2),
			'BBCODE_TAG'		=> $row['bbcode_tag'],
			'BBCODE_HELPLINE'	=> $row['bbcode_helpline'],
			'A_BBCODE_HELPLINE'	=> str_replace(array('&', '"', "'", '<', '>'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']),
		));

		$i++;
	}
	$db->sql_freeresult($result);
}
?>

FILE: index.php
LINE: 165
CALL: mchat_users()

Código: Selecionar todos

<?php
/**
*
* @package phpBB3
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
*/

/**
* @ignore
*/

define('IN_FORUM_INDEX', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

display_forums('', $config['load_moderators']);

// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts	= $config['num_posts'];
$total_topics	= $config['num_topics'];
$total_users	= $config['num_users'];

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';

// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
	$sql = 'SELECT group_id, group_name, group_colour, group_type
		FROM ' . GROUPS_TABLE . '
		WHERE group_legend = 1
		ORDER BY group_name ASC';
}
else
{
	$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
		FROM ' . GROUPS_TABLE . ' g
		LEFT JOIN ' . USER_GROUP_TABLE . ' ug
			ON (
				g.group_id = ug.group_id
				AND ug.user_id = ' . $user->data['user_id'] . '
				AND ug.user_pending = 0
			)
		WHERE g.group_legend = 1
			AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
		ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = array();
while ($row = $db->sql_fetchrow($result))
{
	$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
	$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];

	if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
	{
		$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
	}
	else
	{
		$legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
	}
}
$db->sql_freeresult($result);

$legend = implode(', ', $legend);

// Generate birthday list if required ...
$birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays'])
{
	$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
	$sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
		FROM ' . USERS_TABLE . ' u
		LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
		WHERE (b.ban_id IS NULL
			OR b.ban_exclude = 1)
			AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
			AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
	$result = $db->sql_query($sql);

	while ($row = $db->sql_fetchrow($result))
	{
		$birthday_list .= (($birthday_list != '') ? ', ' : '') . get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);

		if ($age = (int) substr($row['user_birthday'], -4))
		{
			$birthday_list .= ' (' . ($now['year'] - $age) . ')';
		}
	}
	$db->sql_freeresult($result);
}


//Begin: National_Flag
if (!empty($config['allow_flags']))
{
	if (!function_exists('top_flags'))
	{
		include($phpbb_root_path . 'includes/functions_flag.' . $phpEx);
	}
	top_flags();
}
//End: National_Flag
// Assign index specific vars
$template->assign_vars(array(
	'TOTAL_POSTS'	=> sprintf($user->lang[$l_total_post_s], $total_posts),
	'TOTAL_TOPICS'	=> sprintf($user->lang[$l_total_topic_s], $total_topics),
	'TOTAL_USERS'	=> sprintf($user->lang[$l_total_user_s], $total_users),
	'NEWEST_USER'	=> sprintf($user->lang['NEWEST_USER'], get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])),

	'LEGEND'		=> $legend,
	'BIRTHDAY_LIST'	=> $birthday_list,

	'FORUM_IMG'				=> $user->img('forum_read', 'NO_UNREAD_POSTS'),
	'FORUM_UNREAD_IMG'			=> $user->img('forum_unread', 'UNREAD_POSTS'),
	'FORUM_LOCKED_IMG'		=> $user->img('forum_read_locked', 'NO_UNREAD_POSTS_LOCKED'),
	'FORUM_UNREAD_LOCKED_IMG'	=> $user->img('forum_unread_locked', 'UNREAD_POSTS_LOCKED'),

	'S_LOGIN_ACTION'			=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
	'S_DISPLAY_BIRTHDAY_LIST'	=> ($config['load_birthdays']) ? true : false,

	'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
	'U_MCP'				=> ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
);


// BEGIN mChat Mod
$mchat_installed = (!empty($config['mchat_version']) && !empty($config['mchat_enable'])) ? true : false;
if ($mchat_installed && $auth->acl_get('u_mchat_view'))
{
	if(!defined('MCHAT_INCLUDE') && $config['mchat_on_index'] && !empty($user->data['user_mchat_index']))
	{
		define('MCHAT_INCLUDE', true);
		$mchat_include_index = true;
		include($phpbb_root_path . 'mchat.' . $phpEx);
	}	

	if (!empty($config['mchat_stats_index']) && !empty($user->data['user_mchat_stats_index']))
	{
		if (!function_exists('mchat_users'))
		{
			include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
		}
		// Add lang file
		$user->add_lang('mods/mchat_lang');
		// stats display
		$mchat_session_time = !empty($config_mchat['timeout']) ? $config_mchat['timeout'] : 3600;// you can change this number to a greater number for longer chat sessions
		$mchat_stats = mchat_users($mchat_session_time);
		$template->assign_vars(array(
			'MCHAT_INDEX_STATS'	=> true,
			'MCHAT_INDEX_USERS_COUNT'	=> $mchat_stats['mchat_users_count'],
			'MCHAT_INDEX_USERS_LIST'	=> $mchat_stats['online_userlist'],
			'L_MCHAT_ONLINE_EXPLAIN'	=> $mchat_stats['refresh_message'],	
		));
	}
}	
// END mChat Mod
// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
	'body' => 'index_body.html')
);

page_footer();

?>
Abraços

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 16:19
por tucabail
Robra eu tinha...mas pelo visto foi pro sacsss

E se a tabela do Mchat sumiu eu desinstalo o trem e depois coloco de novo.
Mas já tentei fazer pelo automod e dá um punhado de erros, tenho receio de forçar e dar mais problema ainda.
Vou acabar fazendo manualmente se for preciso...que é o que estou vendo ser uma das soluções.
Valeu

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 16:27
por robra
Pelo menos os problemas descritos nas 2 mensagens de erro que você postou não é do ABB3 e sim do Thanks for Post e do Mchat, conforme mencionei em minha mensagem anterior.
Tente reinstalar este 2 MODs para ver se as respectivas tabelas são criadas novamente fazendo desaparecer as mensagens de erro.

Abraço. Imagem

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 16:28
por tucabail
Beleza Robra...vo lá.
Valeu....
volto já...

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 18:31
por tucabail
Bom...problema resolvido....
Editei todos os arquivos na mão, retransferi todos os novos arquivos.
Atualize e deu certo.
Não sei porque isto deu pau no sistema, mas deu e agora já está arrumado.
Só que em contra partida aconteceu isto:
Novo erro.jpg
Isto acontece quanto entramos nas salas para responder ou ler algumas mensagem
Fico no aguardo

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 18:49
por smallbreeds
O que está em sua linha 1695 do arquivo viewtopic.php?

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 18:50
por robra
Tá informando que a tabela "STATUS_TABLE" não existe no banco de dados.
É o mesmo problema das outras mensagens de erro, porém, tem-se que descobrir qual o MOD que a tabela "STATUS_TABLE" pertence para reinstalar o respectivo MOD.
Você tem algum MOD chamado Status MOD ou Users Status MOD ou algo deste gênero ?
Se tiver, a bucha está aí.

Abraço. Imagem

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 18:59
por tucabail
Small....
tá isso:

Código: Selecionar todos

			$result = $db->sql_query_limit($sql, 1);
Vou ver esta outra tabela.
Valeu por enquanto
Abraço

Re: Problema ao atualizar o ABBcode Box 3

Enviado: 24 Set 2011, 19:53
por tucabail
Resolvido....que dor de cabeça gente....acabou.
Agora só na cervejinha.
Abraços ;)