コード例 #1
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

$result = $fdb->query('SELECT m.msg_id, m.msg_timestamp, m.msg_userid, m.msg_guest, m.msg_userip, m.msg_topicid, m.msg_message, m.msg_modified, m.msg_modifieduser, u.usr_id, u.usr_name, um.usr_name AS modified_usr_name FROM ' . $fdb->prefix . 'messages AS m LEFT JOIN ' . $fdb->prefix . 'users AS u ON m.msg_userid=u.usr_id LEFT JOIN ' . $fdb->prefix . 'users AS um ON m.msg_modifieduser=um.usr_id WHERE m.msg_id>' . $start . ' ORDER BY m.msg_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['msg_id'];
    echo $ob['msg_id'] . ' (' . htmlspecialchars($ob['usr_name']) . ")<br>\n";
    flush();
    // Check for anonymous poster id problem
    if ($ob['msg_userid'] == 0) {
        $ob['msg_userid'] = 1;
        $ob['usr_name'] = $ob['msg_guest'];
        if ($ob['usr_name'] == '') {
            $ob['usr_name'] = $lang_common['Guest'];
        }
    } else {
        $ob['msg_userid']++;
    }
    // Dataarray
    $todb = array('id' => $ob['msg_id'], 'poster' => $ob['usr_name'], 'poster_id' => $ob['msg_userid'], 'posted' => $ob['msg_timestamp'], 'poster_ip' => long2ip($ob['msg_userip']), 'message' => convert_posts($ob['msg_message']), 'topic_id' => $ob['msg_topicid'], 'edited' => $ob['msg_modified'] > 0 ? $ob['msg_modified'] : '', 'edited_by' => isset($ob['modified_usr_name']) ? $ob['modified_usr_name'] : '');
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('msg_id', 'messages', $last_id);
コード例 #2
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

// Fetch posts info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'messages WHERE ID_MSG>' . $start . ' ORDER BY ID_MSG LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['ID_MSG'];
    echo '<br>' . $ob['ID_MSG'] . ' (' . htmlspecialchars($ob['posterName']) . ")\n";
    flush();
    // Settings
    $ob['ID_MEMBER'] == -1 ? $ob['ID_MEMBER'] = 1 : null;
    $ob['ID_MEMBER'] == 1 ? $ob['ID_MEMBER'] = $_SESSION['admin_id'] : null;
    // Dataarray
    $todb = array('id' => $ob['ID_MSG'], 'poster' => $ob['posterName'], 'poster_id' => $ob['ID_MEMBER'], 'posted' => $ob['posterTime'], 'poster_ip' => $ob['posterIP'], 'message' => convert_posts($ob['body']), 'topic_id' => $ob['ID_TOPIC']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['smilies'] = $ob['smiliesEnabled'];
    } else {
        $todb['hide_smilies'] = !$ob['smiliesEnabled'];
    }
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('ID_MSG', 'messages	', $last_id);
コード例 #3
0
ファイル: users.php プロジェクト: bowu8/fluxbb-converters
        $ob['group_id'] = PUN_MEMBER;
    } elseif ($ob['group_id'] == 4) {
        // moderators
        $ob['group_id'] = PUN_MOD;
    } elseif ($ob['group_id'] == 5) {
        // admins
        $ob['group_id'] = PUN_ADMIN;
    }
    // Check for user/guest collision
    if ($ob['user_id'] == 1) {
        // Fetch last user id
        $last_result = $fdb->query('SELECT user_id FROM ' . $fdb->prefix . "users ORDER BY user_id DESC LIMIT 1") or myerror('Unable to fetch last user id', __FILE__, __LINE__, $fdb->error());
        list($last_user_id) = $fdb->fetch_row($last_result);
        $ob['user_id'] = ++$last_user_id;
        $_SESSION['admin_id'] = $ob['user_id'];
    }
    // Bots
    if ($ob['user_type'] == '2') {
        continue;
    }
    // Dataarray
    $todb = array('id' => $ob['user_id'], 'group_id' => $ob['group_id'], 'username' => $ob['username'], 'password' => $ob['user_password'], 'title' => $title, 'url' => $ob['user_website'], 'icq' => $ob['user_icq'], 'msn' => $ob['user_msnm'], 'aim' => $ob['user_aim'], 'yahoo' => $ob['user_yim'], 'num_posts' => $ob['user_posts'], 'last_post' => $last['post_time'], 'location' => $ob['user_from'], 'email_setting' => !$ob['user_allow_viewemail'], 'timezone' => (int) $ob['user_timezone'], 'last_visit' => $ob['user_lastvisit'], 'signature' => convert_posts($ob['user_sig']), 'email' => $ob['user_email']);
    // Handle the user registered date
    $todb['registered'] = intval($ob['user_regdate']) > 0 ? $ob['user_regdate'] : strtotime($ob['user_regdate']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['last_action'] = $ob['user_lastvisit'];
    }
    // Save data
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('user_id', 'users', $last_id);
コード例 #4
0
ファイル: messages.php プロジェクト: bowu8/fluxbb-converters
}
$result = $fdb->query('SELECT m.mp_id, m.mp_subj, m.mp_content, m.mp_read, m.mp_to, m.mp_from, m.mp_timestamp, u.usr_name, ur.usr_name AS receiver FROM ' . $fdb->prefix . 'mp AS m LEFT JOIN ' . $fdb->prefix . 'users AS u ON u.usr_id=m.mp_from LEFT JOIN ' . $fdb->prefix . 'users AS ur ON ur.usr_id=m.mp_to WHERE m.mp_id>' . $start . ' ORDER BY m.mp_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get message list", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['mp_id'];
    echo htmlspecialchars($ob['usr_name']) . ' (' . $ob['mp_id'] . ")<br>\n";
    flush();
    ++$ob['mp_from'];
    $ob['mp_subj'] = convert_posts($ob['mp_subj']);
    // Topic already exist?
    $result_tid = $db->query('SELECT t.id FROM ' . $db->prefix . 'pms_new_topics AS t WHERE t.topic=\'' . $db->escape(str_replace('Re : ', '', $ob['mp_subj'])) . '\' ORDER BY t.id LIMIT 1') or myerror("Unable to get topic id", __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result_tid)) {
        $topic_id = $db->result($result_tid);
        // Check if there are more same messages, if yes, it is a message to all users
        $result_all = $fdb->query('SELECT 1 FROM ' . $fdb->prefix . 'mp AS m WHERE m.mp_id<>' . $ob['mp_id'] . ' AND m.mp_content=\'' . $fdb->escape($ob['mp_content']) . '\' LIMIT 1') or myerror("Unable to check message", __FILE__, __LINE__, $fdb->error());
        if ($fdb->num_rows($result_all)) {
            $db->query('UPDATE ' . $db->prefix . 'pms_new_topics SET to_user=\'all\', to_id=1 WHERE id=' . $topic_id) or myerror('Unable to update topics', __FILE__, __LINE__, $db->error());
            continue;
        }
    } else {
        $todb = array('topic' => $ob['mp_subj'], 'starter' => $ob['usr_name'], 'starter_id' => $ob['mp_from'], 'to_user' => $ob['receiver'], 'to_id' => ++$ob['mp_to'], 'replies' => 1, 'last_posted' => $ob['mp_timestamp']);
        // Save data
        insertdata('pms_new_topics', $todb, __FILE__, __LINE__);
        $topic_id = $db->insert_id();
    }
    // Dataarray
    $todb = array('poster' => $ob['usr_name'], 'poster_id' => $ob['mp_from'], 'message' => convert_posts($ob['mp_content']), 'posted' => $ob['mp_timestamp'], 'post_new' => $ob['mp_read'], 'topic_id' => $topic_id);
    // Save data
    insertdata('pms_new_posts', $todb, __FILE__, __LINE__);
}
convredirect('mp_id', 'mp', $last_id);
コード例 #5
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'posts WHERE pid>' . $start . ' ORDER BY pid LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['pid'];
    echo $ob['pid'] . ' (' . htmlspecialchars($ob['username']) . ")<br>\n";
    flush();
    // Check for anonymous poster id problem
    /*		if($ob['poster_id'] == -1)
    	{
    		$ob['poster_id'] = 1;
    		$ob['username'] = $ob['post_username'];
    		if ($ob['username'] == '')
    			$ob['username'] = $lang_common['Guest'];
    	}*/
    // Dataarray
    $todb = array('id' => $ob['pid'], 'poster' => $ob['username'], 'poster_id' => ++$ob['uid'], 'posted' => $ob['dateline'], 'poster_ip' => $ob['ipaddress'], 'message' => convert_posts($ob['message']), 'topic_id' => $ob['tid']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('pid', 'posts', $last_id);
コード例 #6
0
ファイル: posts.php プロジェクト: neofutur/MyBestBB
<?php

$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'posts AS p, ' . $_SESSION['php'] . 'users AS u WHERE p.post_author=u.user_id AND post_id>' . $start . ' ORDER BY post_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['post_id'];
    echo $ob['post_id'] . ' (' . $ob['user_name'] . ")<br>\n";
    flush();
    // Check id=1 collisions
    $ob['post_author'] == 1 ? $ob['post_author'] = $_SESSION['admin_id'] : null;
    // Guest id=0 -> id=1
    $ob['post_author'] == 0 ? $ob['post_author'] = 1 : null;
    // Dataarray
    $todb = array('id' => $ob['post_id'], 'poster' => $ob['user_name'], 'poster_id' => $ob['post_author'], 'posted' => $ob['post_datestamp'], 'message' => convert_posts($ob['post_message']), 'topic_id' => $ob['thread_id']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('post_id', 'posts', $last_id);
コード例 #7
0
ファイル: users.php プロジェクト: neofutur/MyBestBB
    $last_id = $ob['userid'];
    echo '<br>' . $ob['username'] . ' (' . $ob['userid'] . ")\n";
    flush();
    // Settings
    $ob['status'] = 0;
    $ob['usergroupid'] == 6 ? $ob['status'] = 2 : null;
    $ob['usergroupid'] == 7 ? $ob['status'] = 1 : null;
    // Fetch last_post_time
    $result = $fdb->query('SELECT dateline FROM ' . $_SESSION['php'] . 'post WHERE userid=' . $ob['userid'] . ' ORDER BY postid DESC LIMIT 1') or myerror('Unable to fetch last user id', __FILE__, __LINE__, $fdb->error());
    $ob['dateline'] = $fdb->num_rows($result) > 0 ? $fdb->result($result, 0) : 'null';
    // Check for user/guest collision
    if ($ob['userid'] == 1) {
        // Fetch last user id
        $last_result = $fdb->query('SELECT userid FROM ' . $_SESSION['php'] . "user ORDER BY userid DESC LIMIT 1") or myerror('Unable to fetch last user id', __FILE__, __LINE__, $fdb->error());
        list($last_user_id) = $fdb->fetch_row($last_result);
        $ob['userid'] = ++$last_user_id;
        $_SESSION['admin_id'] = $ob['userid'];
    }
    // Dataarray
    $todb = array('id' => $ob['userid'], 'username' => $ob['username'], 'password' => '', 'url' => $ob['homepage'], 'icq' => $ob['icq'], 'msn' => $ob['msn'], 'aim' => $ob['aim'], 'yahoo' => $ob['yahoo'], 'signature' => convert_posts($ob['signature']), 'timezone' => $ob['timezoneoffset'], 'num_posts' => $ob['posts'], 'last_post' => $ob['dateline'], 'registered' => $ob['joindate'], 'last_visit' => $ob['lastvisit'], 'location' => $ob['location'], 'email' => $ob['email']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['status'] = $ob['status'];
    } else {
        if ($ob['status'] == 2) {
            $todb['group_id'] = 1;
        }
    }
    // Save data
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('userid', 'user', $last_id);
コード例 #8
0
ファイル: messages.php プロジェクト: bowu8/fluxbb-converters
// Check if New PMS mod is installed
if ($start == 0 && !$db->table_exists('pms_new_posts')) {
    next_step();
}
$result = $fdb->query('SELECT m.*, u.username FROM ' . $fdb->prefix . 'privmsgs AS m LEFT JOIN ' . $fdb->prefix . 'users AS u ON u.user_id=m.author_id WHERE m.msg_id>' . $start . ' ORDER BY m.msg_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get message list", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['msg_id'];
    echo $ob['msg_id'] . "<br>\n";
    flush();
    $result_msg = $fdb->query('SELECT t.*, u.username FROM ' . $fdb->prefix . 'privmsgs_to AS t, ' . $fdb->prefix . 'users AS u WHERE t.user_id=u.user_id AND t.msg_id=' . $ob['msg_id'] . ' LIMIT 1') or myerror("Unable to get message list", __FILE__, __LINE__, $fdb->error());
    $msg = $fdb->fetch_assoc($result_msg);
    // Is topic message?
    if ($ob['root_level'] != 0) {
        $topic_id = $ob['root_level'];
    } else {
        $to_user = intval(str_replace('u_', '', $ob['to_address']));
        $result_username = $fdb->query('SELECT username FROM ' . $fdb->prefix . 'users WHERE user_id=' . $to_user) or myerror('Unable to get username', __FILE__, __LINE__, $fdb->error());
        $to_username = $fdb->result($result_username);
        $todb = array('id' => $ob['msg_id'], 'topic' => $ob['message_subject'], 'starter' => $ob['username'], 'starter_id' => $ob['author_id'], 'to_user' => $to_username, 'to_id' => $to_user, 'replies' => 1, 'last_posted' => $ob['message_time']);
        // Save data
        insertdata('pms_new_topics', $todb, __FILE__, __LINE__);
        $topic_id = $db->insert_id();
    }
    // Dataarray
    $todb = array('poster' => $ob['username'], 'poster_id' => $ob['author_id'], 'message' => convert_posts($ob['message_text']), 'posted' => $ob['message_time'], 'post_new' => $msg['pm_unread'], 'topic_id' => $topic_id);
    // Save data
    insertdata('pms_new_posts', $todb, __FILE__, __LINE__);
}
convredirect('msg_id', 'privmsgs', $last_id);
コード例 #9
0
ファイル: users.php プロジェクト: bowu8/fluxbb-converters
    */
    $group_id = $ob['usergroup'];
    // Convert mybb group id to fluxbb group id
    if ($group_id == 1) {
        $group_id = PUN_GUEST;
    } elseif ($group_id == 2) {
        $group_id = PUN_MEMBER;
    } elseif ($group_id == 3 || $group_id == 6) {
        $group_id = PUN_MOD;
    } elseif ($group_id == 4) {
        $group_id = PUN_ADMIN;
    } elseif ($group_id == 5) {
        $group_id = -1;
    }
    /*		else
    		++$group_id;
    */
    /*		if ($group_id > $group_count) // something went wrong
    		$group_id = PUN_MEMBER; // set as user
    */
    if (!in_array($group_id, $groups)) {
        $group_id = PUN_MEMBER;
    }
    // Dataarray
    $todb = array('id' => $ob['uid'], 'group_id' => $group_id, 'username' => $ob['username'], 'password' => $ob['password'], 'salt' => $ob['salt'], 'title' => '', 'url' => $ob['website'], 'icq' => $ob['icq'], 'msn' => $ob['msn'], 'aim' => $ob['aim'], 'yahoo' => $ob['yahoo'], 'num_posts' => $ob['postnum'], 'last_post' => $last['dateline'], 'location' => '', 'email_setting' => $ob['hideemail'], 'timezone' => $ob['timezone'], 'last_visit' => $ob['lastvisit'], 'signature' => convert_posts($ob['signature']), 'email' => $ob['email'], 'registered' => $ob['regdate'], 'registration_ip' => $ob['regip']);
    // Handle the user registered date
    //		$todb['registered'] = intval($ob['user_regdate']) > 0 ? $ob['user_regdate'] : strtotime($ob['user_regdate']);
    // Save data
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('uid', 'users', $last_id);
コード例 #10
0
ファイル: posts.php プロジェクト: neofutur/MyBestBB
<?php

$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'posts WHERE pid>' . $start . ' ORDER BY pid LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['pid'];
    echo $ob['pid'] . ' (' . $ob['author_name'] . ")<br>\n";
    flush();
    // Check id=1 collisions
    $ob['author_id'] == 1 ? $ob['author_id'] = $_SESSION['admin_id'] : null;
    // Guest id=0 -> id=1
    $ob['author_id'] == 0 ? $ob['author_id'] = 1 : null;
    // Dataarray
    $todb = array('id' => $ob['pid'], 'poster' => $ob['author_name'], 'poster_id' => $ob['author_id'], 'posted' => $ob['post_date'], 'poster_ip' => $ob['ip_address'], 'message' => convert_posts($ob['post']), 'topic_id' => $ob['topic_id']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('pid', 'posts', $last_id);
コード例 #11
0
ファイル: posts.php プロジェクト: neofutur/MyBestBB
<?php

// Fetch posts info
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'post WHERE postid>' . $start . ' ORDER BY postid LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['postid'];
    echo '<br>' . $ob['postid'] . ' (' . $ob['username'] . ")\n";
    flush();
    // Settings
    // --> Check id=1 collisions
    $ob['userid'] == 1 ? $ob['userid'] = $_SESSION['admin_id'] : null;
    // Dataarray
    $todb = array('id' => $ob['postid'], 'poster' => $ob['username'], 'poster_id' => $ob['userid'], 'posted' => $ob['dateline'], 'poster_ip' => $ob['ipaddress'], 'message' => convert_posts($ob['pagetext']), 'topic_id' => $ob['threadid']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['smilies'] = $ob['allowsmilie'];
    } else {
        $todb['hide_smilies'] = !$ob['allowsmilie'];
    }
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('postid', 'post', $last_id);
コード例 #12
0
ファイル: posts.php プロジェクト: neofutur/MyBestBB
<?php

$result = $fdb->query('SELECT post.post_id, post.post_time, post.poster_id, post.poster_ip, post.topic_id, text.post_subject, text.post_text, users.username FROM ' . $_SESSION['php'] . $_SESSION['phpnuke'] . 'posts AS post, ' . $_SESSION['php'] . $_SESSION['phpnuke'] . 'posts_text AS text, ' . $_SESSION['php'] . 'users AS users WHERE post.post_id>' . $start . ' AND post.post_id=text.post_id AND users.user_id=post.poster_id ORDER BY post.post_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['post_id'];
    echo $ob['post_id'] . ' (' . $ob['username'] . ")<br>\n";
    flush();
    // Check for anonymous poster id problem
    if ($ob['poster_id'] == -1) {
        $ob['poster_id'] = 1;
        $ob['username'] = 'Guest';
    }
    // Dataarray
    $todb = array('id' => $ob['post_id'], 'poster' => $ob['username'], 'poster_id' => $ob['poster_id'], 'posted' => $ob['post_time'], 'poster_ip' => decode_ip($ob['poster_ip']), 'message' => convert_posts($ob['post_text']), 'topic_id' => $ob['topic_id']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('post_id', $_SESSION['phpnuke'] . 'posts', $last_id);
コード例 #13
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'messages WHERE id_msg>' . $start . ' ORDER BY id_msg LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['id_msg'];
    echo $ob['id_msg'] . ' (' . htmlspecialchars($ob['poster_name']) . ")<br>\n";
    flush();
    // Check id=1 collisions
    $ob['id_member'] == 1 ? $ob['id_member'] = $_SESSION['admin_id'] : null;
    // Guest id=0 -> id=1
    $ob['id_member'] == 0 ? $ob['id_member'] = 1 : null;
    // Dataarray
    $todb = array('id' => $ob['id_msg'], 'poster' => $ob['poster_name'], 'poster_id' => $ob['id_member'], 'posted' => $ob['poster_time'], 'poster_ip' => $ob['poster_ip'], 'message' => convert_posts($ob['body']), 'topic_id' => $ob['id_topic']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('id_msg', 'messages', $last_id);
コード例 #14
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

$result = $fdb->query('SELECT p.*, u.* FROM ' . $fdb->prefix . 'posts AS p LEFT JOIN ' . $fdb->prefix . 'users AS u ON p.poster_id=u.user_id WHERE p.post_id>' . $start . ' ORDER BY p.post_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['post_id'];
    echo htmlspecialchars($ob['post_id']) . ' (' . $ob['username'] . ")<br>\n";
    flush();
    // Check for anonymous poster id problem
    if ($ob['poster_id'] == 1) {
        $ob['username'] = $ob['post_username'];
        if ($ob['username'] == '') {
            $ob['username'] = $lang_common['Guest'];
        }
    }
    // Dataarray
    $todb = array('id' => $ob['post_id'], 'poster' => $ob['username'], 'poster_id' => $ob['poster_id'], 'posted' => $ob['post_time'], 'poster_ip' => $ob['poster_ip'], 'message' => convert_posts(html_entity_decode($ob['post_text'])), 'topic_id' => $ob['topic_id']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('post_id', 'posts', $last_id);
コード例 #15
0
ファイル: users.php プロジェクト: bowu8/fluxbb-converters
    // Last post
    $lastresult = $fdb->query('SELECT msg_timestamp FROM ' . $fdb->prefix . 'messages WHERE msg_userid =' . $ob['usr_id'] . ' ORDER BY msg_id DESC LIMIT 1') or myerror("Unable to get user indo", __FILE__, __LINE__, $fdb->error());
    $last = $fdb->fetch_assoc($lastresult);
    $last['msg_timestamp'] == 0 ? $last['msg_timestamp'] = 'null' : null;
    // Convert cb group id to fluxbb group id
    if ($ob['usr_class'] == 1) {
        $ob['usr_class'] = PUN_ADMIN;
    } elseif ($ob['usr_class'] == 2) {
        $ob['usr_class'] = PUN_MOD;
    } elseif ($ob['usr_class'] == 3 || $ob['usr_class'] == 4) {
        // user
        $ob['usr_class'] = PUN_MEMBER;
    }
    if (!in_array($ob['usr_class'], $groups)) {
        $ob['usr_class'] = PUN_MEMBER;
    }
    if ($ob['usr_punished'] != '') {
        list($type, $start, $expires) = explode('|', $ob['usr_punished']);
        //Dataarray
        $todb = array('username' => $ob['usr_name'], 'email' => $ob['usr_email'], 'ip' => long2ip($ob['usr_ip']), 'expire' => $start + $expires);
        // Save data
        insertdata('bans', $todb, __FILE__, __LINE__);
    }
    // Dataarray
    $todb = array('id' => ++$ob['usr_id'], 'group_id' => $ob['usr_class'], 'username' => $ob['usr_name'], 'password' => $ob['usr_password'], 'url' => $ob['usr_website'], 'icq' => $ob['usr_icq'], 'msn' => $ob['usr_msn'], 'aim' => $ob['usr_aim'], 'yahoo' => $ob['usr_yahoo'], 'num_posts' => $ob['usr_nbmess'], 'last_post' => $last['msg_timestamp'], 'location' => $ob['usr_place'], 'email_setting' => !$ob['usr_publicemail'], 'timezone' => (int) $ob['usr_pref_timezone'], 'dst' => $ob['usr_pref_ctsummer'], 'last_visit' => $ob['usr_lastconnect'], 'signature' => convert_posts($ob['usr_signature']), 'email' => $ob['usr_email'], 'registration_ip' => long2ip($ob['usr_ip']), 'realname' => $ob['usr_realname']);
    // Handle the user registered date
    $todb['registered'] = intval($ob['usr_registertime']) > 0 ? $ob['usr_registertime'] : strtotime($ob['usr_registertime']);
    // Save data
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('usr_id', 'users', $last_id);
コード例 #16
0
ファイル: users.php プロジェクト: neofutur/MyBestBB
    echo $ob['name'] . ' (' . $ob['id'] . ")<br>\n";
    flush();
    // Check for user/guest collision
    if ($ob['id'] == 1) {
        // Fetch last user id
        $last_result = $fdb->query('SELECT id FROM ' . $_SESSION['php'] . "members ORDER BY id DESC LIMIT 1") or myerror('Unable to fetch last user id', __FILE__, __LINE__, $fdb->error());
        list($last_user_id) = $fdb->fetch_row($last_result);
        $ob['id'] = ++$last_user_id;
        $_SESSION['admin_id'] = $ob['id'];
    }
    // Posts and topics settings
    list($ob['disp_posts'], $ob['disp_topics']) = explode("&", $ob['view_prefs']);
    $ob['disp_posts'] < 3 ? $ob['disp_posts'] = 'null' : null;
    $ob['disp_topics'] < 3 ? $ob['disp_topics'] = 'null' : null;
    // Last_post should be 'null' instead of 0
    $ob['last_post'] == null ? $ob['last_post'] = 'null' : null;
    // Ver 1.3 specific stuff
    if ($_SESSION['ver'] == "13") {
        $ob['signature'] = preg_replace('#\\<br>#i', "\r\n", $ob['signature']);
    } else {
        $ob['password'] = '';
    }
    // Dataarray
    $todb = array('id' => $ob['id'], 'username' => $ob['name'], 'password' => $ob['password'], 'url' => $ob['website'], 'icq' => $ob['icq_number'], 'msn' => $ob['msnname'], 'aim' => $ob['aim_name'], 'yahoo' => $ob['yahoo'], 'signature' => convert_posts($ob['signature']), 'location' => $ob['location'], 'timezone' => $ob['time_offset'], 'num_posts' => $ob['posts'], 'last_post' => $ob['last_post'], 'show_img' => $ob['view_img'], 'show_avatars' => $ob['view_avs'], 'show_sig' => $ob['view_sigs'], 'registered' => $ob['joined'], 'last_visit' => $ob['last_visit'], 'email_setting' => (int) ($ob['hide_email'] == "0"), 'email' => $ob['email']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['last_action'] = $ob['last_activity'];
    }
    // Save data
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('id', 'members', $last_id);
コード例 #17
0
ファイル: posts.php プロジェクト: bowu8/fluxbb-converters
<?php

// Fetch posts info
$result = $fdb->query('SELECT post_id, poster_name, post_time, poster_id, poster_ip, topic_id, post_text FROM ' . $fdb->prefix . 'posts WHERE post_id>' . $start . ' ORDER BY post_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get posts", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['post_id'];
    echo htmlspecialchars($ob['post_id']) . ' (' . $ob['poster_name'] . ")<br>\n";
    flush();
    // Change guest and admin user id
    $ob['poster_id'] == 1 ? $ob['poster_id'] = $_SESSION['admin_id'] : null;
    if ($ob['poster_id'] == 0) {
        $ob['poster_id'] = 1;
    }
    // Dataarray
    $todb = array('id' => $ob['post_id'], 'poster' => $ob['poster_name'], 'poster_id' => $ob['poster_id'], 'posted' => strtotime($ob['post_time']), 'poster_ip' => $ob['poster_ip'], 'message' => convert_posts($ob['post_text']), 'topic_id' => $ob['topic_id']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('post_id', 'posts', $last_id);
コード例 #18
0
ファイル: posts.php プロジェクト: neofutur/MyBestBB
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['message_id'];
    echo '<br>' . $ob['message_id'] . ' (' . $ob['author'] . ")\n";
    flush();
    // Settings
    $ob['user_id'] < 1 ? $ob['user_id'] = 1 : null;
    $ob['user_id'] == 1 ? $ob['user_id'] = $_SESSION['admin_id'] : null;
    // Create topic
    if ($ob['message_id'] == $ob['thread']) {
        // Unserialize meta data
        $meta = unserialize($ob['meta']);
        // Dataarray
        $todb = array('id' => $ob['message_id'], 'poster' => $ob['author'], 'subject' => $ob['subject'], 'posted' => $ob['datestamp'], 'forum_id' => $ob['forum_id'], 'num_replies' => $ob['thread_count'] - 1, 'closed' => $ob['closed'], 'last_post' => $ob['datestamp']);
        // Recent post
        if (isset($meta['recent_post'])) {
            $todb['last_post_id'] = $meta['recent_post']['message_id'];
            $todb['last_poster'] = $meta['recent_post']['author'];
        }
        // Number of views
        if (isset($meta['mod_viewcount'])) {
            $todb['num_views'] = $meta['mod_viewcount'][$ob['message_id']];
        }
        // Save data
        insertdata('topics', $todb, __FILE__, __LINE__);
    }
    // Dataarray
    $todb = array('id' => $ob['message_id'], 'poster' => $ob['author'], 'poster_id' => $ob['user_id'], 'posted' => $ob['datestamp'], 'poster_ip' => $ob['ip'], 'message' => convert_posts($ob['body']), 'topic_id' => $ob['thread']);
    // Save data
    insertdata('posts', $todb, __FILE__, __LINE__);
}
convredirect('message_id', 'messages', $last_id);