Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by DarkReaper DarkReaper is offline
Developer Last Online: Feb 2010 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-26-2001 Last Update: Never Installs: 4
 
No support by the author.

Thanks to Stallion and FireFly for their input on this

Part I:

In register.php, Find this:

PHP Code:
$userid=$DB_site->insert_id(); 
AFTER it, add this:

PHP Code:
  // get hold of his posts and update threads
  
$DB_site->query("UPDATE post SET userid='$userid' WHERE username='".addslashes(htmlspecialchars($username))."' AND visible<>0");
  
$DB_site->query("UPDATE thread SET postuserid='$userid' WHERE postusername='".addslashes(htmlspecialchars($username))."' AND visible<>0");
  
$totalposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post WHERE userid='$userid'");
  
$DB_site->query("UPDATE user SET posts='$totalposts[posts]' WHERE userid='$userid'"); 
From now on, when a user registers with the same username they posted with on ezboard, their old posts will be linked to their new member account.

If people have already registered, or if they want a new nickname, you can use the attached script I made. Just edit $newusername and $oldusername and upload to your /admin directory, then run it(be sure to rename it to .php instead of .php.text ).

Yea, I know it doesn't have fancy menus or anything, but I didn't think it was worth the time and effort to do that...so sue me, or do it better, I'd appreciate the latter more

Updated - 10/27/01: Added FireFly's menu code. Thanks

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 10-27-2001, 02:49 PM
Joshua Clinard Joshua Clinard is offline
 
Join Date: Nov 2001
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway you can update this script so that you can type the old and new usernames in a form and press an update button, instead of having to upload the script 100 times?

I would be SO greatful if someone could do this. It would totally ROCK!
Reply With Quote
  #3  
Old 10-27-2001, 03:16 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice addition Darkreaper
Reply With Quote
  #4  
Old 10-27-2001, 04:21 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Save this file as whatever you want .php and upload to your admin folder:
Code:
<?
/******************************************************************************
*		ezboard import member converter
*		By Jason "DarkReaper" Rodzik
*		Special Thanks to Firefly and Stallion
*
*		http://www.unrealtournament.org/forums
*
*
*		Support for this hack at:
*		http://vbulletin.com/forum/showthrea...threadid=31443
*******************************************************************************/


error_reporting(7);
require("./global.php");
$thisscript=substr($PHP_SELF, 0, strlen($PHP_SELF)-4);

cpheader();

if ($HTTP_POST_VARS['action']=="update") {
	if (isset($oldusername) and isset($newusername)) {
		$getuserid=$DB_site->query_first("SELECT userid FROM user WHERE username='$newusername'");
		$userid=$getuserid[userid];

		// get hold of his posts and update threads
		$DB_site->query("UPDATE post SET userid='$userid',username='$newusername' WHERE username='".addslashes(htmlspecialchars($oldusername))."'");
		$DB_site->query("UPDATE thread SET postuserid='$userid',postusername='$newusername' WHERE postusername='".addslashes(htmlspecialchars($oldusername))."'");
		$DB_site->query("UPDATE thread SET lastposter='$newusername' WHERE lastposter='".addslashes(htmlspecialchars($oldusername))."'");
		$DB_site->query("UPDATE forum SET lastposter='$newusername' WHERE lastposter='".addslashes(htmlspecialchars($oldusername))."'");

		// Update post counts
		$totalposts=$DB_site->query_first("SELECT COUNT(postid) AS posts FROM post WHERE userid='$userid'");
		$DB_site->query("UPDATE user SET posts='$totalposts[posts]' WHERE userid='$userid'");
		echo "Fixing user with ID of $userid and posts are $totalposts[posts]\n\nYou should now update your member titles.";
	} else {
		echo "Please enter new and old usernames.";
	}
}

doformheader("$thisscript","update");
maketableheader("Update user stuff");
makeinputcode("His new username","newusername","$newusername");
makeinputcode("His old username","oldusername","$oldusername");
doformfooter("Update!");

cpfooter();

?>
Just added some fancy code, includes a form now so you can just enter two usernames and click update.
Reply With Quote
  #5  
Old 10-27-2001, 04:30 PM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll see if I can't put something in the CP that will help with this or just reinstating a user who you deleted. There is already an option to rebuild post counts in the next version.
Reply With Quote
  #6  
Old 10-27-2001, 04:35 PM
DarkReaper DarkReaper is offline
 
Join Date: Oct 2001
Posts: 429
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks FireFly, I updated the attachment

freddie: Great!
Reply With Quote
  #7  
Old 10-27-2001, 08:28 PM
Joshua Clinard Joshua Clinard is offline
 
Join Date: Nov 2001
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason, if the old and new usernames are not the same, it will not work. I tried this with a few of my users, and instead of the usual message it said

Fixing user with ID and posts are 8900 You should now update your member titles.

There was No user ID, and I think the 8900 is the number of total posts on the board. Anyway, I hope this doesn't mess anything up. It's not a big, deal, I don't have to have it, but I was just letting people know that it doesn't work...The rest of it works great though...

On the other hand thier are a few users on my board that changed usernames...
Reply With Quote
  #8  
Old 10-27-2001, 08:49 PM
DarkReaper DarkReaper is offline
 
Join Date: Oct 2001
Posts: 429
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works fine for me when they're different. If it didn't, I wouldn't have released it

What version of vBulletin are you running? Are you sure that you're inputting the EXACT nicknames correctly? And that you're putting the old username and new username in the correct box?

What are some of the old/new usernames that are giving you problems?
Reply With Quote
  #9  
Old 10-27-2001, 10:10 PM
Joshua Clinard Joshua Clinard is offline
 
Join Date: Nov 2001
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am running the most cuurent version. 2.0.3. The usernames I tried were hooky27 to Alex....Eson to Emerson...

I just tired it again and got thepotterconnection to Wizard Girl to work...

Don't know why...I am confused. Thanks for the help though.

well it said it worked..but I don't think it did...the posts don't show up in the search for username...I think I messed it up...now not even the posts she has posted since vbulletin show up....

Is there anyway to fix this...
Reply With Quote
  #10  
Old 10-27-2001, 11:14 PM
DarkReaper DarkReaper is offline
 
Join Date: Oct 2001
Posts: 429
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try rebuilding your search index. That *should* fix it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:45 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05767 seconds
  • Memory Usage 2,310KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete