- no more encoding mixture, say hello to UTF-8 (I'll add a validation solution for PHP 4.3.3/4 ASAP) [side effect: fixes Bug #3762]

- take local server time into consideration for birthday/age calculation
- faster active topic search
- allow changing active topic time frame [Bug #4150]
- reload stylesheet on language change [Bug #4222]


git-svn-id: file:///svn/phpbb/trunk@6380 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Nils Adermann 2006-09-17 22:02:28 +00:00
parent e2ac2f9d7d
commit ea065f3e67
85 changed files with 256 additions and 293 deletions

View file

@ -148,14 +148,14 @@ function adm_page_header($page_title)
'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'])
);
if (!empty($config['send_encoding']))
if ($config['send_encoding'])
{
header('Content-type: text/html; charset: ' . $user->lang['ENCODING']);
header('Content-type: text/html; charset=UTF-8');
}
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');

View file

@ -178,6 +178,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler('msg_handler');

View file

@ -1220,7 +1220,6 @@ function get_schema_struct()
'post_subject' => array('XSTEXT_UNI', ''),
'post_text' => array('MTEXT_UNI', ''),
'post_checksum' => array('VCHAR:32', ''),
'post_encoding' => array('VCHAR:20', 'iso-8859-1'),
'post_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:252', ''),
'bbcode_uid' => array('VCHAR:5', ''),
@ -1259,7 +1258,6 @@ function get_schema_struct()
'message_text' => array('MTEXT_UNI', ''),
'message_edit_reason' => array('STEXT_UNI', ''),
'message_edit_user' => array('UINT', 0),
'message_encoding' => array('VCHAR:20', 'iso-8859-1'),
'message_attachment' => array('BOOL', 0),
'bbcode_bitfield' => array('VCHAR:252', ''),
'bbcode_uid' => array('VCHAR:5', ''),

View file

@ -320,7 +320,7 @@ class acp_search
}
else
{
$sql = 'SELECT post_id, post_subject, post_text, post_encoding, poster_id, forum_id
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
FROM ' . POSTS_TABLE . '
WHERE post_id >= ' . (int) ($post_counter + 1) . '
AND post_id < ' . (int) ($post_counter + $this->batch_size);
@ -328,7 +328,7 @@ class acp_search
while ($row = $db->sql_fetchrow($result))
{
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['post_encoding'], $row['poster_id'], $row['forum_id']);
$this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']);
}
$db->sql_freeresult($result);

View file

