Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 15th March 2008, 04:35
Fynnon's Avatar
Fynnon Fynnon is offline
xxx
 
Join Date: Nov 2007
P2P
Posts: 984
Angry 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:
<?php
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
Reply With Quote
The Following 2 Users Say Thank You to Fynnon For This Useful Post:
nicukent (27th January 2010), Tibys08 (29th May 2011)
  #2  
Old 16th July 2008, 23:37
koolfire koolfire is offline
Senior Member
 
Join Date: Jun 2008
Posts: 27
Default Re: [TBDev]Import Users
Import users from WHAT to tbdev?! or tbdev to WHAT?!
Reply With Quote
  #3  
Old 16th July 2008, 23:52
D3SI D3SI is offline
Senior Member
 
Join Date: May 2008
Posts: 58
Default 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
__________________
I install Site Source for $
Reply With Quote
  #4  
Old 17th July 2008, 03:27
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default 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?
__________________
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 http://demo.btmanager.org/
Reply With Quote
  #5  
Old 28th July 2008, 02:52
Swompen Swompen is offline
Senior Member
 
Join Date: Apr 2008
Posts: 31
Default Re: [TBDev]Import Users
Code:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
:(
Reply With Quote
  #6  
Old 16th October 2008, 16:05
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
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??
Reply With Quote
  #7  
Old 12th January 2010, 05:18
Laffin's Avatar
Laffin Laffin is offline
Senior Member
 
Join Date: Oct 2008
Posts: 32
Default
Quote:
Originally Posted by joeroberts View Post
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.
Reply With Quote
  #8  
Old 6th August 2013, 09:38
ratza ratza is offline
Senior Member
 
Join Date: Jun 2009
P2P
Posts: 21
Default
not working,is showing a blank page :(
Reply With Quote
Reply

Tags
import , users

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Q??] Import users Zuby Gazelle 0 16th March 2010 21:40
import users and torrent Njep TBDev 3 5th March 2009 10:42
Import Users Tbdev Netmaniack 1.6 to Yuna Scatari v2.0 r 2.1 Izacic Yuna Scatari Edition (YSE) 0 21st February 2009 19:26
Import Users TT --> TS zape Template Shares 0 23rd October 2008 18:23
Import Users Swompen Template Shares 0 30th July 2008 06:32



All times are GMT +2. The time now is 00:36. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.