Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Import Users (http://www.bvlist.com/showthread.php?t=209)

Fynnon 15th March 2008 04:35

Import Users
 
This script is working 100%

i tested it and you can import the users and users don't even have to recover the pass

This code is very useful when you try to change from one source to another i did it

my friend wanted to change from X*m to Tbdev and it worked fine

Note: All Thanks goes to Aurthor of this code

use this

import.php
Code:

require_once("include/bittorrent.php");
dbconn();

# Table Names
$old_tableprefix = "users2"; // Old table name
$new_tableprefix = "users"; //New Table Name

#$query = do_mysql_query("SELECT id, username, email, added, secret, passhash, uploaded, downloaded, donor, gender, country, vip_until FROM {$old_tableprefix}") or sqlerr(__FILE__,__LINE__);
$query = do_mysql_query("SELECT id, username, email, added, secret, passhash, uploaded, downloaded, gender, status FROM {$old_tableprefix}") or sqlerr(__FILE__,__LINE__);

stdhead();
echo "I will try to update user table --> ";
$count=0;
while ($olduser = mysql_fetch_assoc($query))
{
  //  $id = intval($olduser['id']);
  //  if ($id == 1)
  //    $class = UC_SYSOP;
  //  else
      //  $class = UC_USER;

    $id = sqlesc($olduser['id']);
    $username = sqlesc($olduser['username']);
    $passhash = sqlesc($olduser['passhash']);
    $secret = sqlesc($olduser['secret']);
    $email = sqlesc($olduser['email']);
    $added = sqlesc($olduser['added']);
    $uploaded = sqlesc($olduser['uploaded']);
    $downloaded = sqlesc($olduser['downloaded']);
  // $donor = sqlesc($olduser['donor']);
    $gender = sqlesc($olduser['gender']);
    $status = sqlesc($olduser['status']);
  //  $country = sqlesc($olduser['country']);
  //  $donoruntil = sqlesc($olduser['vip_until']);
   

   
  /*  do_mysql_query("INSERT INTO {$new_tableprefix} (id,username,email,passhash,secret,added,uploaded,downloaded,donor,gender,countr
y,donoruntil)
    VALUES ($id, $username, $email, $passhash, $secret, $added, $uploaded, $downloaded, $donor, $gender, $country, $donoruntil)");
    $count++;
}  */

do_mysql_query("INSERT INTO {$new_tableprefix} (id,username,email,passhash,secret,added,uploaded,downloaded,gender,status)
    VALUES ($id, $username, $email, $passhash, $secret, $added, $uploaded, $downloaded, $gender, $status)");
    $count++;
}

echo "Done..

Total {$count} users has been updaded...
Note: All users should recover their password...";
stdfoot();
?>

then run this SQL queries (phpmyadmin)
Because it will not import passkey [ its not added in importing code]

Code:

UPDATE users SET passkey=md5(passhash);
should work Fine

If can make this code better please do so and some feedback :D

Update:

you can also try this SQL queries

Code:

INSERT INTO users (field1, field2, field3, field4)
SELECT field1, field2, field3, field4 FROM users3

or

Code:

REPLACE INTO users (field1, field2, field3, field4)
SELECT field1, field2, field3, field4 FROM users3

Thx

Sam007@tbdev.net

koolfire 16th July 2008 23:37

Re: [TBDev]Import Users
 
Import users from WHAT to tbdev?! or tbdev to WHAT?!

D3SI 16th July 2008 23:52

Re: [TBDev]Import Users
 
posted by me on tbdev :P aka sam007 :P

you can important users from nearly any source to any source.

hope this helps

joeroberts 17th July 2008 03:27

Re: [TBDev]Import Users
 
not PMBT it wont because I dont have some of them tabble and my user status is not the same neather is user level they use 1,2,3 and I use user premium moderator and admin.
I was going to creat a script that would allow for you to get table info and then select what you wanted to transfer in to what table.
and A good source changer should also convert your torrents and files to shouldn't it?

Swompen 28th July 2008 02:52

Re: [TBDev]Import Users
 
Code:

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
:(

wMan 16th October 2008 16:05

how do u use this add your code in ftp also import.php go to db leave users table there add the sql above thats it??

Laffin 12th January 2010 05:18

Quote:

Originally Posted by joeroberts (Post 2691)
not PMBT it wont because I dont have some of them tabble and my user status is not the same neather is user level they use 1,2,3 and I use user premium moderator and admin.
I was going to creat a script that would allow for you to get table info and then select what you wanted to transfer in to what table.
and A good source changer should also convert your torrents and files to shouldn't it?

I did write some code a bit ago, which reindexed your tbdev database (removing the spacial range between ids; 2, 17, 88 would become 1, 2, 3).
It did users, torrents, forum posts, the code is pretty interesting, as it builds a cross reference list. but it shouldnt be that much more work to have it export to a different tracker source.

ratza 6th August 2013 09:38

not working,is showing a blank page :(


All times are GMT +2. The time now is 05:53.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.