@ -355,7 +355,7 @@ class dbal_firebird extends dbal
*/
function sql_escape($msg)
{
return (@ini_get('magic_quotes_sybase') || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg));
return (@ini_get('magic_quotes_sybase') == 1 || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg));
}
/**

View file

@ -24,15 +24,27 @@ function set_var(&$result, $var, $type, $multibyte = false)
if ($type == 'string')
{
$result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result)));
$result = (STRIP) ? stripslashes($result) : $result;
$result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result), ENT_QUOTES, 'UTF-8'));
// Check for possible multibyte characters to save a preg_replace call if nothing is in there...
if ($multibyte && strpos($result, '&amp;#') !== false)
if (!empty($result))
{
$result = preg_replace('#&amp;(\#[0-9]+;)#', '&\1', $result);
// Make sure multibyte characters are wellformed
if ($multibyte)
{
if (!preg_match('/^./u', $result))
{
$result = '';
}
}
else
{
// no multibyte, allow only ASCII (0-127)
$result = preg_replace('/[\x80-\xFF]/', '?', $result);
}
}
$result = (STRIP) ? stripslashes($result) : $result;
}
}
/**
@ -2039,7 +2051,7 @@ function get_context($text, $words, $length = 400)
// find the starting indizes of all words
foreach ($words as $word)
{
if (preg_match('#(?: |^)(' . str_replace('\*', '\w*?', preg_quote($word, '#')) . ')(?: |$)#i', $text, $match))
if (preg_match('#(?:[^\w]|^)(' . str_replace('\*', '\w*?', preg_quote($word, '#')) . ')(?:[^\w]|$)#i', $text, $match))
{
$pos = strpos($text, $match[1]);
if ($pos !== false)
@ -2363,6 +2375,12 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_
{
global $config, $user;
if (!function_exists('display_attachments'))
{
global $phpbb_root_path, $phpEx;
include_once("{$phpbb_root_path}includes/functions_display.$phpEx");
}
$attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true);
$tpl_size = sizeof($attachments);
@ -3143,7 +3161,7 @@ function page_header($page_title = '', $display_online_list = true)
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
'S_USERNAME' => $user->data['username'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''),
@ -3164,7 +3182,7 @@ function page_header($page_title = '', $display_online_list = true)
'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&amp;id=" . $user->theme['style_id'],
'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&amp;id=" . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'],
'T_STYLESHEET_NAME' => $user->theme['theme_name'],
'T_THEME_DATA' => (!$user->theme['theme_storedb']) ? '' : $user->theme['theme_data'],
@ -3173,7 +3191,7 @@ function page_header($page_title = '', $display_online_list = true)
if ($config['send_encoding'])
{
header('Content-type: text/html; charset=' . $user->lang['ENCODING']);
header('Content-type: text/html; charset=UTF-8');
}
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');

View file

@ -25,7 +25,6 @@
*/
class jabber
{
var $encoding;
var $server;
var $port;
var $username;
@ -68,8 +67,6 @@ class jabber
$this->packet_queue = $this->subscription_queue = array();
$this->iq_sleep_timer = $this->delay_disconnect = 1;
$this->encoding = 'UTF-8';
$this->returned_keep_alive = true;
$this->txnid = 0;
@ -454,7 +451,6 @@ class jabber
}
$this->_array_xmlspecialchars($content);
$this->_array_conv_utf8($content);
$xml = "<message to='$to' type='$type' id='$id'>\n";
@ -795,69 +791,6 @@ class jabber
$string = str_replace(array('&', '>', '<', '"', '\''), array('&amp;', '&gt;', '&lt;', '&quot;', '&apos;'), $string);
}
/**
* Recursively converts all elements in an array to UTF-8 from the encoding stored in {@link encoding the encoding attribute}.
* @access private
*/
function _array_conv_utf8(&$array)
{
// no need to do anything if the encoding already is UTF-8
if (strtoupper($this->encoding) == 'UTF-8')
{
return true;
}
if (is_array($array))
{
foreach ($array as $k => $v)
{
if (is_array($v))
{
$this->_array_conv_utf8($array[$k]);
}
else
{
$this->_conv_utf8($array[$k]);
}
}
}
}
/**
* Converts a string to utf8 encoding.
*
* @param string $string has to have the same encoding as {@link encoding the encoding attribute} is set to.
*
* @return boolean True on success, false on failure.
*
* @access private
*/
function _conv_utf8(&$string)
{
// no need to do anything if the encoding already is UTF-8
if (strtoupper($this->encoding) == 'UTF-8')
{
return true;
}
// first try iconv then mb_convert_encoding and as a last fall back try recode_string
if (function_exists('iconv') && (($string = iconv($this->encoding, 'UTF-8', $string)) !== false))
{
return true;
}
elseif (function_exists('mb_convert_encoding') && (($string = mb_convert_encoding($string, 'UTF-8', $this->encoding)) !== false))
{
return true;
}
elseif (function_exists('recode_string') && (($string = recode_string($this->encoding . '..UTF-8', $string)) !== false))
{
return true;
}
// if everything fails we will just have to live with what we have, good luck!
return false;
}
// ======================================================================
// <message/> parsers
// ======================================================================

View file

