|
@@ -262,6 +262,21 @@ if ($ThreadInfo['LastPostAuthorID'] == $LoggedUser['ID'] && ((!check_perms('site
|
262
|
262
|
|
263
|
263
|
//Increment this now to make sure we redirect to the correct page
|
264
|
264
|
$ThreadInfo['Posts']++;
|
|
265
|
+
|
|
266
|
+ //Award a badge if necessary
|
|
267
|
+ $DB->query("
|
|
268
|
+ SELECT COUNT(ID)
|
|
269
|
+ FROM forums_posts
|
|
270
|
+ WHERE AuthorID = '$LoggedUser[ID]'");
|
|
271
|
+ list($UserPosts) = $DB->next_record(MYSQLI_NUM, false);
|
|
272
|
+ foreach (AUTOMATED_BADGE_IDS['Posts'] AS $Count => $Badge) {
|
|
273
|
+ if ((int) $UserPosts > $Count) {
|
|
274
|
+ $Success = Badges::award_badge($LoggedUser['ID'], $Badge);
|
|
275
|
+ if ($Success) {
|
|
276
|
+ Misc::send_pm($LoggedUser['ID'], 0, 'You have received a badge!', "You have received a badge for making ".$Count." forum posts.\n\nIt can be enabled from your user settings.");
|
|
277
|
+ }
|
|
278
|
+ }
|
|
279
|
+ }
|
265
|
280
|
}
|
266
|
281
|
|
267
|
282
|
Subscriptions::flush_subscriptions('forums', $TopicID);
|