vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   When you change a username, update thread starter (without updating all threads) (https://vborg.vbsupport.ru/showthread.php?t=73811)

sblum 01-04-2005 10:00 PM

When you change a username, update thread starter (without updating all threads)
 
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']) . "\";')
                ");

add right after:
Code:

                //update thread starter
                $DB_site->query("
                                UPDATE " . TABLE_PREFIX . "thread
                                SET postusername = '" . addslashes($user['username']) . "'
                                WHERE postuserid = $userid
                ");


cinq 01-05-2005 05:14 AM

I thought by default when you change a member's username, it gets updated site-wide ?

Intex 01-05-2005 09:29 AM

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:

Originally Posted by cinq
I thought by default when you change a member's username, it gets updated site-wide ?


manguish 01-05-2005 09:41 AM

Mine gets updated site wide?

Zachery 01-05-2005 12:20 PM

This is fixed in 3.0.4 IIRC :)

nexialys 01-05-2005 12:47 PM

.. 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.. ;) )

Oblivion Knight 01-05-2005 01:05 PM

I've installed this since I'm using a patched 3.0.3..

Thanks for sharing! :)


All times are GMT. The time now is 06:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01035 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete