Exemplo n.º 1
0
$tpl_friends = str_replace("%HOME%", $HOME_TEXT, $tpl_friends);
$tpl_friends = str_replace("%HOME_LINK%", $linkurl, $tpl_friends);
$db = new sqldb2($DB_CONFIG_v2);
// get users
$name_id = array();
$all_users = array();
$t = $db->query('SELECT * FROM nlb_users;');
while ($row = mysql_fetch_assoc($t)) {
    $all_users[] = $row;
    $name_id[$row['username']] = $row['id'];
}
// get blogs
$all_blogs = $db->getAllArray('SELECT * FROM nlb_blogs;');
// get comments
$all_com = $db->getAllArray('SELECT * FROM nlb_comments;');
$db->clear();
$db->setConfig($DB_CONFIG_v3);
$db->connect();
$now = time();
$past = 458895600;
//
//	INSERT USERS
//
foreach ($all_users as $u) {
    if (isset($_GET['old']) && $_GET['old'] == 'true') {
        $u['bio'] = addslashes($u['bio']);
        $u['custom_title'] = addslashes($u['custom_title']);
        $u['username'] = addslashes($u['username']);
    }
    $db->query('INSERT INTO `nlb3_users` ( `user_id` , `username` , `password` , `email` , `access` , `registered` , `last_login` , `ip` , `blog_count` , `timezone` , `bio` , `custom` , `date_format` , `birthday` , `perpage` , `gender` , `valid` )
	VALUES (' . "\r\n\t'{$u['id']}', \r\n\t'{$u['username']}', \r\n\t'{$u['password']}', \r\n\t'{$u['email']}', \r\n\t'{$users_access}', \r\n\t'{$u['registered']}', \r\n\t'{$u['last_seen']}', \r\n\t'{$u['ip_address']}', \r\n\t'0', \r\n\t'0', \r\n\t'{$u['bio']}', \r\n\t'{$u['custom_title']}', \r\n\t'{$u['date_format']}', \r\n\t'', \r\n\t'{$u['blogs_per_page']}', \r\n\t'{$u['gender']}', \r\n\t'{$u['status']}'\r\n\t);");