@ -14,7 +14,7 @@
*/
class messenger
{
var $vars, $msg, $extra_headers, $replyto, $from, $subject, $encoding;
var $vars, $msg, $extra_headers, $replyto, $from, $subject;
var $addresses = array();
var $mail_priority = MAIL_NORMAL_PRIORITY;
@ -45,7 +45,7 @@ class messenger
function reset()
{
$this->addresses = array();
$this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = $this->encoding = '';
$this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = '';
$this->mail_priority = MAIL_NORMAL_PRIORITY;
}
@ -221,16 +221,6 @@ class messenger
$this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_SUBJECT']);
}
if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match))
{
$this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($user->lang['ENCODING']);
$drop_header .= '[\r\n]*?' . preg_quote($match[1], '#');
}
else
{
$this->encoding = trim($user->lang['ENCODING']);
}
if ($drop_header)
{
$this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg));
@ -324,7 +314,7 @@ class messenger
foreach ($address_ary as $which_ary)
{
$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name'], $this->encoding) . '" <' . $which_ary['email'] . '>' : $which_ary['email']);
$$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name']) . '" <' . $which_ary['email'] . '>' : $which_ary['email']);
}
}
@ -348,7 +338,7 @@ class messenger
$headers .= "MIME-Version: 1.0\n";
$headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n";
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n";
$headers .= "Content-type: text/plain; charset={$this->encoding}\n";
$headers .= "Content-type: text/plain; charset=UTF-8\n";
$headers .= "Content-transfer-encoding: 8bit\n";
$headers .= "X-Priority: {$this->mail_priority}\n";
$headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n";
@ -357,7 +347,7 @@ class messenger
$headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n";
$headers .= ($this->extra_headers != '') ? $this->extra_headers : '';
// Send message ... removed $this->encode() from subject for time being
// Send message ...
if (!$use_queue)
{
$mail_to = ($to == '') ? 'Undisclosed-Recipient:;' : $to;
@ -365,7 +355,7 @@ class messenger
if ($config['smtp_delivery'])
{
$result = smtpmail($this->addresses, $this->subject, wordwrap($this->msg), $err_msg, $this->encoding, $headers);
$result = smtpmail($this->addresses, $this->subject, wordwrap($this->msg), $err_msg, $headers);
}
else
{
@ -387,7 +377,6 @@ class messenger
'addresses' => $this->addresses,
'subject' => $this->subject,
'msg' => $this->msg,
'encoding' => $this->encoding,
'headers' => $headers)
);
}
@ -435,7 +424,6 @@ class messenger
$this->jabber->username = $config['jab_username'];
$this->jabber->password = $config['jab_password'];
$this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : '';
$this->jabber->encoding = $this->encoding;
if (!$this->jabber->connect())
{
@ -607,7 +595,7 @@ class queue
$err_msg = '';
$to = (!$to) ? 'Undisclosed-Recipient:;' : $to;
$result = ($config['smtp_delivery']) ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $encoding, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers);
$result = ($config['smtp_delivery']) ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers);
if (!$result)
{
@ -739,7 +727,7 @@ class queue
/**
* Replacement or substitute for PHP's mail command
*/
function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers = '')
function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')
{
global $config, $user;
@ -794,7 +782,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers
{
foreach ($addresses['to'] as $which_ary)
{
$mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
$mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
$mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>';
}
}
@ -811,7 +799,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers
{
foreach ($addresses['cc'] as $which_ary)
{
$mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
$mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
$mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>';
}
}
@ -1363,12 +1351,12 @@ class smtp_class
}
/**
* Encodes the given string for proper display for this encoding ... nabbed
* Encodes the given string for proper display in UTF-8 ... nabbed
* from php.net and modified. There is an alternative encoding method which
* may produce less output but it's questionable as to its worth in this
* scenario IMO
* scenario.
*/
function mail_encode($str, $encoding)
function mail_encode($str)
{
if ($encoding == '')
{
@ -1377,7 +1365,7 @@ function mail_encode($str, $encoding)
// define start delimimter, end delimiter and spacer
$end = "?=";
$start = "=?$encoding?B?";
$start = "=?UTF-8?B?";
$spacer = "$end\r\n $start";
// determine length of encoded text within chunks and ensure length is even

View file

@ -1414,7 +1414,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'post_subject' => $subject,
'post_text' => $data['message'],
'post_checksum' => $data['message_md5'],
'post_encoding' => $user->lang['ENCODING'],
'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0,
'bbcode_bitfield' => $data['bbcode_bitfield'],
'bbcode_uid' => $data['bbcode_uid'],
@ -1468,7 +1467,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'post_edit_reason' => $data['post_edit_reason'],
'post_edit_user' => (int) $data['post_edit_user'],
'post_checksum' => $data['message_md5'],
'post_encoding' => $user->lang['ENCODING'],
'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0,
'bbcode_bitfield' => $data['bbcode_bitfield'],
'bbcode_uid' => $data['bbcode_uid'],
@ -1911,7 +1909,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
trigger_error($error);
}
$search->index($mode, $data['post_id'], $data['message'], $subject, $user->lang['ENCODING'], $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
$search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
}
$db->sql_transaction('commit');

View file

@ -1323,7 +1323,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
'enable_sig' => $data['enable_sig'],
'message_subject' => $subject,
'message_text' => $data['message'],
'message_encoding' => $user->lang['ENCODING'],
'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0,
'bbcode_bitfield' => $data['bbcode_bitfield'],
'bbcode_uid' => $data['bbcode_uid'],
@ -1342,7 +1341,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
'enable_sig' => $data['enable_sig'],
'message_subject' => $subject,
'message_text' => $data['message'],
'message_encoding' => $user->lang['ENCODING'],
'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0,
'bbcode_bitfield' => $data['bbcode_bitfield'],
'bbcode_uid' => $data['bbcode_uid']

View file

@ -893,7 +893,6 @@ function mcp_fork_topic($topic_ids)
'post_edit_reason' => (string) $row['post_edit_reason'],
'post_edit_user' => (int) $row['post_edit_user'],
'post_checksum' => (string) $row['post_checksum'],
'post_encoding' => (string) $row['post_encoding'],
'post_attachment' => (int) $row['post_attachment'],
'bbcode_bitfield' => $row['bbcode_bitfield'],
'bbcode_uid' => (string) $row['bbcode_uid'],

View file

@ -561,7 +561,7 @@ class fulltext_mysql extends search_backend
*
* @param string $mode contains the post mode: edit, post, reply, quote ...
*/
function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id)
function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
{
global $db;

View file

@ -56,10 +56,6 @@ class fulltext_native extends search_backend
{
include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
}
if (!function_exists('utf8_strlen'))
{
include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
}
$error = false;
@ -86,47 +82,89 @@ class fulltext_native extends search_backend
{
global $db, $config, $user;
// Clean up the query search
$keywords = trim($this->cleanup($keywords, '+-|()*'));
// allow word|word|word without brackets
if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false))
{
$keywords = '(' . $keywords . ')';
}
$open_bracket = $space = false;
for ($i = 0, $n = strlen($keywords); $i < $n; $i++)
{
if ($open_bracket !== false)
{
switch ($keywords[$i])
{
case ')':
if ($open_bracket + 1 == $i)
{
$keywords[$i - 1] = '|';
$keywords[$i] = '|';
}
$open_bracket = false;
break;
case '(':
$keywords[$i] = '|';
break;
case '+':
case '-':
case ' ':
$keywords[$i] = '|';
break;
}
}
else
{
switch ($keywords[$i])
{
case ')':
$keywords[$i] = ' ';
break;
case '(':
$open_bracket = $i;
break;
case '|':
$keywords[$i] = ' ';
break;
case '-':
case '+':
$space = $keywords[$i];
break;
case ' ':
if ($space !== false)
{
$keywords[$i] = $space;
}
break;
default:
$space = false;
}
}
}
if ($open_bracket)
{
$keywords .= ')';
}
$match = array(
// Replace multiple spaces with a single space
'# +#',
// Strip spaces after: +-|(
'#([+\\-|(]) #',
// Strip spaces before: |*)
'# ([|*)])#',
// Make word|word|word work without brackets
'#^[^()]*\\|[^()]*$#',
// Remove nested brackets
'#(\\([^()]*)(?=\\()#',
'#\\)([^()]*)(?=\\))#',
'#\|\|+#',
'#(\+|\-)(?:\+|\-)+#',
'#\(\|#',
'#\|\)#',
);
$replace = array(
' ',
'|',
'$1',
'$1',
'($0)',
'$1)',
'$1',
'(',
')',
);
$keywords = trim(preg_replace($match, $replace, $this->cleanup($keywords, '+-|()*', $user->lang['ENCODING'])));
// remove some useless bracket combinations which might be created by the previous regexps
$keywords = str_replace(array('()', ')|('), array('', '|'), $keywords);
$keywords = preg_replace_callback(
'#\((?:(?:[^)]*?) )*?[^)]*?\)#',
create_function(
'$matches',
'return str_replace(" ", "|", $matches[0]);'
),
$keywords
);
$keywords = preg_replace($match, $replace, $keywords);
// $keywords input format: each word seperated by a space, words in a bracket are not seperated
@ -143,7 +181,7 @@ class fulltext_native extends search_backend
}
// set the search_query which is shown to the user
$this->search_query = utf8_encode_ncr($keywords, ENT_QUOTES);
$this->search_query = $keywords;
$exact_words = array();
preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#', $keywords, $exact_words);
@ -224,6 +262,11 @@ class fulltext_native extends search_backend
$mode = 'must_contain';
}
if (empty($word))
{
continue;
}
// if this is an array of words then retrieve an id for each
if (is_array($word))
{
@ -255,7 +298,7 @@ class fulltext_native extends search_backend
// throw an error if we shall not ignore unexistant words
else if (!$ignore_no_id)
{
trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], utf8_encode_ncr(implode(', ', $word))));
trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $word)));
}
}
// else we only need one id
@ -273,7 +316,7 @@ class fulltext_native extends search_backend
// throw an error if we shall not ignore unexistant words
else if (!$ignore_no_id)
{
trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], utf8_encode_ncr($word)));
trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word));
}
}
@ -558,9 +601,16 @@ class fulltext_native extends search_backend
case 'mysql':
case 'mysql4':
case 'mysqli':
// 3.x does not support SQL_CALC_FOUND_ROWS
if (SQL_LAYER != 'mysql' || $db->sql_server_info[6] != '3')
{
$sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
$is_mysql = true;
// that's everything for MySQL >= 4.0
break;
}
// no break for MySQL 3.x
case 'sqlite':
$sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id';
@ -871,7 +921,7 @@ class fulltext_native extends search_backend
*
* NOTE: duplicates are NOT removed from the return array
*
* @param string $text Text to split, encoded in user's encoding
* @param string $text Text to split, encoded in UTF-8
* @return array Array of UTF-8 words
*
* @access private
@ -899,7 +949,7 @@ class fulltext_native extends search_backend
/**
* Clean up the string, remove HTML tags, remove BBCodes
*/
$word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1, $user->lang['ENCODING']), ' ');
$word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' ');
while (isset($word[0]))
{
@ -952,13 +1002,12 @@ class fulltext_native extends search_backend
* @param int $post_id The id of the post which is modified/created
* @param string $message New or updated post content
* @param string $subject New or updated post subject
* @param string $encoding The post content's encoding
* @param int $poster_id Post author's user id
* @param int $forum_id The id of the forum in which the post is located
*
* @access public
*/
function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id)
function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
{
global $config, $db, $user;
@ -1103,22 +1152,6 @@ class fulltext_native extends search_backend
unset($cur_words);
}
/**
* Used by index() to sort strings by string length, longest first
*/
function strlencmp($a, $b)
{
$len_a = strlen($a);
$len_b = strlen($b);
if ($len_a == $len_b)
{
return 0;
}
return ($len_a > $len_b) ? -1 : 1;
}
/**
* Removes entries from the wordmatch table for the specified post_ids
*/
@ -1278,7 +1311,7 @@ class fulltext_native extends search_backend
* @param string $encoding Text encoding
* @return string Cleaned up text, only alphanumeric chars are left
*/
function cleanup($text, $allowed_chars = null, $encoding = 'iso-8859-1')
function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
{
global $phpbb_root_path, $phpEx;
static $conv = array(), $conv_loaded = array();
@ -1537,7 +1570,7 @@ class fulltext_native extends search_backend
// These are fields required in the config table
return array(
'tpl' => $tpl,
'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:252', 'fulltext_native_max_chars' => 'integer:0:252')
'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:252', 'fulltext_native_max_chars' => 'integer:0:255')
);
}
}

