|
When you change a username, update thread starter (without updating all threads)
This modification is in the archives.
This is a pretty simple hack. I was annoyed by the fact that when you change somebody's username it doesn't edit the thread starter field to include their new name, and on a large board updating all threads information is a huge pain in the ass.
Open up admincp/user.php find: Code:
$olduser = strlen($olduserinfo['username']);
$newuser = strlen($user['username']);
$DB_site->query("
UPDATE " . TABLE_PREFIX . "pmtext
SET touserarray = REPLACE(touserarray, 'i:$userid;s:$olduser:\"" . addslashes($olduserinfo['username']) . "\";','i:$userid;s:$newuser:\"" . addslashes($user['username']) . "\";')
");
Code:
//update thread starter
$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET postusername = '" . addslashes($user['username']) . "'
WHERE postuserid = $userid
");
Download No files for download. |
|||||||||