The Arcive of vBulletin Modifications Site. |
|
When you change a username, update thread starter (without updating all threads) Details »»
|
|||||||||||||||||||||||||||
|
When you change a username, update thread starter (without updating all threads)
Developer Last Online: Jul 2005
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
");
Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
I thought by default when you change a member's username, it gets updated site-wide ?
|
|
#3
|
|||
|
|||
|
Not to my knowledge, unless I'm missing something. I changed one of my usernames only the other day and I had to update the counters manually.
Nice job sblum. Thanks for sharing. Quote:
|
|
#4
|
|||
|
|||
|
Mine gets updated site wide?
|
|
#5
|
||||
|
||||
|
This is fixed in 3.0.4 IIRC
|
|
#6
|
|||
|
|||
|
.. this hack have to be reset to be for vB Version: 3.0.3 or prior to... as the 3.0.4 version is already corrected (as said Zach and me..
)
|
|
#7
|
||||
|
||||
|
I've installed this since I'm using a patched 3.0.3..
Thanks for sharing!
|
![]() |
|
|