View file

@ -61,7 +61,7 @@ class ucp_prefs
$var_ary = array(
'dateformat' => array('string', false, 3, 30),
'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'),
'lang' => array('match', false, '#^[a-z0-9_\-]{2,}$#i'),
'tz' => array('num', false, -14, 14),
);

View file

@ -741,7 +741,7 @@ function utf8_recode($string, $encoding)
*/
function utf8_encode_ncr($text)
{
return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]+#', 'utf8_encode_ncr_callback', $text);
return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]?[\\x80-\\xBF]?[\\x80-\\xBF]+#', 'utf8_encode_ncr_callback', $text);
}
/**

View file

@ -54,7 +54,7 @@ $db->sql_freeresult($result);
$birthday_list = '';
if ($config['load_birthdays'])
{
$now = getdate(time() + $user->timezone + $user->dst);
$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600);
$sql = 'SELECT user_id, username, user_colour, user_birthday
FROM ' . USERS_TABLE . "
WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'

View file

@ -320,16 +320,13 @@ class module
'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/',
'S_CONTENT_DIRECTION' => $lang['DIRECTION'],
'S_CONTENT_ENCODING' => $lang['ENCODING'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'],
)
);
if (!empty($lang['ENCODING']))
{
header('Content-type: text/html; charset: ' . $lang['ENCODING']);
}
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');

View file

@ -640,7 +640,6 @@ CREATE TABLE phpbb_posts (
post_subject BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
post_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
post_checksum VARCHAR(32) DEFAULT '' NOT NULL,
post_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL,
@ -689,7 +688,6 @@ CREATE TABLE phpbb_privmsgs (
message_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
message_edit_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL,
message_edit_user INTEGER DEFAULT 0 NOT NULL,
message_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment INTEGER DEFAULT 0 NOT NULL,
bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL,
bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL,

View file

@ -751,7 +751,6 @@ CREATE TABLE [phpbb_posts] (
[post_subject] [nvarchar] (1000) DEFAULT ('') NOT NULL ,
[post_text] [ntext] DEFAULT ('') NOT NULL ,
[post_checksum] [varchar] (32) DEFAULT ('') NOT NULL ,
[post_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL ,
[post_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL ,
[bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,
@ -811,7 +810,6 @@ CREATE TABLE [phpbb_privmsgs] (
[message_text] [ntext] DEFAULT ('') NOT NULL ,
[message_edit_reason] [nvarchar] (3000) DEFAULT ('') NOT NULL ,
[message_edit_user] [int] DEFAULT (0) NOT NULL ,
[message_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL ,
[message_attachment] [int] DEFAULT (0) NOT NULL ,
[bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL ,
[bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL ,

View file

@ -438,7 +438,6 @@ CREATE TABLE phpbb_posts (
post_subject text DEFAULT '' NOT NULL,
post_text mediumtext DEFAULT '' NOT NULL,
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
@ -475,7 +474,6 @@ CREATE TABLE phpbb_privmsgs (
message_text mediumtext DEFAULT '' NOT NULL,
message_edit_reason text DEFAULT '' NOT NULL,
message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,

View file

@ -438,7 +438,6 @@ CREATE TABLE phpbb_posts (
post_subject text DEFAULT '' NOT NULL,
post_text mediumtext DEFAULT '' NOT NULL,
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
@ -475,7 +474,6 @@ CREATE TABLE phpbb_privmsgs (
message_text mediumtext DEFAULT '' NOT NULL,
message_edit_reason text DEFAULT '' NOT NULL,
message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,

View file

@ -848,7 +848,6 @@ CREATE TABLE phpbb_posts (
post_subject varchar2(1000) DEFAULT '' ,
post_text clob DEFAULT '' ,
post_checksum varchar2(32) DEFAULT '' ,
post_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield varchar2(252) DEFAULT '' ,
bbcode_uid varchar2(5) DEFAULT '' ,
@ -911,7 +910,6 @@ CREATE TABLE phpbb_privmsgs (
message_text clob DEFAULT '' ,
message_edit_reason varchar2(3000) DEFAULT '' ,
message_edit_user number(8) DEFAULT '0' NOT NULL,
message_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment number(1) DEFAULT '0' NOT NULL,
bbcode_bitfield varchar2(252) DEFAULT '' ,
bbcode_uid varchar2(5) DEFAULT '' ,

View file

@ -606,7 +606,6 @@ CREATE TABLE phpbb_posts (
post_subject varchar(1000) DEFAULT '' NOT NULL,
post_text TEXT DEFAULT '' NOT NULL,
post_checksum varchar(32) DEFAULT '' NOT NULL,
post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0),
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,
@ -647,7 +646,6 @@ CREATE TABLE phpbb_privmsgs (
message_text TEXT DEFAULT '' NOT NULL,
message_edit_reason varchar(3000) DEFAULT '' NOT NULL,
message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0),
message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL,
message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0),
bbcode_bitfield varchar(252) DEFAULT '' NOT NULL,
bbcode_uid varchar(5) DEFAULT '' NOT NULL,

View file

@ -425,7 +425,6 @@ CREATE TABLE phpbb_posts (
post_subject text(65535) NOT NULL DEFAULT '',
post_text mediumtext(16777215) NOT NULL DEFAULT '',
post_checksum varchar(32) NOT NULL DEFAULT '',
post_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1',
post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
bbcode_bitfield varchar(252) NOT NULL DEFAULT '',
bbcode_uid varchar(5) NOT NULL DEFAULT '',
@ -461,7 +460,6 @@ CREATE TABLE phpbb_privmsgs (
message_text mediumtext(16777215) NOT NULL DEFAULT '',
message_edit_reason text(65535) NOT NULL DEFAULT '',
message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0',
message_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1',
message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0',
bbcode_bitfield varchar(252) NOT NULL DEFAULT '',
bbcode_uid varchar(5) NOT NULL DEFAULT '',

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -21,6 +21,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
@ -30,7 +32,6 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'TRANSLATION_INFO' => '',
'ENCODING' => 'iso-8859-1',
'DIRECTION' => 'ltr',
'LEFT' => 'left',
'RIGHT' => 'right',

View file

@ -1,5 +1,4 @@
Subject: New user account
Charset: iso-8859-1
Hello,

View file

@ -1,4 +1,3 @@
Charset: iso-8859-1
The following is an email sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:

View file

@ -1,5 +1,4 @@
Subject: Account Activated
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -1,5 +1,4 @@
Subject: {SITENAME} - Email a friend
Charset: iso-8859-1
Hello {TO_USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Forum Post Notification - {FORUM_NAME}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: You have been added to this usergroup
Charset: iso-8859-1
Congratulations,

View file

@ -1,5 +1,4 @@
Subject: Your request has been approved
Charset: iso-8859-1
Congratulations,

View file

@ -1,5 +1,4 @@
Subject: A request to join your group has been made
Charset: iso-8859-1
Dear {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: phpBB Installed
Charset: iso-8859-1
Congratulations,

View file

@ -1,5 +1,4 @@
Subject: New Topic Notification - {FORUM_NAME}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Post Approved - {POST_SUBJECT}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Post Disapproved - {POST_SUBJECT}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: New Private Message has arrived
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,4 +1,3 @@
Charset: iso-8859-1
Hello {TO_USERNAME},

View file

@ -1,4 +1,3 @@
Charset: iso-8859-1
Hello {TO_USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Report Closed - {POST_SUBJECT}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Report Closed - {POST_SUBJECT}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Topic Approved - {TOPIC_TITLE}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Topic Disapproved - {TOPIC_TITLE}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Topic Reply Notification - {TOPIC_TITLE}
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Reactivate your account
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Your account has been deactivated
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: New password activation
Charset: iso-8859-1
Hello {USERNAME}

View file

@ -1,5 +1,4 @@
Subject: Inactive account reminder
Charset: iso-8859-1
Hello {USERNAME},

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -1,5 +1,4 @@
Subject: Welcome to {SITENAME} Forums
Charset: iso-8859-1
{WELCOME_MSG}

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -15,6 +15,8 @@
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -15,6 +15,8 @@
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct

View file

@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang))
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
@ -75,7 +77,6 @@ $lang = array_merge($lang, array(
'POLL_ENDED_AT' => 'Poll ended at %s',
'POLL_RUN_TILL' => 'Poll runs till %s',
'POLL_VOTED_OPTION' => 'You voted for this option',
'POST_ENCODING' => 'This post by <strong>%1$s</strong> was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.',
'PRINT_TOPIC' => 'Print view',
'QUICK_MOD' => 'Quick-mod tools',

View file

@ -1333,7 +1333,7 @@ function show_profile($data)
if ($bday_year)
{
$now = getdate(time() + $user->timezone + $user->dst);
$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600);
$diff = $now['mon'] - $bday_month;
if ($diff == 0)

View file

@ -254,24 +254,23 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$sort_key = 't';
$sort_dir = 'd';
$sort_by_sql['t'] = 't.topic_last_post_time';
$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
if (!$sort_days)
{
$sort_days = 1;
$sort_days = 3;
}
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
$s_sort_key = $s_sort_dir = $u_sort_param = '';
$s_sort_key = $s_sort_dir = '';
$u_sort_param = 'st=' . $sort_days;
$last_post_time = (time() - ($sort_days * 24 * 3600));
$sql = 'SELECT DISTINCT t.topic_last_post_time, t.topic_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
WHERE p.post_time > $last_post_time
$sql = 'SELECT t.topic_last_post_time, t.topic_id
FROM ' . TOPICS_TABLE . " t
WHERE t.topic_last_post_time > $last_post_time
AND t.topic_moved_id = 0
AND p.topic_id = t.topic_id
$m_approve_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . '
" . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . '
ORDER BY t.topic_last_post_time DESC';
$field = 'topic_id';
break;
@ -286,6 +285,15 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : '';
$sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort;
if ($sort_days)
{
$last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600));
}
else
{
$last_post_time = '';
}
if ($show_results == 'posts')
{
if ($sort_key == 'a')
@ -298,6 +306,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
WHERE t.topic_replies = 0
AND p.topic_id = t.topic_id
$last_post_time
$m_approve_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
@ -310,6 +319,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
WHERE t.topic_replies = 0
AND t.topic_moved_id = 0
AND p.topic_id = t.topic_id
$last_post_time
$m_approve_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
@ -325,10 +335,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
if (!$sort_days)
{
$sort_days = 1;
}
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
$s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
@ -935,6 +941,11 @@ while ($row = $db->sql_fetchrow($result))
$db->sql_freeresult($result);
unset($pad_store);
if (!$s_forums)
{
trigger_error($user->lang['NO_SEARCH']);
}
// Number of chars returned
$s_characters = '<option value="-1">' . $user->lang['ALL_AVAILABLE'] . '</option>';
$s_characters .= '<option value="0">0</option>';

View file

@ -133,12 +133,6 @@
<td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td>
<!-- ELSE -->
<!-- IF postrow.FORCE_ENCODING -->
<td class="gensmall" colspan="2" height="25" align="center">{postrow.FORCE_ENCODING}</td>
</tr>
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<!-- ENDIF -->
<td align="center" valign="middle"><!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td>
<td width="100%" height="25">
<table width="100%" cellspacing="0">

View file

@ -804,7 +804,7 @@ else
// Container for user details, only process once
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array();
$has_attachments = $display_notice = false;
$bbcode_bitfield = $force_encoding = '';
$bbcode_bitfield = '';
$i = $i_total = 0;
// Go ahead and pull all data for this topic
@ -862,7 +862,7 @@ $sql = $db->sql_build_query('SELECT', array(
$result = $db->sql_query($sql);
$now = getdate(time() + $user->timezone + $user->dst);
$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600);
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
@ -922,7 +922,6 @@ while ($row = $db->sql_fetchrow($result))
'post_approved' => $row['post_approved'],
'post_reported' => $row['post_reported'],
'post_text' => $row['post_text'],
'post_encoding' => $row['post_encoding'],
'bbcode_uid' => $row['bbcode_uid'],
'bbcode_bitfield' => $row['bbcode_bitfield'],
'enable_smilies' => $row['enable_smilies'],
@ -1238,10 +1237,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
continue;
}
else if ($row['post_encoding'] != $user->lang['ENCODING'] && $view == 'encoding' && $post_id == $row['post_id'])
{
$force_encoding = $row['post_encoding'];
}
// End signature parsing, only if needed
if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed']))
@ -1398,8 +1393,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
'FORCE_ENCODING' => ($row['post_encoding'] != $user->lang['ENCODING']) ? sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=encoding#p{$row['post_id']}" . '">', '</a>') : '',
'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
@ -1528,12 +1521,6 @@ else if (!$all_marked_read)
}
}
// Change encoding if appropriate
if ($force_encoding != '')
{
$user->lang['ENCODING'] = $force_encoding;
}
// We overwrite $_REQUEST['f'] if there is no forum specified
// to be able to display the correct online list.
// One downside is that the user currently viewing this topic/post is not taken into account.