Browse Source

! When deleting a user we should also clear out the likes they made. This doesn't account for clearing up things like the count in the messages table, however, or indeed anything else.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 years ago
parent
commit
d57b054c72
1 changed files with 9 additions and 0 deletions
  1. 9 0
      Sources/Subs-Members.php

+ 9 - 0
Sources/Subs-Members.php

@@ -218,6 +218,15 @@ function deleteMembers($users, $check_not_admin = false)
 		)
 	);
 
+	// Delete anything they liked.
+	$smcFunc['db_query']('', '
+		DELETE FROM {db_prefix}user_likes
+		WHERE id_member IN ({array_int:users})',
+		array(
+			'users' => $users,
+		)
+	);
+
 	// Delete the logs...
 	$smcFunc['db_query']('', '
 		DELETE FROM {db_prefix}log_actions