Updates mainly for removal of extension + header comment ... moved some aspects of ucp around, further work to be done on these areas ... not commiting search for time being

git-svn-id: file:///svn/phpbb/trunk@4473 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2003-09-07 13:46:51 +00:00
parent e1ba6d3c52
commit 8ac06a256b
28 changed files with 782 additions and 880 deletions

View file

@ -1,23 +1,15 @@
<?php
/***************************************************************************
* common.php
* -------------------
* begin : Saturday, Feb 23, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : common.php
// STARTED : Sat Feb 17, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
if (!defined('IN_PHPBB'))
{
@ -45,10 +37,10 @@ if (!get_magic_quotes_gpc())
{
$_GET = slash_input_data($_GET);
$_POST = slash_input_data($_POST);
$_REQUEST = slash_input_data($_REQUEST);
$_COOKIE = slash_input_data($_COOKIE);
}
require($phpbb_root_path . 'config.'.$phpEx);
if (!defined('PHPBB_INSTALLED'))
@ -161,6 +153,7 @@ define('DRAFTS_TABLE', $table_prefix.'drafts');
define('EXTENSIONS_TABLE', $table_prefix.'extensions');
define('EXTENSION_GROUPS_TABLE', $table_prefix.'extension_groups');
define('FORUMS_TABLE', $table_prefix.'forums');
define('FORUMS_ACCESS_TABLE', $table_prefix.'forum_access');
define('FORUMS_TRACK_TABLE', $table_prefix.'forums_marking');
define('FORUMS_WATCH_TABLE', $table_prefix.'forums_watch');
define('GROUPS_TABLE', $table_prefix.'groups');

View file

@ -11,110 +11,14 @@
//
// -------------------------------------------------------------
if ( defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
$download_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : FALSE;
$thumbnail = (isset($_REQUEST['thumb'])) ? intval($_REQUEST['thumb']) : FALSE;
function send_file_to_browser($attachment, $upload_dir, $category)
{
global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config;
$filename = ($upload_dir == '') ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename'];
if (!file_exists($filename))
{
trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
}
// Determine the Browser the User is using, because of some nasty incompatibilities.
// borrowed from phpMyAdmin. :)
if (!empty($_SERVER['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
else if (!isset($HTTP_USER_AGENT))
{
$HTTP_USER_AGENT = '';
}
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'opera';
}
else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'ie';
}
else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'omniweb';
}
else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'netscape';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'mozilla';
}
else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'konqueror';
}
else
{
$browser_version = 0;
$browser_agent = 'other';
}
// Correct the mime type - we force application/octetstream for all files, except images
// Please do not change this, it is a security precaution
if ($category == NONE_CAT && !strstr($attachment['mimetype'], 'image'))
{
$attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream';
}
// Now the tricky part... let's dance
@ob_end_clean();
@ini_set('zlib.output_compression', 'Off');
header('Pragma: public');
header('Content-Transfer-Encoding: none');
// Send out the Headers
header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
// Now send the File Contents to the Browser
$size = @filesize($filename);
if ($size)
{
header("Content-length: $size");
}
readfile($filename);
exit;
}
// Start session management
$user->start();
$auth->acl($user->data);
@ -221,4 +125,102 @@ else
exit;
}
// ---------
// FUNCTIONS
//
function send_file_to_browser($attachment, $upload_dir, $category)
{
global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $user, $db, $config;
$filename = ($upload_dir == '') ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename'];
if (!file_exists($filename))
{
trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '<br /><br />' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename));
}
// Determine the Browser the User is using, because of some nasty incompatibilities.
// borrowed from phpMyAdmin. :)
if (!empty($_SERVER['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']))
{
$HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
else if (!isset($HTTP_USER_AGENT))
{
$HTTP_USER_AGENT = '';
}
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[2];
$browser_agent = 'opera';
}
else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'ie';
}
else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'omniweb';
}
else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'netscape';
}
else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'mozilla';
}
else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version))
{
$browser_version = $log_version[1];
$browser_agent = 'konqueror';
}
else
{
$browser_version = 0;
$browser_agent = 'other';
}
// Correct the mime type - we force application/octetstream for all files, except images
// Please do not change this, it is a security precaution
if ($category == NONE_CAT && !strstr($attachment['mimetype'], 'image'))
{
$attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream';
}
// Now the tricky part... let's dance
@ob_end_clean();
@ini_set('zlib.output_compression', 'Off');
header('Pragma: public');
header('Content-Transfer-Encoding: none');
// Send out the Headers
header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $attachment['real_filename'] . '"');
header('Content-Disposition: inline; filename="' . $attachment['real_filename'] . '"');
// Now send the File Contents to the Browser
$size = @filesize($filename);
if ($size)
{
header("Content-length: $size");
}
readfile($filename);
exit;
}
//
// FUNCTIONS
// ---------
?>

View file

@ -1,36 +1,26 @@
<?php
/***************************************************************************
* faq.php
* -------------------
* begin : Sunday, Jul 8, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : faq.php
// STARTED : Mon Jul 8, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$user->start();
$auth->acl($user->data);
$user->setup();
// Load the appropriate faq file
if (isset($_GET['mode']))
{

View file

@ -1,153 +1,38 @@
<?php
/***************************************************************************
* groupcp.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : groupcp.php
// STARTED : Sat Feb 13, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// -------------------------
//
function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim)
{
global $lang, $images, $config, $phpEx;
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;';
$joined = create_date($date_format, $row['user_regdate'], $config['board_timezone']);
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
$poster_avatar = '';
if ( $row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] )
{
switch( $row['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$poster_avatar = ( $config['allow_avatar_upload'] ) ? '<img src="' . $config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$poster_avatar = ( $config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$poster_avatar = ( $config['allow_avatar_local'] ) ? '<img src="' . $config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
if ( !empty($row['user_viewemail']) || $group_mod )
{
$email_uri = ( $config['board_email_form'] ) ? append_sid("ucp.$phpEx?mode=email&amp;" . POST_USERS_URL .'=' . $row['user_id']) : 'mailto:' . $row['user_email'];
$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
}
else
{
$email_img = '&nbsp;';
$email = '&nbsp;';
}
$temp_url = append_sid("ucp.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
$temp_url = append_sid("privmsg.$phpEx?mode=post&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
$www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
$www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
if ( !empty($row['user_icq']) )
{
$icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
$icq_status_img = '';
$icq_img = '';
$icq = '';
}
$aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '';
$aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '';
$temp_url = append_sid("ucp.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
$msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';
$yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&amp;showresults=posts");
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
return;
}
//
// --------------------------
//
// Start session management
//
$user->start();
$user->setup();
$auth->acl($user->data);
//
// End session management
//
$user->setup();
$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx;
$server_name = trim($config['server_name']);
$server_protocol = ( $config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $config['server_port'] <> 80 ) ? ':' . trim($config['server_port']) . '/' : '/';
$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path']));
$script_name = ($script_name != '') ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx;
$server_name = trim($config['server_name']);
$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';
$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/';
$server_url = $server_protocol . $server_name . $server_port . $script_name;
$server_url = $server_protocol . $server_name . $server_port . $script_name;
if ( isset($_GET[POST_GROUPS_URL]) || isset($_POST[POST_GROUPS_URL]) )
{
$group_id = ( isset($_GET[POST_GROUPS_URL]) ) ? intval($_GET[POST_GROUPS_URL]) : intval($_POST[POST_GROUPS_URL]);
}
else
{
$group_id = '';
}
if ( isset($_POST['mode']) || isset($_GET['mode']) )
{
$mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
}
else
{
$mode = '';
}
$confirm = ( isset($_POST['confirm']) ) ? TRUE : 0;
$cancel = ( isset($_POST['cancel']) ) ? TRUE : 0;
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
$group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : false;
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : false;
$confirm = (!empty($_POST['confirm'])) ? TRUE : 0;
$cancel = (!empty($_POST['cancel'])) ? TRUE : 0;
$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0;
//
// Default var values
@ -166,7 +51,7 @@ if ( isset($_POST['groupstatus']) && $group_id )
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
@ -177,7 +62,7 @@ if ( isset($_POST['groupstatus']) && $group_id )
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['Not_group_moderator'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Not_group_moderator'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -187,14 +72,14 @@ if ( isset($_POST['groupstatus']) && $group_id )
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">')
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">')
);
$message = $lang['Group_type_updated'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Group_type_updated'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
@ -217,7 +102,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
AND ug.group_id = g.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not obtain user and group information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
@ -232,7 +117,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['Already_member_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Already_member_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -244,7 +129,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['This_closed_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['This_closed_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -258,7 +143,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
VALUES ($group_id, " . $user->data['user_id'] . ", 1)";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql);
trigger_error("Error inserting user group subscription", "", __LINE__, __FILE__, $sql);
}
$sql = "SELECT u.user_email, u.username, u.user_lang, g.group_name
@ -267,7 +152,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
AND g.group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, "Error getting group moderator data", "", __LINE__, __FILE__, $sql);
trigger_error("Error getting group moderator data", "", __LINE__, __FILE__, $sql);
}
$moderator = $db->sql_fetchrow($result);
@ -287,7 +172,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
'GROUP_MODERATOR' => $moderator['username'],
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true")
'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id&validate=true")
);
$emailer->send();
$emailer->reset();
@ -296,7 +181,7 @@ else if ( isset($_POST['joingroup']) && $group_id )
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['Group_joined'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Group_joined'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -322,7 +207,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
AND group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql);
trigger_error('Could not delete group memebership data', '', __LINE__, __FILE__, $sql);
}
if ( $user->data['user_level'] != ADMIN && $user->data['user_level'] == MOD )
@ -334,7 +219,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
AND aa.auth_mod = 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
trigger_error('Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
@ -344,7 +229,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
WHERE user_id = " . $user->data['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
}
@ -353,7 +238,7 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['Usub_success'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Usub_success'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -361,10 +246,9 @@ else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
{
$unsub_msg = ( isset($_POST['unsub']) ) ? $lang['Confirm_unsub'] : $lang['Confirm_unsub_pending'];
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" /><input type="hidden" name="unsub" value="1" />';
$s_hidden_fields = '<input type="hidden" name="' . 'g' . '" value="' . $group_id . '" /><input type="hidden" name="unsub" value="1" />';
$page_title = $lang['Group_Control_Panel'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'confirm' => 'confirm_body.tpl')
@ -437,7 +321,7 @@ else if ( $group_id )
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not get moderator information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not get moderator information', '', __LINE__, __FILE__, $sql);
}
if ( $group_info = $db->sql_fetchrow($result) )
@ -479,16 +363,16 @@ else if ( $group_id )
WHERE username = '" . str_replace("\'", "''", $username) . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, "Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql);
trigger_error("Could not get user information", $lang['Error'], __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">')
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">')
);
$message = $lang['Could_not_add_user'] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
$message = $lang['Could_not_add_user'] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
message_die(MESSAGE, $message);
}
@ -496,10 +380,10 @@ else if ( $group_id )
if ( $row['user_id'] == ANONYMOUS )
{
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">')
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">')
);
$message = $lang['Could_not_anon_user'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['Could_not_anon_user'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -511,7 +395,7 @@ else if ( $group_id )
AND ug.group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not get user information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not get user information', '', __LINE__, __FILE__, $sql);
}
if ( !($db->sql_fetchrow($result)) )
@ -520,7 +404,7 @@ else if ( $group_id )
VALUES (" . $row['user_id'] . ", $group_id, 0)";
if ( !$db->sql_query($sql) )
{
message_die(ERROR, 'Could not add user to group', '', __LINE__, __FILE__, $sql);
trigger_error('Could not add user to group', '', __LINE__, __FILE__, $sql);
}
if ( $row['user_level'] != ADMIN && $row['user_level'] != MOD && $group_info['auth_mod'] )
@ -530,7 +414,7 @@ else if ( $group_id )
WHERE user_id = " . $row['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
@ -543,7 +427,7 @@ else if ( $group_id )
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($group_sql)) )
{
message_die(ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
trigger_error('Could not get group information', '', __LINE__, __FILE__, $group_sql);
}
$group_name_row = $db->sql_fetchrow($result);
@ -565,7 +449,7 @@ else if ( $group_id )
'GROUP_NAME' => $group_name,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id")
);
$emailer->send();
$emailer->reset();
@ -573,10 +457,10 @@ else if ( $group_id )
else
{
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">')
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">')
);
$message = $lang['User_is_member_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
$message = $lang['User_is_member_group'] . '<br /><br />' . sprintf($lang['Click_return_group'], '<a href="' . append_sid("groupcp.$phpEx?" . 'g' . "=$group_id") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(MESSAGE, $message);
}
@ -604,7 +488,7 @@ else if ( $group_id )
AND user_level NOT IN (" . MOD . ", " . ADMIN . ")";
if ( !$db->sql_query($sql) )
{
message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
@ -629,7 +513,7 @@ else if ( $group_id )
ORDER BY ug.user_id, ug.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
trigger_error('Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
@ -659,7 +543,7 @@ else if ( $group_id )
AND user_level NOT IN (" . ADMIN . ")";
if ( !$db->sql_query($sql) )
{
message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
trigger_error('Could not update user level', '', __LINE__, __FILE__, $sql);
}
}
}
@ -672,7 +556,7 @@ else if ( $group_id )
if ( !$db->sql_query($sql) )
{
message_die(ERROR, 'Could not update user group table', '', __LINE__, __FILE__, $sql);
trigger_error('Could not update user group table', '', __LINE__, __FILE__, $sql);
}
//
@ -682,7 +566,7 @@ else if ( $group_id )
{
if ( !($result = $db->sql_query($sql_select)) )
{
message_die(ERROR, 'Could not get user email information', '', __LINE__, __FILE__, $sql);
trigger_error('Could not get user email information', '', __LINE__, __FILE__, $sql);
}
$email_addresses = '';
@ -699,7 +583,7 @@ else if ( $group_id )
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($group_sql)) )
{
message_die(ERROR, 'Could not get group information', '', __LINE__, __FILE__, $group_sql);
trigger_error('Could not get group information', '', __LINE__, __FILE__, $group_sql);
}
$group_name_row = $db->sql_fetchrow($result);
@ -720,7 +604,7 @@ else if ( $group_id )
'GROUP_NAME' => $group_name,
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id")
'U_GROUPCP' => $server_url . '?' . 'g' . "=$group_id")
);
$emailer->send();
$emailer->reset();
@ -742,11 +626,10 @@ else if ( $group_id )
//
$sql = "SELECT *
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id
AND group_single_user = 0";
WHERE group_id = $group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql);
}
if ( !($group_info = $db->sql_fetchrow($result)) )
@ -762,7 +645,7 @@ else if ( $group_id )
WHERE user_id = " . $group_info['group_moderator'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting user list for group', '', __LINE__, __FILE__, $sql);
}
$group_moderator = $db->sql_fetchrow($result);
@ -779,7 +662,7 @@ else if ( $group_id )
ORDER BY u.username";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting user list for group', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting user list for group', '', __LINE__, __FILE__, $sql);
}
$group_members = $db->sql_fetchrowset($result);
@ -795,7 +678,7 @@ else if ( $group_id )
ORDER BY u.username";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting user pending information', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting user pending information', '', __LINE__, __FILE__, $sql);
}
$modgroup_pending_list = $db->sql_fetchrowset($result);
@ -837,7 +720,7 @@ else if ( $group_id )
$group_details = $lang['Are_group_moderator'];
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
$s_hidden_fields = '<input type="hidden" name="' . 'g' . '" value="' . $group_id . '" />';
}
else if ( $is_group_member || $is_group_pending_member )
{
@ -845,7 +728,7 @@ else if ( $group_id )
$group_details = ( $is_group_pending_member ) ? $lang['Pending_this_group'] : $lang['Member_this_group'];
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
$s_hidden_fields = '<input type="hidden" name="' . 'g' . '" value="' . $group_id . '" />';
}
else if ( $user->data['user_id'] == ANONYMOUS )
{
@ -859,7 +742,7 @@ else if ( $group_id )
$template->assign_block_vars('switch_subscribe_group_input', array());
$group_details = $lang['This_open_group'];
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
$s_hidden_fields = '<input type="hidden" name="' . 'g' . '" value="' . $group_id . '" />';
}
else if ( $group_info['group_type'] == GROUP_CLOSED )
{
@ -874,7 +757,6 @@ else if ( $group_id )
}
$page_title = $lang['Group_Control_Panel'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
//
// Load templates
@ -894,39 +776,7 @@ else if ( $group_id )
generate_user_info($group_moderator, $config['default_dateformat'], $is_moderator, $from, $posts, $joined, $poster_avatar, $profile_img, $profile, $search_img, $search, $pm_img, $pm, $email_img, $email, $www_img, $www, $icq_status_img, $icq_img, $icq, $aim_img, $aim, $msn_img, $msn, $yim_img, $yim);
$template->assign_vars(array(
'L_GROUP_INFORMATION' => $lang['Group_Information'],
'L_GROUP_NAME' => $lang['Group_name'],
'L_GROUP_DESC' => $lang['Group_description'],
'L_GROUP_TYPE' => $lang['Group_type'],
'L_GROUP_MEMBERSHIP' => $lang['Group_membership'],
'L_SUBSCRIBE' => $lang['Subscribe'],
'L_UNSUBSCRIBE' => $lang['Unsubscribe'],
'L_JOIN_GROUP' => $lang['Join_group'],
'L_UNSUBSCRIBE_GROUP' => $lang['Unsubscribe'],
'L_GROUP_OPEN' => $lang['Group_open'],
'L_GROUP_CLOSED' => $lang['Group_closed'],
'L_GROUP_HIDDEN' => $lang['Group_hidden'],
'L_UPDATE' => $lang['Update'],
'L_GROUP_MODERATOR' => $lang['Group_Moderator'],
'L_GROUP_MEMBERS' => $lang['Group_Members'],
'L_PENDING_MEMBERS' => $lang['Pending_members'],
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
'L_PM' => $lang['Private_Message'],
'L_EMAIL' => $lang['Email'],
'L_POSTS' => $lang['Posts'],
'L_WEBSITE' => $lang['Website'],
'L_FROM' => $lang['Location'],
'L_ORDER' => $lang['Order'],
'L_SORT' => $lang['Sort'],
'L_SUBMIT' => $lang['Sort'],
'L_AIM' => $lang['AIM'],
'L_YIM' => $lang['YIM'],
'L_MSNM' => $lang['MSNM'],
'L_ICQ' => $lang['ICQ'],
'L_SELECT' => $lang['Select'],
'L_REMOVE_SELECTED' => $lang['Remove_selected'],
'L_ADD_MEMBER' => $lang['Add_member'],
'L_FIND_USERNAME' => $lang['Find_username'],
'GROUP_NAME' => $group_info['group_name'],
'GROUP_DESC' => $group_info['group_description'],
@ -970,7 +820,7 @@ else if ( $group_id )
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_MODE_SELECT' => $select_sort_mode,
'S_ORDER_SELECT' => $select_sort_order,
'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id"))
'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . 'g' . "=$group_id"))
);
//
@ -1041,7 +891,7 @@ else if ( $group_id )
$current_page = ( !$members_count ) ? 1 : ceil( $members_count / $config['topics_per_page'] );
$template->assign_vars(array(
'PAGINATION' => generate_pagination("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id", $members_count, $config['topics_per_page'], $start),
'PAGINATION' => generate_pagination("groupcp.$phpEx?" . 'g' . "=$group_id", $members_count, $config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $config['topics_per_page'] ) + 1 ), $current_page ),
'L_GOTO_PAGE' => $lang['Goto_page'])
@ -1149,11 +999,10 @@ else
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id = " . $user->data['user_id'] . "
AND ug.group_id = g.group_id
AND g.group_single_user <> " . TRUE . "
ORDER BY g.group_name, ug.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
@ -1176,23 +1025,22 @@ else
}
while( $row = $db->sql_fetchrow($result) );
$s_pending_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_pending_groups_opt . "</select>";
$s_member_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_member_groups_opt . "</select>";
$s_pending_groups = '<select name="' . 'g' . '">' . $s_pending_groups_opt . "</select>";
$s_member_groups = '<select name="' . 'g' . '">' . $s_member_groups_opt . "</select>";
}
}
//
// Select all other groups i.e. groups that this user is not a member of
//
$ignore_group_sql = ( count($in_group) ) ? "AND group_id NOT IN (" . implode(', ', $in_group) . ")" : '';
$ignore_group_sql = ( count($in_group) ) ? "WHERE group_id NOT IN (" . implode(', ', $in_group) . ")" : '';
$sql = "SELECT group_id, group_name, group_type
FROM " . GROUPS_TABLE . " g
WHERE group_single_user <> " . TRUE . "
$ignore_group_sql
$ignore_group_sql
ORDER BY g.group_name";
if ( !($result = $db->sql_query($sql)) )
{
message_die(ERROR, 'Error getting group information', '', __LINE__, __FILE__, $sql);
trigger_error('Error getting group information', '', __LINE__, __FILE__, $sql);
}
$s_group_list_opt = '';
@ -1203,19 +1051,13 @@ else
$s_group_list_opt .='<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
}
}
$s_group_list = '<select name="' . POST_GROUPS_URL . '">' . $s_group_list_opt . '</select>';
$s_group_list = '<select name="' . 'g' . '">' . $s_group_list_opt . '</select>';
if ( $s_group_list_opt != '' || $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
{
//
// Load and process templates
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'user' => 'groupcp_user_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);
if ( $s_pending_groups_opt != '' || $s_member_groups_opt != '' )
{
@ -1240,32 +1082,116 @@ else
$s_hidden_fields = '<input type="hidden" name="sid" value="' . $user->data['session_id'] . '" />';
$template->assign_vars(array(
'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'],
'L_JOIN_A_GROUP' => $lang['Group_member_join'],
'L_YOU_BELONG_GROUPS' => $lang['Current_memberships'],
'L_SELECT_A_GROUP' => $lang['Non_member_groups'],
'L_PENDING_GROUPS' => $lang['Memberships_pending'],
'L_SUBSCRIBE' => $lang['Subscribe'],
'L_UNSUBSCRIBE' => $lang['Unsubscribe'],
'L_VIEW_INFORMATION' => $lang['View_Information'],
'S_USERGROUP_ACTION' => append_sid("groupcp.$phpEx"),
'S_USERGROUP_ACTION' => "groupcp.$phpEx$SID",
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'GROUP_LIST_SELECT' => $s_group_list,
'GROUP_PENDING_SELECT' => $s_pending_groups,
'GROUP_MEMBER_SELECT' => $s_member_groups)
);
$template->pparse('user');
}
else
{
message_die(MESSAGE, $lang['No_groups_exist']);
trigger_error($user->lang['No_groups_exist']);
}
// Output the page
page_header($user->lang['WHO_IS_ONLINE']);
$template->set_filenames(array(
'body' => 'gcp_user_body.html')
);
make_jumpbox('viewforum.'.$phpEx);
page_footer();
}
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
// ---------
// FUNCTIONS
//
function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim)
{
global $lang, $images, $config, $phpEx;
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;';
$joined = create_date($date_format, $row['user_regdate'], $config['board_timezone']);
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
$poster_avatar = '';
if ( $row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] )
{
switch( $row['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$poster_avatar = ( $config['allow_avatar_upload'] ) ? '<img src="' . $config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_REMOTE:
$poster_avatar = ( $config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
case USER_AVATAR_GALLERY:
$poster_avatar = ( $config['allow_avatar_local'] ) ? '<img src="' . $config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
break;
}
}
if ( !empty($row['user_viewemail']) || $group_mod )
{
$email_uri = ( $config['board_email_form'] ) ? append_sid("ucp.$phpEx?mode=email&amp;" . POST_USERS_URL .'=' . $row['user_id']) : 'mailto:' . $row['user_email'];
$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
}
else
{
$email_img = '&nbsp;';
$email = '&nbsp;';
}
$temp_url = append_sid("ucp.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
$temp_url = append_sid("privmsg.$phpEx?mode=post&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
$www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
$www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
if ( !empty($row['user_icq']) )
{
$icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
$icq_status_img = '';
$icq_img = '';
$icq = '';
}
$aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '';
$aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '';
$temp_url = append_sid("ucp.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']);
$msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
$msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';
$yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&amp;showresults=posts");
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . $lang['Search_user_posts'] . '" border="0" /></a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
return;
}
//
// FUNCTIONS
// ---------
?>

View file

@ -11,6 +11,7 @@
//
// -------------------------------------------------------------
function set_config($config_name, $config_value, $is_dynamic = FALSE)
{
global $db, $cache, $config;
@ -215,7 +216,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false)
$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
FROM ' . FORUMS_TABLE . '
ORDER BY left_id ASC';
$result = $db->sql_query($sql, 600);
$result = $db->sql_query($sql);
$right = $cat_right = $padding_inc = 0;
$padding = $forum_list = $holding = '';
@ -236,7 +237,7 @@ function make_jumpbox($action, $forum_id = false, $select_all = false)
if ($row['left_id'] < $right)
{
$padding .= '&nbsp; &nbsp; &nbsp;';
$padding .= '&nbsp; &nbsp;';
$padding_store[$row['parent_id']] = $padding;
}
else if ($row['left_id'] > $right + 1)
@ -376,7 +377,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
{
$is_watching = 0;
$sql = "DELETE FROM " . $table_sql . "
$sql = 'DELETE FROM ' . $table_sql . "
WHERE $where_sql = $match_id
AND user_id = $user_id";
$db->sql_query($sql);
@ -393,7 +394,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
if ($notify_status)
{
$sql = "UPDATE " . $table_sql . "
$sql = 'UPDATE ' . $table_sql . "
SET notify_status = 0
WHERE $where_sql = $match_id
AND user_id = $user_id";
@ -409,7 +410,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
{
$is_watching = TRUE;
$sql = "INSERT INTO " . $table_sql . " (user_id, $where_sql, notify_status)
$sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status)
VALUES ($user_id, $match_id, 0)";
$db->sql_query($sql);
}
@ -691,11 +692,11 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$page_string .= ($on_page == $total_pages) ? '<b>' . $total_pages . '</b>' : '<a href="' . $base_url . '&amp;start=' . (($total_pages - 1) * $per_page) . '">' . $total_pages . '</a>&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ($on_page * $per_page) . '">' . $user->lang['NEXT'] . '</a>';
$page_string = $user->lang['GOTO_PAGE'] . ' ' . $page_string;
// $page_string = '<a href="javascript:goto();">' . $user->lang['GOTO_PAGE'] . '</a> ' . $page_string;
// $page_string = $user->lang['GOTO_PAGE'] . ' ' . $page_string;
$page_string = '<a href="javascript:jumpto();">' . $user->lang['GOTO_PAGE'] . '</a> ' . $page_string;
// $template->assign_var('BASE_URL', $base_url);
// $template->assign_var('PER_PAGE', $per_page);
$template->assign_var('BASE_URL', $base_url);
$template->assign_var('PER_PAGE', $per_page);
return $page_string;
}
@ -706,7 +707,7 @@ function on_page($num_items, $per_page, $start)
$on_page = floor($start / $per_page) + 1;
// $template->assign_var('ON_PAGE', $on_page);
$template->assign_var('ON_PAGE', $on_page);
return sprintf($user->lang['PAGE_OF'], $on_page, max(ceil($num_items / $per_page), 1));
}
@ -961,16 +962,13 @@ function login_box($s_action, $s_hidden_fields = '', $login_explain = '')
page_footer();
}
// TODO
// If forum has parents, check to see if password has been entered
// for those (if it/they are the same as this forums).? If they are
// different then we ignore them as if they were blank
// Generate forum login box
function login_forum_box(&$forum_data)
{
global $db, $config, $user, $template, $phpEx;
$sql = 'SELECT forum_id
FROM phpbb_forum_access
FROM ' . FORUMS_ACCESS_TABLE . '
WHERE forum_id = ' . $forum_data['forum_id'] . '
AND user_id = ' . $user->data['user_id'] . "
AND session_id = '$user->session_id'";
@ -987,6 +985,7 @@ function login_forum_box(&$forum_data)
{
// TODO
// Remove old valid sessions
$sql = '';
if ($_POST['password'] == $forum_data['forum_password'])
{

View file

@ -15,6 +15,141 @@
// User functions
//
function normalise_data(&$data, &$normalise)
{
$valid_data = array();
foreach ($normalise as $var_type => $var_ary)
{
foreach ($var_ary as $var_name => $var_limits)
{
$var_name = (is_string($var_name)) ? $var_name : $var_limits;
$l_prefix = strtoupper($var_name);
if (isset($data[$var_name]))
{
switch ($var_type)
{
case 'i':
$valid_data[$var_name] = (int) $data[$var_name];
break;
case 'f':
$valid_data[$var_name] = (double) $data[$var_name];
break;
case 'b':
$valid_data[$var_name] = ($data[$var_name] <= 0) ? 0 : 1;
break;
case 's':
// Cleanup data, remove excess spaces, convert entity forms
$valid_data[$var_name] = trim(preg_replace('#\s{2,}#s', ' ', strtr((string) $data[$var_name], array_flip(get_html_translation_table(HTML_ENTITIES)))));
// How should we check this data?
if (!is_array($var_limits))
{
// Is the match a string? If it is, process it further, else we'll
// assume it's a maximum length
if (is_string($var_limits))
{
if (strstr($var_limits, ','))
{
list($min_value, $max_value) = explode(',', $var_limits);
if (!empty($valid_data[$var_name]) && strlen($valid_data[$var_name]) < $min_value)
{
$this->error[] = $l_prefix . '_TOO_SHORT';
}
if (strlen($valid_data[$var_name]) > $max_value)
{
$this->error[] = $l_prefix . '_TOO_LONG';
}
}
}
else
{
if (strlen($valid_data[$var_name]) > $var_limits)
{
$this->error[] = $l_prefix . '_TOO_LONG';
}
}
}
break;
}
}
}
}
return $valid_data;
}
// Validates data subject to supplied requirements, errors appropriately
function validate_data(&$data, &$validate)
{
global $db, $user, $config;
foreach ($validate as $operation => $var_ary)
{
foreach ($var_ary as $var_name => $compare)
{
$l_prefix = strtoupper($var_name);
if (!empty($compare))
{
switch ($operation)
{
case 'm':
if (is_array($compare))
{
foreach ($compare as $match)
{
if (!preg_match($match, $data[$var_name]))
{
$this->error[] = $l_prefix . '_WRONG_DATA';
}
}
}
else if (!preg_match($compare, $data[$var_name]))
{
$this->error[] = $l_prefix . '_WRONG_DATA';
}
break;
case 'c':
if (is_array($compare))
{
if (!in_array($data[$var_name], $compare))
{
$this->error[] = $l_prefix . '_MISMATCH';
}
}
else if ($data[$var_name] != $compare)
{
$this->error[] = $l_prefix . '_MISMATCH';
}
break;
case 'f':
if ($result = $compare($data[$var_name]))
{
$this->error[] = $result;
}
break;
case 'r':
if (!isset($data[$compare]) || (is_string($data[$compare]) && $data[$compare] === ''))
{
$this->error[] = strtoupper($compare) . '_MISSING_DATA';
}
break;
}
}
}
}
}
// Generates an alphanumeric random string of given length
function gen_rand_string($num_chars)
{

View file

@ -258,7 +258,8 @@ class session
$sql_ary = array(
'session_id' => (string) $this->session_id,
'session_user_id' => (int) $user_id,
'session_start' => (int) $this->data['session_last_visit'],
'session_start' => (int) $current_time,
'session_last_visit' => (int) $this->data['session_last_visit'],
'session_time' => (int) $current_time,
'session_ip' => (string) $this->ip,
'session_browser' => (string) $this->browser,
@ -282,7 +283,7 @@ class session
if ($this->data['user_id'] != ANONYMOUS)
{
// Trigger EVENT_NEW_SESSION
// Trigger EVT_NEW_SESSION
}
return true;
@ -312,6 +313,11 @@ class session
$this->session_id = '';
if ($this->data['user_id'] != ANONYMOUS)
{
// Trigger EVT_END_SESSION
}
return true;
}
@ -467,6 +473,7 @@ class user extends session
if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
{
global $SID;
$style = intval($_GET['style']);
$SID .= '&amp;style=' . $style;
}
@ -482,7 +489,7 @@ class user extends session
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_id';
$result = $db->sql_query($sql, 600);
$result = $db->sql_query($sql, 3600);
if (!($row = $db->sql_fetchrow($result)))
{

View file

@ -4,8 +4,8 @@
// $Id$
//
// FILENAME : ucp_main.php
// STARTED : Sat Feb 21, 2003
// COPYRIGHT : © 2003 phpBB Group
// STARTED : Mon May 19, 2003
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//

View file

@ -43,23 +43,23 @@ class ucp_prefs extends ucp
{
$data = array();
$normalise = array(
'string' => array(
's' => array(
'dateformat'=> '3,15',
'lang' => '2,5',
),
'int' => array('dst', 'style'),
'float' => array('tz'),
'bool' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm')
'i' => array('dst', 'style'),
'f' => array('tz'),
'b' => array('viewemail', 'massemail', 'hideonline', 'notifypm', 'popuppm')
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
$validate = array(
'reqd' => array('lang', 'tz', 'dateformat', 'style'),
'match' => array(
'r' => array('lang', 'tz', 'dateformat', 'style'),
'm' => array(
'lang' => ($data['lang']) ? '#^[a-z_]+$#i' : '',
),
);
$this->validate_data($data, $validate);
validate_data($data, $validate);
if (!sizeof($this->error))
{
@ -147,14 +147,14 @@ class ucp_prefs extends ucp
{
$data = array();
$normalise = array(
'string' => array(
's' => array(
'sk' => '1,1',
'sd' => '1,1',
),
'int' => array('st', 'minkarma'),
'bool' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'),
'i' => array('st', 'minkarma'),
'b' => array('images', 'flash', 'smilies', 'sigs', 'avatars', 'wordcensor'),
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
if (!sizeof($this->error))
{
@ -257,9 +257,9 @@ class ucp_prefs extends ucp
{
$data = array();
$normalise = array(
'bool' => array('bbcode', 'html', 'smilies', 'sig', 'notify'),
'b' => array('bbcode', 'html', 'smilies', 'sig', 'notify'),
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
if (!sizeof($this->error))
{

View file

@ -37,11 +37,12 @@ class ucp_profile extends ucp
{
case 'reg_details':
if (isset($_POST['submit']))
if ($submit)
{
$data = array();
$normalise = array(
'string' => array(
's' => array(
'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'],
'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
@ -50,27 +51,29 @@ class ucp_profile extends ucp
'email_confirm' => '7,60',
)
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
// md5 current password for checking
$data['cur_password'] = md5($data['cur_password']);
$validate = array(
'reqd' => array('username', 'email'),
'compare' => array(
'r' => array('username', 'email'),
'c' => array(
'password_confirm' => ($data['new_password']) ? $data['new_password'] : '',
'cur_password' => ($data['new_password'] || $data['email'] != $user->data['user_email'] || $data['username'] != $user->data['username']) ? $user->data['user_password'] : '',
'email_confirm' => ($data['email'] != $user->data['user_email']) ? $data['email'] : '',
),
'match' => array(
'm' => array(
'username' => ($data['username'] != $user->data['username']) ? '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu' : '',
),
'function' => array(
'f' => array(
'username' => ($data['username'] != $user->data['username']) ? 'validate_username' : '',
'email' => ($data['email'] != $user->data['user_email']) ? 'validate_email' : '',
),
);
$this->validate_data($data, $validate);
validate_data($data, $validate);
if (!sizeof($this->error))
{
@ -128,7 +131,7 @@ class ucp_profile extends ucp
{
$data = array();
$normalise = array(
'string' => array(
's' => array(
'icq' => '3,15',
'aim' => '5,255',
'msn' => '5,255',
@ -139,17 +142,17 @@ class ucp_profile extends ucp
'occupation'=> '2,500',
'interests' => '2,500',
),
'int' => array('bday_day', 'bday_month', 'bday_year')
'i' => array('bday_day', 'bday_month', 'bday_year')
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
$validate = array(
'match' => array(
'm' => array(
'icq' => ($data['icq']) ? '#^[0-9]+$#i' : '',
'website' => ($data['website']) ? '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i' : '',
),
);
$this->validate_data($data, $validate);
validate_data($data, $validate);
if (!sizeof($this->error))
{
@ -261,7 +264,7 @@ class ucp_profile extends ucp
$message_parser = new parse_message();
$message_parser->message = $signature;
$message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies);
echo ">>" . $signature = $message_parser->message;
$signature = $message_parser->message;
$sql_ary = array(
'user_sig' => $signature,
@ -269,7 +272,7 @@ class ucp_profile extends ucp
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
);
echo $sql = 'UPDATE ' . USERS_TABLE . '
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
$db->sql_query($sql);
@ -356,24 +359,24 @@ class ucp_profile extends ucp
else if (!empty($_POST['uploadurl']) && $can_upload)
{
$normalise = array(
'string' => array(
's' => array(
'uploadurl' => '1,255',
)
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
$this->error = avatar_upload($data);
}
else if (!empty($_POST['remotelink']) && $auth->acl_get('u_chgavatar') && $config['allow_avatar_remote'])
{
$normalise = array(
'string' => array(
's' => array(
'remotelink' => '1,255',
'width' => '1,3',
'height' => '1,3',
)
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
$this->error = avatar_remote($data);
}

View file

@ -72,7 +72,7 @@ class ucp_register extends ucp
if (isset($_POST['submit']))
{
$normalise = array(
'string' => array(
's' => array(
'username' => $config['min_name_chars'] . ',' . $config['max_name_chars'],
'password_confirm' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
'new_password' => $config['min_pass_chars'] . ',' . $config['max_pass_chars'],
@ -81,25 +81,25 @@ class ucp_register extends ucp
'email' => '7,60',
'email_confirm' => '7,60',
),
'float' => array('tz')
'f' => array('tz')
);
$data = $this->normalise_data($_POST, $normalise);
$data = normalise_data($_POST, $normalise);
$validate = array(
'reqd' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'),
'compare' => array(
'r' => array('username', 'email', 'email_confirm', 'new_password', 'password_confirm', 'lang', 'confirm_code', 'tz'),
'c' => array(
'password_confirm' => $data['new_password'],
'email_confirm' => $data['email'],
),
'match' => array(
'm' => array(
'username' => '#^' . preg_replace('#/{1}#', '\\', $config['allow_name_chars']) . '$#iu',
),
'function' => array(
'f' => array(
'username' => 'validate_username',
'email' => 'validate_email',
),
);
$this->validate_data($data, $validate);
validate_data($data, $validate);
// Visual Confirmation handling
if ($config['enable_confirm'])

View file

@ -1,27 +1,19 @@
<?php
/***************************************************************************
* index.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : index.php
// STARTED : Sat Feb 13, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// Get posted/get info

View file

@ -92,9 +92,24 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port','25');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port','5222');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_aim_enable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_aim_user','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_aim_pass','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_icq_enable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_icq_user','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_icq_pass','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_msn_enable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_msn_user','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_msn_pass','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_yim_enable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_yim_user','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_yim_pass','');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval','15');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval','0');

View file

@ -45,6 +45,7 @@ $lang += array(
'EVENTS' => 'Events',
'CRON' => 'Cronjobs',
'PHP_INFO' => 'PHP Information',
'IM' => 'Jabber Settings',
'GROUP_CAT' => 'Usergroups',
'CREATE' => 'Create',
@ -468,42 +469,83 @@ $lang += array(
// Banning
$lang += array(
'BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <u>Until</u> for the ban length and enter a date in yyyy-mm-dd format.',
'BAN_LENGTH' => 'Length of ban',
'PERMANENT' => 'Permanent',
'30_MINS' => '30 Minutes',
'1_HOUR' => '1 Hour',
'6_HOURS' => '6 Hours',
'OTHER' => 'Until',
'BAN_EXCLUDE' => 'Exclude from banning',
'BAN_USER_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.',
'BAN_EXPLAIN' => 'Here you can control the banning of users by name, IP or email address. These methods prevent a user reaching any part of the board. You can give a short (255 character) reason for the ban if you wish. This will be displayed in the admin log. The length of a ban can also be specified. If you want the ban to end on a specific date rather than after a set time period select <u>Until</u> for the ban length and enter a date in yyyy-mm-dd format.',
'BAN_EXCLUDE' => 'Exclude from banning',
'BAN_REASON' => 'Reason for ban',
'BAN_LENGTH' => 'Length of ban',
'PERMANENT' => 'Permanent',
'30_MINS' => '30 Minutes',
'1_HOUR' => '1 Hour',
'6_HOURS' => '6 Hours',
'OTHER' => 'Until',
'BAN_USERNAME_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a Username</u> facility to look up and add one or more users automatically.',
'UNBAN_USERNAME' => 'Un-ban or Un-exclude usernames',
'UNBAN_USERNAME_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users have a grey background.',
'BAN_USER_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.',
'NO_BANNED_USERS' => 'No banned usernames',
'IP_HOSTNAME' => 'IP addresses or hostnames',
'BAN_IP_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *',
'UNBAN_IP' => 'Un-ban or Un-exclude IPs',
'UNBAN_IP_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.',
'BAN_IP_EXCLUDE_EXPLAIN'=> 'Enable this to exclude the entered IP from all current bans.',
'NO_BANNED_IP' => 'No banned IP addresses',
'BAN_EMAIL' => 'Ban one or more email addresses',
'BAN_EMAIL_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.',
'UNBAN_EMAIL' => 'Un-ban or Un-exclude Emails',
'UNBAN_EMAIL_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses have a grey background.',
'BAN_EMAIL_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered email address from all current bans.',
'BAN_IP_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.',
'BAN_REASON' => 'Reason for ban',
'BAN_USERNAME_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <u>Find a Username</u> facility to look up and add one or more users automatically.',
'UNBAN_USERNAME' => 'Un-ban or Un-exclude usernames',
'UNBAN_USERNAME_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users have a grey background.',
'IP_HOSTNAME' => 'IP addresses or hostnames',
'BAN_IP_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *',
'UNBAN_IP' => 'Un-ban or Un-exclude IPs',
'UNBAN_IP_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.',
'BAN_EMAIL' => 'Ban one or more email addresses',
'BAN_EMAIL_EXPLAIN' => 'To specify more than one email address enter each on a new line. To match partial addresses use * as the wildcard, e.g. *@hotmail.com, *@*.domain.tld, etc.',
'UNBAN_EMAIL' => 'Un-ban or Un-exclude Emails',
'UNBAN_EMAIL_EXPLAIN' => 'You can unban (or un-exclude) multiple email addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded email addresses have a grey background.',
'NO_BANNED_USERS' => 'No banned usernames',
'NO_BANNED_IP' => 'No banned IP addresses',
'NO_BANNED_EMAIL' => 'No banned email addresses',
'BAN_UPDATE_SUCESSFUL' => 'The banlist has been updated successfully',
'NO_BANNED_EMAIL' => 'No banned email addresses',
'BAN_UPDATE_SUCESSFUL' => 'The banlist has been updated successfully',
);
// Jabber settings
$lang += array(
'IM_EXPLAIN' => 'Here you can enable and control the use Jabber for instant messaging and board notices. Jabber is an opensource protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Please note that not all servers offer all transports and changes in protocols can prevent transports from operating.',
'JAB_ENABLE' => 'Enable Jabber',
'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications',
'JAB_SERVER' => 'Jabber server',
'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers',
'JAB_PORT' => 'Jabber port',
'JAB_USERNAME' => 'Jabber username',
'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.',
'JAB_PASSWORD' => 'Jabber password',
'JAB_RESOURCE' => 'Jabber resource',
'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.',
'JAB_TRANSPORTS' => 'Jabber Transports',
'JAB_AIM_ENABLE' => 'Enable AIM transport',
'AIM_USERNAME' => 'AIM Username',
'AIM_USERNAME_EXPLAIN' => 'A valid username on %sAIM%s',
'AIM_PASSWORD' => 'AIM Password',
'JAB_ICQ_ENABLE' => 'Enable ICQ transport',
'ICQ_USERNAME' => 'ICQ UID',
'ICQ_USERNAME_EXPLAIN' => 'A valid user id on %sICQ%s',
'ICQ_PASSWORD' => 'ICQ Password',
'JAB_MSN_ENABLE' => 'Enable MSN transport',
'MSN_USERNAME' => 'MSN Username',
'MSN_USERNAME_EXPLAIN' => 'A valid username on %sMSN%s',
'MSN_PASSWORD' => 'MSN Password',
'JAB_YIM_ENABLE' => 'Enable YIM transport',
'YIM_USERNAME' => 'YIM Username',
'YIM_USERNAME_EXPLAIN' => 'A valid username on %sYIM%s',
'YIM_PASSWORD' => 'YIM Password',
);
// Cookie settings
$lang += array(
'COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.',
'COOKIE_DOMAIN' => 'Cookie domain',
'COOKIE_NAME' => 'Cookie name',
'COOKIE_PATH' => 'Cookie path',
'COOKIE_SECURE' => 'Cookie secure',
'COOKIE_SETTINGS_EXPLAIN' => 'These details define the data used to send cookies to your users browsers. In most cases the default values for the cookie settings should be sufficient. If you do need to change any do so with care, incorrect settings can prevent users logging in.',
'COOKIE_DOMAIN' => 'Cookie domain',
'COOKIE_NAME' => 'Cookie name',
'COOKIE_PATH' => 'Cookie path',
'COOKIE_SECURE' => 'Cookie secure',
'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled',
);

View file

@ -447,7 +447,7 @@ $lang += array(
'DISPLAY_POSTS' => 'Display posts from previous',
'ALL_POSTS' => 'All Posts',
'BACK_TO_TOP' => 'Back to top',
'BACK_TO_TOP' => 'Top',
'POST_SUBJECT' => 'Post subject',
'KARMA_LEVEL' => 'Karma Level',
'READ_PROFILE' => 'Profile',
@ -994,6 +994,7 @@ $lang += array(
'BEFORE' => 'Before',
'AFTER' => 'After',
'NEVER' => 'Never',
'SELECT_MARKED' => 'Select Marked',
'SEND_EMAIL' => 'Send Email',
'NO_EMAIL' => 'You are not permitted to send email to this user.',
@ -1107,40 +1108,48 @@ $lang += array(
// search
$lang += array(
'Search_query' => 'Search Query',
'Search_options' => 'Search Options',
'Search_keywords' => 'Search for Keywords',
'Search_keywords_explain' => 'You can use <u>AND</u> to define words which must be in the results, <u>OR</u> to define words which may be in the result and <u>NOT</u> to define words which should not be in the result. Use * as a wildcard for partial matches',
'Search_author' => 'Search for Author',
'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches',
'Last_active' => 'Last active',
'SELECT_MARKED' => 'Select Marked',
'Search_for_any' => 'Search for any terms or use query as entered',
'Search_for_all' => 'Search for all terms',
'Search_title_msg' => 'Search topic title and message text',
'Search_msg_only' => 'Search message text only',
'Return_first' => 'Return first',
'characters_posts' => 'characters of posts',
'Search_previous' => 'Search previous',
'SEARCH_QUERY' => 'Search Query',
'SEARCH_OPTIONS' => 'Search Options',
'SORT_BY' => 'Sort by',
'SORT_TIME' => 'Post Time',
'SEARCH_KEYWORDS' => 'Search for Keywords',
'SEARCH_KEYWORDS_EXPLAIN' => 'Use <b>+</b> for words which must be found, <b>-</b> for words which must not be found and <b>|</b> for words which may or may not be found. Use * as a wildcard for partial matches',
'SEARCH_AUTHOR' => 'Search for Author',
'SEARCH_AUTHOR_EXPLAIN' => 'Use * as a wildcard for partial matches',
'SEARCH_FORUMS' => 'Search in forums',
'SEARCH_FORUMS_EXPLAIN' => 'Select the forum or forums you wish to search in. For speed all subforums can be searched by selecting the parent and setting enable search subforums below.',
'SEARCH_ALL_TERMS' => 'Search for all terms or use query as entered',
'SEARCH_ANY_TERMS' => 'Search for any terms',
'SEARCH_WITHIN' => 'Search within',
'SEARCH_TITLE_MSG' => 'Topic titles and message text',
'SEARCH_MSG_ONLY' => 'Message text only',
'SEARCH_TITLE_ONLY' => 'Topic titles only',
'RETURN_FIRST' => 'Return first',
'POST_CHARACTERS' => 'characters of posts',
'SEARCH_PREVIOUS' => 'Search previous',
'RECENT_SEARCHES' => 'Recent searches',
'RESULT_DAYS' => 'Limit results to previous',
'RESULT_SORT' => 'Sort results by',
'RESULT_DIR' => 'Order results',
'SORT_BY' => 'Sort by',
'SORT_TIME' => 'Post Time',
'SORT_POST_SUBJECT' => 'Post Subject',
'SORT_TOPIC_TITLE' => 'Topic Title',
'SORT_AUTHOR' => 'Author',
'SORT_FORUM' => 'Forum',
'SORT_TOPIC_TITLE' => 'Topic Title',
'SORT_AUTHOR' => 'Author',
'SORT_FORUM' => 'Forum',
'LAST_ACTIVE' => 'Last active',
'Display_results' => 'Display results as',
'All_available' => 'All available',
'No_searchable_forums' => 'You do not have permissions to search any forum on this site',
'No_search_match' => 'No topics or posts met your search criteria',
'Found_search_match' => 'Search found %d match',
'Found_search_matches' => 'Search found %d matches',
'DISPLAY_RESULTS' => 'Display results as',
'ALL_AVAILABLE' => 'All available',
'ALL_RESULTS' => 'All results',
'NO_SEARCHABLE_FORUMS' => 'You do not have permissions to search any forum on this site',
'NO_SEARCH_MATCH' => 'No topics or posts met your search criteria',
'FOUND_SEARCH_MATCH' => 'Search found %d match',
'FOUND_SEARCH_MATCHES' => 'Search found %d matches',
'Not_Authorised' => 'Not Authorised',
'NOT_AUTHORISED' => 'Not Authorised',
);
// viewonline

View file

@ -248,4 +248,4 @@ IIRC
LOL
ROTF
ROTFLMAO
YMMV
YMMV

View file

@ -1,23 +1,15 @@
<?php
/***************************************************************************
* mcp.php
* -------------------
* begin : July 4, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : mcp.php
// STARTED : Mon May 5, 2003
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
// TODO for 2.2:
//
@ -45,7 +37,7 @@
define('IN_PHPBB', true);
define('NEED_SID', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);

View file

@ -1,23 +1,15 @@
<?php
/***************************************************************************
* memberlist.php
* -------------------
* begin : Friday, May 11, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : memberlist.php
// STARTED : Sat Feb 13, 2001
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
// TODO
// Add permission check for IM clients
@ -168,6 +160,7 @@ switch ($mode)
$jabber->username = (!empty($config['jab_username'])) ? $config['jab_username'] : '';
$jabber->password = (!empty($config['jab_password'])) ? $config['jab_password'] : '';
$jabber->resource = 'phpBB';
// If a username/password are set we will try and authorise. If they don't we will
// try and create a new user, username will be the basic domain name with _phpbb
@ -204,7 +197,7 @@ switch ($mode)
set_config('jab_password', $jabber->password);
}
$jabber->SendPresence();
$jabber->SendPresence(NULL, NULL, 'online');
// This _really_ needs to be an "email" template I think ... indeed the whole system is probably
// best suited "merged" with email in some way. Would enable notifications, etc. to be sent via
@ -212,7 +205,7 @@ switch ($mode)
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
$message = stripslashes(htmlspecialchars($_POST['message']));
$jabber->SendMessage($row[$sql_field], NULL, NULL, array('subject' => $subject, 'body' => $message));
$jabber->SendMessage($row[$sql_field], 'normal', NULL, array('subject' => $subject, 'body' => $message), '');
$jabber->Disconnect();
$s_select = 'S_SENT_JABBER';

View file

@ -13,7 +13,7 @@
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);

View file

@ -1,36 +1,26 @@
<?php
/***************************************************************************
* report.php
* -------------------
* begin : July 4, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : report.php
// STARTED : Thu Apr 3, 2003
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
// Start session management
$user->start();
$auth->acl($user->data);
$user->setup();
// var definitions
$post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0;
$reason_id = (!empty($_REQUEST['reason_id'])) ? intval($_REQUEST['reason_id']) : 0;
@ -43,7 +33,6 @@ if (isset($_POST['cancel']))
redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id");
}
// Grab all relevant data
$sql = 'SELECT f.*, t.*, p.*
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f

View file

@ -1,27 +1,19 @@
<?php
/***************************************************************************
* style.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : style.php
// STARTED : Thu Jul 24, 2003
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'config.'.$phpEx);
set_magic_quotes_runtime(0);

View file

@ -21,7 +21,7 @@
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_IS_CAT -->
<tr>
<td class="cat" colspan="2" height="28"><a class="cattitle" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></td>
<td class="cat" colspan="2" height="28"><a class="cattitle" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></td>
<td class="catdiv" colspan="3" align="right">&nbsp;</td>
</tr>
<!-- ELSEIF forumrow.S_IS_LINK -->

View file

@ -30,7 +30,7 @@ function im_popup(url, width, height)
return false;
}
function goto()
function jumpto()
{
var page = prompt('{L_JUMP_PAGE}:', '{ON_PAGE}');
var perpage = '{PER_PAGE}';

View file

@ -169,7 +169,7 @@
</tr>
</table></td>
</tr>
<!-- IF S_SIGNATURE_PREVIEW -->
<!-- IF SIGNATURE_PREVIEW -->
<tr>
<th colspan="2" height="28" valign="middle">{L_SIGNATURE_PREVIEW}</th>
</tr>

View file

@ -23,7 +23,7 @@
<!-- IF S_IS_POSTABLE -->
<td width="10" align="left" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
<!-- ENDIF -->
<td class="nav" width="100%" valign="middle">&nbsp; <a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> -> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></td>
<td class="nav" width="100%" valign="middle"><a href="{U_INDEX}">{L_INDEX}</a><!-- BEGIN navlinks --> -> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></td>
</tr>
</table>
@ -83,7 +83,7 @@
<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a>&nbsp;<!-- ENDIF -->
</td>
<!-- ENDIF -->
<td width="100%">{topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}<a class="topictitle" href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a><span class="gensmall"><br />{topicrow.GOTO_PAGE}</td>
<td width="100%">{topicrow.NEWEST_POST_IMG}{topicrow.ATTACH_ICON_IMG}<a class="topictitle" href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span></td>
</tr>
</table></td>
<td class="row2" align="center" valign="middle"><span class="topicauthor">{topicrow.TOPIC_AUTHOR}</span></td>

View file

@ -98,15 +98,28 @@
<tr class="row2">
<!-- ENDIF -->
<!-- IF postrow.S_IGNORE_POST -->
<!-- IF postrow.S_IGNORE_POST -->
<td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td>
<!-- ELSE -->
<td rowspan="2" align="left" valign="top"><a name="{postrow.U_POST_ID}"></a>
<!-- ELSE -->
<td align="center" valign="middle"><a name="{postrow.U_POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td>
<td width="100%" height="28"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>{postrow.POST_ICON_IMG}&nbsp;</td>
<td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{postrow.POST_SUBJECT}</td>
<td valign="top" nowrap="nowrap">&nbsp;<!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_IP --><a href="{postrow.U_IP}">{IP_IMG}</a> <!-- ENDIF --></td>
</tr>
</table></td>
</tr>
<!-- IF postrow.S_ROW_COUNT is even -->
<tr class="row1">
<!-- ELSE -->
<tr class="row2">
<!-- ENDIF -->
<td valign="top">
<table width="150" cellspacing="0" cellpadding="4" border="0">
<tr>
<td align="center"><b class="postauthor">{postrow.POSTER_NAME}</b></td>
</tr>
<table width="150" cellspacing="0" cellpadding="4" border="0" align="center">
<tr>
<td align="center">{postrow.KARMA_IMG}</td>
</tr>
@ -139,14 +152,41 @@
</span>
<br />
</td>
<td width="100%" height="28"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<td height="100%"><table height="100%" width="100%" cellspacing="5" cellpadding="0" border="0">
<tr>
<td>{postrow.POST_ICON_IMG}&nbsp;</td>
<td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}:</b>&nbsp;</td>
<td class="gensmall" width="100%" valign="middle">{postrow.POST_SUBJECT}</td>
<td valign="top" nowrap="nowrap">&nbsp;<!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_IP --><a href="{postrow.U_IP}">{IP_IMG}</a> <!-- ENDIF --></td>
<td valign="top">
<span class="postbody">{postrow.MESSAGE}</span>
<!-- IF postrow.S_HAS_ATTACHMENTS --><!-- INCLUDE viewtopic_attach_body.html --><!-- ENDIF -->
<!-- IF postrow.S_DISPLAY_NOTICE --><span class="gensmall" style="color:red;"><br /><br />{L_DOWNLOAD_NOTICE}</span><!-- ENDIF -->
<!-- IF postrow.SIGNATURE --><span class="postbody"><br />_________________<br />{postrow.SIGNATURE}</span><!-- ENDIF -->
<span class="gensmall">{postrow.EDITED_MESSAGE}</span>
</td>
</tr>
<tr>
<td valign="bottom">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr valign="middle">
<!-- IF postrow.S_POST_UNAPPROVED -->
<td width="5">{UNAPPROVED_IMG}</td>
<td class="gensmall" nowrap="nowrap">&nbsp;<b><a style="color:green" href="{postrow.U_MCP_APPROVE}">{L_POST_NOT_APPROVED}</a></b>&nbsp;</td>
<!-- ENDIF -->
<!-- IF postrow.S_POST_REPORTED -->
<td width="5">{REPORTED_IMG}</td>
<td class="gensmall" nowrap="nowrap">&nbsp;<b><a style="color:red" href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></b>&nbsp;</td>
<!-- ENDIF -->
<!-- IF postrow.S_CAN_RATE -->
<td nowrap="nowrap" class="gensmall"><b>{L_RATE}:</b> <a style="color:green" href="{postrow.U_RATE_GOOD}">{L_RATE_GOOD}</a> / <a style="color:red" href="{postrow.U_RATE_BAD}">{L_RATE_BAD}</a></td>
<!-- ENDIF -->
<td width="100%">&nbsp;</td>
<td width="10" nowrap="nowrap"><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a></td>
<td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {postrow.POST_DATE}</td>
<!-- IF postrow.U_REPORT -->
<td>&nbsp;<a href="{postrow.U_REPORT}">{REPORT_IMG}</a></td>
<!-- ENDIF -->
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
@ -157,51 +197,7 @@
<tr class="row2">
<!-- ENDIF -->
<td valign="top"><table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td height="120" valign="top"><table width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><span class="postbody">{postrow.MESSAGE}</span>
<!-- IF postrow.S_HAS_ATTACHMENTS --><!-- INCLUDE viewtopic_attach_body.html --><!-- ENDIF -->
<!-- IF postrow.S_DISPLAY_NOTICE --><span class="gensmall" style="color:red;"><br /><br />{L_DOWNLOAD_NOTICE}</span><!-- ENDIF -->
<!-- IF postrow.SIGNATURE --><span class="postbody"><br />_________________<br />{postrow.SIGNATURE}</span><!-- ENDIF -->
<span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr valign="middle">
<!-- IF postrow.S_POST_UNAPPROVED -->
<td width="5">{UNAPPROVED_IMG}</td>
<td class="gensmall" nowrap="nowrap">&nbsp;<b><a style="color:green" href="{postrow.U_MCP_APPROVE}">{L_POST_NOT_APPROVED}</a></b>&nbsp;</td>
<!-- ENDIF -->
<!-- IF postrow.S_POST_REPORTED -->
<td width="5">{REPORTED_IMG}</td>
<td class="gensmall" nowrap="nowrap">&nbsp;<b><a style="color:red" href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></b>&nbsp;</td>
<!-- ENDIF -->
<!-- IF postrow.S_CAN_RATE -->
<td nowrap="nowrap" class="gensmall"><b>{L_RATE}:</b> <a style="color:green" href="{postrow.U_RATE_GOOD}">{L_RATE_GOOD}</a> / <a style="color:red" href="{postrow.U_RATE_BAD}">{L_RATE_BAD}</a></td>
<!-- ENDIF -->
<td width="100%">&nbsp;</td>
<td width="10" nowrap="nowrap"><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a></td>
<td class="gensmall" nowrap="nowrap"><b>{L_POSTED}:</b> {postrow.POST_DATE}</td>
<!-- IF postrow.U_REPORT -->
<td>&nbsp;<a href="{postrow.U_REPORT}">{REPORT_IMG}</a></td>
<!-- ENDIF -->
</tr>
</table></td>
</tr>
</table></td>
</tr>
<!-- IF postrow.S_ROW_COUNT is even -->
<tr class="row1">
<!-- ELSE -->
<tr class="row2">
<!-- ENDIF -->
<td class="nav" width="150" align="center" valign="middle"><!-- IF MCP --><a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a><!-- ELSE --><a href="#top">{L_BACK_TO_TOP}</a><!-- ENDIF --></td>
<td class="nav" width="150" align="center" valign="middle"><a href="#{postrow.U_PREV_POST_ID}">Up</a> | <a href="#top">{L_BACK_TO_TOP}</a> | <a href="#{postrow.U_NEXT_POST_ID}">Down</a></td>
<td width="100%" height="28" valign="bottom" nowrap="nowrap"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="middle" nowrap="nowrap"><!-- IF postrow.U_PROFILE --><a href="{postrow.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_WWW --><a href="{postrow.U_WWW}" target="_userwww">{WWW_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_AIM --><a href="{postrow.U_AIM}" onclick="im_popup('{postrow.U_AIM}', 550, 320); return false">{AIM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_YIM --><a href="{postrow.U_YIM}" onclick="im_popup('{postrow.U_YIM}', 780, 550); return false">{YIM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_MSN --><a href="{postrow.U_MSN}" onclick="im_popup('{postrow.U_MSN}', 550, 320); return false">{MSN_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_JABBER --><a href="{postrow.U_JABBER}" onclick="im_popup('{postrow.U_JABBER}', 550, 320); return false">{JABBER_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_ICQ --><script language="JavaScript" type="text/javascript"><!--

View file

@ -1,29 +1,20 @@
<?php
/***************************************************************************
* ucp.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id$
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
// -------------------------------------------------------------
//
// $Id$
//
// FILENAME : bbcode.php
// STARTED : Thu Nov 21, 2002
// COPYRIGHT : © 2001, 2003 phpBB Group
// WWW : http://www.phpbb.com/
// LICENCE : GPL vs2.0 [ see /docs/COPYING ]
//
// -------------------------------------------------------------
// TODO for 2.2:
//
// * Registration
// * Link to (additional?) registration conditions
// * Admin defineable characters allowed in usernames?
// * Admin forced revalidation of given user/s from ACP
// * Opening tab:
@ -43,15 +34,12 @@
// * PM system
// * See privmsg
// * Avatars
// * as current but with definable width/height box?
// * Permissions?
// * List permissions granted to this user (in UCP and ACP UCP)
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . '/includes/functions_user.'.$phpEx);
@ -152,136 +140,6 @@ class ucp extends user
// Normalises supplied data dependant on required type/length, errors
// on incorrect data
function normalise_data(&$data, &$normalise)
{
$valid_data = array();
foreach ($normalise as $var_type => $var_ary)
{
foreach ($var_ary as $var_name => $var_limits)
{
$var_name = (is_string($var_name)) ? $var_name : $var_limits;
if (isset($data[$var_name]))
{
switch ($var_type)
{
case 'int':
$valid_data[$var_name] = (int) $data[$var_name];
break;
case 'float':
$valid_data[$var_name] = (double) $data[$var_name];
break;
case 'bool':
$valid_data[$var_name] = ($data[$var_name] <= 0) ? 0 : 1;
break;
case 'string':
// Cleanup data, remove excess spaces, run entites
$valid_data[$var_name] = htmlentities(trim(preg_replace('#\s{2,}#s', ' ', strtr((string) $data[$var_name], array_flip(get_html_translation_table(HTML_ENTITIES))))));
// How should we check this data?
if (!is_array($var_limits))
{
// Is the match a string? If it is, process it further, else we'll
// assume it's a maximum length
if (is_string($var_limits))
{
if (strstr($var_limits, ','))
{
list($min_value, $max_value) = explode(',', $var_limits);
if (!empty($valid_data[$var_name]) && strlen($valid_data[$var_name]) < $min_value)
{
$this->error[] = strtoupper($var_name) . '_TOO_SHORT';
}
if (strlen($valid_data[$var_name]) > $max_value)
{
$this->error[] = strtoupper($var_name) . '_TOO_LONG';
}
}
}
else
{
if (strlen($valid_data[$var_name]) > $var_limits)
{
$this->error[] = strtoupper($var_name) . '_TOO_LONG';
}
}
}
break;
}
}
}
}
return $valid_data;
}
// Validates data subject to supplied requirements, errors appropriately
function validate_data(&$data, &$validate)
{
global $db, $user, $config;
foreach ($validate as $operation => $var_ary)
{
foreach ($var_ary as $var_name => $compare)
{
if (!empty($compare))
{
switch ($operation)
{
case 'match':
if (is_array($compare))
{
foreach ($compare as $match)
{
if (!preg_match($match, $data[$var_name]))
{
$this->error[] = strtoupper($var_name) . '_WRONG_DATA';
}
}
}
else if (!preg_match($compare, $data[$var_name]))
{
$this->error[] = strtoupper($var_name) . '_WRONG_DATA';
}
break;
case 'compare':
if (is_array($compare))
{
if (!in_array($data[$var_name], $compare))
{
$this->error[] = strtoupper($var_name) . '_MISMATCH';
}
}
else if ($data[$var_name] != $compare)
{
$this->error[] = strtoupper($var_name) . '_MISMATCH';
}
break;
case 'function':
if ($result = $compare($data[$var_name]))
{
$this->error[] = $result;
}
break;
case 'reqd':
if (!isset($data[$compare]) || (is_string($data[$compare]) && $data[$compare] === ''))
{
$this->error[] = strtoupper($compare) . '_MISSING_DATA';
}
break;
}
}
}
}
}
}
//
// FUNCTIONS
@ -291,7 +149,6 @@ class ucp extends user
// Start session management
$user->start();
$auth->acl($user->data);
$user->setup();
// Basic parameter data

View file

@ -121,7 +121,6 @@ if ($view && !$post_id)
}
}
// This rather complex gaggle of code handles querying for topics but
// also allows for direct linking to a post (and the calculation of which
// page the post is on and the correct display of viewtopic)
@ -180,17 +179,14 @@ if (!($topic_data = $db->sql_fetchrow($result)))
// Extract the data
extract($topic_data);
// Setup look and feel
$user->setup(false, $forum_style);
if (!$topic_approved && !$auth->acl_get('m_approve', $forum_id))
{
trigger_error('NO_TOPIC');
}
// Start auth check
if (!$auth->acl_get('f_read', $forum_id))
{
@ -202,7 +198,6 @@ if (!$auth->acl_get('f_read', $forum_id))
login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', htmlspecialchars($_SERVER['REQUEST_URI'])), '', $user->lang['LOGIN_VIEWFORUM']);
}
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($forum_password)
@ -210,14 +205,11 @@ if ($forum_password)
login_forum_box($topic_data);
}
// Not final in the slightest! Far too simplistic
if ($rate)
{
// Check for rating count for previous X time
// Grab existing rating for this post, if it exists
$sql = 'SELECT *
FROM ' . RATINGS_TABLE . '
@ -380,17 +372,14 @@ else
// Select the sort order
$sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
// Grab ranks
$ranks = array();
obtain_ranks($ranks);
// Grab icons
$icons = array();
obtain_icons($icons);
// Was a highlight request part of the URI?
$highlight_match = $highlight = '';
if ($hilit_words)
@ -406,7 +395,6 @@ if ($hilit_words)
$highlight = htmlspecialchars(urlencode($hilit_words));
}
// Forum rules listing
$s_forum_rules = '';
gen_forum_rules('topic', $forum_id);
@ -429,23 +417,19 @@ $topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '<option value="viewlogs">' .
$pagination_url = "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;" . (($highlight_match) ? "&amp;hilit=$highlight" : '');
$pagination = generate_pagination($pagination_url, $total_posts, $config['posts_per_page'], $start);
// Grab censored words
$censors = array();
obtain_word_list($censors);
// Navigation links
generate_forum_nav($topic_data);
// Moderators
$forum_moderators = array();
get_moderators($forum_moderators, $forum_id);
// This is only used for print view so ...
$server_path = (!isset($_GET['view'])) ? '' : (($config['cookie_secure']) ? 'https://' : 'http://') . trim($config['server_name']) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . trim($config['script_path']) . '/';
$server_path = (!$view) ? '' : (($config['cookie_secure']) ? 'https://' : 'http://') . trim($config['server_name']) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . trim($config['script_path']) . '/';
// Replace naughty words in title
if (sizeof($censors))
@ -497,7 +481,7 @@ $template->assign_vars(array(
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('f_search', $forum_id)) ? true : false,
'S_SEARCHBOX_ACTION' => "search.$phpEx$SID&amp;f=$forum_id",
'U_TOPIC' => $server_path . "viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
'U_FORUM' => $server_path,
'U_VIEW_UNREAD_POST' => "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;view=unread#unread",
'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&amp;f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;$u_sort_param&amp;hilit=$highlight",
@ -511,7 +495,6 @@ $template->assign_vars(array(
'U_POST_REPLY_TOPIC' => "posting.$phpEx$SID&amp;mode=reply&amp;f=$forum_id&amp;t=$topic_id")
);
// Does this topic contain a poll?
if (!empty($poll_start))
{
@ -676,12 +659,11 @@ if (!empty($poll_start))
unset($voted_id);
}
// Container for user details, only process once
$user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = array();
$has_attachments = $display_notice = FALSE;
$force_encoding = '';
$bbcode_bitfield = $i = 0;
$bbcode_bitfield = $i = $i_total = 0;
// If the user is trying to reach the second half of the topic, fetch it starting from the end
$store_reverse = FALSE;
@ -722,7 +704,7 @@ do
$poster_id = $row['poster_id'];
$poster = ($poster_id == ANONYMOUS) ? ((!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'];
if ($row['user_karma'] < $user->data['user_min_karma'] && (empty($_GET['view']) || $_GET['view'] != 'karma' || $post_id != $row['post_id']))
if ($row['user_karma'] < $user->data['user_min_karma'] && (!$view || $view != 'karma' || $post_id != $row['post_id']))
{
$rowset[] = array(
'below_karma' => TRUE,
@ -799,7 +781,6 @@ do
// Define the global bbcode bitfield, will be used to load bbcodes
$bbcode_bitfield |= $row['bbcode_bitfield'];
// Cache various user specific data ... so we don't have to recompute
// this each time the same user appears on this page
if (!isset($user_cache[$poster_id]))
@ -939,7 +920,6 @@ if ($config['load_onlinetrack'] && sizeof($id_cache))
}
unset($id_cache);
// Pull attachment data
if (count($attach_list))
{
@ -960,8 +940,7 @@ if (count($attach_list))
}
$db->sql_freeresult($result);
// No attachments exist, but post table thinks they do
// so go ahead and reset post_attach flags
// No attachments exist, but post table thinks they do so go ahead and reset post_attach flags
if (!count($attachments))
{
$sql = 'UPDATE ' . POSTS_TABLE . '
@ -1011,7 +990,6 @@ if (count($attach_list))
}
}
// Instantiate BBCode if need be
if ($bbcode_bitfield)
{
@ -1019,6 +997,8 @@ if ($bbcode_bitfield)
$bbcode = new bbcode($bbcode_bitfield);
}
$i_total = sizeof($rowset) - 1;
$prev_post_id = '';
// Output the posts
foreach ($rowset as $i => $row)
@ -1042,7 +1022,7 @@ foreach ($rowset as $i => $row)
}
else if ($row['post_encoding'] != $user->lang['ENCODING'])
{
if (!empty($_GET['view']) && $_GET['view'] == 'encoding' && $post_id == $row['post_id'])
if ($view == 'encoding' && $post_id == $row['post_id'])
{
$force_encoding = $row['post_encoding'];
}
@ -1078,13 +1058,10 @@ foreach ($rowset as $i => $row)
$user_cache[$poster_id]['sig_parsed'] = TRUE;
}
// Parse the message and subject
$message = $row['post_text'];
// If the board has HTML off but the post has HTML
// on then we process it, else leave it alone
// If the board has HTML off but the post has HTML on then we process it, else leave it alone
if (!$auth->acl_get('f_html', $forum_id))
{
if ($row['enable_html'] && $auth->acl_get('f_bbcode', $forum_id))
@ -1093,19 +1070,16 @@ foreach ($rowset as $i => $row)
}
}
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
// If we allow users to disable display of emoticons
// we'll need an appropriate check and preg_replace here
$message = (empty($config['allow_smilies']) || !$user->data['user_viewsmilies']) ? preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILE_PATH\}\/.*? \/><!\-\- s\1 \-\->#', '\1', $message) : str_replace('<img src="{SMILE_PATH}', '<img src="' . $config['smilies_path'], $message);
// Highlight active words (primarily for search)
if ($highlight_match)
{
@ -1114,7 +1088,6 @@ foreach ($rowset as $i => $row)
$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace('#\b(" . $highlight_match . ")\b#i', '<span class=\"posthilit\">\\\\1</span>', '\\0')", '>' . $message . '<'), 1, -1));
}
// Replace naughty words such as farty pants
if (sizeof($censors))
{
@ -1122,10 +1095,8 @@ foreach ($rowset as $i => $row)
$message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $message . '<'), 1, -1));
}
$message = str_replace("\n", '<br />', $message);
// Editing information
if (!empty($row['post_edit_count']) && $config['display_last_edited'])
{
@ -1138,7 +1109,6 @@ foreach ($rowset as $i => $row)
$l_edited_by = '';
}
// Dump vars into template
$template->assign_block_vars('postrow', array(
'POSTER_NAME' => $row['poster'],
@ -1186,6 +1156,8 @@ foreach ($rowset as $i => $row)
'U_MCP_DETAILS' => "mcp.$phpEx$SID&amp;mode=post_details&amp;p=" . $row['post_id'],
'U_MINI_POST' => "viewtopic.$phpEx$SID&amp;p=" . $row['post_id'] . '#' . $row['post_id'],
'U_POST_ID' => ($unread_post_id == $row['post_id']) ? 'unread' : $row['post_id'],
'U_NEXT_POST_ID' => ($i < $i_total) ? $rowset[$i + 1]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
'S_ROW_COUNT' => $i,
'S_CAN_RATE' => ($auth->acl_get('f_rate', $forum_id) && $row['post_approved'] && !$row['post_reported'] && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? true : false,
@ -1201,13 +1173,14 @@ foreach ($rowset as $i => $row)
display_attachments($attachments[$row['post_id']], $update_count);
}
$prev_post_id = $row['post_id'];
unset($rowset[$i]);
unset($attachments[$row['post_id']]);
}
unset($rowset);
unset($user_cache);
// Update topic view and if necessary attachment view counters ... but only
// if this is the first 'page view'
if (!preg_match("#&t=$topic_id#", $user->data['session_page']))
@ -1227,24 +1200,21 @@ if (!preg_match("#&t=$topic_id#", $user->data['session_page']))
}
}
// Mark topics read
$mark_forum_id = ($topic_type == POST_GLOBAL) ? 0 : $forum_id;
markread('topic', $mark_forum_id, $topic_id, $row['post_time']);
// Change encoding if appropriate
if ($force_encoding != '')
{
$user->lang['ENCODING'] = $force_encoding;
}
// Output the page
page_header($user->lang['VIEW_TOPIC'] .' - ' . $topic_title);
$template->set_filenames(array(
'body' => (isset($_GET['view']) && $_GET['view'] == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);