Bravo List
Go Back   > Bravo List > Source Code > Active Trackers > BT.Manager (phpMyBitTorrent) > Mods & Themes
Old 29th June 2021, 09:15
wdq's Avatar
wdq wdq is offline
Senior Member
Join Date: Mar 2010
Posts: 45
Default An update for Transfer users to BTMANAGER?
Is there an update to this code too?
PHP Code:

# Table Names
$old_tableprefix "users"// Old table name
$new_tableprefix "div_users"//New Table Name

$query $db->sql_query("SELECT id, username, email, added, secret, passhash, uploaded, downloaded, gender, status FROM {$old_tableprefix}") or sqlerr(__FILE__,__LINE__);

OpenTable("User Import");
"I will try to update user table --> ";
while (
$olduser $db->sql_fetchrow($query))
$id $olduser['id'];
$username $olduser['username'];
$email $olduser['email'];
$added $olduser['added'];
$uploaded $olduser['uploaded'];
$downloaded $olduser['downloaded'];
$tempass RandomAlpha(8)
$act_key RandomAlpha(32);
$status = ($olduser['status']=="confirmed")? :0;
                                                                                        do {
$passkey ", '".RandomAlpha(32)."'";
//Check whether passkey already exists
$sqll "SELECT passkey FROM ".$new_tableprefix." WHERE passkey = '".$passkey."';";
$resl mysql_query($sqll)OR print("error");
$cnt = @mysql_num_rows($sqll);
                                                                                        } while (
$cnt 0);
$passkeyrow ', passkey';
$passkeyrow NULL;
$passkey NULL;

$sqlnew "INSERT INTO ".$new_tableprefix." (id,username,clean_username,email,regdate,password,act_key,uploaded,downloaded,active".$passkeyrow.")
$id', '$username', '".strtolower($username)."', '$email', '$added', '$tempass', '$act_key', '$uploaded', '$downloaded', '$status$passkey)";
$gonew $db->sql_query($sqlnew);
$gonew)echo "<br>Error:<br>Not able to creat ".$username." Maybe a duplicate Intry<br>";

"Done..<br><br>Total {$count} users has been updaded...<br>Note: All users should recover their password...";
And do we really need to transfer the ID aswell ?
Being AUTO INCREMENT can't this get a new ID automatically?
Reply With Quote
Old 4th July 2021, 12:26
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
Join Date: Jan 2008
United States
Posts: 2,112
I had started one but its not completed.
the reason ID was copied was to match uploads comments and forum posts
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Managerô forum
My Current Demo is here
Reply With Quote

Thread Tools

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 +2. The time now is 08:52. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2021, vBulletin Solutions Inc.