| @@ 2230-2244 (lines=15) @@ | ||
| 2227 | logAction(empty($_POST['sticky']) ? 'unsticky' : 'sticky', array('topic' => $topicOptions['id'], 'board' => $topicOptions['board'])); |
|
| 2228 | ||
| 2229 | // Returning to the topic? |
|
| 2230 | if (!empty($_REQUEST['goback'])) |
|
| 2231 | { |
|
| 2232 | // Mark the board as read.... because it might get confusing otherwise. |
|
| 2233 | $smcFunc['db_query']('', ' |
|
| 2234 | UPDATE {db_prefix}log_boards |
|
| 2235 | SET id_msg = {int:maxMsgID} |
|
| 2236 | WHERE id_member = {int:current_member} |
|
| 2237 | AND id_board = {int:current_board}', |
|
| 2238 | array( |
|
| 2239 | 'current_board' => $board, |
|
| 2240 | 'current_member' => $user_info['id'], |
|
| 2241 | 'maxMsgID' => $modSettings['maxMsgID'], |
|
| 2242 | ) |
|
| 2243 | ); |
|
| 2244 | } |
|
| 2245 | ||
| 2246 | if ($board_info['num_topics'] == 0) |
|
| 2247 | cache_put_data('board-' . $board, null, 120); |
|
| @@ 1056-1071 (lines=16) @@ | ||
| 1053 | $context['is_marked_notify'] = true; |
|
| 1054 | ||
| 1055 | // Only do this once, but mark the notifications as "not sent yet" for next time. |
|
| 1056 | if (!empty($row['sent']) && $do_once) |
|
| 1057 | { |
|
| 1058 | $smcFunc['db_query']('', ' |
|
| 1059 | UPDATE {db_prefix}log_notify |
|
| 1060 | SET sent = {int:is_not_sent} |
|
| 1061 | WHERE (id_topic = {int:current_topic} OR id_board = {int:current_board}) |
|
| 1062 | AND id_member = {int:current_member}', |
|
| 1063 | array( |
|
| 1064 | 'current_board' => $board, |
|
| 1065 | 'current_member' => $user_info['id'], |
|
| 1066 | 'current_topic' => $topic, |
|
| 1067 | 'is_not_sent' => 0, |
|
| 1068 | ) |
|
| 1069 | ); |
|
| 1070 | $do_once = false; |
|
| 1071 | } |
|
| 1072 | } |
|
| 1073 | ||
| 1074 | // Have we recently cached the number of new topics in this board, and it's still a lot? |
|
| @@ 694-707 (lines=14) @@ | ||
| 691 | } |
|
| 692 | $smcFunc['db_free_result']($request); |
|
| 693 | ||
| 694 | if ($context['is_marked_notify'] && !empty($board_sent)) |
|
| 695 | { |
|
| 696 | $smcFunc['db_query']('', ' |
|
| 697 | UPDATE {db_prefix}log_notify |
|
| 698 | SET sent = {int:is_sent} |
|
| 699 | WHERE id_member = {int:current_member} |
|
| 700 | AND id_board = {int:current_board}', |
|
| 701 | array( |
|
| 702 | 'current_board' => $board, |
|
| 703 | 'current_member' => $user_info['id'], |
|
| 704 | 'is_sent' => 0, |
|
| 705 | ) |
|
| 706 | ); |
|
| 707 | } |
|
| 708 | ||
| 709 | require_once($sourcedir . '/Subs-Notify.php'); |
|
| 710 | $pref = getNotifyPrefs($user_info['id'], array('board_notify', 'board_notify_' . $board), true); |
|