mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- load tracking updates. Need to be tested on a clean installation too - at the moment only tiny quirks are noticed at area51.
- reported bugs fixed git-svn-id: file:///svn/phpbb/trunk@6256 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
b470f34807
commit
53085a4c78
16 changed files with 241 additions and 110 deletions
|
@ -42,7 +42,7 @@ $dbms_type_map = array(
|
||||||
'MTEXT' => 'mediumtext',
|
'MTEXT' => 'mediumtext',
|
||||||
'TIMESTAMP' => 'int(11) UNSIGNED',
|
'TIMESTAMP' => 'int(11) UNSIGNED',
|
||||||
'DECIMAL' => 'decimal(5,2)',
|
'DECIMAL' => 'decimal(5,2)',
|
||||||
'VCHAR_BIN' => 'varchar(252) BINARY',
|
'VCHAR_BIN' => 'varchar(252) /*!40101 CHARACTER SET utf8 */ BINARY',
|
||||||
'VCHAR_CI' => 'varchar(252)',
|
'VCHAR_CI' => 'varchar(252)',
|
||||||
'VARBINARY' => 'varbinary(255)',
|
'VARBINARY' => 'varbinary(255)',
|
||||||
),
|
),
|
||||||
|
@ -64,7 +64,7 @@ $dbms_type_map = array(
|
||||||
'MTEXT' => 'BLOB SUB_TYPE TEXT',
|
'MTEXT' => 'BLOB SUB_TYPE TEXT',
|
||||||
'TIMESTAMP' => 'INTEGER',
|
'TIMESTAMP' => 'INTEGER',
|
||||||
'DECIMAL' => 'DOUBLE PRECISION',
|
'DECIMAL' => 'DOUBLE PRECISION',
|
||||||
'VCHAR_BIN' => 'VARCHAR(252)',
|
'VCHAR_BIN' => 'VARCHAR(252) CHARACTER SET UNICODE_FSS',
|
||||||
'VCHAR_CI' => 'VARCHAR(252)',
|
'VCHAR_CI' => 'VARCHAR(252)',
|
||||||
'VARBINARY' => 'CHAR(255)',
|
'VARBINARY' => 'CHAR(255)',
|
||||||
),
|
),
|
||||||
|
@ -108,7 +108,7 @@ $dbms_type_map = array(
|
||||||
'MTEXT' => 'clob',
|
'MTEXT' => 'clob',
|
||||||
'TIMESTAMP' => 'number(11)',
|
'TIMESTAMP' => 'number(11)',
|
||||||
'DECIMAL' => 'number(5, 2)',
|
'DECIMAL' => 'number(5, 2)',
|
||||||
'VCHAR_BIN' => 'varchar2(252)',
|
'VCHAR_BIN' => 'nvarchar2(252)',
|
||||||
'VCHAR_CI' => 'varchar2(252)',
|
'VCHAR_CI' => 'varchar2(252)',
|
||||||
'VARBINARY' => 'raw(255)',
|
'VARBINARY' => 'raw(255)',
|
||||||
),
|
),
|
||||||
|
@ -130,7 +130,7 @@ $dbms_type_map = array(
|
||||||
'MTEXT' => 'mediumtext(16777215)',
|
'MTEXT' => 'mediumtext(16777215)',
|
||||||
'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
|
'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
|
||||||
'DECIMAL' => 'decimal(5,2)',
|
'DECIMAL' => 'decimal(5,2)',
|
||||||
'VCHAR_BIN' => 'varchar(252)',
|
'VCHAR_BIN' => 'nvarchar(252)',
|
||||||
'VCHAR_CI' => 'varchar(252)',
|
'VCHAR_CI' => 'varchar(252)',
|
||||||
'VARBINARY' => 'blob',
|
'VARBINARY' => 'blob',
|
||||||
),
|
),
|
||||||
|
@ -182,7 +182,7 @@ foreach ($supported_dbms as $dbms)
|
||||||
|
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
$line = "#\n# SQLite Schema for phpBB 3.x - (c) phpBB Group, 2005\n#\n# \$I" . "d: $\n#\n\n";
|
$line = "#\n# SQLite Schema for phpBB 3.x - (c) phpBB Group, 2005\n#\n# \$I" . "d: $\n#\n\n";
|
||||||
$line .= "BEGIN TRANSACTION;\n\n";
|
$line .= "BEGIN TRANSACTION;;\n\n";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mssql':
|
case 'mssql':
|
||||||
|
@ -477,7 +477,7 @@ foreach ($supported_dbms as $dbms)
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
// Remove last line delimiter...
|
// Remove last line delimiter...
|
||||||
$line = substr($line, 0, -2);
|
$line = substr($line, 0, -2);
|
||||||
$line .= "\n);\n\n";
|
$line .= "\n);;\n\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,6 +526,12 @@ foreach ($supported_dbms as $dbms)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
|
$line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
|
||||||
|
$line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
|
||||||
|
|
||||||
|
$line .= " {$table_name}_{$key_name} ON {$table_name} (" . implode(', ', $key_data[1]) . ");;\n";
|
||||||
|
break;
|
||||||
|
|
||||||
case 'postgres':
|
case 'postgres':
|
||||||
$line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
|
$line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
|
||||||
$line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
|
$line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
|
||||||
|
@ -653,6 +659,17 @@ EOF;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sqlite':
|
case 'sqlite':
|
||||||
|
$line = '
|
||||||
|
CREATE TRIGGER "t_phpbb_styles_template"
|
||||||
|
AFTER INSERT ON "phpbb_styles_template"
|
||||||
|
FOR EACH ROW WHEN NEW.bbcode_bitfield = \'\'
|
||||||
|
BEGIN
|
||||||
|
UPDATE phpbb_styles_template SET bbcode_bitfield = binary_insert(1) WHERE template_id = NEW.template_id;
|
||||||
|
END;;
|
||||||
|
|
||||||
|
COMMIT;;';
|
||||||
|
break;
|
||||||
|
|
||||||
case 'postgres':
|
case 'postgres':
|
||||||
$line = "\nCOMMIT;";
|
$line = "\nCOMMIT;";
|
||||||
break;
|
break;
|
||||||
|
@ -802,6 +819,12 @@ function get_schema_struct()
|
||||||
'ban_give_reason' => array('STEXT', ''),
|
'ban_give_reason' => array('STEXT', ''),
|
||||||
),
|
),
|
||||||
'PRIMARY_KEY' => 'ban_id',
|
'PRIMARY_KEY' => 'ban_id',
|
||||||
|
'KEYS' => array(
|
||||||
|
'ban_end' => array('INDEX', 'ban_end'),
|
||||||
|
'ban_user' => array('INDEX', array('ban_userid', 'ban_exclude')),
|
||||||
|
'ban_email' => array('INDEX', array('ban_email', 'ban_exclude')),
|
||||||
|
'ban_ip' => array('INDEX', array('ban_ip', 'ban_exclude')),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$schema_data['phpbb_bbcodes'] = array(
|
$schema_data['phpbb_bbcodes'] = array(
|
||||||
|
@ -870,6 +893,9 @@ function get_schema_struct()
|
||||||
'code' => array('VCHAR:8', ''),
|
'code' => array('VCHAR:8', ''),
|
||||||
),
|
),
|
||||||
'PRIMARY_KEY' => array('session_id', 'confirm_id'),
|
'PRIMARY_KEY' => array('session_id', 'confirm_id'),
|
||||||
|
'KEYS' => array(
|
||||||
|
'confirm_type' => array('INDEX', 'confirm_type'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$schema_data['phpbb_disallow'] = array(
|
$schema_data['phpbb_disallow'] = array(
|
||||||
|
@ -1245,6 +1271,9 @@ function get_schema_struct()
|
||||||
'rule_folder_id' => array('INT:4', 0),
|
'rule_folder_id' => array('INT:4', 0),
|
||||||
),
|
),
|
||||||
'PRIMARY_KEY' => 'rule_id',
|
'PRIMARY_KEY' => 'rule_id',
|
||||||
|
'KEYS' => array(
|
||||||
|
'user_id' => array('INDEX', 'user_id'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
$schema_data['phpbb_privmsgs_to'] = array(
|
$schema_data['phpbb_privmsgs_to'] = array(
|
||||||
|
@ -1262,6 +1291,7 @@ function get_schema_struct()
|
||||||
),
|
),
|
||||||
'KEYS' => array(
|
'KEYS' => array(
|
||||||
'msg_id' => array('INDEX', 'msg_id'),
|
'msg_id' => array('INDEX', 'msg_id'),
|
||||||
|
'author_id' => array('INDEX', 'author_id'),
|
||||||
'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
|
'usr_flder_id' => array('INDEX', array('user_id', 'folder_id')),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1386,6 +1416,7 @@ function get_schema_struct()
|
||||||
),
|
),
|
||||||
'KEYS' => array(
|
'KEYS' => array(
|
||||||
'word_id' => array('INDEX', 'word_id'),
|
'word_id' => array('INDEX', 'word_id'),
|
||||||
|
'post_id' => array('INDEX', 'post_id'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1675,6 +1706,7 @@ function get_schema_struct()
|
||||||
'forum_id' => array('INDEX', 'forum_id'),
|
'forum_id' => array('INDEX', 'forum_id'),
|
||||||
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
|
'forum_id_type' => array('INDEX', array('forum_id', 'topic_type')),
|
||||||
'last_post_time' => array('INDEX', 'topic_last_post_time'),
|
'last_post_time' => array('INDEX', 'topic_last_post_time'),
|
||||||
|
'fid_time_moved' => array('INDEX', array('forum_id', 'topic_last_post_time', 'topic_moved_id')),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ class acp_bbcodes
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline, bbcode_helpline
|
$sql = 'SELECT bbcode_match, bbcode_tpl, display_on_posting, bbcode_helpline
|
||||||
FROM ' . BBCODES_TABLE . '
|
FROM ' . BBCODES_TABLE . '
|
||||||
WHERE bbcode_id = ' . $bbcode_id;
|
WHERE bbcode_id = ' . $bbcode_id;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
|
@ -241,6 +241,7 @@ class acp_board
|
||||||
'legend2' => 'GENERAL_OPTIONS',
|
'legend2' => 'GENERAL_OPTIONS',
|
||||||
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
'load_anon_lastread' => array('lang' => 'YES_ANON_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true),
|
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true),
|
||||||
|
|
|
@ -554,6 +554,9 @@ class acp_icons
|
||||||
|
|
||||||
$notice = $user->lang[$lang . '_DELETED'];
|
$notice = $user->lang[$lang . '_DELETED'];
|
||||||
|
|
||||||
|
$cache->destroy('icons');
|
||||||
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'move_up':
|
case 'move_up':
|
||||||
|
|
|
@ -539,7 +539,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||||
$db->sql_query('DELETE FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}");
|
$db->sql_query('DELETE FROM ' . FORUMS_TRACK_TABLE . " WHERE user_id = {$user->data['user_id']}");
|
||||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}");
|
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}");
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
||||||
|
@ -633,7 +633,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
$tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
$tracking = ($tracking) ? unserialize($tracking) : array();
|
$tracking = ($tracking) ? unserialize($tracking) : array();
|
||||||
|
@ -698,7 +698,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||||
$db->sql_return_on_error(false);
|
$db->sql_return_on_error(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
$tracking = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
$tracking = ($tracking) ? unserialize($tracking) : array();
|
$tracking = ($tracking) ? unserialize($tracking) : array();
|
||||||
|
@ -745,7 +745,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
|
||||||
|
|
||||||
if ($user->data['is_registered'])
|
if ($user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . intval(base_convert(max($time_keys) + $config['board_startdate'], 36, 10)) . " WHERE user_id = {$user->data['user_id']}");
|
$user->data['user_lastmark'] = intval(base_convert(max($time_keys) + $config['board_startdate'], 36, 10));
|
||||||
|
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . $user->data['user_lastmark'] . " WHERE user_id = {$user->data['user_id']}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -929,7 +930,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
global $tracking_topics;
|
global $tracking_topics;
|
||||||
|
|
||||||
|
@ -995,6 +996,111 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
|
||||||
return $last_read;
|
return $last_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for read forums and update topic tracking info accordingly
|
||||||
|
*
|
||||||
|
* @param int $forum_id the forum id to check
|
||||||
|
* @param int $forum_last_post_time the forums last post time
|
||||||
|
* @param int $f_mark_time the forums last mark time if user is registered and load_db_lastread enabled
|
||||||
|
* @param int $mark_time_forum false if the mark time needs to be obtained, else the last users forum mark time
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
|
||||||
|
{
|
||||||
|
global $db, $tracking_topics, $user, $config;
|
||||||
|
|
||||||
|
// Determine the users last forum mark time if not given.
|
||||||
|
if ($mark_time_forum === false)
|
||||||
|
{
|
||||||
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
$mark_time_forum = (!empty($f_mark_time)) ? $f_mark_time : $user->data['user_lastmark'];
|
||||||
|
}
|
||||||
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
if (!isset($tracking_topics) || !sizeof($tracking_topics))
|
||||||
|
{
|
||||||
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
|
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$user->data['is_registered'])
|
||||||
|
{
|
||||||
|
$user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mark_time_forum = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the forum for any left unread topics.
|
||||||
|
// If there are none, we mark the forum as read.
|
||||||
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
if ($mark_time_forum >= $forum_last_post_time)
|
||||||
|
{
|
||||||
|
// We do not need to mark read, this happened before. Therefore setting this to true
|
||||||
|
$row = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t
|
||||||
|
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
|
||||||
|
WHERE t.forum_id = ' . $forum_id . '
|
||||||
|
AND t.topic_last_post_time > ' . $mark_time_forum . '
|
||||||
|
AND t.topic_moved_id = 0
|
||||||
|
AND tt.topic_id IS NULL
|
||||||
|
GROUP BY t.forum_id';
|
||||||
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
$row = $db->sql_fetchrow($result);
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
// Get information from cookie
|
||||||
|
$row = false;
|
||||||
|
|
||||||
|
if (!isset($tracking_topics['tf'][$forum_id]))
|
||||||
|
{
|
||||||
|
// We do not need to mark read, this happened before. Therefore setting this to true
|
||||||
|
$row = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = 'SELECT topic_id
|
||||||
|
FROM ' . TOPICS_TABLE . '
|
||||||
|
WHERE forum_id = ' . $forum_id . '
|
||||||
|
AND topic_last_post_time > ' . $mark_time_forum . '
|
||||||
|
AND topic_moved_id = 0';
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$check_forum = $tracking_topics['tf'][$forum_id];
|
||||||
|
$unread = false;
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
if (!in_array(base_convert($row['topic_id'], 10, 36), array_keys($check_forum)))
|
||||||
|
{
|
||||||
|
$unread = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$row = $unread;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$row = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$row)
|
||||||
|
{
|
||||||
|
markread('topics', $forum_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Pagination functions
|
// Pagination functions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -46,16 +46,16 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
// Display list of active topics for this category?
|
// Display list of active topics for this category?
|
||||||
$show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false;
|
$show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false;
|
||||||
|
|
||||||
|
$sql_from = FORUMS_TABLE . ' f ';
|
||||||
|
$lastread_select = $sql_lastread = '';
|
||||||
|
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_from = FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)';
|
$sql_from = FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)';
|
||||||
$lastread_select = ', ft.mark_time ';
|
$lastread_select = ', ft.mark_time ';
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_from = FORUMS_TABLE . ' f ';
|
|
||||||
$lastread_select = $sql_lastread = '';
|
|
||||||
|
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||||
{
|
{
|
||||||
$forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
|
$forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
if (!$user->data['is_registered'])
|
if (!$user->data['is_registered'])
|
||||||
{
|
{
|
||||||
|
|
|
@ -1905,6 +1905,35 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
// We do not use post_time here, this is intended (post_time can have a date in the past if editing a message)
|
// We do not use post_time here, this is intended (post_time can have a date in the past if editing a message)
|
||||||
markread('topic', $data['forum_id'], $data['topic_id'], time());
|
markread('topic', $data['forum_id'], $data['topic_id'], time());
|
||||||
|
|
||||||
|
//
|
||||||
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
$sql = 'SELECT mark_time
|
||||||
|
FROM ' . FORUMS_TRACK_TABLE . '
|
||||||
|
WHERE user_id = ' . $user->data['user_id'] . '
|
||||||
|
AND forum_id = ' . $data['forum_id'];
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$f_mark_time = (int) $db->sql_fetchfield('mark_time');
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
}
|
||||||
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
$f_mark_time = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($config['load_db_lastread'] || $config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
|
{
|
||||||
|
// Update forum info
|
||||||
|
$sql = 'SELECT forum_last_post_time
|
||||||
|
FROM ' . FORUMS_TABLE . '
|
||||||
|
WHERE forum_id = ' . $data['forum_id'];
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
$forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time');
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false);
|
||||||
|
}
|
||||||
|
|
||||||
// Send Notifications
|
// Send Notifications
|
||||||
if ($mode != 'edit' && $mode != 'delete' && ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])))
|
if ($mode != 'edit' && $mode != 'delete' && ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])))
|
||||||
{
|
{
|
||||||
|
|
|
@ -809,6 +809,12 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||||
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
||||||
$sql_where";
|
$sql_where";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
|
if ($mode == 'user')
|
||||||
|
{
|
||||||
|
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' ' . ((in_array('*', $banlist_ary)) ? '' : 'WHERE user_id IN (' . implode(', ', $banlist_ary) . ')');
|
||||||
|
$db->sql_query($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ucp_attachments
|
||||||
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1)
|
LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1)
|
||||||
WHERE a.poster_id = ' . $user->data['user_id'] . "
|
WHERE a.poster_id = ' . $user->data['user_id'] . "
|
||||||
ORDER BY $order_by";
|
ORDER BY $order_by";
|
||||||
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
|
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
||||||
|
|
||||||
$row_count = 0;
|
$row_count = 0;
|
||||||
if ($row = $db->sql_fetchrow($result))
|
if ($row = $db->sql_fetchrow($result))
|
||||||
|
@ -138,8 +138,8 @@ class ucp_attachments
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_NUMBER' => on_page($num_attachments, $config['posts_per_page'], $start),
|
'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start),
|
||||||
'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['posts_per_page'], $start),
|
'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start),
|
||||||
'TOTAL_ATTACHMENTS' => $num_attachments,
|
'TOTAL_ATTACHMENTS' => $num_attachments,
|
||||||
|
|
||||||
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],
|
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],
|
||||||
|
|
|
@ -723,7 +723,7 @@ class ucp_groups
|
||||||
'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true),
|
'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true),
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action . "&g=$group_id",
|
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'))
|
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'))
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -267,6 +267,8 @@ $lang = array_merge($lang, array(
|
||||||
'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.',
|
'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.',
|
||||||
'RECOMPILE_TEMPLATES' => 'Recompile stale templates',
|
'RECOMPILE_TEMPLATES' => 'Recompile stale templates',
|
||||||
'RECOMPILE_TEMPLATES_EXPLAIN' => 'Check for updated template files on filesystem and recompile.',
|
'RECOMPILE_TEMPLATES_EXPLAIN' => 'Check for updated template files on filesystem and recompile.',
|
||||||
|
'YES_ANON_READ_MARKING' => 'Enable topic marking for guests',
|
||||||
|
'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled posts are always read for guests.',
|
||||||
'YES_BIRTHDAYS' => 'Enable birthday listing',
|
'YES_BIRTHDAYS' => 'Enable birthday listing',
|
||||||
'YES_JUMPBOX' => 'Enable display of Jumpbox',
|
'YES_JUMPBOX' => 'Enable display of Jumpbox',
|
||||||
'YES_MODERATORS' => 'Enable display of Moderators',
|
'YES_MODERATORS' => 'Enable display of Moderators',
|
||||||
|
|
|
@ -525,7 +525,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->data['is_registered'] || !$config['load_db_lastread'])
|
if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
|
||||||
{
|
{
|
||||||
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
$tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
|
||||||
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
$tracking_topics = ($tracking_topics) ? unserialize($tracking_topics) : array();
|
||||||
|
@ -563,7 +563,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
{
|
{
|
||||||
$topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
|
$topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
|
$topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<th colspan="5">{L_UCP}</th>
|
<th colspan="5">{L_UCP}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="5" align="center"><span class="genmed">{L_UCP_WELCOME}</span></td>
|
<td class="row1" colspan="5" align="center"><span class="genmed">{L_BOOKMARKS_EXPLAIN}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="5">{L_BOOKMARKS}</th>
|
<th colspan="5">{L_BOOKMARKS}</th>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<th colspan="4">{L_UCP}</th>
|
<th colspan="4">{L_UCP}</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="4" align="center"><span class="genmed">{L_UCP_WELCOME}</span></td>
|
<td class="row1" colspan="4" align="center"><span class="genmed">{L_WATCHED_EXPLAIN}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="4">{L_WATCHED_FORUMS}</th>
|
<th colspan="4">{L_WATCHED_FORUMS}</th>
|
||||||
|
|
|
@ -38,17 +38,14 @@ if (!$forum_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_from = FORUMS_TABLE . ' f';
|
$sql_from = FORUMS_TABLE . ' f';
|
||||||
|
$lastread_select = '';
|
||||||
|
|
||||||
// Grab appropriate forum data
|
// Grab appropriate forum data
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
|
$sql_from .= ' LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
|
||||||
AND ft.forum_id = f.forum_id)';
|
AND ft.forum_id = f.forum_id)';
|
||||||
$lastread_select = ', ft.mark_time';
|
$lastread_select .= ', ft.mark_time';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$lastread_select = '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->data['is_registered'])
|
if ($user->data['is_registered'])
|
||||||
|
@ -428,6 +425,7 @@ $topic_tracking_info = $tracking_topics = array();
|
||||||
if (sizeof($topic_list))
|
if (sizeof($topic_list))
|
||||||
{
|
{
|
||||||
$mark_forum_read = true;
|
$mark_forum_read = true;
|
||||||
|
$mark_time_forum = 0;
|
||||||
|
|
||||||
// Active topics?
|
// Active topics?
|
||||||
if ($s_display_active && sizeof($active_forum_ary))
|
if ($s_display_active && sizeof($active_forum_ary))
|
||||||
|
@ -447,7 +445,7 @@ if (sizeof($topic_list))
|
||||||
$topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), false);
|
$topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
foreach ($topic_forum_list as $f_id => $topic_row)
|
foreach ($topic_forum_list as $f_id => $topic_row)
|
||||||
{
|
{
|
||||||
|
@ -464,7 +462,7 @@ if (sizeof($topic_list))
|
||||||
$topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $rowset, array($forum_id => $forum_data['mark_time']), $global_announce_list);
|
$topic_tracking_info = get_topic_tracking($forum_id, $topic_list, $rowset, array($forum_id => $forum_data['mark_time']), $global_announce_list);
|
||||||
$mark_time_forum = (!empty($forum_data['mark_time'])) ? $forum_data['mark_time'] : $user->data['user_lastmark'];
|
$mark_time_forum = (!empty($forum_data['mark_time'])) ? $forum_data['mark_time'] : $user->data['user_lastmark'];
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, $global_announce_list);
|
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_list, $global_announce_list);
|
||||||
|
|
||||||
|
@ -572,65 +570,7 @@ if (sizeof($topic_list))
|
||||||
// after reading a topic
|
// after reading a topic
|
||||||
if ($forum_data['forum_type'] == FORUM_POST && sizeof($topic_list) && $mark_forum_read)
|
if ($forum_data['forum_type'] == FORUM_POST && sizeof($topic_list) && $mark_forum_read)
|
||||||
{
|
{
|
||||||
// Make sure there are not additional topics unread
|
update_forum_tracking_info($forum_id, $forum_data['forum_last_post_time'], false, $mark_time_forum);
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
|
||||||
{
|
|
||||||
if ($mark_time_forum >= $forum_data['forum_last_post_time'])
|
|
||||||
{
|
|
||||||
$row = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t
|
|
||||||
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
|
|
||||||
WHERE t.forum_id = ' . $forum_id . '
|
|
||||||
AND t.topic_last_post_time > ' . $mark_time_forum . '
|
|
||||||
AND t.topic_moved_id = 0
|
|
||||||
AND tt.topic_id IS NULL
|
|
||||||
GROUP BY t.forum_id';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Get information from cookie
|
|
||||||
$row = false;
|
|
||||||
|
|
||||||
if (!isset($tracking_topics['tf'][$forum_id]))
|
|
||||||
{
|
|
||||||
// We do not need to mark read, this has happened before. Therefore setting this to true
|
|
||||||
$row = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
|
|
||||||
WHERE forum_id = ' . $forum_id . '
|
|
||||||
AND topic_last_post_time > ' . $mark_time_forum . '
|
|
||||||
AND topic_moved_id = 0';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$check_forum = $tracking_topics['tf'][$forum_id];
|
|
||||||
$unread = false;
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
if (!in_array(base_convert($row['topic_id'], 10, 36), array_keys($check_forum)))
|
|
||||||
{
|
|
||||||
$unread = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$row = $unread;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$row)
|
|
||||||
{
|
|
||||||
markread('topics', $forum_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page_footer();
|
page_footer();
|
||||||
|
|
|
@ -325,6 +325,8 @@ if ($post_id)
|
||||||
// Get topic tracking info
|
// Get topic tracking info
|
||||||
if (!isset($topic_tracking_info))
|
if (!isset($topic_tracking_info))
|
||||||
{
|
{
|
||||||
|
$topic_tracking_info = array();
|
||||||
|
|
||||||
// Get topic tracking info
|
// Get topic tracking info
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
|
@ -332,7 +334,7 @@ if (!isset($topic_tracking_info))
|
||||||
$topic_tracking_info = get_topic_tracking($forum_id, $topic_id, $tmp_topic_data, array($forum_id => $topic_data['forum_mark_time']));
|
$topic_tracking_info = get_topic_tracking($forum_id, $topic_id, $tmp_topic_data, array($forum_id => $topic_data['forum_mark_time']));
|
||||||
unset($tmp_topic_data);
|
unset($tmp_topic_data);
|
||||||
}
|
}
|
||||||
else
|
else if ($config['load_anon_lastread'] || $user->data['is_registered'])
|
||||||
{
|
{
|
||||||
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id);
|
$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id);
|
||||||
}
|
}
|
||||||
|
@ -715,20 +717,25 @@ if (!empty($topic_data['poll_start']))
|
||||||
|
|
||||||
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
|
for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
|
||||||
{
|
{
|
||||||
|
$poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
|
||||||
|
|
||||||
if ($poll_bbcode !== false)
|
if ($poll_bbcode !== false)
|
||||||
{
|
{
|
||||||
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
|
$poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
|
$poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
|
||||||
$poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', censor_text($poll_info[$i]['poll_option_text']));
|
$poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$topic_data['poll_title'] = censor_text($topic_data['poll_title']);
|
||||||
|
|
||||||
if ($poll_bbcode !== false)
|
if ($poll_bbcode !== false)
|
||||||
{
|
{
|
||||||
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
|
$poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
|
||||||
}
|
}
|
||||||
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
|
$topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
|
||||||
$topic_data['poll_title'] = str_replace("\n", '<br />', censor_text($topic_data['poll_title']));
|
$topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
|
||||||
|
|
||||||
unset($poll_bbcode);
|
unset($poll_bbcode);
|
||||||
|
|
||||||
|
@ -1082,7 +1089,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
$diff = ($diff < 0) ? 1 : 0;
|
$diff = ($diff < 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$age = (int) (date('Y', $time) - $bday_year - $diff);
|
$age = (int) (date('Y', time()) - $bday_year - $diff);
|
||||||
$user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
|
$user_cache[$poster_id]['age'] = (int) ($today['year'] - $bday_year - $diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1193,7 +1200,7 @@ if (sizeof($attach_list))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instantiate BBCode if need be
|
// Instantiate BBCode if need be
|
||||||
if ($bbcode_bitfield)
|
if ($bbcode_bitfield !== '')
|
||||||
{
|
{
|
||||||
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
|
||||||
$bbcode = new bbcode($bbcode_bitfield);
|
$bbcode = new bbcode($bbcode_bitfield);
|
||||||
|
@ -1233,18 +1240,20 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
// End signature parsing, only if needed
|
// End signature parsing, only if needed
|
||||||
if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed']))
|
if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed']))
|
||||||
{
|
{
|
||||||
|
$user_cache[$poster_id]['sig'] = censor_text($user_cache[$poster_id]['sig']);
|
||||||
|
|
||||||
if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
|
if ($user_cache[$poster_id]['sig_bbcode_bitfield'])
|
||||||
{
|
{
|
||||||
$bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
|
$bbcode->bbcode_second_pass($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
|
$user_cache[$poster_id]['sig'] = smiley_text($user_cache[$poster_id]['sig']);
|
||||||
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', censor_text($user_cache[$poster_id]['sig']));
|
$user_cache[$poster_id]['sig'] = str_replace("\n", '<br />', $user_cache[$poster_id]['sig']);
|
||||||
$user_cache[$poster_id]['sig_parsed'] = true;
|
$user_cache[$poster_id]['sig_parsed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the message and subject
|
// Parse the message and subject
|
||||||
$message = $row['post_text'];
|
$message = censor_text($row['post_text']);
|
||||||
|
|
||||||
// Second parse bbcode here
|
// Second parse bbcode here
|
||||||
if ($row['bbcode_bitfield'])
|
if ($row['bbcode_bitfield'])
|
||||||
|
@ -1274,7 +1283,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
|
|
||||||
// Replace naughty words such as farty pants
|
// Replace naughty words such as farty pants
|
||||||
$row['post_subject'] = censor_text($row['post_subject']);
|
$row['post_subject'] = censor_text($row['post_subject']);
|
||||||
$message = str_replace("\n", '<br />', censor_text($message));
|
$message = str_replace("\n", '<br />', $message);
|
||||||
|
|
||||||
// Editing information
|
// Editing information
|
||||||
if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason'])
|
if (($row['post_edit_count'] && $config['display_last_edited']) || $row['post_edit_reason'])
|
||||||
|
@ -1478,6 +1487,9 @@ if (isset($user->data['session_page']) && strpos($user->data['session_page'], '&
|
||||||
if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id])
|
if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id])
|
||||||
{
|
{
|
||||||
markread('topic', $forum_id, $topic_id, $max_post_time);
|
markread('topic', $forum_id, $topic_id, $max_post_time);
|
||||||
|
|
||||||
|
// Update forum info
|
||||||
|
update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change encoding if appropriate
|
// Change encoding if appropriate
|
||||||
|
|
Loading…
Add table
Reference in a new issue