mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
merged from 2.0.0 branch (marked merge_point_20020420) + assorted updates and trial stuff for example session alterations
git-svn-id: file:///svn/phpbb/trunk@2532 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
65aa921828
commit
5b0bba72b1
56 changed files with 4087 additions and 3798 deletions
|
@ -33,7 +33,7 @@ if( !empty($setmodules) )
|
||||||
// Load default header
|
// Load default header
|
||||||
//
|
//
|
||||||
$no_page_header = TRUE;
|
$no_page_header = TRUE;
|
||||||
$phpbb_root_path = "../";
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ require('pagestart.' . $phpEx);
|
||||||
//
|
//
|
||||||
@set_time_limit(1200);
|
@set_time_limit(1200);
|
||||||
|
|
||||||
$message = "";
|
$message = '';
|
||||||
$subject = "";
|
$subject = '';
|
||||||
|
|
||||||
//
|
//
|
||||||
// Do the job ...
|
// Do the job ...
|
||||||
|
@ -66,12 +66,15 @@ if( isset($HTTP_POST_VARS['submit']) )
|
||||||
$sql = "SELECT user_email
|
$sql = "SELECT user_email
|
||||||
FROM " . USERS_TABLE;
|
FROM " . USERS_TABLE;
|
||||||
}
|
}
|
||||||
|
if( !($result = $db->sql_query($sql)) )
|
||||||
if( !$result = $db->sql_query($sql) )
|
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Coult not select group members!", __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, 'Could not select group members', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( !$db->sql_numrows($result) )
|
if( !$db->sql_numrows($result) )
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -81,9 +84,13 @@ if( isset($HTTP_POST_VARS['submit']) )
|
||||||
}
|
}
|
||||||
|
|
||||||
$email_list = $db->sql_fetchrowset($g_result);
|
$email_list = $db->sql_fetchrowset($g_result);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$subject = stripslashes($HTTP_POST_VARS["subject"]);
|
|
||||||
$message = stripslashes($HTTP_POST_VARS["message"]);
|
$subject = stripslashes($HTTP_POST_VARS['subject']);
|
||||||
|
$message = stripslashes($HTTP_POST_VARS['message']);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Error checking needs to go here ... if no subject and/or
|
// Error checking needs to go here ... if no subject and/or
|
||||||
|
@ -107,39 +114,35 @@ if( isset($HTTP_POST_VARS['submit']) )
|
||||||
}
|
}
|
||||||
$emailer = new emailer($board_config['smtp_delivery']);
|
$emailer = new emailer($board_config['smtp_delivery']);
|
||||||
|
|
||||||
$email_headers = "From: " . $board_config['board_email'] . "\n";
|
$email_headers = 'From: ' . $board_config['board_email'] . "\n";
|
||||||
|
|
||||||
$bcc_list = "";
|
$bcc_list = '';
|
||||||
for($i = 0; $i < count($email_list); $i++)
|
for($i = 0; $i < count($email_list); $i++)
|
||||||
{
|
{
|
||||||
if( $bcc_list != "" )
|
$bcc_list .= ( ( $bcc_list != '' ) ? ', ' : '' ) . $email_list[$i]['user_email'];
|
||||||
{
|
|
||||||
$bcc_list .= ", ";
|
|
||||||
}
|
|
||||||
$bcc_list .= $email_list[$i]['user_email'];
|
|
||||||
}
|
}
|
||||||
$email_headers .= "Bcc: $bcc_list\n";
|
$email_headers .= "Bcc: $bcc_list\n";
|
||||||
|
|
||||||
$email_headers .= "Return-Path: " . $userdata['board_email'] . "\n";
|
$email_headers .= 'Return-Path: ' . $userdata['board_email'] . "\n";
|
||||||
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n";
|
$email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
|
||||||
$email_headers .= "X-AntiAbuse: User_id - " . $userdata['user_id'] . "\n";
|
$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
|
||||||
$email_headers .= "X-AntiAbuse: Username - " . $userdata['username'] . "\n";
|
$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
|
||||||
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
|
$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\r\n";
|
||||||
|
|
||||||
$emailer->use_template("admin_send_email");
|
$emailer->use_template('admin_send_email');
|
||||||
$emailer->email_address($board_config['board_email']);
|
$emailer->email_address($board_config['board_email']);
|
||||||
$emailer->set_subject($subject);
|
$emailer->set_subject($subject);
|
||||||
$emailer->extra_headers($email_headers);
|
$emailer->extra_headers($email_headers);
|
||||||
|
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
"SITENAME" => $board_config['sitename'],
|
'SITENAME' => $board_config['sitename'],
|
||||||
"BOARD_EMAIL" => $board_config['board_email'],
|
'BOARD_EMAIL' => $board_config['board_email'],
|
||||||
"MESSAGE" => $message)
|
'MESSAGE' => $message)
|
||||||
);
|
);
|
||||||
$emailer->send();
|
$emailer->send();
|
||||||
$emailer->reset();
|
$emailer->reset();
|
||||||
|
|
||||||
$message = $lang['Email_sent'] . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
|
$message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
|
||||||
|
|
||||||
message_die(GENERAL_MESSAGE, $message);
|
message_die(GENERAL_MESSAGE, $message);
|
||||||
}
|
}
|
||||||
|
@ -152,18 +155,21 @@ if( isset($HTTP_POST_VARS['submit']) )
|
||||||
$sql = "SELECT group_id, group_name
|
$sql = "SELECT group_id, group_name
|
||||||
FROM ".GROUPS_TABLE . "
|
FROM ".GROUPS_TABLE . "
|
||||||
WHERE group_single_user <> 1";
|
WHERE group_single_user <> 1";
|
||||||
$g_result = $db->sql_query($sql);
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
$group_list = $db->sql_fetchrowset($g_result);
|
|
||||||
|
|
||||||
$select_list = '<select name = "' . POST_GROUPS_URL . '">';
|
|
||||||
$select_list .= '<option value = "-1">' . $lang['All_users'] . '</option>';
|
|
||||||
|
|
||||||
for($i = 0;$i < count($group_list); $i++)
|
|
||||||
{
|
{
|
||||||
$select_list .= "<option value = \"" . $group_list[$i]['group_id'];
|
message_die(GENERAL_ERROR, 'Could not obtain list of groups', '', __LINE__, __FILE__, $sql);
|
||||||
$select_list .= "\">" . $group_list[$i]['group_name'] . "</option>";
|
|
||||||
}
|
}
|
||||||
$select_list .= "</select>";
|
|
||||||
|
$select_list = '<select name = "' . POST_GROUPS_URL . '"><option value = "-1">' . $lang['All_users'] . '</option>';
|
||||||
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$select_list .= '<option value = "' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
|
||||||
|
}
|
||||||
|
while ( $row = $db->sql_fetchrow($result) );
|
||||||
|
}
|
||||||
|
$select_list .= '</select>';
|
||||||
|
|
||||||
//
|
//
|
||||||
// Generate page
|
// Generate page
|
||||||
|
@ -171,28 +177,28 @@ $select_list .= "</select>";
|
||||||
include('page_header_admin.'.$phpEx);
|
include('page_header_admin.'.$phpEx);
|
||||||
|
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
"body" => "admin/user_email_body.tpl")
|
'body' => 'admin/user_email_body.tpl')
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
"MESSAGE" => $message,
|
'MESSAGE' => $message,
|
||||||
"SUBJECT" => $subject,
|
'SUBJECT' => $subject,
|
||||||
|
|
||||||
"L_EMAIL_TITLE" => $lang['Email'],
|
'L_EMAIL_TITLE' => $lang['Email'],
|
||||||
"L_EMAIL_EXPLAIN" => $lang['Mass_email_explain'],
|
'L_EMAIL_EXPLAIN' => $lang['Mass_email_explain'],
|
||||||
"L_COMPOSE" => $lang['Compose'],
|
'L_COMPOSE' => $lang['Compose'],
|
||||||
"L_RECIPIENTS" => $lang['Recipients'],
|
'L_RECIPIENTS' => $lang['Recipients'],
|
||||||
"L_EMAIL_SUBJECT" => $lang['Subject'],
|
'L_EMAIL_SUBJECT' => $lang['Subject'],
|
||||||
"L_EMAIL_MSG" => $lang['Message'],
|
'L_EMAIL_MSG' => $lang['Message'],
|
||||||
"L_EMAIL" => $lang['Email'],
|
'L_EMAIL' => $lang['Email'],
|
||||||
"L_NOTICE" => $notice,
|
'L_NOTICE' => $notice,
|
||||||
|
|
||||||
"S_USER_ACTION" => append_sid('admin_mass_email.'.$phpEx),
|
'S_USER_ACTION' => append_sid('admin_mass_email.'.$phpEx),
|
||||||
"S_GROUP_SELECT" => $select_list)
|
'S_GROUP_SELECT' => $select_list)
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->pparse('body');
|
$template->pparse('body');
|
||||||
|
|
||||||
include('page_footer_admin.'.$phpEx);
|
include('page_footer_admin.'.$phpEx);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -28,27 +28,16 @@ if ( !defined('IN_PHPBB') )
|
||||||
//
|
//
|
||||||
// Show the overall footer.
|
// Show the overall footer.
|
||||||
//
|
//
|
||||||
$current_time = time();
|
|
||||||
|
|
||||||
$template->set_filenames(array(
|
$template->set_filenames(array(
|
||||||
"page_footer" => "admin/page_footer.tpl")
|
'page_footer' => 'admin/page_footer.tpl')
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
"PHPBB_VERSION" => "2.0 " . $board_config['version'],
|
'PHPBB_VERSION' => '2' . $board_config['version'],
|
||||||
"TRANSLATION_INFO" => $lang['TRANSLATION_INFO'])
|
'TRANSLATION_INFO' => $lang['TRANSLATION_INFO'])
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->pparse("page_footer");
|
$template->pparse('page_footer');
|
||||||
|
|
||||||
//
|
|
||||||
// Output page creation time
|
|
||||||
//
|
|
||||||
$mtime = microtime();
|
|
||||||
$mtime = explode(" ",$mtime);
|
|
||||||
$mtime = $mtime[1] + $mtime[0];
|
|
||||||
$endtime = $mtime;
|
|
||||||
$totaltime = ($endtime - $starttime);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Close our DB connection.
|
// Close our DB connection.
|
||||||
|
@ -73,10 +62,10 @@ if( $do_gzip_compress )
|
||||||
$gzip_contents = gzcompress($gzip_contents, 9);
|
$gzip_contents = gzcompress($gzip_contents, 9);
|
||||||
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
|
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
|
||||||
|
|
||||||
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
|
echo '\x1f\x8b\x08\x00\x00\x00\x00\x00';
|
||||||
echo $gzip_contents;
|
echo $gzip_contents;
|
||||||
echo pack("V", $gzip_crc);
|
echo pack('V', $gzip_crc);
|
||||||
echo pack("V", $gzip_size);
|
echo pack('V', $gzip_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
|
288
phpBB/common.php
288
phpBB/common.php
|
@ -29,71 +29,28 @@ error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninit
|
||||||
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
|
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
|
||||||
|
|
||||||
//
|
//
|
||||||
// addslashes to vars if magic_quotes_gpc is off
|
// addslashes to vars if magic_quotes_gpc is off this is a security precaution
|
||||||
// this is a security precaution to prevent someone
|
// to prevent someone trying to break out of a SQL statement.
|
||||||
// trying to break out of a SQL statement.
|
|
||||||
//
|
//
|
||||||
if( !get_magic_quotes_gpc() )
|
function slash_input_data(&$data)
|
||||||
{
|
{
|
||||||
if( is_array($HTTP_GET_VARS) )
|
if ( is_array($data) )
|
||||||
{
|
{
|
||||||
while( list($k, $v) = each($HTTP_GET_VARS) )
|
while( list($k, $v) = each($data) )
|
||||||
{
|
{
|
||||||
if( is_array($HTTP_GET_VARS[$k]) )
|
$data[$k] = ( is_array($v) ) ? slash_input_data($v) : addslashes($v);
|
||||||
{
|
|
||||||
while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
|
|
||||||
{
|
|
||||||
$HTTP_GET_VARS[$k][$k2] = addslashes($v2);
|
|
||||||
}
|
|
||||||
@reset($HTTP_GET_VARS[$k]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$HTTP_GET_VARS[$k] = addslashes($v);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@reset($HTTP_GET_VARS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( is_array($HTTP_POST_VARS) )
|
@reset($data);
|
||||||
{
|
|
||||||
while( list($k, $v) = each($HTTP_POST_VARS) )
|
|
||||||
{
|
|
||||||
if( is_array($HTTP_POST_VARS[$k]) )
|
|
||||||
{
|
|
||||||
while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
|
|
||||||
{
|
|
||||||
$HTTP_POST_VARS[$k][$k2] = addslashes($v2);
|
|
||||||
}
|
|
||||||
@reset($HTTP_POST_VARS[$k]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$HTTP_POST_VARS[$k] = addslashes($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@reset($HTTP_POST_VARS);
|
|
||||||
}
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
if( is_array($HTTP_COOKIE_VARS) )
|
if ( !get_magic_quotes_gpc() )
|
||||||
{
|
{
|
||||||
while( list($k, $v) = each($HTTP_COOKIE_VARS) )
|
$HTTP_GET_VARS = slash_input_data($HTTP_GET_VARS);
|
||||||
{
|
$HTTP_POST_VARS = slash_input_data($HTTP_POST_VARS);
|
||||||
if( is_array($HTTP_COOKIE_VARS[$k]) )
|
$HTTP_COOKIE_VARS = slash_input_data($HTTP_COOKIE_VARS);
|
||||||
{
|
|
||||||
while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) )
|
|
||||||
{
|
|
||||||
$HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2);
|
|
||||||
}
|
|
||||||
@reset($HTTP_COOKIE_VARS[$k]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$HTTP_COOKIE_VARS[$k] = addslashes($v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@reset($HTTP_COOKIE_VARS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -101,26 +58,213 @@ if( !get_magic_quotes_gpc() )
|
||||||
// malicious rewriting of language and otherarray values via
|
// malicious rewriting of language and otherarray values via
|
||||||
// URI params
|
// URI params
|
||||||
//
|
//
|
||||||
$board_config = Array();
|
$board_config = array();
|
||||||
$userdata = Array();
|
$userdata = array();
|
||||||
$theme = Array();
|
$theme = array();
|
||||||
$images = Array();
|
$images = array();
|
||||||
$lang = Array();
|
$lang = array();
|
||||||
$gen_simple_header = FALSE;
|
$gen_simple_header = FALSE;
|
||||||
|
|
||||||
@include($phpbb_root_path . 'config.'.$phpEx);
|
require($phpbb_root_path . 'config.'.$phpEx);
|
||||||
|
|
||||||
if( !defined("PHPBB_INSTALLED") )
|
if( !defined("PHPBB_INSTALLED") )
|
||||||
{
|
{
|
||||||
header("Location: install.$phpEx");
|
header("Location: install.$phpEx");
|
||||||
}
|
}
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
// Debug Level
|
||||||
|
define('DEBUG', 1); // Debugging on
|
||||||
|
//define('DEBUG', 0); // Debugging off
|
||||||
|
|
||||||
|
|
||||||
|
// User Levels <- Do not change the values of USER or ADMIN
|
||||||
|
define('ANONYMOUS', -1);
|
||||||
|
define('USER', 0);
|
||||||
|
define('ADMIN', 1);
|
||||||
|
define('MOD', 2);
|
||||||
|
|
||||||
|
|
||||||
|
// User related
|
||||||
|
define('USER_ACTIVATION_NONE', 0);
|
||||||
|
define('USER_ACTIVATION_SELF', 1);
|
||||||
|
define('USER_ACTIVATION_ADMIN', 2);
|
||||||
|
|
||||||
|
define('USER_AVATAR_NONE', 0);
|
||||||
|
define('USER_AVATAR_UPLOAD', 1);
|
||||||
|
define('USER_AVATAR_REMOTE', 2);
|
||||||
|
define('USER_AVATAR_GALLERY', 3);
|
||||||
|
|
||||||
|
|
||||||
|
// Group settings
|
||||||
|
define('GROUP_OPEN', 0);
|
||||||
|
define('GROUP_CLOSED', 1);
|
||||||
|
define('GROUP_HIDDEN', 2);
|
||||||
|
|
||||||
|
|
||||||
|
// Forum state
|
||||||
|
define('FORUM_UNLOCKED', 0);
|
||||||
|
define('FORUM_LOCKED', 1);
|
||||||
|
|
||||||
|
|
||||||
|
// Topic status
|
||||||
|
define('TOPIC_UNLOCKED', 0);
|
||||||
|
define('TOPIC_LOCKED', 1);
|
||||||
|
define('TOPIC_MOVED', 2);
|
||||||
|
define('TOPIC_WATCH_NOTIFIED', 1);
|
||||||
|
define('TOPIC_WATCH_UN_NOTIFIED', 0);
|
||||||
|
|
||||||
|
|
||||||
|
// Topic types
|
||||||
|
define('POST_NORMAL', 0);
|
||||||
|
define('POST_STICKY', 1);
|
||||||
|
define('POST_ANNOUNCE', 2);
|
||||||
|
define('POST_GLOBAL_ANNOUNCE', 3);
|
||||||
|
|
||||||
|
|
||||||
|
// SQL codes
|
||||||
|
define('BEGIN_TRANSACTION', 1);
|
||||||
|
define('END_TRANSACTION', 2);
|
||||||
|
|
||||||
|
|
||||||
|
// Error codes
|
||||||
|
define('GENERAL_MESSAGE', 200);
|
||||||
|
define('GENERAL_ERROR', 202);
|
||||||
|
define('CRITICAL_MESSAGE', 203);
|
||||||
|
define('CRITICAL_ERROR', 204);
|
||||||
|
|
||||||
|
|
||||||
|
// Private messaging
|
||||||
|
define('PRIVMSGS_READ_MAIL', 0);
|
||||||
|
define('PRIVMSGS_NEW_MAIL', 1);
|
||||||
|
define('PRIVMSGS_SENT_MAIL', 2);
|
||||||
|
define('PRIVMSGS_SAVED_IN_MAIL', 3);
|
||||||
|
define('PRIVMSGS_SAVED_OUT_MAIL', 4);
|
||||||
|
define('PRIVMSGS_UNREAD_MAIL', 5);
|
||||||
|
|
||||||
|
|
||||||
|
// URL PARAMETERS
|
||||||
|
define('POST_TOPIC_URL', 't');
|
||||||
|
define('POST_CAT_URL', 'c');
|
||||||
|
define('POST_FORUM_URL', 'f');
|
||||||
|
define('POST_USERS_URL', 'u');
|
||||||
|
define('POST_POST_URL', 'p');
|
||||||
|
define('POST_GROUPS_URL', 'g');
|
||||||
|
|
||||||
|
// Session parameters
|
||||||
|
define('SESSION_METHOD_COOKIE', 100);
|
||||||
|
define('SESSION_METHOD_GET', 101);
|
||||||
|
|
||||||
|
|
||||||
|
// Page numbers for session handling
|
||||||
|
define('PAGE_INDEX', 0);
|
||||||
|
define('PAGE_LOGIN', -1);
|
||||||
|
define('PAGE_SEARCH', -2);
|
||||||
|
define('PAGE_REGISTER', -3);
|
||||||
|
define('PAGE_PROFILE', -4);
|
||||||
|
define('PAGE_VIEWONLINE', -6);
|
||||||
|
define('PAGE_VIEWMEMBERS', -7);
|
||||||
|
define('PAGE_FAQ', -8);
|
||||||
|
define('PAGE_POSTING', -9);
|
||||||
|
define('PAGE_PRIVMSGS', -10);
|
||||||
|
define('PAGE_GROUPCP', -11);
|
||||||
|
define('PAGE_TOPIC_OFFSET', 5000);
|
||||||
|
|
||||||
|
|
||||||
|
// Auth settings
|
||||||
|
define('AUTH_LIST_ALL', 0);
|
||||||
|
define('AUTH_ALL', 0);
|
||||||
|
|
||||||
|
define('AUTH_REG', 1);
|
||||||
|
define('AUTH_ACL', 2);
|
||||||
|
define('AUTH_MOD', 3);
|
||||||
|
define('AUTH_ADMIN', 5);
|
||||||
|
|
||||||
|
define('AUTH_VIEW', 1);
|
||||||
|
define('AUTH_READ', 2);
|
||||||
|
define('AUTH_POST', 3);
|
||||||
|
define('AUTH_REPLY', 4);
|
||||||
|
define('AUTH_EDIT', 5);
|
||||||
|
define('AUTH_DELETE', 6);
|
||||||
|
define('AUTH_ANNOUNCE', 7);
|
||||||
|
define('AUTH_STICKY', 8);
|
||||||
|
define('AUTH_POLLCREATE', 9);
|
||||||
|
define('AUTH_VOTE', 10);
|
||||||
|
define('AUTH_ATTACH', 11);
|
||||||
|
|
||||||
|
|
||||||
|
// Table names
|
||||||
|
define('AUTH_ACCESS_TABLE', $table_prefix.'auth_access');
|
||||||
|
define('BANLIST_TABLE', $table_prefix.'banlist');
|
||||||
|
define('CATEGORIES_TABLE', $table_prefix.'categories');
|
||||||
|
define('CONFIG_TABLE', $table_prefix.'config');
|
||||||
|
define('DISALLOW_TABLE', $table_prefix.'disallow');
|
||||||
|
define('FORUMS_TABLE', $table_prefix.'forums');
|
||||||
|
define('GROUPS_TABLE', $table_prefix.'groups');
|
||||||
|
define('POSTS_TABLE', $table_prefix.'posts');
|
||||||
|
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
|
||||||
|
define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');
|
||||||
|
define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text');
|
||||||
|
define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore');
|
||||||
|
define('PRUNE_TABLE', $table_prefix.'forum_prune');
|
||||||
|
define('RANKS_TABLE', $table_prefix.'ranks');
|
||||||
|
define('SEARCH_TABLE', $table_prefix.'search_results');
|
||||||
|
define('SEARCH_WORD_TABLE', $table_prefix.'search_wordlist');
|
||||||
|
define('SEARCH_MATCH_TABLE', $table_prefix.'search_wordmatch');
|
||||||
|
define('SESSIONS_TABLE', $table_prefix.'sessions');
|
||||||
|
define('SMILIES_TABLE', $table_prefix.'smilies');
|
||||||
|
define('THEMES_TABLE', $table_prefix.'themes');
|
||||||
|
define('THEMES_NAME_TABLE', $table_prefix.'themes_name');
|
||||||
|
define('TOPICS_TABLE', $table_prefix.'topics');
|
||||||
|
define('TOPICS_WATCH_TABLE', $table_prefix.'topics_watch');
|
||||||
|
define('USER_GROUP_TABLE', $table_prefix.'user_group');
|
||||||
|
define('USERS_TABLE', $table_prefix.'users');
|
||||||
|
define('WORDS_TABLE', $table_prefix.'words');
|
||||||
|
define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
|
||||||
|
define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
|
||||||
|
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/template.'.$phpEx);
|
include($phpbb_root_path . 'includes/template.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
|
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/auth.'.$phpEx);
|
include($phpbb_root_path . 'includes/auth.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
|
||||||
|
switch($dbms)
|
||||||
|
{
|
||||||
|
case 'mysql':
|
||||||
|
include($phpbb_root_path . 'db/mysql.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'mysql4':
|
||||||
|
include($phpbb_root_path . 'db/mysql4.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'postgres':
|
||||||
|
include($phpbb_root_path . 'db/postgres7.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'mssql':
|
||||||
|
include($phpbb_root_path . 'db/mssql.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'oracle':
|
||||||
|
include($phpbb_root_path . 'db/oracle.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'msaccess':
|
||||||
|
include($phpbb_root_path . 'db/msaccess.'.$phpEx);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'mssql-odbc':
|
||||||
|
include($phpbb_root_path . 'db/mssql-odbc.'.$phpEx);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make the database connection.
|
||||||
|
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false);
|
||||||
|
if ( !$db->db_connect_id )
|
||||||
|
{
|
||||||
|
message_die(CRITICAL_ERROR, "Could not connect to the database");
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Mozilla navigation bar
|
// Mozilla navigation bar
|
||||||
|
@ -170,22 +314,20 @@ $user_ip = encode_ip($client_ip);
|
||||||
//
|
//
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM " . CONFIG_TABLE;
|
FROM " . CONFIG_TABLE;
|
||||||
if(!$result = $db->sql_query($sql))
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Could not query config information', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
while($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
while($row = $db->sql_fetchrow($result))
|
$board_config[$row['config_name']] = $row['config_value'];
|
||||||
{
|
|
||||||
$board_config[$row['config_name']] = $row['config_value'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Show 'Board is disabled' message if needed.
|
// Show 'Board is disabled' message if needed.
|
||||||
//
|
//
|
||||||
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )
|
if ( $board_config['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
|
message_die(GENERAL_MESSAGE, 'Board_disable', 'Information');
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -67,7 +67,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_user
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020402]');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020420]');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
-- Categories
|
-- Categories
|
||||||
|
|
|
@ -318,7 +318,7 @@ CREATE TABLE [phpbb_users] (
|
||||||
[user_regdate] [int] NOT NULL ,
|
[user_regdate] [int] NOT NULL ,
|
||||||
[user_level] [smallint] NOT NULL ,
|
[user_level] [smallint] NOT NULL ,
|
||||||
[user_posts] [int] NOT NULL ,
|
[user_posts] [int] NOT NULL ,
|
||||||
[user_timezone] [real] NOT NULL ,
|
[user_timezone] [decimal] (4,2) NOT NULL ,
|
||||||
[user_style] [int] NULL ,
|
[user_style] [int] NULL ,
|
||||||
[user_lang] [varchar] (255) NULL ,
|
[user_lang] [varchar] (255) NULL ,
|
||||||
[user_dateformat] [varchar] (14) NOT NULL ,
|
[user_dateformat] [varchar] (14) NOT NULL ,
|
||||||
|
|
|
@ -60,7 +60,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.myserver.tld');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.myserver.tld');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020402]');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020420]');
|
||||||
|
|
||||||
|
|
||||||
# -- Categories
|
# -- Categories
|
||||||
|
|
|
@ -463,7 +463,7 @@ CREATE TABLE phpbb_users (
|
||||||
user_regdate int(11) DEFAULT '0' NOT NULL,
|
user_regdate int(11) DEFAULT '0' NOT NULL,
|
||||||
user_level tinyint(4) DEFAULT '0',
|
user_level tinyint(4) DEFAULT '0',
|
||||||
user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||||
user_timezone float DEFAULT '0' NOT NULL,
|
user_timezone decimal(4,2) DEFAULT '0' NOT NULL,
|
||||||
user_style tinyint(4),
|
user_style tinyint(4),
|
||||||
user_lang varchar(255),
|
user_lang varchar(255),
|
||||||
user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
|
user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
|
||||||
|
|
|
@ -61,7 +61,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('record_online_date
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', 'www.yourdomain.tld');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', '80');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', '/phpBB2/');
|
||||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020402]');
|
INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '.1.0 [20020420]');
|
||||||
|
|
||||||
-- Categories
|
-- Categories
|
||||||
INSERT INTO phpbb_categories (cat_id, cat_title, cat_order) VALUES (1, 'Test category 1', 10);
|
INSERT INTO phpbb_categories (cat_id, cat_title, cat_order) VALUES (1, 'Test category 1', 10);
|
||||||
|
|
|
@ -478,7 +478,7 @@ CREATE TABLE phpbb_users (
|
||||||
user_avatar_type int2 DEFAULT '0' NOT NULL,
|
user_avatar_type int2 DEFAULT '0' NOT NULL,
|
||||||
user_level int4 DEFAULT '1',
|
user_level int4 DEFAULT '1',
|
||||||
user_lang varchar(255),
|
user_lang varchar(255),
|
||||||
user_timezone real DEFAULT '0' NOT NULL,
|
user_timezone decimal(4) DEFAULT '0' NOT NULL,
|
||||||
user_dateformat varchar(14) DEFAULT 'd M Y H:m' NOT NULL,
|
user_dateformat varchar(14) DEFAULT 'd M Y H:m' NOT NULL,
|
||||||
user_notify_pm int2 DEFAULT '1' NOT NULL,
|
user_notify_pm int2 DEFAULT '1' NOT NULL,
|
||||||
user_popup_pm int2 DEFAULT '0' NOT NULL,
|
user_popup_pm int2 DEFAULT '0' NOT NULL,
|
||||||
|
|
|
@ -29,7 +29,7 @@ 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)
|
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, $board_config;
|
global $lang, $images, $board_config, $phpEx;
|
||||||
|
|
||||||
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
|
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
|
||||||
$joined = create_date($date_format, $row['user_regdate'], $board_config['board_timezone']);
|
$joined = create_date($date_format, $row['user_regdate'], $board_config['board_timezone']);
|
||||||
|
@ -207,7 +207,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
|
||||||
//
|
//
|
||||||
if ( !$userdata['session_logged_in'] )
|
if ( !$userdata['session_logged_in'] )
|
||||||
{
|
{
|
||||||
header($header_location . ppend_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
|
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT ug.user_id, g.group_type
|
$sql = "SELECT ug.user_id, g.group_type
|
||||||
|
@ -308,7 +308,7 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending
|
||||||
//
|
//
|
||||||
if ( $cancel )
|
if ( $cancel )
|
||||||
{
|
{
|
||||||
header($header_location . ppend_sid("groupcp.$phpEx", true));
|
header($header_location . append_sid("groupcp.$phpEx", true));
|
||||||
}
|
}
|
||||||
elseif ( !$userdata['session_logged_in'] )
|
elseif ( !$userdata['session_logged_in'] )
|
||||||
{
|
{
|
||||||
|
@ -912,7 +912,8 @@ else if ( $group_id )
|
||||||
'L_PENDING_MEMBERS' => $lang['Pending_members'],
|
'L_PENDING_MEMBERS' => $lang['Pending_members'],
|
||||||
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
|
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
|
||||||
'L_PM' => $lang['Private_Message'],
|
'L_PM' => $lang['Private_Message'],
|
||||||
'L_EMAIL' => $lang['Email'],
|
'L_EMAIL' => $lang['Email'],
|
||||||
|
'L_POSTS' => $lang['Posts'],
|
||||||
'L_WEBSITE' => $lang['Website'],
|
'L_WEBSITE' => $lang['Website'],
|
||||||
'L_FROM' => $lang['Location'],
|
'L_FROM' => $lang['Location'],
|
||||||
'L_ORDER' => $lang['Order'],
|
'L_ORDER' => $lang['Order'],
|
||||||
|
|
|
@ -251,7 +251,7 @@ function bbencode_first_pass($text, $uid)
|
||||||
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
|
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
|
||||||
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
|
$text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');
|
||||||
|
|
||||||
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\".*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
|
$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\\"[^"]*?\\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
|
||||||
|
|
||||||
// [list] and [list=x] for (un)ordered lists.
|
// [list] and [list=x] for (un)ordered lists.
|
||||||
$open_tag = array();
|
$open_tag = array();
|
||||||
|
@ -433,7 +433,13 @@ function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_
|
||||||
// Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right.
|
// Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right.
|
||||||
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
|
$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
|
||||||
bbcode_array_push($stack, $match);
|
bbcode_array_push($stack, $match);
|
||||||
++$curr_pos;
|
//
|
||||||
|
// Rather than just increment $curr_pos
|
||||||
|
// Set it to the ending of the tag we just found
|
||||||
|
// Keeps error in nested tag from breaking out
|
||||||
|
// of table structure..
|
||||||
|
//
|
||||||
|
$curr_pos = $curr_pos + strlen($possible_start);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,17 +178,7 @@ class emailer
|
||||||
//
|
//
|
||||||
function send()
|
function send()
|
||||||
{
|
{
|
||||||
global $phpEx, $phpbb_root_dir;
|
global $phpEx, $phpbb_root_path;
|
||||||
|
|
||||||
if (isset($phpbb_root_dir))
|
|
||||||
{
|
|
||||||
// we must be in the admin section.
|
|
||||||
$phpbb_root_path = $phpbb_root_dir;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$phpbb_root_path = "./";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->address == NULL)
|
if ($this->address == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -491,7 +491,7 @@ function obtain_word_list(&$orig_word, &$replacement_word)
|
||||||
//
|
//
|
||||||
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
|
function message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '')
|
||||||
{
|
{
|
||||||
global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links;
|
global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header;
|
||||||
global $userdata, $user_ip, $session_length;
|
global $userdata, $user_ip, $session_length;
|
||||||
global $starttime;
|
global $starttime;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
if ( !defined('IN_PHPBB') )
|
if ( !defined('IN_PHPBB') )
|
||||||
{
|
{
|
||||||
die("Hacking attempt");
|
die('Hacking attempt');
|
||||||
}
|
}
|
||||||
|
|
||||||
$html_entities_match = array('#&#', '#<#', '#>#');
|
$html_entities_match = array('#&#', '#<#', '#>#');
|
||||||
|
@ -380,7 +380,7 @@ function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_i
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$sign = ( $mode == 'delete' ) ? "- 1" : "+ 1";
|
$sign = ( $mode == 'delete' ) ? '- 1' : '+ 1';
|
||||||
$forum_update_sql = "forum_posts = forum_posts $sign";
|
$forum_update_sql = "forum_posts = forum_posts $sign";
|
||||||
$topic_update_sql = '';
|
$topic_update_sql = '';
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_i
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$topic_update_sql = "topic_replies = topic_replies - 1";
|
$topic_update_sql .= "topic_replies = topic_replies - 1";
|
||||||
|
|
||||||
$sql = "SELECT MAX(post_id) AS post_id
|
$sql = "SELECT MAX(post_id) AS post_id
|
||||||
FROM " . POSTS_TABLE . "
|
FROM " . POSTS_TABLE . "
|
||||||
|
@ -439,9 +439,13 @@ function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_i
|
||||||
|
|
||||||
if ( $row = $db->sql_fetchrow($result) )
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
$topic_update_sql = 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
|
$topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['post_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$topic_update_sql .= 'topic_replies = topic_replies - 1';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( $mode != 'poll_delete' )
|
else if ( $mode != 'poll_delete' )
|
||||||
{
|
{
|
||||||
|
|
|
@ -428,7 +428,9 @@ function remove_search_post($post_id_sql)
|
||||||
function username_search($search_match)
|
function username_search($search_match)
|
||||||
{
|
{
|
||||||
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
|
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
|
||||||
global $starttime;
|
global $starttime, $gen_simple_header;
|
||||||
|
|
||||||
|
$gen_simple_header = TRUE;
|
||||||
|
|
||||||
$username_list = '';
|
$username_list = '';
|
||||||
if ( !empty($search_match) )
|
if ( !empty($search_match) )
|
||||||
|
@ -459,7 +461,6 @@ function username_search($search_match)
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$gen_simple_header = TRUE;
|
|
||||||
$page_title = $lang['Search'];
|
$page_title = $lang['Search'];
|
||||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ function validate_username($username)
|
||||||
{
|
{
|
||||||
while( $row = $db->sql_fetchrow($result) )
|
while( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
|
if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
|
||||||
{
|
{
|
||||||
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
|
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ function validate_username($username)
|
||||||
{
|
{
|
||||||
while( $row = $db->sql_fetchrow($result) )
|
while( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
if ( preg_match("#\b(" . str_replace("\*", "\w*?", preg_quote($row['word'])) . ")\b#i", $username) )
|
if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'])) . ")\b#i", $username) )
|
||||||
{
|
{
|
||||||
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
|
return array('error' => true, 'error_msg' => $lang['Username_disallowed']);
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ function validate_email($email)
|
||||||
|
|
||||||
if ( $email != '' )
|
if ( $email != '' )
|
||||||
{
|
{
|
||||||
if ( preg_match('/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
|
if ( preg_match('/^[a-z0-9\.\-_\+]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)*?[a-z]+$/is', $email) )
|
||||||
{
|
{
|
||||||
$sql = "SELECT ban_email
|
$sql = "SELECT ban_email
|
||||||
FROM " . BANLIST_TABLE;
|
FROM " . BANLIST_TABLE;
|
||||||
|
@ -110,7 +110,7 @@ function validate_email($email)
|
||||||
{
|
{
|
||||||
while( $row = $db->sql_fetchrow($result) )
|
while( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
$match_email = str_replace('*', '.*', $row['ban_email']);
|
$match_email = str_replace('*', '.*?', $row['ban_email']);
|
||||||
if ( preg_match('/^' . $match_email . '$/is', $email) )
|
if ( preg_match('/^' . $match_email . '$/is', $email) )
|
||||||
{
|
{
|
||||||
return array('error' => true, 'error_msg' => $lang['Email_banned']);
|
return array('error' => true, 'error_msg' => $lang['Email_banned']);
|
||||||
|
|
|
@ -85,13 +85,11 @@ $s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['
|
||||||
// Get basic (usernames + totals) online
|
// Get basic (usernames + totals) online
|
||||||
// situation
|
// situation
|
||||||
//
|
//
|
||||||
$user_forum_sql = ( !empty($forum_id) ) ? "AND ( u.user_session_page = $forum_id
|
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = $forum_id" : '';
|
||||||
OR s.session_page = $forum_id)" : '';
|
|
||||||
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
|
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
|
||||||
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
||||||
WHERE u.user_id = s.session_user_id
|
WHERE u.user_id = s.session_user_id
|
||||||
AND ( s.session_time >= ".( time() - 300 ) . "
|
AND s.session_time >= ".( time() - 300 ) . "
|
||||||
OR u.user_session_time >= " . ( time() - 300 ) . " )
|
|
||||||
$user_forum_sql
|
$user_forum_sql
|
||||||
ORDER BY u.username ASC, s.session_ip ASC";
|
ORDER BY u.username ASC, s.session_ip ASC";
|
||||||
if( !($result = $db->sql_query($sql)) )
|
if( !($result = $db->sql_query($sql)) )
|
||||||
|
@ -364,6 +362,8 @@ $template->assign_vars(array(
|
||||||
'L_SEARCH_SELF' => $lang['Search_your_posts'],
|
'L_SEARCH_SELF' => $lang['Search_your_posts'],
|
||||||
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
|
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
|
||||||
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
|
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
|
||||||
|
'L_WHOSONLINE_USER' => sprintf($lang['User_online_color'], '<span style="color:#' . $theme['fontcolor1'] . '">', '</span>'),
|
||||||
|
'L_LEGEND' => $lang['Legend'],
|
||||||
|
|
||||||
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
|
'U_SEARCH_UNANSWERED' => append_sid('search.'.$phpEx.'?search_id=unanswered'),
|
||||||
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
|
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
|
||||||
|
@ -386,7 +386,7 @@ $template->assign_vars(array(
|
||||||
'S_CONTENT_ENCODING' => $lang['ENCODING'],
|
'S_CONTENT_ENCODING' => $lang['ENCODING'],
|
||||||
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
|
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
|
||||||
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
|
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
|
||||||
'S_TIMEZONE' => sprintf($lang['All_times'], $lang[$board_config['board_timezone']]),
|
'S_TIMEZONE' => sprintf($lang['All_times'], $lang[number_format($board_config['board_timezone'])]),
|
||||||
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
|
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),
|
||||||
|
|
||||||
'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
|
'T_HEAD_STYLESHEET' => $theme['head_stylesheet'],
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
//
|
|
||||||
// session_begin()
|
|
||||||
//
|
//
|
||||||
// Adds/updates a new session to the database for the given userid.
|
// Adds/updates a new session to the database for the given userid.
|
||||||
// Returns the new session ID on success.
|
// Returns the new session ID on success.
|
||||||
|
@ -54,8 +52,7 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
$expiry_time = $current_time - $board_config['session_length'];
|
$expiry_time = $current_time - $board_config['session_length'];
|
||||||
|
|
||||||
//
|
//
|
||||||
// Try and pull the last time stored
|
// Try and pull the last time stored in a cookie, if it exists
|
||||||
// in a cookie, if it exists
|
|
||||||
//
|
//
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
FROM " . USERS_TABLE . "
|
FROM " . USERS_TABLE . "
|
||||||
|
@ -81,8 +78,6 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
// autologinid matches password
|
// autologinid matches password
|
||||||
$login = 1;
|
$login = 1;
|
||||||
$enable_autologin = 1;
|
$enable_autologin = 1;
|
||||||
|
|
||||||
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -102,7 +97,6 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
|
|
||||||
$login = 1;
|
$login = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,27 +140,29 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
|
SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
|
||||||
WHERE session_id = '" . $session_id . "'
|
WHERE session_id = '" . $session_id . "'
|
||||||
AND session_ip = '$user_ip'";
|
AND session_ip = '$user_ip'";
|
||||||
if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() )
|
if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
|
||||||
{
|
{
|
||||||
$session_id = md5(uniqid($user_ip));
|
$session_id = md5(uniqid($user_ip));
|
||||||
|
|
||||||
$sql = "INSERT INTO " . SESSIONS_TABLE . "
|
$sql = "INSERT INTO " . SESSIONS_TABLE . "
|
||||||
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
|
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
|
||||||
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
|
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !$db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error creating new session : session_begin', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $user_id != ANONYMOUS )
|
if ( $user_id != ANONYMOUS )
|
||||||
{
|
{// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : (
|
||||||
|
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
|
||||||
|
|
||||||
$sql = "UPDATE " . USERS_TABLE . "
|
$sql = "UPDATE " . USERS_TABLE . "
|
||||||
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
|
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
if ( !$db->sql_query($sql) )
|
if ( !$db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error updating last visit time : session_begin', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$userdata['user_lastvisit'] = $last_visit;
|
$userdata['user_lastvisit'] = $last_visit;
|
||||||
|
@ -185,8 +181,6 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
|
|
||||||
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
// header('Set-cookie: ' . $cookiename . '_data=' . urlencode(serialize($sessiondata)) . '; expires=' . gmdate("l, d-M-Y H:i:s", $current_time + 31536000) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
|
|
||||||
// header('Set-cookie: ' . $cookiename . '_sid=' . $session_id . '; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
|
|
||||||
|
|
||||||
$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
|
$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
|
||||||
|
|
||||||
|
@ -194,8 +188,8 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checks for a given user session, tidies session
|
// Checks for a given user session, tidies session table and updates user
|
||||||
// table and updates user sessions at each page refresh
|
// sessions at each page refresh
|
||||||
//
|
//
|
||||||
function session_pagestart($user_ip, $thispage_id)
|
function session_pagestart($user_ip, $thispage_id)
|
||||||
{
|
{
|
||||||
|
@ -206,7 +200,6 @@ function session_pagestart($user_ip, $thispage_id)
|
||||||
$cookiepath = $board_config['cookie_path'];
|
$cookiepath = $board_config['cookie_path'];
|
||||||
$cookiedomain = $board_config['cookie_domain'];
|
$cookiedomain = $board_config['cookie_domain'];
|
||||||
$cookiesecure = $board_config['cookie_secure'];
|
$cookiesecure = $board_config['cookie_secure'];
|
||||||
$cookiesecure = ( $board_config['cookie_secure'] ) ? '; secure' : '';
|
|
||||||
|
|
||||||
$current_time = time();
|
$current_time = time();
|
||||||
unset($userdata);
|
unset($userdata);
|
||||||
|
@ -240,7 +233,7 @@ function session_pagestart($user_ip, $thispage_id)
|
||||||
AND s.session_ip = '$user_ip'";
|
AND s.session_ip = '$user_ip'";
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch : session_pagestart', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
$userdata = $db->sql_fetchrow($result);
|
$userdata = $db->sql_fetchrow($result);
|
||||||
|
@ -255,32 +248,66 @@ function session_pagestart($user_ip, $thispage_id)
|
||||||
//
|
//
|
||||||
// Only update session DB a minute or so after last update
|
// Only update session DB a minute or so after last update
|
||||||
//
|
//
|
||||||
$last_update = ( $userdata['user_id'] == ANONYMOUS ) ? $userdata['session_time'] : $userdata['user_session_time'];
|
if ( $current_time - $userdata['session_time'] > 60 || $userdata['session_page'] != $thispage_id )
|
||||||
|
{
|
||||||
if ( $current_time - $last_update > 60 )
|
$sql = "UPDATE " . SESSIONS_TABLE . "
|
||||||
{ // || $userdata['user_session_page'] != $thispage_id
|
SET session_time = $current_time, session_page = $thispage_id
|
||||||
$sql = ( $userdata['user_id'] == ANONYMOUS ) ? "UPDATE " . SESSIONS_TABLE . " SET session_time = $current_time, session_page = $thispage_id WHERE session_id = '" . $userdata['session_id'] . "' AND session_ip = '$user_ip'" : "UPDATE " . USERS_TABLE . " SET user_session_time = $current_time, user_session_page = $thispage_id WHERE user_id = " . $userdata['user_id'];
|
WHERE session_id = '" . $userdata['session_id'] . "'
|
||||||
|
AND session_ip = '$user_ip'";
|
||||||
if ( !$db->sql_query($sql) )
|
if ( !$db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error updating sessions table : session_pagestart', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
if ( $current_time - $board_config['session_gc'] > $board_config['session_last_gc'] )
|
||||||
// Delete expired sessions
|
|
||||||
//
|
|
||||||
$expiry_time = $current_time - $board_config['session_length'];
|
|
||||||
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
|
||||||
WHERE session_time < $expiry_time
|
|
||||||
AND session_id <> '$session_id'";
|
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error clearing sessions table : session_pagestart', '', __LINE__, __FILE__, $sql);
|
$sql = "SELECT *
|
||||||
|
FROM " . SESSIONS_TABLE . "
|
||||||
|
WHERE session_time < " . ( $current_time - $board_config['session_length'] ) . "
|
||||||
|
AND session_logged_in = 1";
|
||||||
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
|
{
|
||||||
|
message_die(CRITICAL_ERROR, 'Could not obtain expired session list', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
$del_session_id = '';
|
||||||
|
while ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
$sql = "UPDATE " . USERS_TABLE . "
|
||||||
|
SET user_lastvisit = " . $row['session_time'] . ", user_session_page = " . $row['session_page'] . "
|
||||||
|
WHERE user_id = " . $row['session_user_id'];
|
||||||
|
if ( !$db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(CRITICAL_ERROR, 'Could not update user session info', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
$del_session_id .= ( ( $del_session_id != '' ) ? ', ' : '' ) . '\'' . $row['session_id'] . '\'';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $del_session_id != '' )
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Delete expired sessions
|
||||||
|
//
|
||||||
|
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
||||||
|
WHERE session_id IN ($del_session_id)";
|
||||||
|
if ( !$db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $sql = "UPDATE " . CONFIG_TABLE . "
|
||||||
|
SET config_value = '$current_time'
|
||||||
|
WHERE config_name = 'session_last_gc'";
|
||||||
|
if ( !$db->sql_query($sql) )
|
||||||
|
{
|
||||||
|
message_die(CRITICAL_ERROR, 'Could not update session gc time', '', __LINE__, __FILE__, $sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
// header('Set-cookie: ' . $cookiename . '_data=' . urlencode(serialize($sessiondata)) . '; expires=' . gmdate("l, d-M-Y H:i:s", $current_time + 31536000) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
|
|
||||||
// header('Set-cookie: ' . $cookiename . '_sid=' . $session_id . '; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $userdata;
|
return $userdata;
|
||||||
|
@ -295,7 +322,7 @@ function session_pagestart($user_ip, $thispage_id)
|
||||||
|
|
||||||
if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
|
if ( !($userdata = session_begin($user_id, $user_ip, $thispage_id, TRUE)) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error creating user session : session_pagestart', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error creating user session', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $userdata;
|
return $userdata;
|
||||||
|
@ -316,7 +343,6 @@ function session_end($session_id, $user_id)
|
||||||
$cookiepath = $board_config['cookie_path'];
|
$cookiepath = $board_config['cookie_path'];
|
||||||
$cookiedomain = $board_config['cookie_domain'];
|
$cookiedomain = $board_config['cookie_domain'];
|
||||||
$cookiesecure = $board_config['cookie_secure'];
|
$cookiesecure = $board_config['cookie_secure'];
|
||||||
// $cookiesecure = ( $board_config['cookie_secure'] ) ? '; secure' : '';
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pull cookiedata or grab the URI propagated sid
|
// Pull cookiedata or grab the URI propagated sid
|
||||||
|
@ -324,12 +350,10 @@ function session_end($session_id, $user_id)
|
||||||
if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) )
|
if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) )
|
||||||
{
|
{
|
||||||
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
|
$session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : '';
|
||||||
$sessionmethod = SESSION_METHOD_COOKIE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
|
$session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
|
||||||
$sessionmethod = SESSION_METHOD_GET;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -338,27 +362,19 @@ function session_end($session_id, $user_id)
|
||||||
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
||||||
WHERE session_id = '$session_id'
|
WHERE session_id = '$session_id'
|
||||||
AND session_user_id = $user_id";
|
AND session_user_id = $user_id";
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !$db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
message_die(CRITICAL_ERROR, 'Error removing user session : session_end', '', __LINE__, __FILE__, $sql);
|
message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
||||||
// header('Set-cookie: ' . $cookiename . '_data=0; expires=' . gmdate("l, d-M-Y H:i:s", 0) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath. $cookiesecure);
|
|
||||||
// header('Set-cookie: ' . $cookiename . '_sid=0; expires=' . gmdate("l, d-M-Y H:i:s", 0) . ' GMT; domain=' . $cookiedomain . '; path=' . $cookiepath . $cookiesecure);
|
|
||||||
|
|
||||||
$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Append $SID to a url. Borrowed from phplib and modified. This is an
|
// Append $SID to a url. Borrowed from phplib and modified.
|
||||||
// extra routine utilised by the session code above and acts as a wrapper
|
|
||||||
// around every single URL and form action. If you replace the session
|
|
||||||
// code you must include this routine, even if it's empty.
|
|
||||||
//
|
//
|
||||||
function append_sid($url, $non_html_amp = false)
|
function append_sid($url, $non_html_amp = false)
|
||||||
{
|
{
|
||||||
|
@ -372,4 +388,4 @@ function append_sid($url, $non_html_amp = false)
|
||||||
return($url);
|
return($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -233,7 +233,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
|
||||||
return $avatar_sql;
|
return $avatar_sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$allowviewonline, &$style, &$language, &$timezone, &$dateformat)
|
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat)
|
||||||
{
|
{
|
||||||
global $board_config, $db, $template, $lang, $images, $theme;
|
global $board_config, $db, $template, $lang, $images, $theme;
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
@ -309,7 +309,7 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'allowviewonline', 'style', 'language', 'timezone', 'dateformat');
|
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
|
||||||
|
|
||||||
$s_hidden_vars = '<input type="hidden" name="agreed" value="true" />';
|
$s_hidden_vars = '<input type="hidden" name="agreed" value="true" />';
|
||||||
|
|
||||||
|
@ -333,4 +333,4 @@ function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -27,12 +27,6 @@ if ( !defined('IN_PHPBB') )
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !$userdata['session_logged_in'] )
|
|
||||||
{
|
|
||||||
header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
|
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
|
||||||
{
|
{
|
||||||
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
|
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
|
||||||
|
@ -42,6 +36,12 @@ else
|
||||||
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
|
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !$userdata['session_logged_in'] )
|
||||||
|
{
|
||||||
|
header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "SELECT username, user_email, user_viewemail, user_lang
|
$sql = "SELECT username, user_email, user_viewemail, user_lang
|
||||||
FROM " . USERS_TABLE . "
|
FROM " . USERS_TABLE . "
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
|
|
|
@ -27,11 +27,11 @@ if ( !defined('IN_PHPBB') )
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// ---------------------------------------
|
||||||
// Load agreement template since user has not yet
|
// Load agreement template since user has not yet
|
||||||
// agreed to registration conditions/coppa
|
// agreed to registration conditions/coppa
|
||||||
//
|
//
|
||||||
function show_coppa(&$coppa)
|
function show_coppa()
|
||||||
{
|
{
|
||||||
global $template, $lang, $phpbb_root_path, $phpEx;
|
global $template, $lang, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ function show_coppa(&$coppa)
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'COPPA' => $coppa,
|
|
||||||
'REGISTRATION' => $lang['Registration'],
|
'REGISTRATION' => $lang['Registration'],
|
||||||
'AGREEMENT' => $lang['Reg_agreement'],
|
'AGREEMENT' => $lang['Reg_agreement'],
|
||||||
"AGREE_OVER_13" => $lang['Agree_over_13'],
|
"AGREE_OVER_13" => $lang['Agree_over_13'],
|
||||||
|
@ -55,8 +54,7 @@ function show_coppa(&$coppa)
|
||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//
|
// ---------------------------------------
|
||||||
//
|
|
||||||
|
|
||||||
$error = FALSE;
|
$error = FALSE;
|
||||||
$page_title = ( $mode == 'editprofile' ) ? $lang['Edit_profile'] : $lang['Register'];
|
$page_title = ( $mode == 'editprofile' ) ? $lang['Edit_profile'] : $lang['Register'];
|
||||||
|
@ -65,12 +63,12 @@ if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GE
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||||
|
|
||||||
show_coppa($coppa);
|
show_coppa();
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
$coppa = ( ( !$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa'] ) || $mode == 'register' ) ? 0 : TRUE;
|
$coppa = ( empty($HTTP_POST_VARS['coppa']) && empty($HTTP_GET_VARS['coppa']) ) ? 0 : TRUE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check and initialize some variables if needed
|
// Check and initialize some variables if needed
|
||||||
|
@ -223,14 +221,12 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
||||||
}
|
}
|
||||||
else if ( $mode == 'register' )
|
else if ( $mode == 'register' )
|
||||||
{
|
{
|
||||||
$coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : TRUE;
|
|
||||||
|
|
||||||
if ( empty($username) || empty($password) || empty($password_confirm) || empty($email) )
|
if ( empty($username) || empty($password) || empty($password_confirm) || empty($email) )
|
||||||
{
|
{
|
||||||
$error = TRUE;
|
$error = TRUE;
|
||||||
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
|
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$passwd_sql = '';
|
$passwd_sql = '';
|
||||||
|
@ -707,6 +703,8 @@ if( isset($HTTP_POST_VARS['avatargallery']) && !$error )
|
||||||
'body' => 'profile_avatar_gallery.tpl')
|
'body' => 'profile_avatar_gallery.tpl')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$allowviewonline = !$allowviewonline;
|
||||||
|
|
||||||
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat);
|
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -787,7 +785,7 @@ else
|
||||||
// us from doing file uploads....
|
// us from doing file uploads....
|
||||||
//
|
//
|
||||||
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
|
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
|
||||||
$form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
|
$form_enctype = ( @$ini_val('file_uploads') == '0' || strtolower(@$ini_val('file_uploads') == 'off') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 新的會員帳號
|
|
||||||
|
|
||||||
您好,
|
您好,
|
||||||
|
|
||||||
這個 "{USERNAME}" 的帳號正在等待開通 (可能暫時被凍結了或是才剛完成註冊程序). 如果有必要的話, 請先查明這個使用者的資料, 然後利用以下連結啟用這個會員帳號:
|
這個 "{USERNAME}" 的帳號正在等待開通 (可能暫時被凍結了或是才剛完成註冊程序). 如果有必要的話, 請先查明這個使用者的資料, 然後利用以下連結啟用這個會員帳號:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 帳號已經啟用
|
|
||||||
|
|
||||||
親愛的 {USERNAME} 您好,
|
親愛的 {USERNAME} 您好,
|
||||||
|
|
||||||
您在"{SITENAME}"的帳號已經啟用, 您可以使用所收到的會員帳號及密碼登入"{SITENAME}".
|
您在"{SITENAME}"的帳號已經啟用, 您可以使用所收到的會員帳號及密碼登入"{SITENAME}".
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: w迎來到 {SITENAME} 討論區
|
|
||||||
|
|
||||||
{WELCOME_MSG}
|
{WELCOME_MSG}
|
||||||
|
|
||||||
請妥善保留這封電子郵件. 您的帳號資料如下:
|
請妥善保留這封電子郵件. 您的帳號資料如下:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: w迎來到 {SITENAME} 討論區
|
|
||||||
|
|
||||||
{WELCOME_MSG}
|
{WELCOME_MSG}
|
||||||
|
|
||||||
依照"美國兒童網路隱私保護法"規定, 您的帳號尚未能啟用.
|
依照"美國兒童網路隱私保護法"規定, 您的帳號尚未能啟用.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 您已經被加入這個會員群組
|
|
||||||
|
|
||||||
恭喜您,
|
恭喜您,
|
||||||
|
|
||||||
您已經正式加入"{SITENAME}"的"{GROUP_NAME}"這個群組.
|
您已經正式加入"{SITENAME}"的"{GROUP_NAME}"這個群組.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 您的請求已經獲得批准
|
|
||||||
|
|
||||||
恭喜您,
|
恭喜您,
|
||||||
|
|
||||||
你在"{SITENAME}"所申請加入的群組"{GROUP_NAME}", 已經獲得批准.
|
你在"{SITENAME}"所申請加入的群組"{GROUP_NAME}", 已經獲得批准.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 有一個會員申請加入您的群組
|
|
||||||
|
|
||||||
親愛的 {GROUP_MODERATOR} 您好,
|
親愛的 {GROUP_MODERATOR} 您好,
|
||||||
|
|
||||||
有一個會員提出申請加入你在"{SITENAME}"所管理的會員群組.
|
有一個會員提出申請加入你在"{SITENAME}"所管理的會員群組.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: "您有新的私人訊息
|
|
||||||
|
|
||||||
親愛的 {USERNAME} 您好,
|
親愛的 {USERNAME} 您好,
|
||||||
|
|
||||||
您在"{SITENAME}"有新的私人訊息, 而且您要求系統以電子郵件通知. 您可以利用以下的連結檢視您剛收到的私人訊息:
|
您在"{SITENAME}"有新的私人訊息, 而且您要求系統以電子郵件通知. 您可以利用以下的連結檢視您剛收到的私人訊息:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 主題回覆通知 - {TOPIC_TITLE}
|
|
||||||
|
|
||||||
親愛的 {USERNAME} 您好,
|
親愛的 {USERNAME} 您好,
|
||||||
|
|
||||||
您收到這封這封電子郵件是因為您在"{SITENAME}"訂閱了主題"{TOPIC_TITLE}", 這個主題在您上次來訪後有新的回覆訊息. 您可以使用以下連結來觀看回覆的訊息, 在您觀看原主題之前, 不會有更新的訊息通知您.
|
您收到這封這封電子郵件是因為您在"{SITENAME}"訂閱了主題"{TOPIC_TITLE}", 這個主題在您上次來訪後有新的回覆訊息. 您可以使用以下連結來觀看回覆的訊息, 在您觀看原主題之前, 不會有更新的訊息通知您.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 您的帳號已經恢復啟用!
|
|
||||||
|
|
||||||
親愛的 {USERNAME} 您好,
|
親愛的 {USERNAME} 您好,
|
||||||
|
|
||||||
您在"{SITENAME}"的帳號暫時被凍結, 最有可能的原因是因為您更改過您的個人資料. 請使用以下連結重新啟用您的帳號:
|
您在"{SITENAME}"的帳號暫時被凍結, 最有可能的原因是因為您更改過您的個人資料. 請使用以下連結重新啟用您的帳號:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: 新的密碼啟用
|
|
||||||
|
|
||||||
親愛的 {USERNAME} 您好,
|
親愛的 {USERNAME} 您好,
|
||||||
|
|
||||||
您收到這封這封電子郵件是因為您 (或者是某人冒充您的名義) 申請了一組新的密碼. 假如這不是您本人所申請, 請不用理會這封電子郵件, 但是如果您持續收到這類的信件騷擾, 請您儘快向管理人員連繫.
|
您收到這封這封電子郵件是因為您 (或者是某人冒充您的名義) 申請了一組新的密碼. 假如這不是您本人所申請, 請不用理會這封電子郵件, 但是如果您持續收到這類的信件騷擾, 請您儘快向管理人員連繫.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: w迎來到 {SITENAME} 討論區
|
|
||||||
|
|
||||||
{WELCOME_MSG}
|
{WELCOME_MSG}
|
||||||
|
|
||||||
請妥善保留這封電子郵件. 您的帳號資料如下:
|
請妥善保留這封電子郵件. 您的帳號資料如下:
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
Subject: w迎來到 {SITENAME} 討論區
|
|
||||||
|
|
||||||
{WELCOME_MSG}
|
{WELCOME_MSG}
|
||||||
|
|
||||||
請妥善保留這封電子郵件. 您的帳號資料如下:
|
請妥善保留這封電子郵件. 您的帳號資料如下:
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -11,16 +11,16 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Traditional Chinese[繁體中文語系] Translation
|
* Traditional Chinese Translation [繁體中文語系]
|
||||||
* -------------------
|
* -------------------
|
||||||
* begin : Thu Nov 26 2001
|
* begin : Thu Nov 26 2001
|
||||||
* by : 小竹子, OOHOO, 皇家騎士, 思
|
* by : 小竹子, OOHOO, 皇家騎士, 思
|
||||||
* email : kyo.yoshika@msa.hinet.net
|
* email : kyo.yoshika@msa.hinet.net
|
||||||
* mchiang@bigpond.net.au
|
* webdev@hotmail.com
|
||||||
* sjwu1@ms12.hinet.net
|
* sjwu1@ms12.hinet.net
|
||||||
* f8806077@mail.dyu.edu.tw
|
* f8806077@mail.dyu.edu.tw
|
||||||
*
|
*
|
||||||
* last modify : Sun Dec 30 2001
|
* last modify : Sun Dec 30 2001
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
|
@ -11,16 +11,16 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Traditional Chinese[繁體中文語系] Translation
|
* Traditional Chinese Translation [繁體中文語系]
|
||||||
* -------------------
|
* -------------------
|
||||||
* begin : Thu Nov 26 2001
|
* begin : Thu Nov 26 2001
|
||||||
* by : 小竹子, OOHOO, 皇家騎士, 思
|
* by : 小竹子, OOHOO, 皇家騎士, 思
|
||||||
* email : kyo.yoshika@msa.hinet.net
|
* email : kyo.yoshika@msa.hinet.net
|
||||||
* mchiang@bigpond.net.au
|
* webdev@hotmail.com
|
||||||
* sjwu1@ms12.hinet.net
|
* sjwu1@ms12.hinet.net
|
||||||
* f8806077@mail.dyu.edu.tw
|
* f8806077@mail.dyu.edu.tw
|
||||||
*
|
*
|
||||||
* last modify : Sun Dec 30 2001
|
* last modify : Sun Dec 30 2001
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -106,7 +106,7 @@ $faq[] = array("
|
||||||
$faq[] = array("--","phpBB 2 聲明");
|
$faq[] = array("--","phpBB 2 聲明");
|
||||||
$faq[] = array("誰寫了這個討論版?", "這個程式 (未經修改的格式) 由 phpBB Group 所開發及釋出, 著作版權歸 <a href=\"http://www.phpbb.com/\" target=\"_blank\">phpBB Group</a> 所有. 依照「革奴大眾公有版權」(GNU General Public License) 的聲明, 這個程式可以自由的使用及散布, 如果您需要更多的資訊可以參考 <a href=\"http://www.gnu.org/copyleft/gpl.html\" target=\"_blank\">GNU General Public License</a>.");
|
$faq[] = array("誰寫了這個討論版?", "這個程式 (未經修改的格式) 由 phpBB Group 所開發及釋出, 著作版權歸 <a href=\"http://www.phpbb.com/\" target=\"_blank\">phpBB Group</a> 所有. 依照「革奴大眾公有版權」(GNU General Public License) 的聲明, 這個程式可以自由的使用及散布, 如果您需要更多的資訊可以參考 <a href=\"http://www.gnu.org/copyleft/gpl.html\" target=\"_blank\">GNU General Public License</a>.");
|
||||||
$faq[] = array("為什麼不能使用更多的功能 ?", "這個軟體是由 phpBB Group 所製作. 如果您認為需要加入更多功能請參觀 phpbb.com website 的說明. 請不要發表進階功能要求到 phpbb.com 的討論版, 這會使得開發小組分心無法致力新功能的開發. 請在版面瀏覽, 如果有任何我們已開發且經過測試的程式我們會放在版面上的.");
|
$faq[] = array("為什麼不能使用更多的功能 ?", "這個軟體是由 phpBB Group 所製作. 如果您認為需要加入更多功能請參觀 phpbb.com website 的說明. 請不要發表進階功能要求到 phpbb.com 的討論版, 這會使得開發小組分心無法致力新功能的開發. 請在版面瀏覽, 如果有任何我們已開發且經過測試的程式我們會放在版面上的.");
|
||||||
$faq[] = array("我該向誰聯繫有關這個討論版誤用或法律上的相關事務?", "您可以連絡這個討論版的管理者. 如果您不能找到這個版面的管理者以尋求更進一步的的聯繫. 如果您連絡管理者之後仍然沒有回應 (尋找 whois ) 或者其是屬於一個執行中的免費服務 (例如: yahoo, free.fr, f2s.com...等等), 管理者或誤用此服務的部門. 請記住 phpBB Group 是完全沒有控制權而且完全不負任何責任的, 這個討論版位居何處以及何人擁有. 在相關法令下, 完全沒有向 phpBB Group 指示 (cease and desist, liable, defamatory comment...等等). 也許不是直接由 phpbb.com website 路徑而得, 或者是只有 phpBB 此軟體的部份而已. 如果您 email到 phpBB Group 有關任何第三者使用軟體上的問題, 您的答案將會非常簡單或是根本不予回應.");
|
$faq[] = array("我該向誰聯繫有關這個討論版誤用或法律上的相關事務?", "您可以連絡這個討論版的管理者. 如果您不能找到這個版面的管理者以尋求更進一步的的聯繫. 如果您連絡管理者之後仍然沒有回應 (尋找 whois ) 或者其是屬於一個執行中的免費服務 (例如: yahoo, free.fr, f2s.com...等等), 管理者或誤用此服務的部門. 請記住 phpBB Group 是完全沒有控制權而且完全不負任何責任的, 這個討論版位居何處以及何人擁有. 在相關法令下, 完全沒有向 phpBB Group 指示 (cease and desist, liable, defamatory comment...等等). 也許不是直接由 phpbb.com website 路徑而得, 或者是只有 phpBB 此軟體的部份而已. 如果您 email 到 phpBB Group 有關任何第三者使用軟體上的問題, 您的答案將會非常簡單或是根本不予回應.");
|
||||||
|
|
||||||
//
|
//
|
||||||
// This ends the FAQ entries
|
// This ends the FAQ entries
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -343,7 +343,7 @@ switch( $mode )
|
||||||
$topics = $HTTP_POST_VARS['topic_id_list'];
|
$topics = $HTTP_POST_VARS['topic_id_list'];
|
||||||
for($i = 0; $i < count($topics); $i++)
|
for($i = 0; $i < count($topics); $i++)
|
||||||
{
|
{
|
||||||
$hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . $topics[$i] . '" />';
|
$hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . intval($topics[$i]) . '" />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -391,7 +391,7 @@ switch( $mode )
|
||||||
$topic_list = '';
|
$topic_list = '';
|
||||||
for($i = 0; $i < count($topics); $i++)
|
for($i = 0; $i < count($topics); $i++)
|
||||||
{
|
{
|
||||||
$topic_list .= ( ( $topic_list != '' ) ? ', ' : '' ) . $topics[$i];
|
$topic_list .= ( ( $topic_list != '' ) ? ', ' : '' ) . intval($topics[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT *
|
$sql = "SELECT *
|
||||||
|
@ -624,7 +624,7 @@ switch( $mode )
|
||||||
message_die(GENERAL_MESSAGE, $lang['Empty_subject']);
|
message_die(GENERAL_MESSAGE, $lang['Empty_subject']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_forum_id = $HTTP_POST_VARS['new_forum_id'];
|
$new_forum_id = intval($HTTP_POST_VARS['new_forum_id']);
|
||||||
$topic_time = time();
|
$topic_time = time();
|
||||||
|
|
||||||
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type)
|
$sql = "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type)
|
||||||
|
|
|
@ -82,17 +82,17 @@ if ( isset($HTTP_POST_VARS['cancel']) )
|
||||||
else if ( $topic_id )
|
else if ( $topic_id )
|
||||||
{
|
{
|
||||||
$redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
|
$redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
|
||||||
$post_append = "";
|
$post_append = '';
|
||||||
}
|
}
|
||||||
else if ( $forum_id )
|
else if ( $forum_id )
|
||||||
{
|
{
|
||||||
$redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
|
$redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
|
||||||
$post_append = "";
|
$post_append = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$redirect = "index.$phpEx";
|
$redirect = "index.$phpEx";
|
||||||
$post_append = "";
|
$post_append = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
|
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
|
||||||
|
@ -442,7 +442,7 @@ else if ( $mode == 'vote' )
|
||||||
//
|
//
|
||||||
if ( !empty($HTTP_POST_VARS['vote_id']) )
|
if ( !empty($HTTP_POST_VARS['vote_id']) )
|
||||||
{
|
{
|
||||||
$vote_option_id = $HTTP_POST_VARS['vote_id'];
|
$vote_option_id = intval($HTTP_POST_VARS['vote_id']);
|
||||||
|
|
||||||
$sql = "SELECT vd.vote_id
|
$sql = "SELECT vd.vote_id
|
||||||
FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
|
FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
|
||||||
|
@ -871,7 +871,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||||
if( $is_auth['auth_sticky'] )
|
if( $is_auth['auth_sticky'] )
|
||||||
{
|
{
|
||||||
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
|
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
|
||||||
if ( $post_data['topic_type'] == POST_STICKY )
|
if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
|
||||||
{
|
{
|
||||||
$topic_type_toggle .= ' checked="checked"';
|
$topic_type_toggle .= ' checked="checked"';
|
||||||
}
|
}
|
||||||
|
@ -881,7 +881,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||||
if( $is_auth['auth_announce'] )
|
if( $is_auth['auth_announce'] )
|
||||||
{
|
{
|
||||||
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
|
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
|
||||||
if ( $post_data['topic_type'] == POST_ANNOUNCE )
|
if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
|
||||||
{
|
{
|
||||||
$topic_type_toggle .= ' checked="checked"';
|
$topic_type_toggle .= ' checked="checked"';
|
||||||
}
|
}
|
||||||
|
@ -890,7 +890,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
|
||||||
|
|
||||||
if ( $topic_type_toggle != '' )
|
if ( $topic_type_toggle != '' )
|
||||||
{
|
{
|
||||||
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . ' ' . $topic_type_toggle;
|
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . ' ' . $topic_type_toggle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1082,4 +1082,4 @@ $template->pparse('body');
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -99,11 +99,11 @@ else
|
||||||
$mode = '';
|
$mode = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = ( !empty($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0;
|
$start = ( !empty($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
|
||||||
|
|
||||||
if ( isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]) )
|
if ( isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]) )
|
||||||
{
|
{
|
||||||
$privmsg_id = ( isset($HTTP_POST_VARS[POST_POST_URL]) ) ? $HTTP_POST_VARS[POST_POST_URL] : $HTTP_GET_VARS[POST_POST_URL];
|
$privmsg_id = ( isset($HTTP_POST_VARS[POST_POST_URL]) ) ? intval($HTTP_POST_VARS[POST_POST_URL]) : intval($HTTP_GET_VARS[POST_POST_URL]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ else if ( $mode == 'read' )
|
||||||
{
|
{
|
||||||
if ( !empty($HTTP_GET_VARS[POST_POST_URL]) )
|
if ( !empty($HTTP_GET_VARS[POST_POST_URL]) )
|
||||||
{
|
{
|
||||||
$privmsgs_id = $HTTP_GET_VARS[POST_POST_URL];
|
$privmsgs_id = intval($HTTP_GET_VARS[POST_POST_URL]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -472,9 +472,9 @@ else if ( $mode == 'read' )
|
||||||
$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_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>';
|
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
|
||||||
|
|
||||||
if ( !empty($privmsg['user_viewemail']) || $is_auth['auth_mod'] )
|
if ( !empty($privmsg['user_viewemail']) || $userdata['user_level'] == ADMIN )
|
||||||
{
|
{
|
||||||
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $poster_id) : 'mailto:' . $privmsg['user_email'];
|
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $user_id_from) : 'mailto:' . $privmsg['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_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>';
|
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
|
||||||
|
@ -910,7 +910,7 @@ else if ( $submit || $refresh || $mode != '' )
|
||||||
|
|
||||||
if ( !$userdata['session_logged_in'] )
|
if ( !$userdata['session_logged_in'] )
|
||||||
{
|
{
|
||||||
$user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? '&' . POST_USERS_URL . '=' . $HTTP_GET_VARS[POST_USERS_URL] : '';
|
$user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? '&' . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]) : '';
|
||||||
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
|
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
|
||||||
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
|
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
|
||||||
}
|
}
|
||||||
|
@ -1037,7 +1037,7 @@ else if ( $submit || $refresh || $mode != '' )
|
||||||
|
|
||||||
$msg_time = time();
|
$msg_time = time();
|
||||||
|
|
||||||
if ( $mode != "edit" )
|
if ( $mode != 'edit' )
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// See if recipient is at their inbox limit
|
// See if recipient is at their inbox limit
|
||||||
|
@ -1087,7 +1087,7 @@ else if ( $submit || $refresh || $mode != '' )
|
||||||
message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
|
message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $mode != "edit" )
|
if ( $mode != 'edit' )
|
||||||
{
|
{
|
||||||
$privmsg_sent_id = $db->sql_nextid();
|
$privmsg_sent_id = $db->sql_nextid();
|
||||||
|
|
||||||
|
@ -1225,7 +1225,7 @@ else if ( $submit || $refresh || $mode != '' )
|
||||||
|
|
||||||
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) )
|
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) )
|
||||||
{
|
{
|
||||||
$user_id = $HTTP_GET_VARS[POST_USERS_URL];
|
$user_id = intval($HTTP_GET_VARS[POST_USERS_URL]);
|
||||||
|
|
||||||
$sql = "SELECT username
|
$sql = "SELECT username
|
||||||
FROM " . USERS_TABLE . "
|
FROM " . USERS_TABLE . "
|
||||||
|
@ -1745,7 +1745,7 @@ switch( $folder )
|
||||||
//
|
//
|
||||||
if ( $submit_msgdays && ( !empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_VARS['msgdays']) ) )
|
if ( $submit_msgdays && ( !empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_VARS['msgdays']) ) )
|
||||||
{
|
{
|
||||||
$msg_days = ( !empty($HTTP_POST_VARS['msgdays']) ) ? $HTTP_POST_VARS['msgdays'] : $HTTP_GET_VARS['msgdays'];
|
$msg_days = ( !empty($HTTP_POST_VARS['msgdays']) ) ? intval($HTTP_POST_VARS['msgdays']) : intval($HTTP_GET_VARS['msgdays']);
|
||||||
$min_msg_time = time() - ($msg_days * 86400);
|
$min_msg_time = time() - ($msg_days * 86400);
|
||||||
|
|
||||||
$limit_msg_time_total = " AND privmsgs_date > $min_msg_time";
|
$limit_msg_time_total = " AND privmsgs_date > $min_msg_time";
|
||||||
|
|
|
@ -115,11 +115,7 @@ else
|
||||||
|
|
||||||
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
|
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
|
||||||
|
|
||||||
//
|
|
||||||
// Define some globally used data
|
|
||||||
//
|
|
||||||
$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']);
|
$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']);
|
||||||
$sort_by_sql = array('p.post_time', 'pt.post_subject', 't.topic_title', 'u.username', 'f.forum_id');
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Begin core code
|
// Begin core code
|
||||||
|
@ -161,7 +157,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header("Location: login.$phpEx?redirect=search&search_id=newposts");
|
header("Location: login.$phpEx?redirect=search.$phpEx&search_id=newposts", true);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +175,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
header("Location: login.$phpEx?redirect=search&search_id=egosearch");
|
header("Location: login.$phpEx?redirect=search.$phpEx&search_id=egosearch", true);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,8 +442,8 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
|
||||||
}
|
}
|
||||||
else if ( $search_author != '' || $search_time || $auth_sql != '' )
|
else if ( $search_author != '' || $search_time || $auth_sql != '' )
|
||||||
{
|
{
|
||||||
$where_sql = ( $search_author == '' && $auth_sql == '' ) ? "post_id IN (" . implode(', ', $search_ids) . ")" : "p.post_id IN (" . implode(", ", $search_ids) . ")";
|
$where_sql = ( $search_author == '' && $auth_sql == '' ) ? 'post_id IN (' . implode(', ', $search_ids) . ')' : 'p.post_id IN (' . implode(', ', $search_ids) . ')';
|
||||||
$from_sql = ( $search_author == '' && $auth_sql == '' ) ? POSTS_TABLE : POSTS_TABLE . " p";
|
$from_sql = ( $search_author == '' && $auth_sql == '' ) ? POSTS_TABLE : POSTS_TABLE . ' p';
|
||||||
|
|
||||||
if ( $search_time )
|
if ( $search_time )
|
||||||
{
|
{
|
||||||
|
@ -640,10 +636,29 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
|
||||||
AND p2.post_id = t.topic_last_post_id
|
AND p2.post_id = t.topic_last_post_id
|
||||||
AND u2.user_id = p2.poster_id";
|
AND u2.user_id = p2.poster_id";
|
||||||
}
|
}
|
||||||
|
|
||||||
$per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page'];
|
$per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page'];
|
||||||
|
|
||||||
$sql .= " ORDER BY " . $sort_by_sql[$sort_by] . " $sort_dir LIMIT $start, " . $per_page;
|
$sql .= " ORDER BY ";
|
||||||
|
switch ( $sort_by )
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
$sql .= ( $show_results == 'posts' ) ? 'pt.post_subject' : 't.topic_title';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$sql .= 't.topic_title';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$sql .= 'u.username';
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$sql .= 'f.forum_id';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$sql .= ( $show_results == 'posts' ) ? 'p.post_time' : 'p2.post_time';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$sql .= " $sort_dir LIMIT $start, " . $per_page;
|
||||||
|
|
||||||
if ( !$result = $db->sql_query($sql) )
|
if ( !$result = $db->sql_query($sql) )
|
||||||
{
|
{
|
||||||
|
@ -725,7 +740,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
|
||||||
{
|
{
|
||||||
$forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $searchset[$i]['forum_id']);
|
$forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $searchset[$i]['forum_id']);
|
||||||
$topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $searchset[$i]['topic_id'] . "&highlight=$highlight_active");
|
$topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $searchset[$i]['topic_id'] . "&highlight=$highlight_active");
|
||||||
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active#" . $searchset[$i]['post_id']);
|
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active") . '#' . $searchset[$i]['post_id'];
|
||||||
|
|
||||||
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
|
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']);
|
||||||
|
|
||||||
|
@ -1298,4 +1313,4 @@ $template->pparse('body');
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -117,15 +117,15 @@
|
||||||
<td class="row2"><input type="radio" name="privmsg_disable" value="0" {S_PRIVMSG_ENABLED} />{L_ENABLED} <input type="radio" name="privmsg_disable" value="1" {S_PRIVMSG_DISABLED} />{L_DISABLED}</td>
|
<td class="row2"><input type="radio" name="privmsg_disable" value="0" {S_PRIVMSG_ENABLED} />{L_ENABLED} <input type="radio" name="privmsg_disable" value="1" {S_PRIVMSG_DISABLED} />{L_DISABLED}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1">{L_INBOX_LIMIT}</span></td>
|
<td class="row1">{L_INBOX_LIMIT}</td>
|
||||||
<td class="row2"><input type="text" maxlength="4" size="4" name="max_inbox_privmsgs" value="{INBOX_LIMIT}" /></td>
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_inbox_privmsgs" value="{INBOX_LIMIT}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1">{L_SENTBOX_LIMIT}</span></td>
|
<td class="row1">{L_SENTBOX_LIMIT}</td>
|
||||||
<td class="row2"><input type="text" maxlength="4" size="4" name="max_sentbox_privmsgs" value="{SENTBOX_LIMIT}" /></td>
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_sentbox_privmsgs" value="{SENTBOX_LIMIT}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1">{L_SAVEBOX_LIMIT}</span></td>
|
<td class="row1">{L_SAVEBOX_LIMIT}</td>
|
||||||
<td class="row2"><input type="text" maxlength="4" size="4" name="max_savebox_privmsgs" value="{SAVEBOX_LIMIT}" /></td>
|
<td class="row2"><input type="text" maxlength="4" size="4" name="max_savebox_privmsgs" value="{SAVEBOX_LIMIT}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
<td class="{ranks.ROW_CLASS}" align="center">{ranks.RANK}</td>
|
<td class="{ranks.ROW_CLASS}" align="center">{ranks.RANK}</td>
|
||||||
<td class="{ranks.ROW_CLASS}" align="center">{ranks.RANK_MIN}</td>
|
<td class="{ranks.ROW_CLASS}" align="center">{ranks.RANK_MIN}</td>
|
||||||
<td class="{ranks.ROW_CLASS}" align="center">{ranks.SPECIAL_RANK}</td>
|
<td class="{ranks.ROW_CLASS}" align="center">{ranks.SPECIAL_RANK}</td>
|
||||||
<td class="{ranks.ROW_CLASS}" align="center"><a href="{ranks.U_RANK_EDIT}">{L_EDIT}</td>
|
<td class="{ranks.ROW_CLASS}" align="center"><a href="{ranks.U_RANK_EDIT}">{L_EDIT}</a></td>
|
||||||
<td class="{ranks.ROW_CLASS}" align="center"><a href="{ranks.U_RANK_DELETE}">{L_DELETE}</td>
|
<td class="{ranks.ROW_CLASS}" align="center"><a href="{ranks.U_RANK_DELETE}">{L_DELETE}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END ranks -->
|
<!-- END ranks -->
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
|
|
||||||
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
|
<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="bottom"><span class="gensmall">
|
<td width="100%" align="left" valign="bottom"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<!-- BEGIN switch_user_logged_in -->
|
<tr>
|
||||||
{LAST_VISIT_DATE}<br />
|
<td align="left" valign="bottom"><p><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span></p><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
|
||||||
<!-- END switch_user_logged_in -->
|
<td align="right" class="gensmall" valign="bottom">
|
||||||
{CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
|
<!-- BEGIN switch_user_logged_in -->
|
||||||
<td align="right" valign="bottom" class="gensmall">
|
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
|
||||||
<!-- BEGIN switch_user_logged_in -->
|
<!-- END switch_user_logged_in -->
|
||||||
<a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
|
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
|
||||||
<!-- END switch_user_logged_in -->
|
<br />
|
||||||
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
|
<!-- BEGIN switch_user_logged_in -->
|
||||||
|
{LAST_VISIT_DATE}<br />
|
||||||
|
<!-- END switch_user_logged_in -->
|
||||||
|
{CURRENT_TIME}</td>
|
||||||
|
</tr>
|
||||||
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -27,10 +33,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN forumrow -->
|
<!-- BEGIN forumrow -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
|
<td class="row1" width="50" height="50" align="center" valign="middle"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
|
||||||
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
|
<td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br /></span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br /></span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
|
||||||
</span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
|
|
||||||
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
|
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
|
||||||
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
|
<td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
|
||||||
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
|
<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
|
||||||
|
@ -46,17 +50,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
|
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
|
<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
|
<td class="row1" width="46" rowspan="2" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
|
||||||
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
|
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} [ {L_WHOSONLINE_ADMIN} ] [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
|
<td class="row1" align="left"><span class="gensmall"><b>{L_LEGEND}</b> :: {L_WHOSONLINE_ADMIN} - {L_WHOSONLINE_MOD} - {L_WHOSONLINE_USER}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ function storeCaret(textEl) {
|
||||||
<!-- END smilies_row -->
|
<!-- END smilies_row -->
|
||||||
<!-- BEGIN switch_smilies_extra -->
|
<!-- BEGIN switch_smilies_extra -->
|
||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></td>
|
<td colspan="{S_SMILIES_COLSPAN}"><span class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- END switch_smilies_extra -->
|
<!-- END switch_smilies_extra -->
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1"><iframe width="100%" height="300" src="{U_REVIEW_TOPIC}" >
|
<td class="row1"><iframe width="100%" height="300" src="{U_REVIEW_TOPIC}" >
|
||||||
<!-- END switch_inline_mode -->
|
<!-- END switch_inline_mode -->
|
||||||
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline" style="border: 0px #006699 solid ">
|
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="thCornerL" width="22%" height="26">{L_AUTHOR}</th>
|
<th class="thCornerL" width="22%" height="26">{L_AUTHOR}</th>
|
||||||
<th class="thCornerR">{L_MESSAGE}</th>
|
<th class="thCornerR">{L_MESSAGE}</th>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><br /><span class="gensmall"><b>{L_MODERATOR}: {MODERATORS}<br /><br />{LOGGED_IN_USER_LIST}</b></span></td>
|
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><br /><span class="gensmall"><b>{L_MODERATOR}: {MODERATORS}<br /><br />{LOGGED_IN_USER_LIST}</b></span></td>
|
||||||
<td align="right" valign="bottom" nowrap><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="middle" width="50"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a></td>
|
<td align="left" valign="middle" width="50"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" /></a></td>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
|
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
|
||||||
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
|
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
|
||||||
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
|
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
|
||||||
<th align="center" nowrap="nowrap" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
|
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- BEGIN topicrow -->
|
<!-- BEGIN topicrow -->
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -20,20 +20,43 @@ if ( !($result = $db->sql_query($sql)) )
|
||||||
|
|
||||||
if ( $row = $db->sql_fetchrow($result) )
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
if ( $row['config_value'] != '.1.0 [20020402]' )
|
$sql = array();
|
||||||
|
switch ( $row['config_value'] )
|
||||||
{
|
{
|
||||||
$sql = "UPDATE " . CONFIG_TABLE . "
|
case '.1.0 [20020402]':
|
||||||
SET config_value = '.1.0 [20020402]'
|
echo 'Updating from [20020402] :: ';
|
||||||
WHERE config_name = 'version'";
|
flush();
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
|
||||||
{
|
|
||||||
die("Couldn't update version info");
|
|
||||||
}
|
|
||||||
|
|
||||||
die("UPDATING COMPLETE");
|
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
|
||||||
|
VALUES ('session_gc', '3600')";
|
||||||
|
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
|
||||||
|
VALUES ('session_last_gc', '0')";
|
||||||
|
|
||||||
|
echo '<span style="color:green">DONE</span><br /><br />';
|
||||||
|
break;
|
||||||
|
default;
|
||||||
|
echo 'No updates made<br /><br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( count($sql) )
|
||||||
|
{
|
||||||
|
for($i = 0; $i < count($sql); $i++)
|
||||||
|
{
|
||||||
|
if ( !($result = $db->sql_query($sql[$i])) )
|
||||||
|
{
|
||||||
|
die("Couldn't run update >> " . $sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql = "UPDATE " . CONFIG_TABLE . "
|
||||||
|
SET config_value = '.1.0 [20020420]'
|
||||||
|
WHERE config_name = 'version'";
|
||||||
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
|
{
|
||||||
|
die("Couldn't update version info");
|
||||||
|
}
|
||||||
|
|
||||||
echo "\n<br />\n<b>COMPLETE!</b><br />\n";
|
echo "\n<br />\n<b>COMPLETE!</b><br />\n";
|
||||||
echo "\n<p>Don't forget to delete this file!</p>\n";
|
echo "\n<p>Don't forget to delete this file!</p>\n";
|
||||||
|
|
|
@ -161,7 +161,7 @@ function query($sql, $errormsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function smiley_replace($text = "")
|
function smiley_replace($text = '')
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ function smiley_replace($text = "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( $text != "" ) ? preg_replace($search, $replace, $text) : "";
|
return ( $text != '' ) ? preg_replace($search, $replace, $text) : '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,22 +201,22 @@ function get_schema()
|
||||||
{
|
{
|
||||||
$line = $schemafile[$i];
|
$line = $schemafile[$i];
|
||||||
|
|
||||||
if ( preg_match("/^CREATE TABLE (\w+)/i", $line, $matches) )
|
if ( preg_match('/^CREATE TABLE (\w+)/i', $line, $matches) )
|
||||||
{
|
{
|
||||||
// Start of a new table definition, set some variables and go to the next line.
|
// Start of a new table definition, set some variables and go to the next line.
|
||||||
$tabledata = 1;
|
$tabledata = 1;
|
||||||
// Replace the 'phpbb_' prefix by the user defined prefix.
|
// Replace the 'phpbb_' prefix by the user defined prefix.
|
||||||
$table = str_replace("phpbb_", $table_prefix, $matches[1]);
|
$table = str_replace('phpbb_', $table_prefix, $matches[1]);
|
||||||
$table_def[$table] = "CREATE TABLE $table (\n";
|
$table_def[$table] = "CREATE TABLE $table (\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( preg_match("/^\);/", $line) )
|
if ( preg_match('/^\);/', $line) )
|
||||||
{
|
{
|
||||||
// End of the table definition
|
// End of the table definition
|
||||||
// After this we will skip everything until the next 'CREATE' line
|
// After this we will skip everything until the next 'CREATE' line
|
||||||
$tabledata = 0;
|
$tabledata = 0;
|
||||||
$table_def[$table] .= ")"; // We don't need the closing semicolon
|
$table_def[$table] .= ')'; // We don't need the closing semicolon
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $tabledata == 1 )
|
if ( $tabledata == 1 )
|
||||||
|
@ -224,18 +224,18 @@ function get_schema()
|
||||||
// We are inside a table definition, parse this line.
|
// We are inside a table definition, parse this line.
|
||||||
// Add the current line to the complete table definition:
|
// Add the current line to the complete table definition:
|
||||||
$table_def[$table] .= $line;
|
$table_def[$table] .= $line;
|
||||||
if ( preg_match("/^\s*(\w+)\s+(\w+)\((\d+)\)(.*)$/", $line, $matches) )
|
if ( preg_match('/^\s*(\w+)\s+(\w+)\(([\d,]+)\)(.*)$/', $line, $matches) )
|
||||||
{
|
{
|
||||||
// This is a column definition
|
// This is a column definition
|
||||||
$field = $matches[1];
|
$field = $matches[1];
|
||||||
$type = $matches[2];
|
$type = $matches[2];
|
||||||
$size = $matches[3];
|
$size = $matches[3];
|
||||||
|
|
||||||
preg_match("/DEFAULT (NULL|\'.*?\')[,\s](.*)$/i", $matches[4], $match);
|
preg_match('/DEFAULT (NULL|\'.*?\')[,\s](.*)$/i', $matches[4], $match);
|
||||||
$default = $match[1];
|
$default = $match[1];
|
||||||
|
|
||||||
$notnull = ( preg_match("/NOT NULL/i", $matches[4]) ) ? 1 : 0;
|
$notnull = ( preg_match('/NOT NULL/i', $matches[4]) ) ? 1 : 0;
|
||||||
$auto_increment = ( preg_match("/auto_increment/i", $matches[4]) ) ? 1 : 0;
|
$auto_increment = ( preg_match('/auto_increment/i', $matches[4]) ) ? 1 : 0;
|
||||||
|
|
||||||
$field_def[$table][$field] = array(
|
$field_def[$table][$field] = array(
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
|
@ -246,17 +246,17 @@ function get_schema()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( preg_match("/\s*PRIMARY\s+KEY\s*\((.*)\).*/", $line, $matches) )
|
if ( preg_match('/\s*PRIMARY\s+KEY\s*\((.*)\).*/', $line, $matches) )
|
||||||
{
|
{
|
||||||
// Primary key
|
// Primary key
|
||||||
$key_def[$table]['PRIMARY'] = $matches[1];
|
$key_def[$table]['PRIMARY'] = $matches[1];
|
||||||
}
|
}
|
||||||
else if ( preg_match("/\s*KEY\s+(\w+)\s*\((.*)\)/", $line, $matches) )
|
else if ( preg_match('/\s*KEY\s+(\w+)\s*\((.*)\)/', $line, $matches) )
|
||||||
{
|
{
|
||||||
// Normal key
|
// Normal key
|
||||||
$key_def[$table][$matches[1]] = $matches[2];
|
$key_def[$table][$matches[1]] = $matches[2];
|
||||||
}
|
}
|
||||||
else if ( preg_match("/^\s*(\w+)\s*(.*?),?\s*$/", $line, $matches) )
|
else if ( preg_match('/^\s*(\w+)\s*(.*?),?\s*$/', $line, $matches) )
|
||||||
{
|
{
|
||||||
// Column definition
|
// Column definition
|
||||||
$create_def[$table][$matches[1]] = $matches[2];
|
$create_def[$table][$matches[1]] = $matches[2];
|
||||||
|
@ -280,11 +280,11 @@ function get_inserts()
|
||||||
{
|
{
|
||||||
global $table_prefix;
|
global $table_prefix;
|
||||||
|
|
||||||
$insertfile = file("db/schemas/mysql_basic.sql");
|
$insertfile = file('db/schemas/mysql_basic.sql');
|
||||||
|
|
||||||
for($i = 0; $i < count($insertfile); $i++)
|
for($i = 0; $i < count($insertfile); $i++)
|
||||||
{
|
{
|
||||||
if ( preg_match("/(INSERT INTO (\w+)\s.*);/i", str_replace("phpbb_", $table_prefix, $insertfile[$i]), $matches) )
|
if ( preg_match('/(INSERT INTO (\w+)\s.*);/i', str_replace('phpbb_', $table_prefix, $insertfile[$i]), $matches) )
|
||||||
{
|
{
|
||||||
$returnvalue[$matches[2]][] = $matches[1];
|
$returnvalue[$matches[2]][] = $matches[1];
|
||||||
}
|
}
|
||||||
|
@ -323,16 +323,16 @@ function output_table_content($content)
|
||||||
function bbdecode($message)
|
function bbdecode($message)
|
||||||
{
|
{
|
||||||
// Undo [code]
|
// Undo [code]
|
||||||
$code_start_html = "<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Code:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><PRE>";
|
$code_start_html = '<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Code:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><PRE>';
|
||||||
$code_end_html = "</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->";
|
$code_end_html = '</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode End -->';
|
||||||
$message = str_replace($code_start_html, "[code]", $message);
|
$message = str_replace($code_start_html, '[code]', $message);
|
||||||
$message = str_replace($code_end_html, "[/code]", $message);
|
$message = str_replace($code_end_html, '[/code]', $message);
|
||||||
|
|
||||||
// Undo [quote]
|
// Undo [quote]
|
||||||
$quote_start_html = "<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Quote:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><BLOCKQUOTE>";
|
$quote_start_html = '<!-- BBCode Quote Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font size=-1>Quote:</font><HR></TD></TR><TR><TD><FONT SIZE=-1><BLOCKQUOTE>';
|
||||||
$quote_end_html = "</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->";
|
$quote_end_html = '</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE><!-- BBCode Quote End -->';
|
||||||
$message = str_replace($quote_start_html, "[quote]", $message);
|
$message = str_replace($quote_start_html, '[quote]', $message);
|
||||||
$message = str_replace($quote_end_html, "[/quote]", $message);
|
$message = str_replace($quote_end_html, '[/quote]', $message);
|
||||||
|
|
||||||
// Undo [b] and [i]
|
// Undo [b] and [i]
|
||||||
$message = preg_replace("#<!-- BBCode Start --><B>(.*?)</B><!-- BBCode End -->#s", "[b]\\1[/b]", $message);
|
$message = preg_replace("#<!-- BBCode Start --><B>(.*?)</B><!-- BBCode End -->#s", "[b]\\1[/b]", $message);
|
||||||
|
@ -353,17 +353,17 @@ function bbdecode($message)
|
||||||
// Undo lists (unordered/ordered)
|
// Undo lists (unordered/ordered)
|
||||||
|
|
||||||
// <li> tags:
|
// <li> tags:
|
||||||
$message = str_replace("<!-- BBCode --><LI>", "[*]", $message);
|
$message = str_replace('<!-- BBCode --><LI>', '[*]', $message);
|
||||||
|
|
||||||
// [list] tags:
|
// [list] tags:
|
||||||
$message = str_replace("<!-- BBCode ulist Start --><UL>", "[list]", $message);
|
$message = str_replace('<!-- BBCode ulist Start --><UL>', '[list]', $message);
|
||||||
|
|
||||||
// [list=x] tags:
|
// [list=x] tags:
|
||||||
$message = preg_replace("#<!-- BBCode olist Start --><OL TYPE=([A1])>#si", "[list=\\1]", $message);
|
$message = preg_replace('#<!-- BBCode olist Start --><OL TYPE=([A1])>#si', "[list=\\1]", $message);
|
||||||
|
|
||||||
// [/list] tags:
|
// [/list] tags:
|
||||||
$message = str_replace("</UL><!-- BBCode ulist End -->", "[/list]", $message);
|
$message = str_replace('</UL><!-- BBCode ulist End -->', '[/list]', $message);
|
||||||
$message = str_replace("</OL><!-- BBCode olist End -->", "[/list]", $message);
|
$message = str_replace('</OL><!-- BBCode olist End -->', '[/list]', $message);
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
@ -1075,7 +1075,7 @@ if ( !empty($next) )
|
||||||
// undo 1.2.x encoding..
|
// undo 1.2.x encoding..
|
||||||
$row['post_text'] = bbdecode(stripslashes($row['post_text']));
|
$row['post_text'] = bbdecode(stripslashes($row['post_text']));
|
||||||
$row['post_text'] = undo_make_clickable($row['post_text']);
|
$row['post_text'] = undo_make_clickable($row['post_text']);
|
||||||
$row['post_text'] = str_replace("<BR>", "\n", $row['post_text']);
|
$row['post_text'] = str_replace('<BR>', "\n", $row['post_text']);
|
||||||
|
|
||||||
// make a uid
|
// make a uid
|
||||||
$uid = make_bbcode_uid();
|
$uid = make_bbcode_uid();
|
||||||
|
@ -1086,14 +1086,14 @@ if ( !empty($next) )
|
||||||
$row['post_text'] = addslashes($row['post_text']);
|
$row['post_text'] = addslashes($row['post_text']);
|
||||||
|
|
||||||
$edited_sql = "";
|
$edited_sql = "";
|
||||||
if ( preg_match("/^(.*?)([\n]+<font size=\-1>\[ This message was .*?)$/s", $row['post_text'], $matches) )
|
if ( preg_match('/^(.*?)([\n]+<font size=\-1>\[ This message was .*?)$/s', $row['post_text'], $matches) )
|
||||||
{
|
{
|
||||||
$row['post_text'] = $matches[1];
|
$row['post_text'] = $matches[1];
|
||||||
$edit_info = $matches[2];
|
$edit_info = $matches[2];
|
||||||
|
|
||||||
$edit_times = count(explode(" message ", $edit_info)) - 1; // Taken from example for substr_count in annotated PHP manual
|
$edit_times = count(explode(' message ', $edit_info)) - 1; // Taken from example for substr_count in annotated PHP manual
|
||||||
|
|
||||||
if ( preg_match("/^.* by: (.*?) on (....)-(..)-(..) (..):(..) \]<\/font>/s", $edit_info, $matches) )
|
if ( preg_match('/^.* by: (.*?) on (....)-(..)-(..) (..):(..) \]<\/font>/s', $edit_info, $matches) )
|
||||||
{
|
{
|
||||||
$edited_user = $matches[1];
|
$edited_user = $matches[1];
|
||||||
$edited_time = gmmktime($matches[5], $matches[6], 0, $matches[3], $matches[4], $matches[2]);
|
$edited_time = gmmktime($matches[5], $matches[6], 0, $matches[3], $matches[4], $matches[2]);
|
||||||
|
@ -1130,7 +1130,7 @@ if ( !empty($next) )
|
||||||
$inc++;
|
$inc++;
|
||||||
if ( $inc == $per_pct )
|
if ( $inc == $per_pct )
|
||||||
{
|
{
|
||||||
print ".";
|
print '.';
|
||||||
flush();
|
flush();
|
||||||
$inc = 0;
|
$inc = 0;
|
||||||
}
|
}
|
||||||
|
@ -1259,7 +1259,7 @@ if ( !empty($next) )
|
||||||
$inc++;
|
$inc++;
|
||||||
if ( $inc == $per_pct )
|
if ( $inc == $per_pct )
|
||||||
{
|
{
|
||||||
print ".";
|
print '.';
|
||||||
flush();
|
flush();
|
||||||
$inc = 0;
|
$inc = 0;
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1279,7 @@ if ( !empty($next) )
|
||||||
while( $row = $db->sql_fetchrow($result) )
|
while( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
// Check if this moderator and this forum still exist
|
// Check if this moderator and this forum still exist
|
||||||
$sql = "SELECT NULL
|
$sql = "SELECT user_id
|
||||||
FROM " . USERS_TABLE . ", " . FORUMS_TABLE . "
|
FROM " . USERS_TABLE . ", " . FORUMS_TABLE . "
|
||||||
WHERE user_id = " . $row['user_id'] . "
|
WHERE user_id = " . $row['user_id'] . "
|
||||||
AND forum_id = " . $row['forum_id'];
|
AND forum_id = " . $row['forum_id'];
|
||||||
|
@ -1309,6 +1309,35 @@ if ( !empty($next) )
|
||||||
|
|
||||||
print "<span class=\"ok\"><b>OK</b></span><br />\n";
|
print "<span class=\"ok\"><b>OK</b></span><br />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print " * Setting correct user_level for moderators ::";
|
||||||
|
flush();
|
||||||
|
|
||||||
|
$sql = "SELECT DISTINCT u.user_id
|
||||||
|
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
|
||||||
|
WHERE aa.auth_mod = 1
|
||||||
|
AND ug.group_id = aa.group_id
|
||||||
|
AND u.user_id = ug.user_id
|
||||||
|
AND u.user_level <> " . ADMIN;
|
||||||
|
$result = query($sql, "Couldn't obtain list of moderators");
|
||||||
|
|
||||||
|
if ( $row = $db->sql_fetchrow($result) )
|
||||||
|
{
|
||||||
|
$ug_sql = '';
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
$ug_sql .= ( ( $ug_sql != '' ) ? ', ' : '' ) . $row['user_id'];
|
||||||
|
}
|
||||||
|
while ( $row = $db->sql_fetchrow($result) );
|
||||||
|
|
||||||
|
$sql = "UPDATE " . USERS_TABLE . "
|
||||||
|
SET user_level = " . MOD . "
|
||||||
|
WHERE user_id IN ($ug_sql)";
|
||||||
|
query($sql, "Couldn't set moderator status for users");
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<span class=\"ok\"><b>OK</b></span><br />\n";
|
||||||
|
|
||||||
end_step('convert_privforums');
|
end_step('convert_privforums');
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_U
|
||||||
}
|
}
|
||||||
else if ( isset($HTTP_GET_VARS['forum']))
|
else if ( isset($HTTP_GET_VARS['forum']))
|
||||||
{
|
{
|
||||||
$forum_id = $HTTP_GET_VARS['forum'];
|
$forum_id = intval($HTTP_GET_VARS['forum']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,11 +79,10 @@ $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);
|
||||||
//
|
//
|
||||||
// Get user list
|
// Get user list
|
||||||
//
|
//
|
||||||
$sql = "SELECT u.user_id, u.username, u.user_session_time, u.user_session_page, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip
|
$sql = "SELECT u.user_id, u.username, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip
|
||||||
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
||||||
WHERE u.user_id = s.session_user_id
|
WHERE u.user_id = s.session_user_id
|
||||||
AND ( s.session_time >= ".( time() - 300 ) . "
|
AND s.session_time >= ".( time() - 300 ) . "
|
||||||
OR u.user_session_time >= " . ( time() - 300 ) . " )
|
|
||||||
ORDER BY u.username ASC, s.session_ip ASC";
|
ORDER BY u.username ASC, s.session_ip ASC";
|
||||||
if ( !($result = $db->sql_query($sql)) )
|
if ( !($result = $db->sql_query($sql)) )
|
||||||
{
|
{
|
||||||
|
@ -134,9 +133,6 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||||
$registered_users++;
|
$registered_users++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_update = $row['user_session_time'];
|
|
||||||
$user_page = $row['user_session_page'];
|
|
||||||
|
|
||||||
$which_counter = 'reg_counter';
|
$which_counter = 'reg_counter';
|
||||||
$which_row = 'reg_user_row';
|
$which_row = 'reg_user_row';
|
||||||
$prev_user = $user_id;
|
$prev_user = $user_id;
|
||||||
|
@ -146,13 +142,10 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||||
{
|
{
|
||||||
if ( $row['session_ip'] != $prev_ip )
|
if ( $row['session_ip'] != $prev_ip )
|
||||||
{
|
{
|
||||||
|
$username = $lang['Guest'];
|
||||||
$view_online = true;
|
$view_online = true;
|
||||||
$guest_users++;
|
$guest_users++;
|
||||||
|
|
||||||
$username = $lang['Guest'];
|
|
||||||
$last_update = $row['session_time'];
|
|
||||||
$user_page = $row['session_page'];
|
|
||||||
|
|
||||||
$which_counter = 'guest_counter';
|
$which_counter = 'guest_counter';
|
||||||
$which_row = 'guest_user_row';
|
$which_row = 'guest_user_row';
|
||||||
}
|
}
|
||||||
|
@ -162,9 +155,9 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||||
|
|
||||||
if ( $view_online )
|
if ( $view_online )
|
||||||
{
|
{
|
||||||
if ( $user_page < 1 || !$is_auth_ary[$user_page]['auth_view'] )
|
if ( $row['session_page'] < 1 || !$is_auth_ary[$row['session_page']]['auth_view'] )
|
||||||
{
|
{
|
||||||
switch( $user_page )
|
switch( $row['session_page'] )
|
||||||
{
|
{
|
||||||
case PAGE_INDEX:
|
case PAGE_INDEX:
|
||||||
$location = $lang['Forum_index'];
|
$location = $lang['Forum_index'];
|
||||||
|
@ -209,8 +202,8 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $user_page);
|
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
|
||||||
$location = $forum_data[$user_page];
|
$location = $forum_data[$row['session_page']];
|
||||||
}
|
}
|
||||||
|
|
||||||
$row_color = ( $$which_counter % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
|
$row_color = ( $$which_counter % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
|
||||||
|
@ -220,7 +213,7 @@ while ( $row = $db->sql_fetchrow($result) )
|
||||||
'ROW_COLOR' => '#' . $row_color,
|
'ROW_COLOR' => '#' . $row_color,
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
'USERNAME' => $username,
|
'USERNAME' => $username,
|
||||||
'LASTUPDATE' => create_date($board_config['default_dateformat'], $last_update, $board_config['board_timezone']),
|
'LASTUPDATE' => create_date($board_config['default_dateformat'], $row['session_time'], $board_config['board_timezone']),
|
||||||
'FORUM_LOCATION' => $location,
|
'FORUM_LOCATION' => $location,
|
||||||
|
|
||||||
'U_USER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id),
|
'U_USER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id),
|
||||||
|
|
|
@ -990,7 +990,7 @@ for($i = 0; $i < $total_posts; $i++)
|
||||||
{
|
{
|
||||||
$temp_url = append_sid("posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
|
$temp_url = append_sid("posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
|
||||||
$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
|
$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
|
||||||
$delpost_img = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
|
$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue