Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Help
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / General / General Chat

2022-10-24 20:18:38
Good Evening all,

Sorry to bother you but was looking for some help, I am looking to switch from unit3d source code since Vinnie has announced EOL for unit3d, his final release is 7.0, he will only be releasing security patches for his work!

I am looking to get my database converted for users only though, anyone who would like to help let me know (money can be paid for the right price)




Thanks!
2022-10-24 20:23:04
Wow, so he's hanging it up after v7.
Well, all I can say is...R.I.P.
Not really gonna miss it anyway.
I know he put a lot of work into the script, but I feel he way-overcomplicated things. Made it too hard, compared to the other options, for general people to install/modify.
Looked too cookie-cutter...you see one unit3d site, you've seen them all.
Whatever.
Last edited by Obiwan on 2022-10-24 20:26:03
2022-10-25 16:11:43
its a shame to see anyone leave, I liked unit3d but never really used it
i agree with Obiwan i think it was too complicated for most average users i hate frameworks - its a additional thing to learn on top
However with it been laravel someone might take it on
2022-10-25 16:53:59
Yeah it's a shame but one of those things, I got v3 on a test site just now playing with it but would like to get users sorted encase we do make the move to TT
2022-10-25 21:36:23
to transfer users id use something like this

make a backup of your unit3d users table then rename users1 and a new TT table users2
we make 2 new tables in case we make mistake
the tt side would be users2
CREATE TABLE `users2` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `username` varchar(40) NOT NULL default '',
 `password` varchar(40) NOT NULL default '',
 `secret` varchar(20) binary NOT NULL default '',
 `email` varchar(80) NOT NULL default '',
 `status` enum('pending','confirmed') NOT NULL default 'pending',
 `added` datetime DEFAULT NULL,
 `last_login` datetime DEFAULT NULL,
 `last_access` datetime DEFAULT NULL,
 `editsecret` varchar(20) binary NOT NULL default '',
 `privacy` enum('strong','normal','low') NOT NULL default 'normal',
 `stylesheet` int(10) default '1',
 `language` varchar(20) NOT NULL default '1',
 `info` text,
 `acceptpms` enum('yes','no') NOT NULL default 'yes',
 `ip` varchar(39) NOT NULL default '',
 `class` tinyint(3) unsigned NOT NULL default '1',
 `avatar` varchar(100) NOT NULL default '',
 `uploaded` bigint(20) unsigned NOT NULL default '0',
 `downloaded` bigint(20) unsigned NOT NULL default '0',
 `title` varchar(30) NOT NULL default '',
 `donated` int(5) unsigned NOT NULL default '0',
 `country` int(10) unsigned NOT NULL default '0',
 `notifs` varchar(100) NOT NULL default '',
 `enabled` varchar(10) NOT NULL default 'yes',
 `modcomment` text default NULL,
 `gender` varchar(6) NOT NULL default '',
 `client` varchar(25) NOT NULL default '',
 `age` int(3) NOT NULL default '0',
 `warned` char(3) NOT NULL default 'no',
 `signature` varchar(200) NOT NULL default '',
 `last_browse` int(11) NOT NULL default '0',
 `forumbanned` char(3) NOT NULL default 'no',
 `invited_by` int(10) NOT NULL default '0',
 `invitees` varchar(100) NOT NULL default '',
 `invites` smallint(5) NOT NULL default '0',
 `invitedate` datetime DEFAULT NULL,
 `commentpm` enum('yes','no') NOT NULL default 'yes',
 `passkey` varchar(32) NOT NULL default '',
 `page` text,
 `team` int(10) unsigned NOT NULL default '0',
 `tzoffset` int(4) default 0,
 `hideshoutbox` enum('yes', 'no') NOT NULL DEFAULT 'no',
 PRIMARY KEY  (`id`),
 UNIQUE KEY `username` (`username`),
 KEY `status_added` (`status`,`added`),
 KEY `ip` (`ip`),
 KEY `uploaded` (`uploaded`),
 KEY `downloaded` (`downloaded`),
 KEY `country` (`country`)
) ENGINE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1 ;


then create file called test.php
in the example " . $olduser['email'] .", needs to be the unit3d name i assume its email you just need to match up for TT you only need these columns - however you might need to add more like download, upload, signature etc - try get this query to work first any errors will be in admincp log
<?php
require_once("backend/functions.php");
dbconn();
    $sql = SQL_Query_exec("SELECT * from users1");
    $unit3d =  mysqli_fetch_assoc($ss_r);
    foreach ($unit3d as $olduser){
        $addnewuser = SQL_Query_exec("
                           INSERT INTO users (
                            username, password, secret, email,
                            status, added, last_access, age,
                            country, gender, client, stylesheet,
                            language, class, ip)
                            VALUES (
                           " . $olduser['username'] .",
                           " . $olduser['password'] .",
                           " . $olduser['secret'] .",
                           " . $olduser['email'] .",
                           " . $olduser['status'] .",
                           " . $olduser['added'] .",
                           " . $olduser['last_access'] .",
                           " . $olduser['age'].",
                           " . $olduser['country'] .",
                           " . $olduser['gender'] .",
                           " . $olduser['client'] .",
                           " . $site_config["default_theme"] .",
                           " . $site_config["default_language"] .",
                           1,
                           " . $olduser['ip'] .")");
    }
Last edited by M-jay warn on 2022-10-25 21:37:05
2022-10-25 21:56:02
how much would it cost for you to do it? I got a V3 site running atm, can clone it so we can do a database conversion for users?
2022-10-26 09:08:44
Any help would be free I don't do paid work I do it for fun and experience   👍

I know TT database like back of my hand so would just need a backup of the unit3d users table - if you make backup and in the backup sql file keep all the structure ( create users table)
and then delete all data ( insert into users) except 1 - it would help to have one example of a user

I looked at unit3d and the only thing that stood out was the passwords- I don't think you can transfer passwords - so on login user would have ro be directed to recover password or insert password or something like that
I can't seem to find which hash unit3d uses so would be quicker and easier resetting passwords
Last edited by M-jay warn on 2022-10-26 09:09:15
2022-10-26 09:48:23
yeah when doing any convertion from any code to another 99.9% of the time  users need to reset the passwords
2022-10-26 12:45:42
managed to convert them but noticed seedbonus which is not on default TT
i can transfer it if you want to add column to TT - there is a mod on the site for seedbonus
Last edited by M-jay warn on 2022-10-26 12:46:01
2022-10-26 13:25:38
sure i got a test site running anyways, just copied another one but its went a bit weird lol half of index bocks aint showing... lol
2022-10-27 06:41:32
This is how I converted the users table to TT for future reference for full transfers it would just be a case of copying this format to all tables.
<?php
define("DB_HOST", "localhost");
define("DB_USER", "dbusername");
define("DB_PASS", "dbpassword");
define("DB_NAME", "dbname");
define('DB_CHAR', 'utf8mb4');

function mksecret($len = 20)
{
   $chars = array_merge(range(0, 9), range("A", "Z"), range("a", "z"));
   shuffle($chars);
   $x = count($chars) - 1;
   for ($i = 1; $i <= $len; $i++)
       $str .= $chars[mt_rand(0, $x)];
   return $str;
}

function pdo($pdo, $sql, $args = NULL)
{
   try {
       if (!$args) {
           return $pdo->query($sql);
       }
       $stmt = $pdo->prepare($sql);
       $stmt->execute($args);
       return $stmt;
   } catch (\Exception $e) {
       throw $e;
   }
}

$opt = array(
   PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
   PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
   PDO::ATTR_EMULATE_PREPARES => false,
);
$dsn = 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHAR;
try {
   $pdo = new PDO($dsn, DB_USER, DB_PASS, $opt);
} catch (\Exception $e) {
   die('The Database Details Are Incorrect');
}

$unit3d = pdo($pdo, "SELECT * from users1")->fetchAll();
foreach ($unit3d as $olduser) {
   pdo(
       $pdo,
       "INSERT INTO users (
               username, password, secret, email,
               status, added, last_access,
               uploaded, downloaded, passkey, seedbonus, gender,
               stylesheet,
               language, class, signature)
               VALUES (
               ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
       [
           $olduser['username'],
           $olduser['password'],
           mksecret(),
           $olduser['email'],
           'confirmed',
           $olduser['created_at'],
           $olduser['last_action'],
           $olduser['uploaded'],
           $olduser['downloaded'],
           $olduser['passkey'],
           $olduser['seedbonus'],
           'Male',
           1,
           1,
           1,
           $olduser['signature'] ?? ''
       ]
   );
}

2022-10-27 06:48:27
thank you again M-Jay, I appreciate the help :)
2022-10-27 07:24:59
I have noticed when editing your own profile there isn't a save changes button anymore, any idea how to get it back? lol

hmm just checked a test site i got running with a few friends and it's not there either, not on the ravers theme or default hmm
Last edited by Lucifer on 2022-10-27 07:30:18
2022-10-27 07:35:30
on transfer all users were set to default class 1
go to host, phpmyadmin, users table, change you class to 7
after this you can set others on site like moderators etc
2022-10-27 07:38:24
I can do account-details fine it's editing my own profile on site that's the issue there is no save button when making changes to my gender, age etc lol
account.php?action=edit_settings&do=edit --- no save button here, I thought it were just me but seems both sites are the same
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728