diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php
index 4ca7ac492d..c9b3257436 100644
--- a/phpBB/adm/admin_board.php
+++ b/phpBB/adm/admin_board.php
@@ -129,7 +129,8 @@ $display_vars = array(
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'type' => 'text:5:4', 'explain' => true),
- 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true)
+ 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true),
+ 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true)
)
),
'message' => array(
diff --git a/phpBB/common.php b/phpBB/common.php
index 52638d2073..d1fb9ed49f 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -168,6 +168,7 @@ define('ACL_USERS_TABLE', $table_prefix.'auth_users');
define('ATTACHMENTS_TABLE', $table_prefix.'attachments');
define('BANLIST_TABLE', $table_prefix.'banlist');
define('BBCODES_TABLE', $table_prefix.'bbcodes');
+define('BOOKMARKS_TABLE', $table_prefix.'bookmarks');
define('BOTS_TABLE', $table_prefix.'bots');
define('CACHE_TABLE', $table_prefix.'cache');
define('CONFIG_TABLE', $table_prefix.'config');
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 19d72bf919..1f941d0baf 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -461,7 +461,7 @@ function tz_select($default = '')
}
// Topic and forum watching common code
-function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $match_id, $notify_status = 'unset')
+function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $match_id, $notify_status = 'unset', $start = 0)
{
global $template, $db, $user, $phpEx, $SID, $start, $phpbb_root_path;
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 44e1808f1c..f1f20a9006 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -990,6 +990,7 @@ class mcp_main extends mcp
if ($this->confirm)
{
+// delete_topics('topic_id', $topic_id_list, true);
return_link('RETURN_FORUM', "viewforum.$phpEx$SID&f={$this->forum_id}");
$template->assign_var('MESSAGE', (count($topic_id_list) == 1) ? $user->lang['TOPIC_DELETED_SUCCESS'] : $user->lang['TOPICS_DELETED_SUCCESS']);
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index e035090ca6..9c086a639e 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -31,7 +31,6 @@ class session
$this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI'];
// Generate Valid URL
- // TODO: need another one with sid for normal redirects
$this->cur_page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1.' . $phpEx . '?\2', str_replace('&', '&', htmlspecialchars($this->page)));
$this->page = preg_replace('#^.*?([a-z]+?)\.' . $phpEx . '\?sid=[a-z0-9]*?(&.*)?$#i', '\1\2', $this->page);
diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php
index 831f455f35..6c90b95b1b 100644
--- a/phpBB/includes/template.php
+++ b/phpBB/includes/template.php
@@ -223,7 +223,7 @@ class template
// Try and open template for read
if (!($fp = @fopen($this->files[$handle], 'r')))
{
- trigger_error("template->_tpl_load(): File " . $this->files[$handle] . " does not exist or is empty", E_USER_ERROR);
+ trigger_error("template->_tpl_load_file(): File {$this->files[$handle]} does not exist or is empty", E_USER_ERROR);
}
$this->compiled_code[$handle] = $this->compile(trim(@fread($fp, filesize($this->files[$handle]))));
@@ -346,7 +346,6 @@ class template
{
$this->compile_var_tags($text_blocks[$i]);
}
-
$compile_blocks = array();
for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++)
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 30a1a63ee0..cb0bd4f082 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -523,6 +523,167 @@ class ucp_main extends module
break;
+ case 'bookmarks':
+
+ if (!$config['allow_bookmarks'])
+ {
+ $template->assign_vars(array(
+ 'S_NO_DISPLAY_BOOKMARKS' => true)
+ );
+ break;
+ }
+
+ $move_up = request_var('move_up', 0);
+ $move_down = request_var('move_down', 0);
+
+ $sql = 'SELECT MAX(order_id) as max_order_id FROM ' . BOOKMARKS_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+ $max_order_id = $db->sql_fetchfield('max_order_id', 0, $result);
+ $db->sql_freeresult($result);
+
+ if ($move_up || $move_down)
+ {
+ if (($move_up && $move_up != 1) || ($move_down && $move_down != $max_order_id))
+ {
+ $order = ($move_up) ? $move_up : $move_down;
+ $order_total = $order * 2 + (($move_up) ? -1 : 1);
+
+ $sql = 'UPDATE ' . BOOKMARKS_TABLE . "
+ SET order_id = $order_total - order_id
+ WHERE order_id IN ($order, " . (($move_up) ? $order - 1 : $order + 1) . ')
+ AND user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
+ }
+ }
+
+ if (isset($_POST['unbookmark']))
+ {
+ $s_hidden_fields = '';
+ $topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array();
+ $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks";
+
+ if (!sizeof($topics))
+ {
+ trigger_error('NO_BOOKMARKS_SELECTED');
+ }
+
+ foreach ($topics as $topic_id)
+ {
+ $s_hidden_fields .= '';
+ }
+
+ if (confirm_box(true))
+ {
+ $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'] . '
+ AND topic_id IN (' . implode(', ', $topics) . ')';
+ $db->sql_query($sql);
+
+ // Re-Order bookmarks (possible with one query? This query massaker is not really acceptable...)
+ $sql = 'SELECT topic_id FROM ' . BOOKMARKS_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'] . '
+ ORDER BY order_id ASC';
+ $result = $db->sql_query($sql);
+
+ $i = 1;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $db->sql_query('UPDATE ' . BOOKMARKS_TABLE . "
+ SET order_id = $i
+ WHERE topic_id = {$row['topic_id']}
+ AND user_id = {$user->data['user_id']}");
+ $i++;
+ }
+ $db->sql_freeresult($result);
+
+ meta_refresh(3, $url);
+ $message = $user->lang['BOOKMARKS_REMOVED'] . '
' . sprintf($user->lang['RETURN_UCP'], '', '');
+ trigger_error($message);
+ }
+ else
+ {
+ confirm_box(false, 'REMOVE_SELECTED_BOOKMARKS', $s_hidden_fields);
+ }
+ }
+
+ // We grab deleted topics here too...
+ // NOTE: At the moment bookmarks are not removed with topics, might be useful later (not really sure how though. :D)
+ // But since bookmarks are sensible to the user, they should not be deleted without notice.
+ $sql = 'SELECT b.order_id, b.topic_id as b_topic_id, t.*, f.forum_name
+ FROM ' . BOOKMARKS_TABLE . ' b
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON b.topic_id = t.topic_id
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON t.forum_id = f.forum_id
+ WHERE b.user_id = ' . $user->data['user_id'] . '
+ ORDER BY b.order_id ASC';
+ $result = $db->sql_query($sql);
+
+ $i = 0;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $forum_id = $row['forum_id'];
+ $topic_id = $row['b_topic_id'];
+
+ $replies = ($auth->acl_get('m_approve')) ? $row['topic_replies_real'] : $row['topic_replies'];
+
+ $topic_type = '';
+ switch ($row['topic_type'])
+ {
+ case POST_ANNOUNCE:
+ $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
+ $folder = 'folder_announce';
+ break;
+
+ case POST_STICKY:
+ $topic_type = $user->lang['VIEW_TOPIC_STICKY'];
+ $folder = 'folder_sticky';
+ break;
+
+ default:
+ if ($replies >= intval($config['hot_threshold']))
+ {
+ $folder = 'folder_hot';
+ }
+ else
+ {
+ $folder = 'folder';
+ }
+ break;
+ }
+
+ if ($row['topic_status'] == ITEM_LOCKED)
+ {
+ $topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
+ $folder = 'folder_locked';
+ }
+
+ $folder_alt = ($row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'TOPIC';
+ $view_topic_url = "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id";
+ $last_post_img = "' . $user->img('icon_post_latest', 'VIEW_LATEST_POST') . '';
+
+ $template->assign_block_vars('topicrow', array(
+ 'FORUM_ID' => $forum_id,
+ 'TOPIC_ID' => $topic_id,
+ 'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
+ 'TOPIC_TITLE' => censor_text($row['topic_title']),
+ 'TOPIC_TYPE' => $topic_type,
+ 'FORUM_NAME' => $row['forum_name'],
+ 'POSTED_AT' => $user->format_date($row['topic_time']),
+
+ 'TOPIC_FOLDER_IMG' => $user->img($folder, $folder_alt),
+ 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $forum_id) && $row['topic_attachment']) ? $user->img('icon_attach', '') : '',
+
+ 'U_VIEW_TOPIC' => $view_topic_url,
+ 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f={$row['forum_id']}",
+ 'U_MOVE_UP' => ($row['order_id'] != 1) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_up={$row['order_id']}" : '',
+ 'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_down={$row['order_id']}" : '',
+
+ 'S_ROW_COUNT' => $i++)
+ );
+ }
+
+ break;
+
case 'drafts':
global $ucp;
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index f73157d1cd..1275d39eaf 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -19,6 +19,7 @@ class ucp_prefs extends module
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
+ $s_hidden_fields = '';
switch($mode)
{
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index 65006eb46f..a21d6d7349 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -98,6 +98,15 @@ CREATE TABLE phpbb_bbcodes (
PRIMARY KEY (bbcode_id)
);
+CREATE TABLE phpbb_bookmarks (
+ topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ order_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
+ KEY topic_id (topic_id),
+ KEY user_id (user_id),
+ KEY notify_status (order_id)
+);
+
# Table: 'phpbb_bots'
CREATE TABLE phpbb_bots (
bot_id tinyint(3) unsigned NOT NULL auto_increment,
@@ -718,6 +727,7 @@ CREATE TABLE phpbb_styles_imageset (
sub_forum varchar(200) DEFAULT '' NOT NULL,
sub_forum_new varchar(200) DEFAULT '' NOT NULL,
folder varchar(200) DEFAULT '' NOT NULL,
+ folder_moved varchar(200) DEFAULT '' NOT NULL,
folder_posted varchar(200) DEFAULT '' NOT NULL,
folder_new varchar(200) DEFAULT '' NOT NULL,
folder_new_posted varchar(200) DEFAULT '' NOT NULL,
@@ -744,6 +754,7 @@ CREATE TABLE phpbb_styles_imageset (
poll_left varchar(200) DEFAULT '' NOT NULL,
poll_center varchar(200) DEFAULT '' NOT NULL,
poll_right varchar(200) DEFAULT '' NOT NULL,
+ attach_progress_bar varchar(200) DEFAULT '' NOT NULL,
karma_left varchar(200) DEFAULT '' NOT NULL,
karma_center varchar(200) DEFAULT '' NOT NULL,
karma_right varchar(200) DEFAULT '' NOT NULL,
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index d48a67f00f..2217ed06b6 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -20,6 +20,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remot
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse','0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks','1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars','.*?');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg','');
@@ -305,7 +306,7 @@ INSERT INTO phpbb_styles (style_id, style_name, style_copyright, template_id, th
# MSSQL IDENTITY phpbb_styles_imageset ON #
# -- phpbb_styles_imageset
-INSERT INTO phpbb_styles_imageset (imageset_id, imageset_name, imageset_copyright, imageset_path, site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_ip, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, karma_left, karma_center, karma_right, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10) VALUES (1, 'subSilver', '© phpBB Group', 'subSilver', '', '{LANG}/btn_post.gif*27*97', '{LANG}/btn_post_pm.gif*27*97', '{LANG}/btn_reply.gif*27*97', '{LANG}/btn_reply_pm.gif*20*90', '{LANG}/btn_locked.gif*27*97', '{LANG}/btn_profile.gif*20*72', '{LANG}/btn_pm.gif*20*72', '{LANG}/btn_delete.gif*20*20', '{LANG}/btn_ip.gif*20*20', '{LANG}/btn_quote.gif*20*90', '{LANG}/btn_search.gif*20*72', '{LANG}/btn_edit.gif*20*90', '{LANG}/btn_report.gif*20*20', '{LANG}/btn_email.gif*20*72', '{LANG}/btn_www.gif*20*72', '{LANG}/btn_icq.gif*20*72', '{LANG}/btn_aim.gif*20*72', '{LANG}/btn_yim.gif*20*72', '{LANG}/btn_msnm.gif*20*72', '{LANG}/btn_jabber.gif*20*72', '{LANG}/btn_online.gif*20*72', '{LANG}/btn_offline.gif*20*72', '', '', 'icon_unapproved.gif*18*19', 'icon_reported.gif*18*19', 'icon_attach.gif*18*14', 'icon_minipost.gif*9*12', 'icon_minipost_new.gif*9*12', 'icon_latest_reply.gif*9*18', 'icon_newest_reply.gif*9*18', 'folder_big.gif*25*46', 'folder_new_big.gif*25*46', 'folder_locked_big.gif*25*46', 'folder_link_big.gif*25*46', 'subfolder_big.gif*25*46', 'subfolder_new_big.gif*25*46', 'folder.gif*18*19', 'folder_posted.gif*18*19', 'folder_new.gif*18*19', 'folder_new_posted.gif*18*19', 'folder_hot.gif*18*19', 'folder_hot_posted.gif*18*19', 'folder_new_hot.gif*18*19', 'folder_new_hot_posted.gif*18*19', 'folder_lock.gif*18*19', 'folder_lock_posted.gif*18*19', 'folder_lock_new.gif*18*19', 'folder_lock_new_posted.gif*18*19', 'folder_sticky.gif*18*19', 'folder_sticky_posted.gif*18*19', 'folder_sticky_new.gif*18*19', 'folder_sticky_new_posted.gif*18*19', 'folder_announce.gif*18*19', 'folder_announce_posted.gif*18*19', 'folder_announce_new.gif*18*19', 'folder_announce_new_posted.gif*18*19', '', '', '', '', 'vote_lcap.gif*12*4', 'voting_bar.gif*12', 'vote_rcap.gif*12*4', '', 'karma/karma{SUFFIX}.gif*6*69', '', '', '', '', '', '', '', '', '', '', '');
+INSERT INTO phpbb_styles_imageset (imageset_id, imageset_name, imageset_copyright, imageset_path, site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_ip, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_moved, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, attach_progress_bar, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10) VALUES (1, 'subSilver', '© phpBB Group', 'subSilver', '', '{LANG}/btn_post.gif*27*97', '{LANG}/btn_post_pm.gif*27*97', '{LANG}/btn_reply.gif*27*97', '{LANG}/btn_reply_pm.gif*20*90', '{LANG}/btn_locked.gif*27*97', '{LANG}/btn_profile.gif*20*72', '{LANG}/btn_pm.gif*20*72', '{LANG}/btn_delete.gif*20*20', '{LANG}/btn_ip.gif*20*20', '{LANG}/btn_quote.gif*20*90', '{LANG}/btn_search.gif*20*72', '{LANG}/btn_edit.gif*20*90', '{LANG}/btn_report.gif*20*20', '{LANG}/btn_email.gif*20*72', '{LANG}/btn_www.gif*20*72', '{LANG}/btn_icq.gif*20*72', '{LANG}/btn_aim.gif*20*72', '{LANG}/btn_yim.gif*20*72', '{LANG}/btn_msnm.gif*20*72', '{LANG}/btn_jabber.gif*20*72', '{LANG}/btn_online.gif*20*72', '{LANG}/btn_offline.gif*20*72', '', '', 'icon_unapproved.gif*18*19', 'icon_reported.gif*18*19', 'icon_attach.gif*18*14', 'icon_minipost.gif*9*12', 'icon_minipost_new.gif*9*12', 'icon_latest_reply.gif*9*18', 'icon_newest_reply.gif*9*18', 'folder_big.gif*25*46', 'folder_new_big.gif*25*46', 'folder_locked_big.gif*25*46', 'folder_link_big.gif*25*46', 'subfolder_big.gif*25*46', 'subfolder_new_big.gif*25*46', 'folder.gif*18*19', 'folder_moved.gif*18*19', 'folder_posted.gif*18*19', 'folder_new.gif*18*19', 'folder_new_posted.gif*18*19', 'folder_hot.gif*18*19', 'folder_hot_posted.gif*18*19', 'folder_new_hot.gif*18*19', 'folder_new_hot_posted.gif*18*19', 'folder_lock.gif*18*19', 'folder_lock_posted.gif*18*19', 'folder_lock_new.gif*18*19', 'folder_lock_new_posted.gif*18*19', 'folder_sticky.gif*18*19', 'folder_sticky_posted.gif*18*19', 'folder_sticky_new.gif*18*19', 'folder_sticky_new_posted.gif*18*19', 'folder_announce.gif*18*19', 'folder_announce_posted.gif*18*19', 'folder_announce_new.gif*18*19', 'folder_announce_new_posted.gif*18*19', '', '', '', '', 'vote_lcap.gif*12*4', 'voting_bar.gif*12', 'vote_rcap.gif*12*4', 'progress_bar.gif*16*280', '', '', '', '', '', '', '', '', '', '');
# MSSQL IDENTITY phpbb_styles_imageset OFF #
@@ -407,7 +408,7 @@ INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip
# MSSQL IDENTITY phpbb_modules OFF #
# -- Modules
-INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\ndrafts', '');
+INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\nbookmarks\r\ndrafts', '');
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PM', 'pm', 2, 1, 'view_messages\r\ncompose\r\nunread\r\ndrafts\r\noptions', 'cfg_allow_privmsg');
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 3, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', '');
INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PREFS', 'prefs', 4, 1, 'personal\r\nview\r\npost', '');
diff --git a/phpBB/language/en/admin.php b/phpBB/language/en/admin.php
index d8b9ea56bd..107848695c 100644
--- a/phpBB/language/en/admin.php
+++ b/phpBB/language/en/admin.php
@@ -871,6 +871,8 @@ $lang += array(
'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.',
'ALLOW_NO_CENSORS' => 'Allow Disable of Censors',
'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.',
+ 'ALLOW_BOOKMARKS' => 'Allow bookmarking topics',
+ 'ALLOW_BOOKMARKS_EXPLAIN' => 'User is able to store personal bookmarks'
);
// Karma settings
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 5435989395..7498a8ef5a 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -386,6 +386,7 @@ $lang += array(
'VIEWING_MEMBERS' => 'Viewing member details',
'VIEWING_ONLINE' => 'Viewing who is online',
'VIEWS' => 'Views',
+ 'VIEW_BOOKMARKS' => 'View bookmarks',
'VIEW_LATEST_POST' => 'View latest post',
'VIEW_NEWEST_POST' => 'View newest post',
'VIEW_ONLINE_TIME' => 'This data is based on users active over the past %d minute',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 7b93e011e2..dd7bd8a8bd 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -64,6 +64,9 @@ $lang += array(
'BOARD_LANGUAGE' => 'My language',
'BOARD_STYLE' => 'My board style',
'BOARD_TIMEZONE' => 'My timezone',
+ 'BOOKMARKS' => 'Bookmarks',
+ 'BOOKMARKS_DISABLED' => 'Bookmarks are disabled on this board',
+ 'BOOKMARKS_REMOVED' => 'Bookmarks removed successfully',
'CHANGE_PASSWORD' => 'Change password',
'CHANGE_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.',
@@ -100,6 +103,7 @@ $lang += array(
'DELETE_ATTACHMENT_CONFIRM' => 'Are you sure you want to delete this attachment?',
'DELETE_ATTACHMENTS_CONFIRM'=> 'Are you sure you want to delete these attachments?',
'DELETE_AVATAR' => 'Delete Image',
+ 'DELETE_COOKIES_CONFIRM' => 'Are you sure you want to delete all cookies set by this board?',
'DELETE_MARKED_PM' => 'Delete Marked Messages',
'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all marked messages?',
'DELETE_OLDEST_MESSAGES' => 'Delete Oldest Messages',
@@ -162,7 +166,9 @@ $lang += array(
'MESSAGE_REPORTED_MESSAGE' => 'Reported Message',
'MINIMUM_KARMA' => 'Minimum User Karma',
'MINIMUM_KARMA_EXPLAIN' => 'Posts by users with Karma less than this will be ignored.',
+ 'MOVE_DOWN' => 'Move down',
'MOVE_TO_FOLDER' => 'Move to Folder',
+ 'MOVE_UP' => 'Move up',
'NEW_EMAIL_ERROR' => 'The email addresses you entered do not match.',
'NEW_PASSWORD' => 'Password',
@@ -217,6 +223,9 @@ $lang += array(
'REGISTRATION' => 'Registration',
'RELEASE_MESSAGES' => 'Click %sHere%s to release the on-hold messages, they will be re-sorted into the appropiate folder if enough space is made available.',
'REMOVE_ADDRESS' => 'Remove address',
+ 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks',
+ 'REMOVE_SELECTED_BOOKMARKS_CONFIRM' => 'Are you sure you want to delete all selected bookmarks?',
+ 'REMOVE_BOOKMARK_MARKED' => 'Remove marked bookmarks',
'REMOVE_FOLDER' => 'Remove folder',
'REPLIED_MESSAGE' => 'Replied to Message',
'REPORT_PM' => 'Report PM',
@@ -257,6 +266,7 @@ $lang += array(
'UCP_ICQ' => 'ICQ Number',
'UCP_JABBER' => 'Jabber Address',
'UCP_MAIN' => 'Overview',
+ 'UCP_MAIN_BOOKMARKS' => 'Bookmarks',
'UCP_MAIN_DRAFTS' => 'Saved drafts',
'UCP_MAIN_FRONT' => 'Front page',
'UCP_MAIN_SUBSCRIBED' => 'Subscribed',
diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php
index ae67f79962..0769970918 100644
--- a/phpBB/language/en/viewforum.php
+++ b/phpBB/language/en/viewforum.php
@@ -37,6 +37,7 @@ $lang += array(
'LOGIN_NOTIFY_FORUM' => 'You have been notified about this forum, please login to view it.',
'MARK_TOPICS_READ' => 'Mark Topics Read',
+ 'MOVED_TOPIC' => 'Moved Topic',
'NEW_POSTS_HOT' => 'New posts [ Popular ]',
'NEW_POSTS_LOCKED' => 'New posts [ Locked ]',
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index 3262803206..3b51a027f1 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -30,6 +30,10 @@ if (empty($lang) || !is_array($lang))
$lang += array(
'ATTACHMENT' => 'Attachment',
+ 'BOOKMARK_ADDED' => 'Bookmarked Topic successfully.',
+ 'BOOKMARK_REMOVED' => 'Removed Bookmarked Topic successfully.',
+ 'BOOKMARK_TOPIC' => 'Bookmark Topic',
+ 'BOOKMARK_TOPIC_REMOVE' => 'Remove from Bookmarks',
'BUMPED_BY' => 'Last bumped by %1$s on %2$s',
'BUMP_TOPIC' => 'Bump Topic',
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 0b435adab2..c545718711 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -55,7 +55,7 @@ if ($cancel || ($current_time - $lastclick < 2 && $submit))
redirect($redirect);
}
-if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$forum_id)
+if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete', 'popup')) && !$forum_id)
{
trigger_error('NO_FORUM');
}
@@ -964,7 +964,7 @@ $template->assign_vars(array(
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=" . $forum_id,
'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&$forum_id&t=$topic_id" : '',
- 'U_PROGRESS_BAR' => "posting.$phpEx$SID&mode=popup",
+ 'U_PROGRESS_BAR' => "posting.$phpEx$SID&f=$forum_id&mode=popup", // do NOT replace & with & here
'S_PRIVMSGS' => false,
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
@@ -2025,6 +2025,10 @@ function upload_popup($forum_style)
'popup' => 'posting_progress_bar.html')
);
+ $template->assign_vars(array(
+ 'PROGRESS_BAR' => $user->img('attach_progress_bar', $user->lang['UPLOAD_IN_PROGRESS']))
+ );
+
$template->display('popup');
}
diff --git a/phpBB/styles/subSilver/imageset/folder_moved.gif b/phpBB/styles/subSilver/imageset/folder_moved.gif
new file mode 100644
index 0000000000..3d6cc22279
Binary files /dev/null and b/phpBB/styles/subSilver/imageset/folder_moved.gif differ
diff --git a/phpBB/styles/subSilver/imageset/imageset.cfg b/phpBB/styles/subSilver/imageset/imageset.cfg
index dc85dc25ae..7257508e38 100644
--- a/phpBB/styles/subSilver/imageset/imageset.cfg
+++ b/phpBB/styles/subSilver/imageset/imageset.cfg
@@ -40,6 +40,7 @@ forum_link*folder_link_big.gif*25*46
sub_forum*subfolder_big.gif*25*46
sub_forum_new*subfolder_new_big.gif*25*46
folder*folder.gif*18*19
+folder_moved*folder_moved.gif*18*19
folder_posted*folder_posted.gif*18*19
folder_new*folder_new.gif*18*19
folder_new_posted*folder_new_posted.gif*18*19
@@ -66,6 +67,4 @@ folder_global_new_posted***
poll_left*vote_lcap.gif*12*4
poll_center*voting_bar.gif*12*
poll_right*vote_rcap.gif*12*4
-karma_left***
-karma_center*karma/karma{SUFFIX}.gif*6*69
-karma_right***
\ No newline at end of file
+attach_progress_bar*attach_progress_bar.gif*16*280
diff --git a/phpBB/styles/subSilver/template/posting_progress_bar.html b/phpBB/styles/subSilver/template/posting_progress_bar.html
index 607ff15b35..d0943becfc 100644
--- a/phpBB/styles/subSilver/template/posting_progress_bar.html
+++ b/phpBB/styles/subSilver/template/posting_progress_bar.html
@@ -27,7 +27,7 @@
{L_UPLOAD_IN_PROGRESS} ![]() {L_CLOSE_WINDOW} |
+ {L_UPLOAD_IN_PROGRESS} {PROGRESS_BAR} {L_CLOSE_WINDOW} |
{L_UCP} | +||||||
---|---|---|---|---|---|---|
{L_UCP_WELCOME} | +||||||
{L_BOOKMARKS} | +||||||
{L_BOOKMARKS_DISABLED} | +||||||
{topicrow.TOPIC_FOLDER_IMG} | + +{L_DELETED_TOPIC} | + +{topicrow.ATTACH_ICON_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE} {L_FORUM}: {topicrow.FORUM_NAME} |
+ {L_POSTED}: {topicrow.POSTED_AT} |
+
+ {L_MOVE_UP} | {L_MOVE_DOWN} | ++ | |
{L_NO_BOOKMARKS} | +||||||
+ |
- {L_WATCH_TOPIC} |
+ {L_WATCH_TOPIC} |
+ {L_BOOKMARK_TOPIC} |
{L_PRINT_TOPIC} |
{L_EMAIL_TOPIC} |
{L_BUMP_TOPIC}
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index bbc77b3ad9..e49566b00e 100755
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -303,26 +303,34 @@ switch ($mode)
case 'delete_cookies':
// Delete Cookies with dynamic names (do NOT delete poll cookies)
- $set_time = time() - 31536000;
- foreach ($_COOKIE as $cookie_name => $cookie_data)
+ if (confirm_box(true))
{
- $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
- if (!strstr($cookie_name, '_poll'))
+ $set_time = time() - 31536000;
+ foreach ($_COOKIE as $cookie_name => $cookie_data)
{
- $user->set_cookie($cookie_name, '', $set_time);
+ $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
+ if (!strstr($cookie_name, '_poll'))
+ {
+ $user->set_cookie($cookie_name, '', $set_time);
+ }
}
+ $user->set_cookie('track', '', $set_time);
+ $user->set_cookie('data', '', $set_time);
+ $user->set_cookie('sid', '', $set_time);
+
+ // We destroy the session here, the user will be logged out nevertheless
+ $user->destroy();
+
+ meta_refresh(3, "{$phpbb_root_path}index.$phpEx");
+
+ $message = $user->lang['COOKIES_DELETED'] . ' ' . sprintf($user->lang['RETURN_INDEX'], "", ''); + trigger_error($message); } - $user->set_cookie('track', '', $set_time); - $user->set_cookie('data', '', $set_time); - $user->set_cookie('sid', '', $set_time); - - // We destroy the session here, the user will be logged out nevertheless - $user->destroy(); - - meta_refresh(3, "{$phpbb_root_path}index.$phpEx"); - - $message = $user->lang['COOKIES_DELETED'] . ' ' . sprintf($user->lang['RETURN_INDEX'], "", ''); - trigger_error($message); + else + { + confirm_box(false, 'DELETE_COOKIES', ''); + } + redirect("index.$phpEx"); break; } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index cb38d98041..a91bd53777 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -72,7 +72,7 @@ else if (!isset($tracking_topics[$forum_id]) && $user->data['user_id'] != ANONYMOUS) { markread('mark', $forum_id); - redirect($user->cur_page); + redirect(str_replace('&', '&', htmlspecialchars((!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : $_ENV['REQUEST_URI']))); } } @@ -272,6 +272,7 @@ if ($forum_data['forum_type'] == FORUM_POST || ($forum_data['forum_flags'] & 16) 'FOLDER_STICKY_NEW_IMG' => $user->img('folder_sticky_new', 'POST_STICKY'), 'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'POST_ANNOUNCEMENT'), 'FOLDER_ANNOUNCE_NEW_IMG'=> $user->img('folder_announce_new', 'POST_ANNOUNCEMENT'), + 'FOLDER_MOVED_IMG' => $user->img('folder_moved', 'TOPIC_MOVED'), 'REPORTED_IMG' => $user->img('icon_reported', 'TOPIC_REPORTED'), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', 'TOPIC_UNAPPROVED'), diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8a59d5e6b4..3040857c49 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -160,9 +160,11 @@ if ($user->data['user_id'] != ANONYMOUS) break; default: - $extra_fields .= ', tw.notify_status'; + $extra_fields .= ', tw.notify_status, bm.order_id as bookmarked'; $join_sql_table .= ' LEFT JOIN ' . TOPICS_WATCH_TABLE . ' tw ON (tw.user_id = ' . $user->data['user_id'] . ' AND t.topic_id = tw.topic_id)'; + $join_sql_table .= ' LEFT JOIN ' . BOOKMARKS_TABLE . ' bm ON (bm.user_id = ' . $user->data['user_id'] . ' + AND t.topic_id = bm.topic_id)'; } } @@ -262,11 +264,20 @@ if ($forum_password) login_forum_box($topic_data); } -// Redirect to login upon emailed notification links -if (isset($_GET['e']) && $user->data['user_id'] == ANONYMOUS) +// Redirect to login or to the correct post upon emailed notification links +if (isset($_GET['e'])) { - $redirect_url = htmlspecialchars(str_replace('&e=' . $_GET['e'], '', $_SERVER['REQUEST_URI'])) . (($_GET['e']) ? '#' . (int) $_GET['e'] : ''); - login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', $redirect_url), '', $user->lang['LOGIN_NOTIFY_TOPIC']); + $jump_to = (int) $_GET['e']; + $redirect_url = htmlspecialchars(str_replace('&e=' . $jump_to, '', $_SERVER['REQUEST_URI'])) . (($jump_to) ? '#' . $jump_to : ''); + if ($user->data['user_id'] == ANONYMOUS) + { + login_box(preg_replace('#.*?([a-z]+?\.' . $phpEx . '.*?)$#i', '\1', $redirect_url), '', $user->lang['LOGIN_NOTIFY_TOPIC']); + } + else if ($jump_to > 0) + { + // We direct the already logged in user to the correct post... + redirect($redirect_url); + } } // What is start equal to? @@ -310,29 +321,6 @@ else $limit_posts_time = ''; } -// Fill extension informations, if this topic has attachments -$extensions = array(); -if ($topic_attachment) -{ - obtain_attach_extensions($extensions); -} - -// Are we watching this topic? -$s_watching_topic = $s_watching_topic_img = array(); -$s_watching_topic['link'] = $s_watching_topic['title'] = ''; -if ($config['email_enable'] && $config['allow_topic_notify'] && $user->data['user_id'] != ANONYMOUS) -{ - watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id, $notify_status); -} - -// Grab ranks -$ranks = array(); -obtain_ranks($ranks); - -// Grab icons -$icons = array(); -obtain_icons($icons); - // Was a highlight request part of the URI? $highlight_match = $highlight = ''; if ($hilit_words) @@ -348,6 +336,71 @@ if ($hilit_words) $highlight = htmlspecialchars(urlencode($hilit_words)); } +// General Viewtopic URL for return links +$viewtopic_url = "{$phpbb_root_path}viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&start=$start&$u_sort_param" . (($highlight_match) ? "&hilit=$highlight" : ''); + +// Are we watching this topic? +$s_watching_topic = $s_watching_topic_img = array(); +$s_watching_topic['link'] = $s_watching_topic['title'] = ''; +if ($config['email_enable'] && $config['allow_topic_notify'] && $user->data['user_id'] != ANONYMOUS) +{ + watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id, $notify_status, $start); +} + +// Bookmarks +if ($config['allow_bookmarks'] && $user->data['user_id'] != ANONYMOUS && request_var('bookmark', 0)) +{ + if (!$bookmarked) + { + $sql = 'INSERT INTO ' . BOOKMARKS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'user_id' => $user->data['user_id'], + 'topic_id' => $topic_id, + 'order_id' => 0) + ); + $db->sql_query($sql); + + $where_sql = ''; + $sign = '+'; + } + else + { + $sql = 'DELETE FROM ' . BOOKMARKS_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND topic_id = $topic_id"; + $db->sql_query($sql); + + // Works because of current order_id selected as bookmark value (please do not change because of simplicity) + $where_sql = " AND order_id > $bookmarked"; + $sign = '-'; + } + + // Re-Sort Bookmarks + $sql = 'UPDATE ' . BOOKMARKS_TABLE . " + SET order_id = order_id $sign 1 + WHERE user_id = {$user->data['user_id']} + $where_sql"; + $db->sql_query($sql); + + meta_refresh(3, $viewtopic_url); + $message = (($bookmarked) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . ' ' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + trigger_error($message); +} + +// Grab ranks +$ranks = array(); +obtain_ranks($ranks); + +// Grab icons +$icons = array(); +obtain_icons($icons); + +// Grab extensions +$extensions = array(); +if ($topic_attachment) +{ + obtain_attach_extensions($extensions); +} + // Forum rules listing $s_forum_rules = ''; gen_forum_auth_level('topic', $forum_id); @@ -367,8 +420,7 @@ $topic_mod .= ($auth->acl_get('f_announce', $forum_id) && $topic_type != POST_GL $topic_mod .= ($auth->acl_get('m_', $forum_id)) ? '' : ''; // If we've got a hightlight set pass it on to pagination. -$pagination_url = "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&sk=$sort_key&st=$sort_days&sd=$sort_dir" . (($highlight_match) ? "&hilit=$highlight" : ''); -$pagination = generate_pagination($pagination_url, $total_posts, $config['posts_per_page'], $start); +$pagination = generate_pagination($viewtopic_url, $total_posts, $config['posts_per_page'], $start); // Navigation links generate_forum_nav($topic_data); @@ -432,16 +484,19 @@ $template->assign_vars(array( 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", 'U_FORUM' => $server_path, 'U_VIEW_UNREAD_POST' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=unread#unread", - 'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&start=$start&$u_sort_param&hilit=$highlight", + 'U_VIEW_TOPIC' => $viewtopic_url, 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id", 'U_VIEW_OLDER_TOPIC' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=previous", 'U_VIEW_NEWER_TOPIC' => "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&view=next", - 'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? "viewtopic.$phpEx$SID&f=$forum_id&t=$topic_id&$u_sort_param&view=print" : '', + 'U_PRINT_TOPIC' => ($auth->acl_get('f_print', $forum_id)) ? $viewtopic_url . '&view=print' : '', 'U_EMAIL_TOPIC' => ($auth->acl_get('f_email', $forum_id) && $config['email_enable']) ? "memberlist.$phpEx$SID&mode=email&t=$topic_id" : '', 'U_WATCH_TOPIC' => $s_watching_topic['link'], 'L_WATCH_TOPIC' => $s_watching_topic['title'], + 'U_BOOKMARK_TOPIC' => ($user->data['user_id'] != ANONYMOUS && $config['allow_bookmarks']) ? $viewtopic_url . '&bookmark=1' : '', + 'L_BOOKMARK_TOPIC' => ($bookmarked) ? $user->lang['BOOKMARK_TOPIC_REMOVE'] : $user->lang['BOOKMARK_TOPIC'], + 'U_POST_NEW_TOPIC' => "posting.$phpEx$SID&mode=post&f=$forum_id", 'U_POST_REPLY_TOPIC' => "posting.$phpEx$SID&mode=reply&f=$forum_id&t=$topic_id", 'U_BUMP_TOPIC' => (bump_topic_allowed($forum_id, $topic_bumped, $topic_last_post_time, $topic_poster, $topic_last_poster_id)) ? "posting.$phpEx$SID&mode=bump&f=$forum_id&t=$topic_id" : '') @@ -602,9 +657,9 @@ if (!empty($poll_start)) 'S_CAN_VOTE' => $s_can_vote, 'S_DISPLAY_RESULTS' => $s_display_results, 'S_IS_MULTI_CHOICE' => ($poll_max_options > 1) ? true : false, - 'S_POLL_ACTION' => "viewtopic.$phpEx$SID&t=$topic_id&$u_sort_param", + 'S_POLL_ACTION' => $viewtopic_url, - 'U_VIEW_RESULTS' => "viewtopic.$phpEx$SID&t=$topic_id&$u_sort_param&view=viewpoll") + 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll') ); unset($poll_info); @@ -829,15 +884,23 @@ while ($row = $db->sql_fetchrow($result)) } else { - foreach ($ranks['normal'] as $rank) + if (sizeof($ranks['normal'])) { - if ($row['user_posts'] >= $rank['rank_min']) + foreach ($ranks['normal'] as $rank) { - $user_cache[$poster_id]['rank_title'] = $rank['rank_title']; - $user_cache[$poster_id]['rank_image'] = (!empty($rank['rank_image'])) ? ' ' : ''; - break; + if ($row['user_posts'] >= $rank['rank_min']) + { + $user_cache[$poster_id]['rank_title'] = $rank['rank_title']; + $user_cache[$poster_id]['rank_image'] = (!empty($rank['rank_image'])) ? ' ' : ''; + break; + } } } + else + { + $user_cache[$poster_id]['rank_title'] = ''; + $user_cache[$poster_id]['rank_image'] = ''; + } } if (!empty($row['user_allow_viewemail']) || $auth->acl_get('a_email')) @@ -1189,9 +1252,9 @@ for ($i = 0; $i < count($post_list); ++$i) 'U_RATE_GOOD' => "viewtopic.$phpEx$SID&rate=good&p=" . $row['post_id'], 'U_RATE_BAD' => "viewtopic.$phpEx$SID&rate=bad&p=" . $row['post_id'], 'U_REPORT' => "report.$phpEx$SID&p=" . $row['post_id'], - 'U_MCP_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', - 'U_MCP_APPROVE' => "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'], - 'U_MCP_DETAILS' => "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'], + 'U_MCP_REPORT' => ($auth->acl_gets('m_', 'a_', 'f_report', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', + 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "mcp.$phpEx$SID&i=queue&mode=approve&p=" . $row['post_id'] : '', + 'U_MCP_DETAILS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? "mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '', 'U_MINI_POST' => "viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'], 'U_POST_ID' => ($unread_post_id == $row['post_id']) ? 'unread' : $row['post_id'], 'POST_ID' => $row['post_id'], |