vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - [DBTech] Username Change v1 (vB4) (https://vborg.vbsupport.ru/showthread.php?t=236980)

Diana Notacat 03-03-2010 09:47 PM

LIFE SAVERS. Thank you. I will now be safe from my username change happy members who like to annoy me with requests!

DragonByte Tech 03-03-2010 10:29 PM

Quote:

Originally Posted by tinkleondabeach (Post 1996438)
Would this work for 3.8?

No, but Marco's old mod for 3.5 still works on 3.8 :)


Fillip

RedHacker 03-06-2010 03:48 PM

User Profile

* Username History

For show this must change username...?

DragonByte Tech 03-06-2010 04:31 PM

Yeah, username must have been changed at least once in order for the History to appear in the profile :)


Fillip

sung 03-06-2010 06:14 PM

Quote:

Originally Posted by DragonByte Tech (Post 1996471)
No, but Marco's old mod for 3.5 still works on 3.8 :)

Is there any possibility to import the name change history/information from Marco's plugin to this one?

DragonByte Tech 03-07-2010 10:09 AM

No, sorry that's not possible.
Marco's plugin uses its own method of storing information, whereas I use vBulletin's method (which, in fairness, didn't exist in vB 3.5 which is what Marco's plugin was written for).

sung 03-08-2010 02:42 AM

Quote:

Originally Posted by DragonByte Tech (Post 1998993)
No, sorry that's not possible.
Marco's plugin uses its own method of storing information, whereas I use vBulletin's method (which, in fairness, didn't exist in vB 3.5 which is what Marco's plugin was written for).

I realize they use different methods for storing the information, but as long as the information was about the same it should be possible to either manually or with a script move the information over.

It would be nice not to lose the username history, as well as resetting all the name change timers/counters, when moving from Marco's to your mod.

DragonByte Tech 03-08-2010 10:17 AM

Well yeah it's not like it's entirely impossible, we just have no plans of writing such a script at this time because not everybody who installs this is upgrading from 3.8 :)

It's been a while since I dealt with Marco's mod, but doing it manually would work too, I guess.


Fillip

sung 03-19-2010 03:04 PM

Here's the script I made/used to go from Marco's name change mod to this one.

PHP Code:

<?php

// Change this stuff

$dbhost 'host';
$dbuser 'user';
$dbpass 'pass';
$dbname 'table';

// END OF STUFF TO CHANGE

$mysqli = new mysqli($dbhost$dbuser$dbpass$dbname);

if(
$mysqli->connect_error) {
   die(
"Connect Error: " $mysqli->connect_error);
}

// Get current usernames for users that have changes
$result $mysqli->query("SELECT distinct mh_unm_history.userid, user.username FROM mh_unm_history, user WHERE user.userid = mh_unm_history.userid");
while (
$row $result->fetch_row()) {
   
$usernames[$row[0]] = mysql_real_escape_string($row[1]);
}
$result->free_result();

// Get the username changes
$result $mysqli->query("SELECT * from mh_unm_history ORDER BY userid ASC, dateline DESC");
while (
$row $result->fetch_row()) {
   
$userid $row[0];
   
$dateline $row[1];
   
$oldname mysql_real_escape_string($row[2]);
   
$adminid $row[3];
   
$uniq md5($dateline $userid $userid rand(1111,9999));

   
// Build the array of queries we'll execute later
   
$q[] = "INSERT INTO userchangelog VALUES('', $userid, 'username', '$usernames[$userid]', '$oldname', $adminid$dateline, '$uniq')";

   
// Set the username as the old one in the
   // event there are multiple name changes
   
$usernames[$userid] = $oldname;
}

foreach (
$q as $query) {
   if (!
$mysqli->real_query($query))
      echo 
"FAILED: " $query "<br>\n"
}

$result->close();
$mysqli->close();
?>


Things I know will cause issues: if you don't have the mysqli (notice the i) extension or use a prefix on your forum tables.

You're on your own to backup/test/verify/etc the above code will work for you!

Das UndergrounD 03-31-2010 12:49 PM

I need this mod for vb3.8 please!!!


All times are GMT. The time now is 01:10 PM.

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.01447 seconds
  • Memory Usage 1,757KB
  • 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
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete