Browse Source

Merge branch 'release-2.1' of https://github.com/SimpleMachines/SMF2.1 into release-2.1

emanuele 12 years ago
parent
commit
fe6afb6484
40 changed files with 559 additions and 122 deletions
  1. 2 0
      .gitignore
  2. 2 2
      SSI.php
  3. 7 2
      Sources/Display.php
  4. 3 0
      Sources/ManagePermissions.php
  5. 1 0
      Sources/ManageSettings.php
  6. 17 17
      Sources/MessageIndex.php
  7. 4 4
      Sources/MoveTopic.php
  8. 62 0
      Sources/Notify.php
  9. 209 2
      Sources/Profile-View.php
  10. 1 0
      Sources/Profile.php
  11. 16 8
      Sources/Recent.php
  12. 2 2
      Sources/RemoveTopic.php
  13. 4 2
      Sources/Security.php
  14. 7 6
      Sources/SplitTopics.php
  15. 41 3
      Sources/Subs-Attachments.php
  16. 29 10
      Sources/Subs-Boards.php
  17. 3 6
      Sources/Subs.php
  18. 1 1
      Themes/default/Admin.template.php
  19. 8 11
      Themes/default/BoardIndex.template.php
  20. 11 11
      Themes/default/ManageBoards.template.php
  21. 2 2
      Themes/default/ManagePermissions.template.php
  22. 11 14
      Themes/default/MessageIndex.template.php
  23. 3 1
      Themes/default/Profile.template.php
  24. 15 6
      Themes/default/css/admin.css
  25. 26 3
      Themes/default/css/index.css
  26. 1 1
      Themes/default/index.template.php
  27. 1 2
      Themes/default/languages/Admin.english.php
  28. 1 0
      Themes/default/languages/ManageSettings.english.php
  29. 2 0
      Themes/default/languages/Profile.english.php
  30. 2 0
      Themes/default/languages/index.english.php
  31. 1 1
      Themes/default/scripts/topic.js
  32. 1 0
      index.php
  33. 1 1
      other/install.php
  34. 3 1
      other/install_2-1_mysql.sql
  35. 2 0
      other/install_2-1_postgresql.sql
  36. 2 0
      other/install_2-1_sqlite.sql
  37. 3 3
      other/upgrade.php
  38. 13 0
      other/upgrade_2-1_mysql.sql
  39. 16 0
      other/upgrade_2-1_postgresql.sql
  40. 23 0
      other/upgrade_2-1_sqlite.sql

+ 2 - 0
.gitignore

@@ -5,3 +5,5 @@ cache/data*.php
 Packages/backups/*
 Packages/temp
 *.*~
+
+.DS_Store

+ 2 - 2
SSI.php

@@ -1287,10 +1287,10 @@ function ssi_showPoll($topic = null, $output_method = 'echo')
 
 	$return = array(
 		'id' => $row['id_poll'],
-		'image' => empty($pollinfo['voting_locked']) ? 'poll' : 'locked_poll',
+		'image' => empty($row['voting_locked']) ? 'poll' : 'locked_poll',
 		'question' => $row['question'],
 		'total_votes' => $total,
-		'is_locked' => !empty($pollinfo['voting_locked']),
+		'is_locked' => !empty($row['voting_locked']),
 		'allow_vote' => $allow_vote,
 		'allow_view_results' => $allow_view_results,
 		'topic' => $topic

+ 7 - 2
Sources/Display.php

@@ -162,6 +162,7 @@ function Display()
 			' . ($user_info['is_guest'] ? 't.id_last_msg + 1' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from
 			' . (!empty($modSettings['recycle_board']) && $modSettings['recycle_board'] == $board ? ', id_previous_board, id_previous_topic' : '') . '
 			' . (!empty($topic_selects) ? implode(',', $topic_selects) : '') . '
+			' . (!$user_info['is_guest'] ? ', IFNULL(lt.disregarded, 0) as disregarded' : '') . '
 		FROM {db_prefix}topics AS t
 			INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)' . ($user_info['is_guest'] ? '' : '
 			LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = {int:current_topic} AND lt.id_member = {int:current_member})
@@ -171,6 +172,7 @@ function Display()
 		LIMIT 1',
 			$topic_parameters
 	);
+
 	if ($smcFunc['db_num_rows']($request) == 0)
 		fatal_lang_error('not_a_topic', false);
 	$topicinfo = $smcFunc['db_fetch_assoc']($request);
@@ -183,6 +185,7 @@ function Display()
 	$context['real_num_replies'] = $context['num_replies'] = $topicinfo['num_replies'];
 	$context['topic_first_message'] = $topicinfo['id_first_msg'];
 	$context['topic_last_message'] = $topicinfo['id_last_msg'];
+	$context['topic_disregarded'] = isset($topicinfo['disregarded']) ? $topicinfo['disregarded'] : 0;
 
 	// Add up unapproved replies to get real number of replies...
 	if ($modSettings['postmod_active'] && allowedTo('approve_posts'))
@@ -832,10 +835,10 @@ function Display()
 			$smcFunc['db_insert']($topicinfo['new_from'] == 0 ? 'ignore' : 'replace',
 				'{db_prefix}log_topics',
 				array(
-					'id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int',
+					'id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'disregarded' => 'int',
 				),
 				array(
-					$user_info['id'], $topic, $mark_at_msg,
+					$user_info['id'], $topic, $mark_at_msg, $topicinfo['disregarded'],
 				),
 				array('id_member', 'id_topic')
 			);
@@ -1070,6 +1073,7 @@ function Display()
 	$context['can_reply'] |= $context['can_reply_unapproved'];
 	$context['can_quote'] = $context['can_reply'] && (empty($modSettings['disabledBBC']) || !in_array('quote', explode(',', $modSettings['disabledBBC'])));
 	$context['can_mark_unread'] = !$user_info['is_guest'] && $settings['show_mark_read'];
+	$context['can_disregard'] = !$user_info['is_guest'] && $modSettings['enable_disregard'];
 
 	$context['can_send_topic'] = (!$modSettings['postmod_active'] || $topicinfo['approved']) && allowedTo('send_topic');
 	$context['can_print'] = empty($modSettings['disable_print_topic']);
@@ -1140,6 +1144,7 @@ function Display()
 		'add_poll' => array('test' => 'can_add_poll', 'text' => 'add_poll', 'image' => 'add_poll.png', 'lang' => true, 'url' => $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start']),
 		'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : '') . 'notify.png', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');"', 'url' => $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
 		'mark_unread' => array('test' => 'can_mark_unread', 'text' => 'mark_unread', 'image' => 'markunread.png', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
+		'disregard' => array('test' => 'can_disregard', 'text' => ($context['topic_disregarded'] ? 'un' : '') . 'disregard', 'image' => ($context['topic_disregarded'] ? 'un' : '') . 'disregard.png', 'lang' => true, 'url' => $scripturl . '?action=disregardtopic;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sa=' . ($context['topic_disregarded'] ? 'off' : 'on') . ';' . $context['session_var'] . '=' . $context['session_id']),
 		'send' => array('test' => 'can_send_topic', 'text' => 'send_topic', 'image' => 'sendtopic.png', 'lang' => true, 'url' => $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0'),
 		'print' => array('test' => 'can_print', 'text' => 'print', 'image' => 'print.png', 'lang' => true, 'custom' => 'rel="new_win nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0'),
 	);

+ 3 - 0
Sources/ManagePermissions.php

@@ -123,6 +123,7 @@ function PermissionIndex()
 			'can_search' => false,
 			'href' => '',
 			'link' => '',
+			'help' => 'membergroup_guests',
 			'is_post_group' => false,
 			'color' => '',
 			'icons' => '',
@@ -142,6 +143,7 @@ function PermissionIndex()
 			'allow_modify' => true,
 			'can_search' => false,
 			'href' => $scripturl . '?action=moderate;area=viewgroups;sa=members;group=0',
+			'help' => 'membergroup_regular_members',
 			'is_post_group' => false,
 			'color' => '',
 			'icons' => '',
@@ -188,6 +190,7 @@ function PermissionIndex()
 			'allow_modify' => $row['id_group'] > 1,
 			'can_search' => $row['id_group'] != 3,
 			'href' => $scripturl . '?action=moderate;area=viewgroups;sa=members;group=' . $row['id_group'],
+			'help' => $row['id_group'] == 1 ? 'membergroup_administrator' : ($row['id_group'] == 3 ? 'membergroup_moderator' : ''),
 			'is_post_group' => $row['min_posts'] != -1,
 			'color' => empty($row['online_color']) ? '' : $row['online_color'],
 			'icons' => !empty($row['icons'][0]) && !empty($row['icons'][1]) ? str_repeat('<img src="' . $settings['images_url'] . '/' . $row['icons'][1] . '" alt="*" />', $row['icons'][0]) : '',

+ 1 - 0
Sources/ManageSettings.php

@@ -498,6 +498,7 @@ function ModifyBasicSettings($return_config = false)
 			// Basic stuff, titles, flash, permissions...
 			array('check', 'allow_guestAccess'),
 			array('check', 'enable_buddylist'),
+			array('check', 'enable_disregard'),
 			array('check', 'allow_editDisplayName'),
 			array('check', 'allow_hideOnline'),
 			array('check', 'titlesEnable'),

+ 17 - 17
Sources/MessageIndex.php

@@ -635,21 +635,6 @@ function MessageIndex()
 			$context['can_remove'] |= ($started && allowedTo('remove_own'));
 		}
 
-		// Find the boards/cateogories they can move their topic to.
-		if ($options['display_quick_mod'] == 1 && $context['can_move'] && !empty($context['topics']))
-		{
-			require_once($sourcedir . '/Subs-MessageIndex.php');
-			$boardListOptions = array(
-				'excluded_boards' => array($board),
-				'not_redirection' => true,
-				'use_permissions' => true,
-				'selected_board' => empty($_SESSION['move_to_topic']) ? null : $_SESSION['move_to_topic'],
-			);
-
-			// With no other boards to see, it's useless to move.
-			if (empty($context['move_to_boards']))
-				$context['can_move'] = false;
-		}
 		// Can we use quick moderation checkboxes?
 		if ($options['display_quick_mod'] == 1)
 			$context['can_quick_mod'] = $context['user']['is_logged'] || $context['can_approve'] || $context['can_remove'] || $context['can_lock'] || $context['can_sticky'] || $context['can_move'] || $context['can_merge'] || $context['can_restore'];
@@ -1163,13 +1148,28 @@ function QuickModeration()
 
 	if (!empty($markCache))
 	{
+		$smcFunc['db_query']('', '
+			SELECT id_topic, disregarded
+			FROM {db_prefix}log_topics
+			WHERE id_topic IN ({array_int:selected_topics}
+				AND id_member = {int:current_user}',
+			array(
+				'selected_topics' => $markCache,
+				'current_user' => $user_info['id'],
+			)
+		);
+		$logged_topics = array();
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$logged_topics[$row['id_topic']] = $row['disregarded'];
+		$smcFunc['db_free_result']($request);
+
 		$markArray = array();
 		foreach ($markCache as $topic)
-			$markArray[] = array($modSettings['maxMsgID'], $user_info['id'], $topic);
+			$markArray[] = array($modSettings['maxMsgID'], $user_info['id'], $topic, (isset($logged_topics[$topic]) ? $logged_topics[$topic] : 0));
 
 		$smcFunc['db_insert']('replace',
 			'{db_prefix}log_topics',
-			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int'),
+			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int', 'disregarded' => 'int'),
 			$markArray,
 			array('id_member', 'id_topic')
 		);

+ 4 - 4
Sources/MoveTopic.php

@@ -456,7 +456,7 @@ function moveTopics($topics, $toBoard)
 	// Move over the mark_read data. (because it may be read and now not by some!)
 	$SaveAServer = max(0, $modSettings['maxMsgID'] - 50000);
 	$request = $smcFunc['db_query']('', '
-		SELECT lmr.id_member, lmr.id_msg, t.id_topic
+		SELECT lmr.id_member, lmr.id_msg, t.id_topic, lt.disregarded
 		FROM {db_prefix}topics AS t
 			INNER JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board
 				AND lmr.id_msg > t.id_first_msg AND lmr.id_msg > {int:protect_lmr_msg})
@@ -471,14 +471,14 @@ function moveTopics($topics, $toBoard)
 	$log_topics = array();
 	while ($row = $smcFunc['db_fetch_assoc']($request))
 	{
-		$log_topics[] = array($row['id_topic'], $row['id_member'], $row['id_msg']);
+		$log_topics[] = array($row['id_topic'], $row['id_member'], $row['id_msg'], $row['disregarded']);
 
 		// Prevent queries from getting too big. Taking some steam off.
 		if (count($log_topics) > 500)
 		{
 			$smcFunc['db_insert']('replace',
 				'{db_prefix}log_topics',
-				array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int'),
+				array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int', 'disregarded' => 'int'),
 				$log_topics,
 				array('id_topic', 'id_member')
 			);
@@ -494,7 +494,7 @@ function moveTopics($topics, $toBoard)
 		// Insert that information into the database!
 		$smcFunc['db_insert']('replace',
 			'{db_prefix}log_topics',
-			array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int'),
+			array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int', 'disregarded' => 'int'),
 			$log_topics,
 			array('id_topic', 'id_member')
 		);

+ 62 - 0
Sources/Notify.php

@@ -184,4 +184,66 @@ function BoardNotify()
 	redirectexit('board=' . $board . '.' . $_REQUEST['start']);
 }
 
+/**
+ * Turn off/on unread replies subscription for a topic
+ * Must be called with a topic specified in the URL.
+ * The sub-action can be 'on', 'off', or nothing for what to do.
+ * Requires the mark_any_notify permission.
+ * Upon successful completion of action will direct user back to topic.
+ * Accessed via ?action=disregardtopic.
+ */
+function TopicDisregard()
+{
+	global $smcFunc, $user_info, $topic, $modSettings;
+
+	// Let's do something only if the function is enabled
+	if (!$user_info['is_guest'] && $modSettings['enable_disregard'])
+	{
+		checkSession('get');
+
+		if (isset($_GET['sa']))
+		{
+			$request = $smcFunc['db_query']('', '
+				SELECT id_member, id_topic, id_msg, disregarded
+				FROM {db_prefix}log_topics
+				WHERE id_member = {int:current_user}
+					AND id_topic = {int:current_topic}',
+				array(
+					'current_user' => $user_info['id'],
+					'current_topic' => $topic,
+				)
+			);
+			$log = $smcFunc['db_fetch_assoc']($request);
+			$smcFunc['db_free_result']($request);
+			if (empty($log))
+			{
+				$insert = true;
+				$log['disregarded'] = $_GET['sa'] == 'on' ? 1 : 0;
+			}
+			else
+			{
+				$insert = false;
+				$log = array(
+					'id_member' => $user_info['id'],
+					'id_topic' => $topic,
+					'id_msg' => 0,
+					'disregarded' => $_GET['sa'] == 'on' ? 1 : 0,
+				);
+			}
+
+			$smcFunc['db_insert']($insert ? 'insert' : 'replace',
+				'{db_prefix}log_topics',
+				array(
+					'id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'disregarded' => 'int',
+				),
+				$log,
+				array('id_member', 'id_topic')
+			);
+		}
+	}
+
+	// Back to the topic.
+	redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
+}
+
 ?>

+ 209 - 2
Sources/Profile-View.php

@@ -206,6 +206,8 @@ function showPosts($memID)
 			),
 			'topics' => array(
 			),
+			'disregardedtopics' => array(
+			),
 			'attach' => array(
 			),
 		),
@@ -221,6 +223,9 @@ function showPosts($memID)
 	// If we're specifically dealing with attachments use that function!
 	if (isset($_GET['sa']) && $_GET['sa'] == 'attach')
 		return showAttachments($memID);
+	// Instead, if we're dealing with disregarded topics (and the feature is enabled) use that other function.
+	elseif (isset($_GET['sa']) && $_GET['sa'] == 'disregardedtopics' && $modSettings['enable_disregard'])
+		return showDisregarded($memID);
 
 	// Are we just viewing topics?
 	$context['is_topics'] = isset($_GET['sa']) && $_GET['sa'] == 'topics' ? true : false;
@@ -527,13 +532,13 @@ function showAttachments($memID)
 
 	require_once($sourcedir . '/Subs-List.php');
 
