@@ -20,7 +20,7 @@ |
||
| 20 | 20 | class MsgReportReply_Notify_Background extends SMF_BackgroundTask |
| 21 | 21 | { |
| 22 | 22 | /** |
| 23 | - * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 23 | + * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 24 | 24 | * @return bool Always returns true. |
| 25 | 25 | */ |
| 26 | 26 | public function execute() |
@@ -40,8 +40,9 @@ discard block |
||
| 40 | 40 | 'last_comment' => $this->_details['comment_id'], |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | - while ($row = $smcFunc['db_fetch_row']($request)) |
|
| 44 | - $possible_members[] = $row[0]; |
|
| 43 | + while ($row = $smcFunc['db_fetch_row']($request)) { |
|
| 44 | + $possible_members[] = $row[0]; |
|
| 45 | + } |
|
| 45 | 46 | $smcFunc['db_free_result']($request); |
| 46 | 47 | |
| 47 | 48 | // Presumably, there are some people? |
@@ -50,8 +51,9 @@ discard block |
||
| 50 | 51 | $possible_members = array_flip(array_flip($possible_members)); |
| 51 | 52 | $possible_members = array_diff($possible_members, array($this->_details['sender_id'])); |
| 52 | 53 | } |
| 53 | - if (empty($possible_members)) |
|
| 54 | - return true; |
|
| 54 | + if (empty($possible_members)) { |
|
| 55 | + return true; |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | // We need to know who can moderate this board - and therefore who can see this report. |
| 57 | 59 | // First up, people who have moderate_board in the board this topic was in. |
@@ -67,8 +69,9 @@ discard block |
||
| 67 | 69 | 'current_board' => $this->_details['board_id'], |
| 68 | 70 | ) |
| 69 | 71 | ); |
| 70 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 71 | - $members[] = $row['id_member']; |
|
| 72 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 73 | + $members[] = $row['id_member']; |
|
| 74 | + } |
|
| 72 | 75 | $smcFunc['db_free_result']($request); |
| 73 | 76 | |
| 74 | 77 | // Thirdly, anyone assigned to be a moderator of this group as a group->board moderator. |
@@ -85,8 +88,9 @@ discard block |
||
| 85 | 88 | ) |
| 86 | 89 | ); |
| 87 | 90 | |
| 88 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 89 | - $members[] = $row['id_member']; |
|
| 91 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 92 | + $members[] = $row['id_member']; |
|
| 93 | + } |
|
| 90 | 94 | $smcFunc['db_free_result']($request); |
| 91 | 95 | |
| 92 | 96 | // So now we have two lists: the people who replied to a report in the past, |
@@ -108,8 +112,9 @@ discard block |
||
| 108 | 112 | { |
| 109 | 113 | foreach ($alert_bits as $type => $bitvalue) |
| 110 | 114 | { |
| 111 | - if ($pref_option['msg_report_reply'] & $bitvalue) |
|
| 112 | - $notifies[$type][] = $member; |
|
| 115 | + if ($pref_option['msg_report_reply'] & $bitvalue) { |
|
| 116 | + $notifies[$type][] = $member; |
|
| 117 | + } |
|
| 113 | 118 | } |
| 114 | 119 | } |
| 115 | 120 | |
@@ -170,8 +175,9 @@ discard block |
||
| 170 | 175 | ); |
| 171 | 176 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 172 | 177 | { |
| 173 | - if (empty($row['lngfile'])) |
|
| 174 | - $row['lngfile'] = $language; |
|
| 178 | + if (empty($row['lngfile'])) { |
|
| 179 | + $row['lngfile'] = $language; |
|
| 180 | + } |
|
| 175 | 181 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
| 176 | 182 | } |
| 177 | 183 | $smcFunc['db_free_result']($request); |
@@ -203,8 +209,9 @@ discard block |
||
| 203 | 209 | $emaildata = loadEmailTemplate('reply_to_moderator', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
| 204 | 210 | |
| 205 | 211 | // And do the actual sending... |
| 206 | - foreach ($recipients as $id_member => $email_address) |
|
| 207 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'rptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
| 212 | + foreach ($recipients as $id_member => $email_address) { |
|
| 213 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'rptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
| 214 | + } |
|
| 208 | 215 | } |
| 209 | 216 | } |
| 210 | 217 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | class Buddy_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | - * This executes the task - loads up the info, sets the alerts and loads up the email queue. |
|
| 22 | + * This executes the task - loads up the info, sets the alerts and loads up the email queue. |
|
| 23 | 23 | * @return bool Always returns true |
| 24 | 24 | */ |
| 25 | 25 | public function execute() |
@@ -51,8 +51,9 @@ discard block |
||
| 51 | 51 | $birthdays = array(); |
| 52 | 52 | while ($row = $smcFunc['db_fetch_assoc']($result)) |
| 53 | 53 | { |
| 54 | - if (!isset($birthdays[$row['lngfile']])) |
|
| 55 | - $birthdays[$row['lngfile']] = array(); |
|
| 54 | + if (!isset($birthdays[$row['lngfile']])) { |
|
| 55 | + $birthdays[$row['lngfile']] = array(); |
|
| 56 | + } |
|
| 56 | 57 | $birthdays[$row['lngfile']][$row['id_member']] = array( |
| 57 | 58 | 'name' => $row['real_name'], |
| 58 | 59 | 'email' => $row['email_address'] |
@@ -117,8 +118,8 @@ discard block |
||
| 117 | 118 | AddMailQueue(true); |
| 118 | 119 | |
| 119 | 120 | // Insert the alerts if any |
| 120 | - if (!empty($alert_rows)) |
|
| 121 | - $smcFunc['db_insert']('', |
|
| 121 | + if (!empty($alert_rows)) { |
|
| 122 | + $smcFunc['db_insert']('', |
|
| 122 | 123 | '{db_prefix}user_alerts', |
| 123 | 124 | array( |
| 124 | 125 | 'alert_time' => 'int', 'id_member' => 'int', 'content_type' => 'string', |
@@ -127,6 +128,7 @@ discard block |
||
| 127 | 128 | $alert_rows, |
| 128 | 129 | array() |
| 129 | 130 | ); |
| 131 | + } |
|
| 130 | 132 | } |
| 131 | 133 | |
| 132 | 134 | return true; |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class Birthday_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * This executes the task. It loads up the birthdays, figures out the greeting, etc. |
|
| 23 | - * @return bool Always returns true |
|
| 24 | - */ |
|
| 21 | + /** |
|
| 22 | + * This executes the task. It loads up the birthdays, figures out the greeting, etc. |
|
| 23 | + * @return bool Always returns true |
|
| 24 | + */ |
|
| 25 | 25 | public function execute() |
| 26 | 26 | { |
| 27 | 27 | global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | class MemberReport_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | - * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 22 | + * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 23 | 23 | * @return bool Always returns true. |
| 24 | 24 | */ |
| 25 | 25 | public function execute() |
@@ -46,9 +46,10 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | foreach ($prefs as $member => $pref_option) |
| 48 | 48 | { |
| 49 | - foreach ($alert_bits as $type => $bitvalue) |
|
| 50 | - if ($pref_option['member_report'] & $bitvalue) |
|
| 49 | + foreach ($alert_bits as $type => $bitvalue) { |
|
| 50 | + if ($pref_option['member_report'] & $bitvalue) |
|
| 51 | 51 | $notifies[$type][] = $member; |
| 52 | + } |
|
| 52 | 53 | } |
| 53 | 54 | |
| 54 | 55 | // Firstly, anyone who wants alerts. |
@@ -109,8 +110,9 @@ discard block |
||
| 109 | 110 | ); |
| 110 | 111 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 111 | 112 | { |
| 112 | - if (empty($row['lngfile'])) |
|
| 113 | - $row['lngfile'] = $language; |
|
| 113 | + if (empty($row['lngfile'])) { |
|
| 114 | + $row['lngfile'] = $language; |
|
| 115 | + } |
|
| 114 | 116 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
| 115 | 117 | } |
| 116 | 118 | $smcFunc['db_free_result']($request); |
@@ -129,8 +131,9 @@ discard block |
||
| 129 | 131 | $emaildata = loadEmailTemplate('report_member_profile', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
| 130 | 132 | |
| 131 | 133 | // And do the actual sending... |
| 132 | - foreach ($recipients as $id_member => $email_address) |
|
| 133 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'ureport' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
| 134 | + foreach ($recipients as $id_member => $email_address) { |
|
| 135 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'ureport' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
| 136 | + } |
|
| 134 | 137 | } |
| 135 | 138 | } |
| 136 | 139 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | class ApprovePost_Notify_Background extends SMF_BackgroundTask |
| 19 | 19 | { |
| 20 | 20 | /** |
| 21 | - * This executes the task - loads up the info, puts the email in the queue and inserts any alerts as needed. |
|
| 21 | + * This executes the task - loads up the info, puts the email in the queue and inserts any alerts as needed. |
|
| 22 | 22 | * @return bool Always returns true |
| 23 | 23 | */ |
| 24 | 24 | public function execute() |
@@ -54,8 +54,9 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | $smcFunc['db_free_result']($request); |
| 56 | 56 | |
| 57 | - if (empty($members)) |
|
| 58 | - return true; |
|
| 57 | + if (empty($members)) { |
|
| 58 | + return true; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | require_once($sourcedir . '/Subs-Notify.php'); |
| 61 | 62 | $members = array_unique($members); |
@@ -103,14 +104,15 @@ discard block |
||
| 103 | 104 | } |
| 104 | 105 | |
| 105 | 106 | // Insert the alerts if any |
| 106 | - if (!empty($alert_rows)) |
|
| 107 | - $smcFunc['db_insert']('', |
|
| 107 | + if (!empty($alert_rows)) { |
|
| 108 | + $smcFunc['db_insert']('', |
|
| 108 | 109 | '{db_prefix}user_alerts', |
| 109 | 110 | array('alert_time' => 'int', 'id_member' => 'int', 'id_member_started' => 'int', 'member_name' => 'string', |
| 110 | 111 | 'content_type' => 'string', 'content_id' => 'int', 'content_action' => 'string', 'is_read' => 'int', 'extra' => 'string'), |
| 111 | 112 | $alert_rows, |
| 112 | 113 | array() |
| 113 | 114 | ); |
| 115 | + } |
|
| 114 | 116 | |
| 115 | 117 | return true; |
| 116 | 118 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | class Register_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | - * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 22 | + * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 23 | 23 | * @return bool Always returns true. |
| 24 | 24 | */ |
| 25 | 25 | public function execute() |
@@ -43,9 +43,10 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | foreach ($prefs as $member => $pref_option) |
| 45 | 45 | { |
| 46 | - foreach ($alert_bits as $type => $bitvalue) |
|
| 47 | - if ($pref_option['member_register'] & $bitvalue) |
|
| 46 | + foreach ($alert_bits as $type => $bitvalue) { |
|
| 47 | + if ($pref_option['member_register'] & $bitvalue) |
|
| 48 | 48 | $notifies[$type][] = $member; |
| 49 | + } |
|
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | // Firstly, anyone who wants alerts. |
@@ -101,8 +102,9 @@ discard block |
||
| 101 | 102 | ); |
| 102 | 103 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 103 | 104 | { |
| 104 | - if (empty($row['lngfile'])) |
|
| 105 | - $row['lngfile'] = $language; |
|
| 105 | + if (empty($row['lngfile'])) { |
|
| 106 | + $row['lngfile'] = $language; |
|
| 107 | + } |
|
| 106 | 108 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
| 107 | 109 | } |
| 108 | 110 | $smcFunc['db_free_result']($request); |
@@ -126,8 +128,9 @@ discard block |
||
| 126 | 128 | $emaildata = loadEmailTemplate($emailtype, $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
| 127 | 129 | |
| 128 | 130 | // And do the actual sending... |
| 129 | - foreach ($recipients as $id_member => $email_address) |
|
| 130 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'newmember' . $this->_details['new_member_id'], $emaildata['is_html'], 0); |
|
| 131 | + foreach ($recipients as $id_member => $email_address) { |
|
| 132 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'newmember' . $this->_details['new_member_id'], $emaildata['is_html'], 0); |
|
| 133 | + } |
|
| 131 | 134 | } |
| 132 | 135 | } |
| 133 | 136 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | class MsgReport_Notify_Background extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | - * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 22 | + * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 23 | 23 | * @return bool Always returns true. |
| 24 | 24 | */ |
| 25 | 25 | public function execute() |
@@ -40,8 +40,9 @@ discard block |
||
| 40 | 40 | 'current_board' => $this->_details['board_id'], |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 44 | - $members[] = $row['id_member']; |
|
| 43 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 44 | + $members[] = $row['id_member']; |
|
| 45 | + } |
|
| 45 | 46 | $smcFunc['db_free_result']($request); |
| 46 | 47 | |
| 47 | 48 | // Thirdly, anyone assigned to be a moderator of this group as a group->board moderator. |
@@ -58,8 +59,9 @@ discard block |
||
| 58 | 59 | ) |
| 59 | 60 | ); |
| 60 | 61 | |
| 61 | - while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 62 | - $members[] = $row['id_member']; |
|
| 62 | + while ($row = $smcFunc['db_fetch_assoc']($request)) { |
|
| 63 | + $members[] = $row['id_member']; |
|
| 64 | + } |
|
| 63 | 65 | $smcFunc['db_free_result']($request); |
| 64 | 66 | |
| 65 | 67 | // And now weed out the duplicates. |
@@ -81,9 +83,10 @@ discard block |
||
| 81 | 83 | |
| 82 | 84 | foreach ($prefs as $member => $pref_option) |
| 83 | 85 | { |
| 84 | - foreach ($alert_bits as $type => $bitvalue) |
|
| 85 | - if ($pref_option['msg_report'] & $bitvalue) |
|
| 86 | + foreach ($alert_bits as $type => $bitvalue) { |
|
| 87 | + if ($pref_option['msg_report'] & $bitvalue) |
|
| 86 | 88 | $notifies[$type][] = $member; |
| 89 | + } |
|
| 87 | 90 | } |
| 88 | 91 | |
| 89 | 92 | // Firstly, anyone who wants alerts. |
@@ -143,8 +146,9 @@ discard block |
||
| 143 | 146 | ); |
| 144 | 147 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 145 | 148 | { |
| 146 | - if (empty($row['lngfile'])) |
|
| 147 | - $row['lngfile'] = $language; |
|
| 149 | + if (empty($row['lngfile'])) { |
|
| 150 | + $row['lngfile'] = $language; |
|
| 151 | + } |
|
| 148 | 152 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
| 149 | 153 | } |
| 150 | 154 | $smcFunc['db_free_result']($request); |
@@ -177,8 +181,9 @@ discard block |
||
| 177 | 181 | $emaildata = loadEmailTemplate('report_to_moderator', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
| 178 | 182 | |
| 179 | 183 | // And do the actual sending... |
| 180 | - foreach ($recipients as $id_member => $email_address) |
|
| 181 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'report' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
| 184 | + foreach ($recipients as $id_member => $email_address) { |
|
| 185 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'report' . $this->_details['report_id'], $emaildata['is_html'], 2); |
|
| 186 | + } |
|
| 182 | 187 | } |
| 183 | 188 | } |
| 184 | 189 | |
@@ -18,10 +18,10 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class Update_TLD_Regex extends SMF_BackgroundTask |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * This executes the task. It just calls set_tld_regex() in Subs.php |
|
| 23 | - * @return bool Always returns true |
|
| 24 | - */ |
|
| 21 | + /** |
|
| 22 | + * This executes the task. It just calls set_tld_regex() in Subs.php |
|
| 23 | + * @return bool Always returns true |
|
| 24 | + */ |
|
| 25 | 25 | public function execute() |
| 26 | 26 | { |
| 27 | 27 | global $sourcedir; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | class MemberReportReply_Notify_Background extends SMF_BackgroundTask |
| 21 | 21 | { |
| 22 | 22 | /** |
| 23 | - * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 23 | + * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed. |
|
| 24 | 24 | * @return bool Always returns true. |
| 25 | 25 | */ |
| 26 | 26 | public function execute() |
@@ -40,8 +40,9 @@ discard block |
||
| 40 | 40 | 'last_comment' => $this->_details['comment_id'], |
| 41 | 41 | ) |
| 42 | 42 | ); |
| 43 | - while ($row = $smcFunc['db_fetch_row']($request)) |
|
| 44 | - $possible_members[] = $row[0]; |
|
| 43 | + while ($row = $smcFunc['db_fetch_row']($request)) { |
|
| 44 | + $possible_members[] = $row[0]; |
|
| 45 | + } |
|
| 45 | 46 | $smcFunc['db_free_result']($request); |
| 46 | 47 | |
| 47 | 48 | // Presumably, there are some people? |
@@ -50,8 +51,9 @@ discard block |
||
| 50 | 51 | $possible_members = array_flip(array_flip($possible_members)); |
| 51 | 52 | $possible_members = array_diff($possible_members, array($this->_details['sender_id'])); |
| 52 | 53 | } |
| 53 | - if (empty($possible_members)) |
|
| 54 | - return true; |
|
| 54 | + if (empty($possible_members)) { |
|
| 55 | + return true; |
|
| 56 | + } |
|
| 55 | 57 | |
| 56 | 58 | // We need to know who can moderate this board - and therefore who can see this report. |
| 57 | 59 | // First up, people who have moderate_board in the board this topic was in. |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | { |
| 74 | 76 | foreach ($alert_bits as $type => $bitvalue) |
| 75 | 77 | { |
| 76 | - if ($pref_option['member_report_reply'] & $bitvalue) |
|
| 77 | - $notifies[$type][] = $member; |
|
| 78 | + if ($pref_option['member_report_reply'] & $bitvalue) { |
|
| 79 | + $notifies[$type][] = $member; |
|
| 80 | + } |
|
| 78 | 81 | } |
| 79 | 82 | } |
| 80 | 83 | |
@@ -136,8 +139,9 @@ discard block |
||
| 136 | 139 | ); |
| 137 | 140 | while ($row = $smcFunc['db_fetch_assoc']($request)) |
| 138 | 141 | { |
| 139 | - if (empty($row['lngfile'])) |
|
| 140 | - $row['lngfile'] = $language; |
|
| 142 | + if (empty($row['lngfile'])) { |
|
| 143 | + $row['lngfile'] = $language; |
|
| 144 | + } |
|
| 141 | 145 | $emails[$row['lngfile']][$row['id_member']] = $row['email_address']; |
| 142 | 146 | } |
| 143 | 147 | $smcFunc['db_free_result']($request); |
@@ -155,8 +159,9 @@ discard block |
||
| 155 | 159 | $emaildata = loadEmailTemplate('reply_to_user_reports', $replacements, empty($modSettings['userLanguage']) ? $language : $this_lang); |
| 156 | 160 | |
| 157 | 161 | // And do the actual sending... |
| 158 | - foreach ($recipients as $id_member => $email_address) |
|
| 159 | - sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'urptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
| 162 | + foreach ($recipients as $id_member => $email_address) { |
|
| 163 | + sendmail($email_address, $emaildata['subject'], $emaildata['body'], null, 'urptrpy' . $this->_details['comment_id'], $emaildata['is_html'], 3); |
|
| 164 | + } |
|
| 160 | 165 | } |
| 161 | 166 | } |
| 162 | 167 | |