-	// This is all the information required for a group listing.
+	// This is all the information required to list attachments.
 	$listOptions = array(
 		'id' => 'attachments',
 		'width' => '100%',
 		'items_per_page' => $modSettings['defaultMaxMessages'],
 		'no_items_label' => $txt['show_attachments_none'],
-		'base_href' => $scripturl . '?action=profile;area=showposts;sa=attach;sort=filename;u=' . $memID,
+		'base_href' => $scripturl . '?action=profile;area=showposts;sa=attach;u=' . $memID,
 		'default_sort_col' => 'filename',
 		'get_items' => array(
 			'function' => 'list_getAttachments',
@@ -718,6 +723,208 @@ function list_getNumAttachments($boardsAllowed, $memID)
 	return $attachCount;
 }
 
+/**
+ * Show all the disregarded topics.
+ *
+ * @param int $memID id_member
+ */
+function showDisregarded($memID)
+{
+	global $txt, $user_info, $scripturl, $modSettings, $board, $context, $sourcedir, $smcFunc;
+
+	// Only the owner can see the list (if the function is enabled of course)
+	if ($user_info['id'] != $memID || !$modSettings['enable_disregard'])
+		return;
+
+	require_once($sourcedir . '/Subs-List.php');
+
+	// And here they are: the topics you don't like
+	$listOptions = array(
+		'id' => 'disregarded_topics',
+		'width' => '100%',
+		'items_per_page' => $modSettings['defaultMaxMessages'],
+		'no_items_label' => $txt['disregarded_topics_none'],
+		'base_href' => $scripturl . '?action=profile;area=showposts;sa=disregardedtopics;u=' . $memID,
+		'default_sort_col' => 'started_on',
+		'get_items' => array(
+			'function' => 'list_getDisregarded',
+			'params' => array(
+				$memID,
+			),
+		),
+		'get_count' => array(
+			'function' => 'list_getNumDisregarded',
+			'params' => array(
+				$memID,
+			),
+		),
+		'columns' => array(
+			'subject' => array(
+				'header' => array(
+					'value' => $txt['subject'],
+					'class' => 'lefttext',
+					'style' => 'width: 30%;',
+				),
+				'data' => array(
+					'sprintf' => array(
+						'format' => '<a href="' . $scripturl . '?topic=%1$d.0">%2$s</a>',
+						'params' => array(
+							'id_topic' => false,
+							'subject' => false,
+						),
+					),
+				),
+				'sort' => array(
+					'default' => 'm.subject',
+					'reverse' => 'm.subject DESC',
+				),
+			),
+			'started_by' => array(
+				'header' => array(
+					'value' => $txt['started_by'],
+					'style' => 'width: 15%;',
+				),
+				'data' => array(
+					'db' => 'started_by',
+				),
+				'sort' => array(
+					'default' => 'mem.real_name',
+					'reverse' => 'mem.real_name DESC',
+				),
+			),
+			'started_on' => array(
+				'header' => array(
+					'value' => $txt['on'],
+					'class' => 'lefttext',
+					'style' => 'width: 20%;',
+				),
+				'data' => array(
+					'db' => 'started_on',
+					'timeformat' => true,
+				),
+				'sort' => array(
+					'default' => 'm.poster_time',
+					'reverse' => 'm.poster_time DESC',
+				),
+			),
+			'last_post_by' => array(
+				'header' => array(
+					'value' => $txt['last_post'],
+					'style' => 'width: 15%;',
+				),
+				'data' => array(
+					'db' => 'last_post_by',
+				),
+				'sort' => array(
+					'default' => 'mem.real_name',
+					'reverse' => 'mem.real_name DESC',
+				),
+			),
+			'last_post_on' => array(
+				'header' => array(
+					'value' => $txt['on'],
+					'class' => 'lefttext',
+					'style' => 'width: 20%;',
+				),
+				'data' => array(
+					'db' => 'last_post_on',
+					'timeformat' => true,
+				),
+				'sort' => array(
+					'default' => 'm.poster_time',
+					'reverse' => 'm.poster_time DESC',
+				),
+			),
+		),
+	);
+
+	// Create the request list.
+	createList($listOptions);
+
+	$context['sub_template'] = 'show_list';
+	$context['default_list'] = 'disregarded_topics';
+}
+
+/**
+ * Get the relevant topics in the disregarded list
+ */
+function list_getDisregarded($start, $items_per_page, $sort, $memID)
+{
+	global $smcFunc, $board, $modSettings, $context;
+
+	// Get the list of topics we can see
+	$request = $smcFunc['db_query']('', '
+		SELECT lt.id_topic
+		FROM {db_prefix}log_topics as lt
+			LEFT JOIN {db_prefix}topics as t ON (lt.id_topic = t.id_topic)
+			LEFT JOIN {db_prefix}boards as b ON (t.id_board = b.id_board)
+			LEFT JOIN {db_prefix}messages as m ON (t.id_first_msg = m.id_msg)' . (in_array($sort, array('mem.real_name', 'mem.real_name DESC', 'mem.poster_time', 'mem.poster_time DESC')) ? '
+			LEFT JOIN {db_prefix}members as mem ON (m.id_member = mem.id_member)' : '') . '
+		WHERE lt.id_member = {int:current_member}
+			AND disregarded = 1
+			AND {query_see_board}
+		ORDER BY {raw:sort}
+		LIMIT {int:offset}, {int:limit}',
+		array(
+			'current_member' => $memID,
+			'sort' => $sort,
+			'offset' => $start,
+			'limit' => $items_per_page,
+		)
+	);
+
+	$topics = array();
+	while ($row = $smcFunc['db_fetch_assoc']($request))
+		$topics[] = $row['id_topic'];
+
+	$smcFunc['db_free_result']($request);
+
+	$request = $smcFunc['db_query']('', '
+		SELECT mf.subject, mf.poster_time as started_on, IFNULL(memf.real_name, mf.poster_name) as started_by, ml.poster_time as last_post_on, IFNULL(meml.real_name, ml.poster_name) as last_post_by, t.id_topic
+		FROM {db_prefix}topics AS t
+			INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
+			INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
+			LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)
+			LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)
+		WHERE t.id_topic IN ({array_int:topics})',
+		array(
+			'topics' => $topics,
+		)
+	);
+	$topicsInfo = array();
+	while ($row = $smcFunc['db_fetch_assoc']($request))
+		$topicsInfo[] = $row;
+	$smcFunc['db_free_result']($request);
+
+	return $topicsInfo;
+}
+
+/**
+ * Count the topics in the disregarded list
+ */
+function list_getNumDisregarded($memID)
+{
+	global $smcFunc, $user_info;
+
+	// Get the total number of attachments they have posted.
+	$request = $smcFunc['db_query']('', '
+		SELECT COUNT(*)
+		FROM {db_prefix}log_topics as lt
+		LEFT JOIN {db_prefix}topics as t ON (lt.id_topic = t.id_topic)
+		LEFT JOIN {db_prefix}boards as b ON (t.id_board = b.id_board)
+		WHERE id_member = {int:current_member}
+			AND disregarded = 1
+			AND {query_see_board}',
+		array(
+			'current_member' => $memID,
+		)
+	);
+	list ($disregardedCount) = $smcFunc['db_fetch_row']($request);
+	$smcFunc['db_free_result']($request);
+
+	return $disregardedCount;
+}
+
 /**
  * Gets the user stats for display
  *

+ 1 - 0
Sources/Profile.php

@@ -109,6 +109,7 @@ function ModifyProfile($post_errors = array())
 					'subsections' => array(
 						'messages' => array($txt['showMessages'], array('profile_view_own', 'profile_view_any')),
 						'topics' => array($txt['showTopics'], array('profile_view_own', 'profile_view_any')),
+						'disregardedtopics' => array($txt['showDisregarded'], array('profile_view_own', 'profile_view_any'), 'enabled' => $modSettings['enable_disregard'] && $context['user']['is_owner']),
 						'attach' => array($txt['showAttachments'], array('profile_view_own', 'profile_view_any')),
 					),
 					'permission' => array(

+ 16 - 8
Sources/Recent.php

@@ -758,7 +758,8 @@ function UnreadTopics()
 			WHERE lt.id_member = {int:current_member}
 				AND t.' . $query_this_board . (empty($earliest_msg) ? '' : '
 				AND t.id_last_msg > {int:earliest_msg}') . ($modSettings['postmod_active'] ? '
-				AND t.approved = {int:is_approved}' : ''),
+				AND t.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : ''),
 			array_merge($query_parameters, array(
 				'current_member' => $user_info['id'],
 				'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
@@ -780,7 +781,8 @@ function UnreadTopics()
 			WHERE t.' . $query_this_board . (!empty($earliest_msg) ? '
 				AND t.id_last_msg > {int:earliest_msg}' : '') . '
 				AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
-				AND t.approved = {int:is_approved}' : ''),
+				AND t.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : ''),
 			array_merge($query_parameters, array(
 				'current_member' => $user_info['id'],
 				'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
@@ -835,7 +837,8 @@ function UnreadTopics()
 			WHERE b.' . $query_this_board . '
 				AND t.id_last_msg >= {int:min_message}
 				AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
-				AND ms.approved = {int:is_approved}' : '') . '
+				AND ms.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : '') . '
 			ORDER BY {raw:sort}
 			LIMIT {int:offset}, {int:limit}',
 			array_merge($query_parameters, array(
@@ -860,7 +863,8 @@ function UnreadTopics()
 				AND t.id_last_msg > {int:earliest_msg}' : (!$context['showing_all_topics'] && empty($_SESSION['first_login']) ? '
 				AND t.id_last_msg > {int:id_msg_last_visit}' : '')) . '
 				AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
-				AND t.approved = {int:is_approved}' : ''),
+				AND t.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : ''),
 			array_merge($query_parameters, array(
 				'current_member' => $user_info['id'],
 				'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
@@ -921,7 +925,8 @@ function UnreadTopics()
 			WHERE t.' . $query_this_board . '
 				AND t.id_last_msg >= {int:min_message}
 				AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < ml.id_msg' . ($modSettings['postmod_active'] ? '
-				AND ms.approved = {int:is_approved}' : '') . '
+				AND ms.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : '') . '
 			ORDER BY {raw:order}
 			LIMIT {int:offset}, {int:limit}',
 			array_merge($query_parameters, array(
@@ -973,7 +978,8 @@ function UnreadTopics()
 					LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})' . (isset($sortKey_joins[$_REQUEST['sort']]) ? $sortKey_joins[$_REQUEST['sort']] : '') . '
 				WHERE m.id_member = {int:current_member}' . (!empty($board) ? '
 					AND t.id_board = {int:current_board}' : '') . ($modSettings['postmod_active'] ? '
-					AND t.approved = {int:is_approved}' : '') . '
+					AND t.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+				AND lt.disregarded != 1' : '') . '
 				GROUP BY m.id_topic',
 				array(
 					'current_board' => $board,
@@ -1026,7 +1032,8 @@ function UnreadTopics()
 				WHERE t.' . $query_this_board . '
 					AND m.id_member = {int:current_member}
 					AND IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
-					AND t.approved = {int:is_approved}' : ''),
+					AND t.approved = {int:is_approved}' : '') . ($modSettings['enable_disregard'] ? '
+					AND lt.disregarded != 1' : ''),
 				array_merge($query_parameters, array(
 					'current_member' => $user_info['id'],
 					'is_approved' => 1,
@@ -1089,7 +1096,8 @@ function UnreadTopics()
 				WHERE t.' . $query_this_board . '
 					AND t.id_last_msg >= {int:min_message}
 					AND (IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0))) < t.id_last_msg
-					AND t.approved = {int:is_approved}
+					AND t.approved = {int:is_approved}' . ($modSettings['enable_disregard'] ? '
+					AND lt.disregarded != 1' : '') . '
 				ORDER BY {raw:order}
 				LIMIT {int:offset}, {int:limit}',
 				array_merge($query_parameters, array(

+ 2 - 2
Sources/RemoveTopic.php

@@ -858,8 +858,8 @@ function removeMessage($message, $decreasePostCount = true)
 			if (!$user_info['is_guest'])
 				$smcFunc['db_insert']('replace',
 					'{db_prefix}log_topics',
-					array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int'),
-					array($topicID, $user_info['id'], $modSettings['maxMsgID']),
+					array('id_topic' => 'int', 'id_member' => 'int', 'id_msg' => 'int', 'disregarded' => 'int'),
+					array($topicID, $user_info['id'], $modSettings['maxMsgID'], 0),
 					array('id_topic', 'id_member')
 				);
 

+ 4 - 2
Sources/Security.php

@@ -106,7 +106,7 @@ function is_not_guest($message = '')
 	global $user_info, $txt, $context, $scripturl;
 
 	// Luckily, this person isn't a guest.
-	if (!$user_info['is_guest'])
+	if (isset($user_info['is_guest']) && !$user_info['is_guest'])
 		return;
 
 	// People always worry when they see people doing things they aren't actually doing...
@@ -1254,7 +1254,9 @@ RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml';
 		if ($fh) {
 			fwrite($fh, '<?php
 
-// This file is here solely to protect your ' . $directoryname . ' directory.
+/**
+ * This file is here solely to protect your ' . $directoryname . ' directory.
+ */
 
 // Look for Settings.php....
 if (file_exists(dirname(dirname(__FILE__)) . \'/Settings.php\'))

+ 7 - 6
Sources/SplitTopics.php

@@ -753,7 +753,7 @@ function splitTopic($split1_ID_TOPIC, $splitMessages, $new_subject)
 	// Copy log topic entries.
 	// @todo This should really be chunked.
 	$request = $smcFunc['db_query']('', '
-		SELECT id_member, id_msg
+		SELECT id_member, id_msg, disregarded
 		FROM {db_prefix}log_topics
 		WHERE id_topic = {int:id_topic}',
 		array(
@@ -764,11 +764,11 @@ function splitTopic($split1_ID_TOPIC, $splitMessages, $new_subject)
 	{
 		$replaceEntries = array();
 		while ($row = $smcFunc['db_fetch_assoc']($request))
-			$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg']);
+			$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg'], $row['disregarded']);
 
 		$smcFunc['db_insert']('ignore',
 			'{db_prefix}log_topics',
-			array('id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int'),
+			array('id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'disregarded' => 'int'),
 			$replaceEntries,
 			array('id_member', 'id_topic')
 		);
@@ -1432,8 +1432,9 @@ function MergeExecute($topics = array())
 	);
 
 	// Merge log topic entries.
+	// The disregard setting comes from the oldest topic
 	$request = $smcFunc['db_query']('', '
-		SELECT id_member, MIN(id_msg) AS new_id_msg
+		SELECT id_member, MIN(id_msg) AS new_id_msg, disregarded
 		FROM {db_prefix}log_topics
 		WHERE id_topic IN ({array_int:topics})
 		GROUP BY id_member',
@@ -1445,11 +1446,11 @@ function MergeExecute($topics = array())
 	{
 		$replaceEntries = array();
 		while ($row = $smcFunc['db_fetch_assoc']($request))
-			$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg']);
+			$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg'], $row['disregarded']);
 
 		$smcFunc['db_insert']('replace',
 			'{db_prefix}log_topics',
-			array('id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int'),
+			array('id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'disregarded' => 'int'),
 			$replaceEntries,
 			array('id_member', 'id_topic')
 		);

+ 41 - 3
Sources/Subs-Attachments.php

@@ -18,6 +18,12 @@
 if (!defined('SMF'))
 	die('Hacking attempt...');
 
+/**
+ * Check if the current directory is still valid or not.
+ * If not creates the new directory
+ *
+ * @return (bool) false if any error occurred
+ */
 function automanage_attachments_check_directory()
 {
 	global $boarddir, $modSettings, $context;
@@ -113,6 +119,13 @@ function automanage_attachments_check_directory()
 	return $outputCreation;
 }
 
+/**
+ * Creates a directory
+ *
+ * @param $updir: the directory to be created
+ *
+ * @return (bool) false on errors
+ */
 function automanage_attachments_create_directory($updir)
 {
 	global $modSettings, $initial_error, $context, $boarddir;
@@ -149,6 +162,7 @@ function automanage_attachments_create_directory($updir)
 		$count--;
 	}
 
+	// @todo: chmod (especially with some servers) is usually bad
 	if (!is_writable($directory))
 	{
 		chmod($directory, 0755);
@@ -177,7 +191,7 @@ function automanage_attachments_create_directory($updir)
 	// Only update if it's a new directory
 	if (!in_array($updir, $modSettings['attachmentUploadDir']))
 	{
-		$modSettings['currentAttachmentUploadDir'] = max(array_keys($modSettings['attachmentUploadDir'])) +1;
+		$modSettings['currentAttachmentUploadDir'] = max(array_keys($modSettings['attachmentUploadDir'])) + 1;
 		$modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']] = $updir;
 
 		updateSettings(array(
@@ -191,6 +205,12 @@ function automanage_attachments_create_directory($updir)
 	return true;
 }
 
+/**
+ * Called when a directory space limit is reached.
+ * Creates a new directory and increments the directory suffix number.
+ *
+ * @return (bool) false on erros
+ */
 function automanage_attachments_by_space()
 {
 	global $modSettings, $boarddir, $context;
@@ -198,7 +218,7 @@ function automanage_attachments_by_space()
 	if (!isset($modSettings['automanage_attachments']) || (!empty($modSettings['automanage_attachments']) && $modSettings['automanage_attachments'] != 1))
 		return;
 
-	$basedirectory = (!empty($modSettings['use_subdirectories_for_attachments']) ? ($modSettings['basedirectory_for_attachments']) : $boarddir);
+	$basedirectory = !empty($modSettings['use_subdirectories_for_attachments']) ? $modSettings['basedirectory_for_attachments'] : $boarddir;
 	//Just to be sure: I don't want directory separators at the end
 	$sep = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '\/' : DIRECTORY_SEPARATOR;
 	$basedirectory = rtrim($basedirectory, $sep);
@@ -234,6 +254,13 @@ function automanage_attachments_by_space()
 		return false;
 }
 
+/**
+ * Split a path into a list of all directories and subdirectories
+ *
+ * @param $directory a path
+ *
+ * @return (mixed) an array of all the directories and subdirectories or false on failure
+ */
 function get_directory_tree_elements ($directory)
 {
 	/*
@@ -247,7 +274,7 @@ function get_directory_tree_elements ($directory)
 		$tree = preg_split('#[\\\/]#', $directory);
 	else
 	{
-		if (substr($directory, 0, 1)!=DIRECTORY_SEPARATOR)
+		if (substr($directory, 0, 1) != DIRECTORY_SEPARATOR)
 			return false;
 
 		$tree = explode(DIRECTORY_SEPARATOR, trim($directory,DIRECTORY_SEPARATOR));
@@ -255,6 +282,14 @@ function get_directory_tree_elements ($directory)
 	return $tree;
 }
 
+/**
+ * Return the first part of a path (i.e. c:\ or / + the first directory), used by automanage_attachments_create_directory
+ *
+ * @param $tree an array 
+ * @param $count the number of elements in $tree
+ *
+ * @return (string)
+ */
 function attachments_init_dir (&$tree, &$count)
 {
 	$directory = '';
@@ -274,6 +309,9 @@ function attachments_init_dir (&$tree, &$count)
 	return $directory;
 }
 
+/**
+ * Moves an attachment to the proper directory and set the relevant data into $_SESSION['temp_attachments']
+ */
 function processAttachments()
 {
 	global $context, $modSettings, $smcFunc, $txt, $user_info;

+ 29 - 10
Sources/Subs-Boards.php

@@ -109,7 +109,8 @@ function markBoardsRead($boards, $unread = false)
 			INNER JOIN {db_prefix}topics AS t /*!40000 USE INDEX (PRIMARY) */ ON (t.id_topic = lt.id_topic
 				AND t.id_board IN ({array_int:board_list}))
 		WHERE lt.id_member = {int:current_member}
-			AND lt.id_topic >= {int:lowest_topic}',
+			AND lt.id_topic >= {int:lowest_topic}
+			AND lt.disregarded != 1',
 		array(
 			'current_member' => $user_info['id'],
 			'board_list' => $boards,
@@ -175,15 +176,30 @@ function MarkRead()
 	elseif (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'unreadreplies')
 	{
 		// Make sure all the boards are integers!
-		$topics = explode('-', $_REQUEST['topics']);
+		$topics = array_map('intval', explode('-', $_REQUEST['topics']));
+
+		$smcFunc['db_query']('', '
+			SELECT id_topic, disregarded
+			FROM {db_prefix}log_topics
+			WHERE id_topic IN ({array_int:selected_topics}
+				AND id_member = {int:current_user}',
+			array(
+				'selected_topics' => $topics,
+				'current_user' => $user_info['id'],
+			)
+		);
+		$logged_topics = array();
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+			$logged_topics[$row['id_topic']] = $row['disregarded'];
+		$smcFunc['db_free_result']($request);
 
 		$markRead = array();
 		foreach ($topics as $id_topic)
-			$markRead[] = array($modSettings['maxMsgID'], $user_info['id'], (int) $id_topic);
+			$markRead[] = array($modSettings['maxMsgID'], $user_info['id'], $id_topic, (isset($logged_topics[$topic]) ? $logged_topics[$topic] : 0));
 
 		$smcFunc['db_insert']('replace',
 			'{db_prefix}log_topics',
-			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int'),
+			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int', 'disregarded' => 'int'),
 			$markRead,
 			array('id_member', 'id_topic')
 		);
@@ -199,11 +215,13 @@ function MarkRead()
 	{
 		// First, let's figure out what the latest message is.
 		$result = $smcFunc['db_query']('', '
-			SELECT id_first_msg, id_last_msg
-			FROM {db_prefix}topics
-			WHERE id_topic = {int:current_topic}',
+			SELECT t.id_first_msg, t.id_last_msg, IFNULL(lt.disregarded, 0) as disregarded
+			FROM {db_prefix}topics as t
+			LEFT JOIN {db_prefix}log_topics as lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
+			WHERE t.id_topic = {int:current_topic}',
 			array(
 				'current_topic' => $topic,
+				'current_member' => $user_info['id'],
 			)
 		);
 		$topicinfo = $smcFunc['db_fetch_assoc']($result);
@@ -246,9 +264,10 @@ function MarkRead()
 				FROM {db_prefix}messages
 				WHERE id_topic = {int:current_topic}
 				ORDER BY id_msg
-				LIMIT ' . (int) $_REQUEST['start'] . ', 1',
+				LIMIT {int:start}, 1',
 				array(
 					'current_topic' => $topic,
+					'start' => (int) $_REQUEST['start'],
 				)
 			);
 			list ($earlyMsg) = $smcFunc['db_fetch_row']($result);
@@ -260,8 +279,8 @@ function MarkRead()
 		// Blam, unread!
 		$smcFunc['db_insert']('replace',
 			'{db_prefix}log_topics',
-			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int'),
-			array($earlyMsg, $user_info['id'], $topic),
+			array('id_msg' => 'int', 'id_member' => 'int', 'id_topic' => 'int', 'disregarded' => 'int'),
+			array($earlyMsg, $user_info['id'], $topic, $topicinfo['disregarded']),
 			array('id_member', 'id_topic')
 		);
 

+ 3 - 6
Sources/Subs.php

@@ -2810,8 +2810,7 @@ function setupThemeContext($forceload = false)
 	$context['show_quick_login'] = !empty($modSettings['enableVBStyleLogin']) && $user_info['is_guest'];
 
 	// Get some news...
-	$context['news_lines'] = explode("\n", str_replace("\r", '', trim(addslashes($modSettings['news']))));
-	$context['fader_news_lines'] = array();
+	$context['news_lines'] = array_filter(explode("\n", str_replace("\r", '', trim(addslashes($modSettings['news'])))));
 	for ($i = 0, $n = count($context['news_lines']); $i < $n; $i++)
 	{
 		if (trim($context['news_lines'][$i]) == '')
@@ -2819,11 +2818,9 @@ function setupThemeContext($forceload = false)
 
 		// Clean it up for presentation ;).
 		$context['news_lines'][$i] = parse_bbc(stripslashes(trim($context['news_lines'][$i])), true, 'news' . $i);
-
-		// Gotta be special for the javascript.
-		$context['fader_news_lines'][$i] = strtr(addslashes($context['news_lines'][$i]), array('/' => '\/', '<a href=' => '<a hre" + "f='));
 	}
-	$context['random_news_line'] = $context['news_lines'][mt_rand(0, count($context['news_lines']) - 1)];
+	if (!empty($context['news_lines']))
+		$context['random_news_line'] = $context['news_lines'][mt_rand(0, count($context['news_lines']) - 1)];
 
 	if (!$user_info['is_guest'])
 	{

+ 1 - 1
Themes/default/Admin.template.php

@@ -41,7 +41,7 @@ function template_admin()
 	echo $txt['admin_center'], '
 			</h3>
 		</div>
-		<div class="roundframe">
+		<div class="roundframe rfix">
 			<div id="welcome">
 				<strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
 				', sprintf($txt['admin_main_welcome'], $txt['admin_center'], $txt['help'], $txt['help']), '

+ 8 - 11
Themes/default/BoardIndex.template.php

@@ -23,23 +23,20 @@ function template_main()
 	</div>';
 
 	// Show the news fader?  (assuming there are things to show...)
-	if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
+	if ($settings['show_newsfader'] && !empty($context['news_lines']))
 	{
 		echo '
 	<div id="newsfader">
 		<div class="cat_bar">
 			<h3 class="catbg">
-				<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
+				<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['hide'], '" align="bottom" style="display: none;" />
 				', $txt['news'], '
 			</h3>
 		</div>
-		<ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>';
-
-			foreach ($context['news_lines'] as $news)
-				echo '
-			<li>', $news, '</li>';
-
-	echo '
+		<ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>
+			<li>
+				', implode('</li><li>', $context['news_lines']), '
+			</li>
 		</ul>
 	</div>
 	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script>
@@ -63,9 +60,9 @@ function template_main()
 				{
 					sId: \'newsupshrink\',
 					srcExpanded: smf_images_url + \'/collapse.png\',
-					altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
+					altExpanded: ', JavaScriptEscape($txt['hide']), ',
 					srcCollapsed: smf_images_url + \'/expand.png\',
-					altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
+					altCollapsed: ', JavaScriptEscape($txt['show']), '
 				}
 			],
 			oThemeOptions: {

+ 11 - 11
Themes/default/ManageBoards.template.php

@@ -44,7 +44,7 @@ function template_main()
 		echo '
 			<div class="cat_bar">
 				<h3 class="catbg">
-					<a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $category['name'], '</a> <a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $txt['catModify'], '</a>
+					<a href="', $scripturl, '?action=admin;area=manageboards;sa=cat;cat=', $category['id'], '">', $category['name'], '</a> <a href="', $scripturl, '?action=admin;area=manageboards;sa=cat;cat=', $category['id'], '">', $txt['catModify'], '</a>
 				</h3>
 			</div>';
 
@@ -116,7 +116,7 @@ function template_modify_category()
 			<input type="hidden" name="cat" value="', $context['category']['id'], '" />
 				<div class="title_bar">
 					<h3 class="titlebg">
-					', isset($context['category']['is_new']) ? $txt['mboards_new_cat_name'] : $txt['catEdit'], '
+						', isset($context['category']['is_new']) ? $txt['mboards_new_cat_name'] : $txt['catEdit'], '
 					</h3>
 				</div>
 				<div class="windowbg">
@@ -150,8 +150,8 @@ function template_modify_category()
 							<input type="text" name="cat_name" value="', $context['category']['editable_name'], '" size="30" tabindex="', $context['tabindex']++, '" class="input_text" />
 						</dd>
 						<dt>
-							<strong>' . $txt['collapse_enable'] . '</strong><br />
-							<span class="smalltext">' . $txt['collapse_desc'] . '</span>
+							<strong>', $txt['collapse_enable'], '</strong><br />
+							<span class="smalltext">', $txt['collapse_desc'], '</span>
 						</dt>
 						<dd>
 							<input type="checkbox" name="collapse"', $context['category']['can_collapse'] ? ' checked="checked"' : '', ' tabindex="', $context['tabindex']++, '" class="input_check" />
@@ -220,7 +220,7 @@ function template_confirm_category_delete()
 					<p>
 						<label for="delete_action0"><input type="radio" id="delete_action0" name="delete_action" value="0" class="input_radio" checked="checked" />', $txt['mboards_delete_option1'], '</label><br />
 						<label for="delete_action1"><input type="radio" id="delete_action1" name="delete_action" value="1" class="input_radio"', count($context['category_order']) == 1 ? ' disabled="disabled"' : '', ' />', $txt['mboards_delete_option2'], '</label>:
-						<select name="cat_to" ', count($context['category_order']) == 1 ? 'disabled="disabled"' : '', '>';
+						<select name="cat_to"', count($context['category_order']) == 1 ? ' disabled="disabled"' : '', '>';
 
 	foreach ($context['category_order'] as $cat)
 		if ($cat['id'] != 0)
@@ -295,7 +295,7 @@ function template_modify_board()
 
 	// The second select box lists all the boards in the category.
 	echo '
-							<select id="board_order" name="board_order" ', isset($context['board']['is_new']) ? '' : 'disabled="disabled"', '>
+							<select id="board_order" name="board_order"', !isset($context['board']['is_new']) ? ' disabled="disabled"' : '', '>
 								', !isset($context['board']['is_new']) ? '<option value="">(' . $txt['mboards_unchanged'] . ')</option>' : '';
 	foreach ($context['board_order'] as $order)
 		echo '
@@ -319,7 +319,7 @@ function template_modify_board()
 							<span class="smalltext">', $txt['mboards_description_desc'], '</span>
 						</dt>
 						<dd>
-							<textarea name="desc" rows="3" cols="35" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';">', $context['board']['description'], '</textarea>
+							<textarea name="desc" rows="3" cols="35" style="width: ', isBrowser('is_ie8') ? '635px; max-width: 99%; min-width: 99' : '99', '%;">', $context['board']['description'], '</textarea>
 						</dd>
 						<dt>
 							<strong>', $txt['permission_profile'], ':</strong><br />
@@ -334,7 +334,7 @@ function template_modify_board()
 
 	foreach ($context['profiles'] as $id => $profile)
 		echo '
-								<option value="', $id, '" ', $id == $context['board']['profile'] ? 'selected="selected"' : '', '>', $profile['name'], '</option>';
+								<option value="', $id, '"', $id == $context['board']['profile'] ? ' selected="selected"' : '', '>', $profile['name'], '</option>';
 
 	echo '
 							</select>
@@ -363,7 +363,7 @@ function template_modify_board()
 			echo '
 							<label for="groups_', $group['id'], '">
 								<input type="checkbox" name="groups[', $group['id'], ']" value="allow" id="groups_', $group['id'], '"', $group['allow'] ? ' checked="checked"' : '', ' class="input_check" />
-								<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
+								<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : ($group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : ''), '>
 									', $group['name'], '
 								</span>
 							</label><br />';
@@ -372,7 +372,7 @@ function template_modify_board()
 								<tr>
 									<td>
 										<label for="groups_', $group['id'], '_a">
-											<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : '', $group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : '', '>
+											<span', $group['is_post_group'] ? ' class="post_group" title="' . $txt['mboards_groups_post_group'] . '"' : ($group['id'] == 0 ? ' class="regular_members" title="' . $txt['mboards_groups_regular_members'] . '"' : ''), '>
 												', $group['name'], '
 											</span>
 										</label>
@@ -500,7 +500,7 @@ function template_modify_board()
 								<span class="smalltext">', $txt['mboards_count_posts_desc'], '</span><br />
 							</dt>
 							<dd>
-								<input type="checkbox" name="count" ', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
+								<input type="checkbox" name="count"', $context['board']['count_posts'] ? ' checked="checked"' : '', ' class="input_check" />
 							</dd>
 						</dl>
 					</div>';

+ 2 - 2
Themes/default/ManagePermissions.template.php

@@ -37,7 +37,7 @@ function template_permission_index()
 			</div>';
 
 		echo '
-			<table width="100%" class="table_grid">
+			<table class="table_grid">
 				<thead>
 					<tr class="catbg">
 						<th class="first_th">', $txt['membergroups_name'], '</th>
@@ -67,7 +67,7 @@ function template_permission_index()
 		echo '
 					<tr class="windowbg', $alternate ? '2' : '', '">
 						<td>
-							', $group['id'] == -1 ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=membergroup_guests" onclick="return reqOverlayDiv(this.href);"><img class="icon" style="vertical-align: top" src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a>' : ($group['id'] == 0 ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=membergroup_regular_members" onclick="return reqOverlayDiv(this.href);"><img class="icon" style="vertical-align: top" src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a>' : ($group['id'] == 1 ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=membergroup_administrator" onclick="return reqOverlayDiv(this.href);"><img class="icon" style="vertical-align: top" src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a>' : ($group['id'] == 3 ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=membergroup_moderator" onclick="return reqOverlayDiv(this.href);"><img class="icon" style="vertical-align: top" src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a>' : '<img class="icon" style="vertical-align: top" src="' . $settings['images_url'] . '/blank.png" width="16px" alt="' . $txt['help'] . '" />'))), '&nbsp;<span>', $group['name'], '</span>';
+							', !empty($group['help']) ? ' <a class="help" href="' . $scripturl . '?action=helpadmin;help=' . $group['help'] . '" onclick="return reqOverlayDiv(this.href);"><img class="icon" src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a>' : '<img class="icon" src="' . $settings['images_url'] . '/blank.png" alt="' . $txt['help'] . '" />', '&nbsp;<span>', $group['name'], '</span>';
 
 		if (!empty($group['children']))
 			echo '

+ 11 - 14
Themes/default/MessageIndex.template.php

@@ -197,7 +197,7 @@ function template_main()
 					<th scope="col" class="lefttext last_th" width="22%">', $context['topics_headers']['last_post'], '</th>';
 			else
 				echo '
-					<th scope="col" class="lefttext" width="22%">', $context['topics_headers']['last_post'], '</a></th>';
+					<th scope="col" class="lefttext" width="22%">', $context['topics_headers']['last_post'], '</th>';
 
 			// Show a "select all" box for quick moderation?
 			if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
@@ -263,19 +263,16 @@ function template_main()
 						</div>
 					</td>
 					<td class="', $alternate_class, ' subject">
-						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '"  ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>';
-
-			// [WIP] Methinks the orange icons look better if they aren't all over the page.
-			// Is this topic new? (assuming they are logged in!)
-			if ($topic['new'] && $context['user']['is_logged'])
-					echo '
-							<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><span class="new_posts">' . $txt['new'] . '</span></a>';
-
-			echo '
-							', $topic['is_sticky'] ? '<strong>' : '', '<span class="preview" title="', $topic[(empty($settings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '"><span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span></span>', $topic['is_sticky'] ? '</strong>' : '', '
-
+						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '"  ondblclick="oQuickModifyTopic.modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
+							<div class="message_index_title">
+								', $topic['new'] && $context['user']['is_logged'] ? '<a href="' . $topic['new_href'] . '" id="newicon' . $topic['first_post']['id'] . '" style="float: left; display: block; margin: 9px 0 0 3px;"><span class="new_posts">' . $txt['new'] . '</span></a>' : '', '
+								<span class="preview', $topic['is_sticky'] ? ' bold_text' : '', '" title="', $topic[(empty($settings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '">
+									<span id="msg_', $topic['first_post']['id'], '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>
+								</span>
+								<br class="clear" />
+							</div>
 							<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
-								<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
+								<small id="pages', $topic['first_post']['id'], '">', $topic['pages'], '</small>
 							</p>
 						</div>
 					</td>
@@ -327,7 +324,7 @@ function template_main()
 		{
 			echo '
 				<tr class="titlebg">
-					<td colspan="6" align="right">
+					<td colspan="6" align="right" id="quick_actions">
 						<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
 							<option value="">--------</option>';
 

+ 3 - 1
Themes/default/Profile.template.php

@@ -58,7 +58,9 @@ function template_summary()
 	<div id="basicinfo">
 		<div class="windowbg">
 			<div class="content flow_auto">
-				<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>
+				<div class="username">
+					<h4>', $context['member']['name'], '<span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4>
+				</div>
 				', $context['member']['avatar']['image'], '
 				<ul class="reset">';
 	// @TODO fix the <ul> when no fields are visible

+ 15 - 6
Themes/default/css/admin.css

@@ -78,7 +78,7 @@ body.action_admin .navigate_section ul li a {
 	border: 1px solid #ddd;
 	border-top: none;
 	border-radius: 0 0 7px 7px;
-	margin: -1px 0 12px 0;
+	margin: 0 0 0 0;
 	padding: 12px 9px 8px 9px;
 }
 .action_admin p.description a {
@@ -228,6 +228,7 @@ div.quick_tasks {
 .action_admin .table_grid tr:nth-child(odd) td {
 	background: #f8f8f8;
 }
+/*-------------------------------------------*/
 
 /* Newsletters screen.
 ---------------------------------------------*/
@@ -296,18 +297,19 @@ legend {
 ------------------------------------------------------- */
 /* Admin quick search bar, and results page. */
 h3.catbg #quick_search form {
+	padding-top: 2px;
 	font-size: 0.9em;
 }
 h3.catbg #quick_search form input, h3.catbg #quick_search form select, h3.catbg #quick_search form .button_submit {
 	margin: 0 3px;
-	padding: 3px;
+	padding: 4px 3px 3px 3px;
 	border-radius: 4px;
 	border: 1px solid #777;
 	vertical-align: top;
 }
 h3.catbg #quick_search form select {
 	font-size: 0.9em;
-	margin: 0;
+	margin: -1px 0 0 0;
 	padding: 2px;
 }
 h3.catbg #quick_search form select option {
@@ -316,7 +318,7 @@ h3.catbg #quick_search form select option {
 h3.catbg #quick_search form .button_submit {
 	font-weight: bold;
 	background: #fff url(../images/theme/lower_section.png) 0 100% repeat-x;
-	padding: 2px 6px 2px 6px;
+	padding: 3px 6px 2px 6px;
 }
 h3.catbg #quick_search form .button_submit:hover {
 	background: #fff;
@@ -325,13 +327,14 @@ h3.catbg #quick_search form .button_submit:hover {
 /* Browser tweaks. */
 body#chrome #quick_search form input {
 	padding: 4px 3px;
+	margin-top: -3px;
 }
 body#chrome #quick_search .button_submit, body#ie #quick_search .button_submit, body#opera #quick_search .button_submit {
 	margin: 0 5px;
 	padding: 5px 9px 4px 9px;
 }
 body#chrome  #quick_search .button_submit {
-	margin: -26px 5px 0 5px;
+	margin: -29px 5px 0 5px;
 }
 
 /* The welcome thingy. */
@@ -339,7 +342,6 @@ body#chrome  #quick_search .button_submit {
 	background: none;
 	border: none;
 	box-shadow: none;
-	margin: 0;
 	padding: 0;
 	overflow: visible;
 }
@@ -879,6 +881,13 @@ dl.settings dd.small_caption {
 }
 /* Styles for the manage permissions section.
 ------------------------------------------------- */
+#permissionForm .table_grid {
+	width: 100%;
+}
+#permissionForm .table_grid img.icon {
+	vertical-align: top;
+	width: 16px;
+}
 dl.admin_permissions dt {
 	width: 35%;
 }

+ 26 - 3
Themes/default/css/index.css

@@ -857,7 +857,7 @@ table.table_list a.collapse {
 }
 
 .table_grid th.last_th input {
-	margin: 0 2px;
+	margin: 0 7px;
 }
 .table_grid th.lefttext {
 	padding: 0 8px;
@@ -910,6 +910,11 @@ img.sort {
 	padding: 6px;
 }
 
+/* Used for combining cat/title headers with a content frame */
+.rfix {
+	margin-top: -1px;
+}
+
 /* The main content area.
 ------------------------------------------------------- */
 .content {
@@ -1856,13 +1861,18 @@ p.whoisviewing {
 .lastpost img {
 	float: right;
 	padding: 4px;
+	margin-top: 4px;
 }
 .titlebg td.qaction_cell {
 	font-size: 0.909em;
 }
-select.qaction, input.qaction {
+select.qaction {
 	padding: 0;
 }
+td#quick_actions {
+	border-right: 1px solid #ccc;
+	padding-right: 4px;
+}
 .qaction_cell .button_submit {
 	margin: 2px 4px 0 4px;
 }
@@ -1895,6 +1905,10 @@ select.qaction, input.qaction {
 	padding: 4px 6px 2px 6px;
 }
 
+.message_index_title {
+	margin-bottom: -3px;
+}
+
 /* Styles for the display template (topic view).
 ---------------------------------------------------- */
 /* Events */
@@ -3032,9 +3046,10 @@ dl {
 	margin-right: 5px;
 	height: 20px;
 }
-#basicinfo#userstatus {
+#basicinfo #userstatus {
 	display: block;
 	clear: both;
+	margin-top: 6px;
 }
 #basicinfo #userstatus img {
 	vertical-align: middle;
@@ -4197,3 +4212,11 @@ tr.catbg th:last-child, #show_attachments th:last-child {
 	color: #222;
 	background: #f3bd9f;
 }
+
+div#manage_boards dl dd textarea[name=desc] {
+	margin-top: 1px;
+}
+
+.bold_text {
+	font-weight: bold;
+}

+ 1 - 1
Themes/default/index.template.php

@@ -325,7 +325,7 @@ function template_body_above()
 	echo'
 					</div>';
 	// Show a random news item? (or you could pick one from news_lines...)
-	if (!empty($settings['enable_news']))
+	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
 		echo '
 					<div class="news">
 						<h2>', $txt['news'], ': </h2>

+ 1 - 2
Themes/default/languages/Admin.english.php

@@ -406,7 +406,6 @@ $txt['attach_current'] = 'Current';
 $txt['attach_path_manage'] = 'Manage attachment paths';
 $txt['attach_directories'] = 'Attachment Directories';
 $txt['attach_paths'] = 'Attachment directory paths';
-$txt['attach_base_paths'] = 'Base directory paths';
 $txt['attach_path'] = 'Path';
 $txt['attach_current_size'] = 'Size (KB)';
 $txt['attach_num_files'] = 'Files';
@@ -734,4 +733,4 @@ $txt['board_perms_ignore'] = 'Ignore';
 $txt['board_perms_deny'] = 'Deny';
 $txt['all_boards_in_cat'] = 'All boards in this category';
 
-?>
+?>

+ 1 - 0
Themes/default/languages/ManageSettings.english.php

@@ -20,6 +20,7 @@ $txt['allow_hideOnline'] = 'Allow non-administrators to hide their online status
 $txt['guest_hideContacts'] = 'Do not reveal contact details of members to guests';
 $txt['titlesEnable'] = 'Enable custom titles';
 $txt['enable_buddylist'] = 'Enable buddy/ignore lists';
+$txt['enable_disregard'] = 'Enable disregad topics';
 $txt['default_personal_text'] = 'Default personal text';
 $txt['default_personal_text_note'] = 'Personal text to assign to newly registered members.';
 $txt['time_format'] = 'Default time format';

+ 2 - 0
Themes/default/languages/Profile.english.php

@@ -153,6 +153,7 @@ $txt['showPosts'] = 'Show Posts';
 $txt['showPosts_help'] = 'This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.';
 $txt['showMessages'] = 'Messages';
 $txt['showTopics'] = 'Topics';
+$txt['showDisregarded'] = 'Disregarded topics';
 $txt['showAttachments'] = 'Attachments';
 $txt['viewWarning_help'] = 'This section allows you to view all warnings issued to this member.';
 $txt['statPanel'] = 'Show Stats';
@@ -311,6 +312,7 @@ $txt['show_member_topics'] = 'View Member Topics';
 $txt['show_member_attachments'] = 'View Member Attachments';
 $txt['show_posts_none'] = 'No posts have been posted yet.';
 $txt['show_topics_none'] = 'No topics have been posted yet.';
+$txt['disregarded_topics_none'] = 'You don\'t have any topic in the disregarded list.';
 $txt['show_attachments_none'] = 'No attachments have been posted yet.';
 $txt['show_attach_filename'] = 'Filename';
 $txt['show_attach_downloads'] = 'Downloads';

+ 2 - 0
Themes/default/languages/index.english.php

@@ -371,6 +371,8 @@ $txt['geek'] = 'I am a geek!!';
 $txt['info_center_title'] = '%1$s - Info Center';
 
 $txt['send_topic'] = 'Send this topic';
+$txt['disregard'] = 'Disregard';
+$txt['undisregard'] = 'Stop disregarding';
 
 $txt['sendtopic_title'] = 'Send the topic &quot;%1$s&quot; to a friend.';
 $txt['sendtopic_sender_name'] = 'Your name';

+ 1 - 1
Themes/default/scripts/topic.js

@@ -189,7 +189,7 @@ QuickModifyTopic.prototype.modify_topic_hide_edit = function (subject)
 // keypress event ... like enter or escape
 QuickModifyTopic.prototype.modify_topic_keypress = function (oEvent)
 {
-	if (typeof(oEvent.keyCode) != "undefined")
+	if (typeof(oEvent.keyCode) != "undefined" && this.bInEditMode)
 	{
 		if (oEvent.keyCode == 27)
 		{

+ 1 - 0
index.php

@@ -273,6 +273,7 @@ function smf_main()
 		'coppa' => array('Register.php', 'CoppaForm'),
 		'credits' => array('Who.php', 'Credits'),
 		'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
+		'disregardtopic' => array('Notify.php', 'TopicDisregard'),
 		'dlattach' => array('Display.php', 'Download'),
 		'editpoll' => array('Poll.php', 'EditPoll'),
 		'editpoll2' => array('Poll.php', 'EditPoll2'),

+ 1 - 1
other/install.php

@@ -2101,7 +2101,7 @@ function template_install_below()
 	if (!empty($incontext['continue']) || !empty($incontext['skip']))
 	{
 		echo '
-								<div class="clear">';
+								<div>';
 
 		if (!empty($incontext['continue']))
 			echo '

+ 3 - 1
other/install_2-1_mysql.sql

@@ -1159,6 +1159,7 @@ CREATE TABLE {$db_prefix}log_topics (
   id_member mediumint(8) unsigned NOT NULL default '0',
   id_topic mediumint(8) unsigned NOT NULL default '0',
   id_msg int(10) unsigned NOT NULL default '0',
+  disregarded tinyint(3) NOT NULL default '0',
   PRIMARY KEY (id_member, id_topic),
   KEY id_topic (id_topic)
 ) ENGINE=MyISAM;
@@ -1834,7 +1835,8 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('attachment_image_paranoid', '0'),
 	('attachment_thumb_png', '1'),
 	('avatar_reencode', '1'),
-	('avatar_paranoid', '0');
+	('avatar_paranoid', '0'),
+	('enable_disregard', '0');
 # --------------------------------------------------------
 
 #

+ 2 - 0
other/install_2-1_postgresql.sql

@@ -1525,6 +1525,7 @@ CREATE TABLE {$db_prefix}log_topics (
   id_member int NOT NULL default '0',
   id_topic int NOT NULL default '0',
   id_msg int NOT NULL default '0',
+  disregarded int NOT NULL default '0',
   PRIMARY KEY (id_member, id_topic)
 );
 
@@ -2324,6 +2325,7 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('attachment_image_par
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('attachment_thumb_png', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('avatar_reencode', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('avatar_paranoid', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enable_disregard', '0');
 # --------------------------------------------------------
 
 #

+ 2 - 0
other/install_2-1_sqlite.sql

@@ -1249,6 +1249,7 @@ CREATE TABLE {$db_prefix}log_topics (
   id_member int NOT NULL default '0',
   id_topic int NOT NULL default '0',
   id_msg int NOT NULL default '0',
+  disregarded int NOT NULL default '0',
   PRIMARY KEY (id_member, id_topic)
 );
 
@@ -1980,6 +1981,7 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('attachment_image_par
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('attachment_thumb_png', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('avatar_reencode', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('avatar_paranoid', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enable_disregard', '0');
 COMMIT;
 
 # --------------------------------------------------------

+ 3 - 3
other/upgrade.php

@@ -985,7 +985,7 @@ function WelcomeLogin()
 	);
 
 	require_once($sourcedir . '/Security.php');
-	createToken('login');
+	$upcontext += createToken('login');
 
 	// Check the cache directory.
 	$cachedir_temp = empty($cachedir) ? $boarddir . '/cache' : $cachedir;
@@ -3642,8 +3642,8 @@ function template_welcome_message()
 		<script type="text/javascript" src="http://www.simplemachines.org/smf/current-version.js?version=' . SMF_VERSION . '"></script>
 		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
 			<h3>', sprintf($txt['upgrade_ready_proceed'], SMF_VERSION), '</h3>
-	<form action="', $upcontext['form_url'], '" method="post" name="upform" id="upform" ', empty($upcontext['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $upcontext['rid'] . '\', \'' . (!empty($context['login_token']) ? $context['login_token'] : '') . '\');"' : '', '>
-		<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '" />
+	<form action="', $upcontext['form_url'], '" method="post" name="upform" id="upform" ', empty($upcontext['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $upcontext['rid'] . '\', \'' . (!empty($upcontext['login_token']) ? $upcontext['login_token'] : '') . '\');"' : '', '>
+		<input type="hidden" name="', $upcontext['login_token_var'], '" value="', $upcontext['login_token'], '" />
 		<div id="version_warning" style="margin: 2ex; padding: 2ex; border: 2px dashed #a92174; color: black; background-color: #fbbbe2; display: none;">
 			<div style="float: left; width: 2ex; font-size: 2em; color: red;">!!</div>
 			<strong style="text-decoration: underline;">', $txt['upgrade_warning'], '</strong><br />

+ 13 - 0
other/upgrade_2-1_mysql.sql

@@ -179,6 +179,19 @@ ALTER TABLE {$db_prefix}boards
 ADD COLUMN deny_member_groups varchar(255) NOT NULL DEFAULT '';
 ---#
 
+/******************************************************************************/
+--- Adding support for topic disregard
+/******************************************************************************/
+---# Adding new columns to boards...
+ALTER TABLE {$db_prefix}log_topics
+ADD COLUMN disregarded tinyint(3) NOT NULL DEFAULT '0';
+
+INSERT INTO {$db_prefix}settings
+	(variable, value)
+VALUES
+	('enable_disregard', 0);
+---#
+
 /******************************************************************************/
 --- Fixing mail queue for long messages
 /******************************************************************************/

+ 16 - 0
other/upgrade_2-1_postgresql.sql

@@ -236,6 +236,22 @@ upgrade_query("
 ---}
 ---#
 
+/******************************************************************************/
+--- Adding support for topic disregard
+/******************************************************************************/
+---# Adding new columns to log_topics...
+---{
+upgrade_query("
+	ALTER TABLE {$db_prefix}log_topics
+	ADD COLUMN disregarded int NOT NULL DEFAULT '0'");
+
+INSERT INTO {$db_prefix}settings
+	(variable, value)
+VALUES
+	('enable_disregard', 0);
+---}
+---#
+
 /******************************************************************************/
 --- Name changes
 /******************************************************************************/

+ 23 - 0
other/upgrade_2-1_sqlite.sql

@@ -212,6 +212,29 @@ $smcFunc['db_alter_table']('{db_prefix}boards', array(
 ---}
 ---#
 
+/******************************************************************************/
+--- Adding support for topic disregard
+/******************************************************************************/
+---# Adding new columns to log_topics...
+---{
+$smcFunc['db_alter_table']('{db_prefix}log_topics', array(
+	'add' => array(
+		'disregarded' => array(
+			'name' => 'disregarded',
+			'null' => false,
+			'default' => 0,
+			'type' => 'int',
+			'auto' => false,
+		),
+	)
+));
+INSERT INTO {$db_prefix}settings
+	(variable, value)
+VALUES
+	('enable_disregard', 0);
+---}
+---#
+
 /******************************************************************************/
 --- Name changes
 /******************************************************************************/