Esempio n. 1
0
<?php

// Fetch forum info
$result = $fdb->query('SELECT b.*,m.posterName,m.ID_MSG,m.posterTime FROM ' . $fdb->prefix . 'boards AS b LEFT JOIN ' . $fdb->prefix . 'messages AS m ON b.ID_LAST_TOPIC=ID_MSG WHERE ID_BOARD>' . $start . ' ORDER BY ID_BOARD LIMIT ' . $_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['ID_BOARD'];
    echo htmlspecialchars($ob['name']) . ' (' . $ob['ID_BOARD'] . ")<br>\n";
    flush();
    // Dataarray
    $todb = array('id' => $ob['ID_BOARD'], 'forum_name' => $ob['name'], 'forum_desc' => $ob['description'], 'num_topics' => $ob['numTopics'], 'num_posts' => $ob['numPosts'], 'disp_position' => $ob['boardOrder'], 'last_poster' => $ob['posterName'], 'last_post_id' => $ob['ID_MSG'], 'last_post' => $ob['posterTime'], 'cat_id' => $ob['ID_CAT']);
    // Save data
    insertdata('forums', $todb, __FILE__, __LINE__);
}
convredirect('ID_BOARD', 'boards', $last_id);
Esempio n. 2
0
// Check if AutoPoll is installed
if ($start == 0 && !$db->table_exists('polls')) {
    next_step();
}
$result = $fdb->query('SELECT vote_id,topic_id,vote_text,vote_start FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'vote_desc WHERE vote_id>' . $start . ' ORDER BY vote_id LIMIT ' . $_SESSION['limit']) or myerror('Unable to fetch poll info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['vote_id'];
    echo htmlspecialchars($ob['vote_text']) . ' (' . $ob['vote_id'] . ")<br>\n";
    flush();
    $answers = null;
    $results = null;
    $vote_results = $fdb->query('SELECT vote_option_text,vote_result FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'vote_results WHERE vote_id=' . $ob['vote_id'] . ' ORDER BY vote_option_id') or myerror("Unable to get poll answers.", __FILE__, __LINE__, $fdb->error());
    while (list($vote_option_text, $vote_result) = $fdb->fetch_row($vote_results)) {
        $answers[] = htmlspecialchars($vote_option_text, ENT_QUOTES);
        $results[] = $vote_result;
    }
    $voter_ids = null;
    $vote_results = $fdb->query('SELECT vote_user_id FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'vote_voters WHERE vote_id=' . $ob['vote_id']) or myerror("PhpBB: Unable to get poll voters.", __FILE__, __LINE__, $fdb->error());
    while (list($voters) = $fdb->fetch_row($vote_results)) {
        $voter_ids[] = $voters;
    }
    $db->query('UPDATE ' . $db->prefix . 'topics SET question=\'' . $db->escape(convert_to_utf8($ob['vote_text'])) . '\' WHERE id=' . $ob['topic_id']) or myerror("PhpBB: Unable to get poll voters.", __FILE__, __LINE__, $fdb->error());
    // Dataarray
    $todb = array('id' => $ob['vote_id'], 'pollid' => $ob['topic_id'], 'ptype' => 1, 'options' => serialize($answers), 'voters' => serialize($voter_ids), 'votes' => serialize($results), 'created' => $ob['vote_start']);
    // Save data
    insertdata('polls', $todb, __FILE__, __LINE__);
}
convredirect('vote_id', $_SESSION['phpnuke'] . 'vote_desc', $last_id);
Esempio n. 3
0
				)') or myerror("Unable to save post", __FILE__, __LINE__, $db->error());
            break;
            // 0: Read the message [ Inbox ]
            // 3: Saved a message [ Savebox ]
        // 0: Read the message [ Inbox ]
        // 3: Saved a message [ Savebox ]
        case 0:
        case 3:
            $ob['owner'] = $ob['privmsgs_to_userid'];
            $ob['sender'] = $ob['privmsgs_from_userid'];
            $ob['status'] = 0;
            $ob['showed'] = 1;
            break;
    }
    // Save to database
    $db->query('INSERT INTO ' . $db->prefix . 'messages
		(owner, subject, message, sender, sender_id, posted, sender_ip, smileys, status, showed) VALUES(
		' . $ob['owner'] . ',
		\'' . addslashes($ob['privmsgs_subject']) . '\',
		\'' . addslashes($ob['privmsgs_text']) . '\',
		\'' . addslashes($ob['username']) . '\',
		' . $ob['sender'] . ',
		' . $ob['privmsgs_date'] . ',
		\'' . decode_ip($ob['privmsgs_ip']) . '\',
		' . $ob['privmsgs_enable_smilies'] . ',
		' . $ob['status'] . ',
		' . $ob['showed'] . '
		)') or myerror("Unable to save post", __FILE__, __LINE__, $db->error());
}
convredirect('privmsgs_id', $_SESSION['phpnuke'] . 'privmsgs', $last_id);
Esempio n. 4
0
    }
    $userres = $fdb->query($sql) or myerror("Unable to fetch user info for forum conversion.", __FILE__, __LINE__, $fdb->error());
    $userinfo = $fdb->fetch_assoc($userres);
    if ($userinfo['poster_id'] == -1) {
        $userinfo['username'] = $userinfo['post_username'];
    }
    if ($userinfo['username'] == '') {
        $userinfo['username'] = $lang_common['Guest'];
    }
    // Change last_post = 0 to null to prevent the time-bug.
    if (!isset($userinfo['post_time']) || $userinfo['post_time'] == 0) {
        $userinfo['post_time'] = 'null';
    }
    if ($ob['forum_last_post_id'] == 0) {
        $ob['forum_last_post_id'] = 'null';
    }
    // Unset variables
    if (!isset($userinfo['username'])) {
        $userinfo['username'] = '******';
    }
    // Category does not exist?
    if (!in_array($ob['cat_id'], $categories)) {
        $ob['cat_id'] = $categories[0];
    }
    // Dataarray
    $todb = array('id' => $ob['forum_id'], 'forum_name' => $ob['forum_name'], 'forum_desc' => $ob['forum_desc'], 'num_topics' => $ob['forum_topics'], 'num_posts' => $ob['forum_posts'], 'disp_position' => $ob['forum_order'], 'last_poster' => $userinfo['username'], 'last_post_id' => $ob['forum_last_post_id'], 'last_post' => $userinfo['post_time'], 'cat_id' => $ob['cat_id']);
    // Save data
    insertdata('forums', $todb, __FILE__, __LINE__);
}
convredirect('forum_id', $_SESSION['phpnuke'] . 'forums', $last_id);
Esempio n. 5
0
<?php

// Fetch topic info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'topics WHERE tid > ' . $start . ' ORDER BY tid LIMIT ' . $_SESSION['limit']) or myerror('Unable to get topic info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['tid'];
    echo htmlspecialchars($ob['title']) . ' (' . $ob['tid'] . ")<br>\n";
    flush();
    // Check id=1 collisions
    $ob['starter_id'] == 1 ? $ob['starter_id'] = $_SESSION['admin_id'] : null;
    $ob['last_poster_id'] == 1 ? $ob['last_poster_id'] = $_SESSION['admin_id'] : null;
    $ob['last_poster_name'] == '' || $ob['last_poster_name'] == null ? $ob['last_poster_name'] = 'null' : null;
    // Fetch last_post_id
    $res = $fdb->query('SELECT pid FROM ' . $fdb->prefix . 'posts WHERE topic_id=' . $ob['tid'] . ' ORDER BY pid DESC LIMIT 1') or myerror('Unable to get last_post_id', __FILE__, __LINE__, $fdb->error());
    $ob['last_post_id'] = $fdb->num_rows($res) > 0 ? $fdb->result($res, 0) : null;
    // Dataarray
    $todb = array('id' => $ob['tid'], 'poster' => $ob['starter_name'], 'subject' => $ob['title'], 'posted' => $ob['start_date'], 'num_views' => $ob['views'], 'num_replies' => $ob['posts'], 'last_post' => $ob['last_post'], 'last_post_id' => $ob['last_post_id'], 'last_poster' => $ob['last_poster_name'], 'sticky' => $ob['pinned'], 'forum_id' => $ob['forum_id']);
    // Save data
    insertdata('topics', $todb, __FILE__, __LINE__);
}
convredirect('tid', 'topics', $last_id);
Esempio n. 6
0
<?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);
Esempio n. 7
0
    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);
Esempio n. 8
0
<?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);
Esempio n. 9
0
<?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'] = '******';
    }
    // 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);
Esempio n. 10
0
// 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);
Esempio n. 11
0
<?php

// Fetch topic info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'topics WHERE id_topic > ' . $start . ' ORDER BY id_topic LIMIT ' . $_SESSION['limit']) or myerror('Unable to get topic info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['id_topic'];
    // Fetch last post info
    $posts_res = $fdb->query('SELECT subject, poster_time, id_msg, poster_name FROM ' . $fdb->prefix . 'messages WHERE id_msg IN(' . $ob['id_first_msg'] . ',' . $ob['id_last_msg'] . ')') or myerror('Unable to fetch last topic post info', __FILE__, __LINE__, $fdb->error());
    $ob['first'] = $fdb->fetch_assoc($posts_res);
    $ob['last'] = $fdb->fetch_assoc($posts_res);
    $ob['last'] == null ? $ob['last'] = $ob['first'] : null;
    echo htmlspecialchars($ob['first']['subject']) . ' (' . $ob['id_topic'] . ")<br>\n";
    flush();
    // Dataarray
    $todb = array('id' => $ob['id_topic'], 'poster' => $ob['first']['poster_name'], 'subject' => $ob['first']['subject'], 'posted' => $ob['first']['poster_time'], 'num_views' => $ob['num_views'], 'num_replies' => $ob['num_replies'], 'last_post' => $ob['last']['poster_time'], 'last_post_id' => $ob['last']['id_msg'], 'last_poster' => $ob['last']['poster_name'], 'sticky' => $ob['is_sticky'], 'closed' => $ob['locked'], 'forum_id' => $ob['id_board']);
    // Save data
    insertdata('topics', $todb, __FILE__, __LINE__);
}
convredirect('id_topic', 'topics', $last_id);
Esempio n. 12
0
<?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);
Esempio n. 13
0
<?php

$result = $fdb->query('SELECT ' . $fdb->prefix . 'ban_items.id_ban, ' . $fdb->prefix . 'members.member_name,
						ip_low1, ip_low2, ip_low3, ip_low4,
						' . $fdb->prefix . 'ban_items.email_address, ' . $fdb->prefix . 'ban_groups.reason, ' . $fdb->prefix . 'ban_groups.expire_time
						FROM ' . $fdb->prefix . 'ban_items
						INNER JOIN ' . $fdb->prefix . 'ban_groups ON ' . $fdb->prefix . 'ban_groups.id_ban_group = ' . $fdb->prefix . 'ban_items.id_ban_group
						LEFT JOIN ' . $fdb->prefix . 'members ON ' . $fdb->prefix . 'members.id_member = ' . $fdb->prefix . 'ban_items.id_member
						WHERE id_ban>' . $start . ' ORDER BY id_ban LIMIT ' . ceil($_SESSION['limit'] / 5)) or myerror("Unable to get bans", __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['id_ban'];
    $ob['member_name'] == '' ? $username = '******' : ($username = $ob['member_name']);
    $ob['ip_low1'] == '0' ? $ip = 'null' : ($ip = trim($ob['ip_low1'] . '.' . $ob['ip_low2'] . '.' . $ob['ip_low3'] . '.' . $ob['ip_low4'], '.'));
    $ob['email_address'] == '' ? $email = 'null' : ($email = $ob['email_address']);
    $ob['reason'] == '' ? $message = 'null' : ($message = $ob['reason']);
    $ob['expire_time'] == '' ? $expire = 'null' : ($expire = strtotime(date('Y-m-d', $ob['expire_time']) . ' GMT'));
    echo $ob['id_ban'] . ' - ' . ($username == 'null' ? $email == 'null' ? $ip : $email : $username) . "<br>\n";
    flush();
    // Dataarray
    $todb = array('username' => $username, 'ip' => $ip, 'email' => $email, 'message' => $message, 'expire' => $expire);
    // Save data
    insertdata('bans', $todb, __FILE__, __LINE__);
}
convredirect('id_ban', 'ban_items', $last_id);
Esempio n. 14
0
// Check if AutoPoll is installed
if ($start == 0 && !$db->table_exists('polls')) {
    next_step();
}
//Look for poll infos
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'polls WHERE poll_id>' . $start . ' ORDER BY poll_id LIMIT ' . $_SESSION['limit']) or myerror('Unable to fetch poll info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['poll_id'];
    echo htmlspecialchars($ob['poll_question']) . ' (' . $ob['poll_id'] . ")<br>\n";
    flush();
    $answers = null;
    //Look for poll answers
    $vote_results = $fdb->query('SELECT poss_name FROM ' . $fdb->prefix . 'pollpossibilities WHERE poss_pollid=' . $ob['poll_id'] . ' ORDER BY poss_id') or myerror("Unable to get poll answers.", __FILE__, __LINE__, $fdb->error());
    while (list($poss_name) = $fdb->fetch_row($vote_results)) {
        $answers[] = convert_to_utf8($poss_name);
    }
    //Look for the topic associated to the poll
    $topic_result = $fdb->query('SELECT topic_id FROM ' . $fdb->prefix . 'topics WHERE topic_poll=' . $ob['poll_id']) or myerror('Unable to get poll topic', __FILE__, __LINE__, $fdb->error());
    list($topic_id) = $fdb->fetch_row($topic_result);
    $db->query('UPDATE ' . $db->prefix . 'topics SET question=\'' . $db->escape(convert_to_utf8($ob['poll_question'])) . '\' WHERE id=' . $topic_id) or myerror("Connectix Boards: Unable to set poll question.", __FILE__, __LINE__, $fdb->error());
    //Look for the poll start time
    $time_result = $fdb->query('SELECT msg_timestamp FROM ' . $fdb->prefix . 'messages WHERE msg_topicid=' . $topic_id . ' ORDER BY msg_id LIMIT 0,1') or myerror('Unable to get topic start time', __FILE__, __LINE__, $fdb->error());
    list($poll_start) = $fdb->fetch_row($time_result);
    // Dataarray
    $todb = array('id' => $ob['poll_id'], 'pollid' => $topic_id, 'ptype' => 1, 'options' => serialize($answers), 'created' => $poll_start);
    // Save data
    insertdata('polls', $todb, __FILE__, __LINE__);
}
convredirect('poll_id', 'polls', $last_id);
Esempio n. 15
0
    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);
Esempio n. 16
0
<?php

// Fetch topic info
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'topics WHERE ID_TOPIC > ' . $start . ' ORDER BY ID_TOPIC LIMIT ' . $_SESSION['limit']) or myerror('Unable to get topic info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['ID_TOPIC'];
    // Fetch last post info
    $posts_res = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'messages WHERE ID_MSG IN(' . $ob['ID_FIRST_MSG'] . ',' . $ob['ID_LAST_MSG'] . ')') or myerror('Unable to fetch last topic post info', __FILE__, __LINE__, $fdb->error());
    $ob['first'] = $fdb->fetch_assoc($posts_res);
    $ob['last'] = $fdb->fetch_assoc($posts_res);
    $ob['last'] == null ? $ob['last'] = $ob['first'] : null;
    echo $ob['first']['subject'] . ' (' . $ob['ID_TOPIC'] . ")<br>\n";
    flush();
    // Dataarray
    $todb = array('id' => $ob['ID_TOPIC'], 'poster' => $ob['first']['posterName'], 'subject' => $ob['first']['subject'], 'posted' => $ob['first']['posterTime'], 'num_views' => $ob['numViews'], 'num_replies' => $ob['numReplies'], 'last_post' => $ob['last']['posterTime'], 'last_post_id' => $ob['last']['ID_MSG'], 'last_poster' => $ob['last']['posterName'], 'sticky' => $ob['isSticky'], 'closed' => $ob['locked'], 'forum_id' => $ob['ID_BOARD']);
    // Save data
    insertdata('topics', $todb, __FILE__, __LINE__);
}
convredirect('ID_TOPIC', 'topics', $last_id);
Esempio n. 17
0
$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);
Esempio n. 18
0
<?php

if ($start == 0 && $_SESSION['phpnuke'] != '') {
    echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>';
    exit;
}
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'banlist WHERE ban_id>' . $start . ' ORDER BY ban_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['ban_id'];
    $username = '';
    if ($ob['ban_userid'] != 0) {
        $res = $db->query('SELECT username FROM ' . $_SESSION['pun'] . 'users WHERE id=' . $ob['ban_userid']) or myerror("Unable to get userinfo for ban", __FILE__, __LINE__, $db->error());
        list($username) = $db->fetch_row($res);
    }
    $ob['ban_ip'] == '' ? $ip = 'null' : ($ip = decode_ip($ob['ban_ip']));
    $ob['ban_email'] == '' ? $ob['ban_email'] = 'null' : null;
    // Dataarray
    $todb = array('username' => $username, 'ip' => $ip, 'email' => $ob['ban_email']);
    // Save data
    insertdata('bans', $todb, __FILE__, __LINE__);
}
convredirect('ban_id', 'banlist', $last_id);
Esempio n. 19
0
        } else {
            $sql = 'SELECT u.username, p.post_username, p.post_time, p.poster_id FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'posts AS p LEFT JOIN ' . $fdb->prefix . 'users AS u ON p.poster_id=u.user_id WHERE post_id=' . $ob['topic_last_post_id'];
        }
        $lastresult = $fdb->query($sql) or myerror("Unable to get user info", __FILE__, __LINE__, $fdb->error());
        list($last['poster'], $last['guestname'], $last['posted'], $last['poster_id']) = $fdb->fetch_row($lastresult);
        if ($last['poster_id'] == -1) {
            $last['poster'] = $last['guestname'];
        }
        if ($last['poster'] == '') {
            $last['poster'] = $lang_common['Guest'];
        }
    }
    // Check for anonymous poster id problem
    if ($ob['topic_poster'] == -1) {
        $firstresult = $fdb->query('SELECT p.' . ($_SESSION['phpnuke'] == 'bb_' ? 'poster_name' : 'post_username') . ' FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'posts AS p WHERE post_id=' . $ob['topic_first_post_id']) or myerror("Unable to get user info", __FILE__, __LINE__, $fdb->error());
        list($ob['username']) = $fdb->fetch_row($firstresult);
        if ($ob['username'] == '') {
            $ob['username'] = $lang_common['Guest'];
        }
    }
    // Dataarray
    $todb = array('id' => $ob['topic_id'], 'poster' => $ob['username'], 'subject' => $ob['topic_title'], 'posted' => $ob['topic_time'], 'num_views' => $ob['topic_views'], 'num_replies' => $ob['topic_replies'], 'last_post' => $last['posted'], 'last_post_id' => $ob['topic_last_post_id'], 'last_poster' => $last['poster'], 'sticky' => isset($ob['topic_sticky']) ? $ob['topic_sticky'] : (int) ($ob['topic_type'] > 0), 'closed' => (int) ($ob['topic_status'] == 1), 'forum_id' => $ob['forum_id']);
    // Save data
    insertdata('topics', $todb, __FILE__, __LINE__);
    // Moved topic
    if ($ob['topic_status'] == 2) {
        $db->query('UPDATE ' . $db->prefix . 'topics SET moved_to=\'' . $ob['topic_moved_id'] . '\' WHERE id=' . $ob['topic_id']) or myerror("Unable to update modeved-topic", __FILE__, __LINE__, $db->error());
    }
}
convredirect('topic_id', $_SESSION['phpnuke'] . 'topics', $last_id);
Esempio n. 20
0
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'forum WHERE forumid>' . $start . ' ORDER BY forumid LIMIT ' . $_SESSION['limit']) or myerror('Unable to fetch forum info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['forumid'];
    echo '<br>' . $ob['title'] . ' (' . $ob['forumid'] . ")\n";
    flush();
    // Forum IS v2.0 category, insert it into the database
    if ($ob['parentid'] == -1) {
        // Dataarray
        $todb = array('id' => $ob['forumid'], 'cat_name' => $ob['title'], 'disp_position' => $ob['displayorder']);
        // Save data
        insertdata('categories', $todb, __FILE__, __LINE__);
    } else {
        // Fetch last-post-id
        $res = $fdb->query('SELECT postid FROM ' . $_SESSION['php'] . 'post WHERE threadid=' . $ob['lastthreadid'] . ' ORDER BY postid DESC') or myerror('Unable to fetch last-post-info', __FILE__, __LINE__, $fdb->error());
        $ob['lastpostid'] = $fdb->result($res, 0);
        // Settings
        //	--> Parent
        $parentlist = explode(',', $ob['parentlist']);
        $ob['parentid'] = $parentlist[sizeof($parentlist) - 2];
        //	--> Lastpost & Lastpostid
        $ob['lastpost'] == 0 ? $ob['lastpost'] = 'null' : null;
        $ob['lastpostid'] == 0 ? $ob['lastpostid'] = 'null' : null;
        // Dataarray
        $todb = array('id' => $ob['forumid'], 'forum_name' => $ob['title'], 'forum_desc' => $ob['description'], 'num_topics' => $ob['threadcount'], 'num_posts' => $ob['replycount'], 'disp_position' => $ob['displayorder'], 'last_poster' => $ob['lastposter'], 'last_post_id' => $ob['lastpostid'], 'last_post' => $ob['lastpost'], 'cat_id' => $ob['parentid']);
        // Save data
        insertdata('forums', $todb, __FILE__, __LINE__);
    }
}
convredirect('forumid', 'forum', $last_id);
Esempio n. 21
0
<?php

// Fetch topic info
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'threads WHERE thread_id > ' . $start . ' ORDER BY thread_id LIMIT ' . $_SESSION['limit']) or myerror('Unable to get topic info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['thread_id'];
    echo $ob['thread_subject'] . ' (' . $ob['thread_id'] . ")<br>\n";
    flush();
    // Select post count
    $res = $fdb->query('SELECT count(*) as count FROM ' . $_SESSION['php'] . 'posts WHERE thread_id=' . $ob['thread_id']) or myerror('Unable to fetch post count', __FILE__, __LINE__, $fdb->error());
    $item = $fdb->fetch_assoc($res);
    $post_count = $item['count'];
    // Select poster
    $res = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'users WHERE user_id=' . $ob['thread_author']) or myerror('Unable to fetch topic author name', __FILE__, __LINE__, $fdb->error());
    $item = $fdb->fetch_assoc($res);
    $author_name = $item['user_name'];
    // Fetch last post info
    $res = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'posts AS p, ' . $_SESSION['php'] . 'users AS u WHERE p.post_author=u.user_id AND thread_id=' . $ob['thread_id'] . ' ORDER BY post_datestamp DESC LIMIT 1') or myerror('Unable to fetch last post info', __FILE__, __LINE__, $fdb->error());
    $last_post = $fdb->fetch_assoc($res);
    // Dataarray
    $todb = array('id' => $ob['thread_id'], 'poster' => $author_name, 'subject' => $ob['thread_subject'], 'num_views' => $ob['thread_views'], 'num_replies' => $post_count - 1, 'last_post' => $last_post['post_datestamp'], 'last_post_id' => $last_post['post_id'], 'last_poster' => $last_post['user_name'], 'sticky' => $ob['thread_sticky'], 'closed' => $ob['thread_locked'], 'forum_id' => $ob['forum_id']);
    // Save data
    insertdata('topics', $todb, __FILE__, __LINE__);
}
convredirect('thread_id', 'threads', $last_id);
Esempio n. 22
0
$last_id = 0;
while ($ob = $fdb->fetch_assoc($res)) {
    $last_id = $ob['user_id'];
    echo htmlspecialchars($ob['user_name']) . ' (' . $ob['user_id'] . ")<br>\n";
    flush();
    // Fetch last post info
    $post_res = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'posts WHERE post_author=' . $ob['user_id'] . ' ORDER BY post_datestamp DESC LIMIT 1') or myerror('Unable to fetch last post info', __FILE__, __LINE__, $fdb->error());
    if ($fdb->num_rows($post_res) > 0) {
        $last_ob = $fdb->fetch_assoc($post_res);
        $ob['last_post_time'] = $last_ob['post_datestamp'];
    } else {
        $ob['last_post_time'] = 'null';
    }
    // 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'];
    }
    // Dataarray
    $todb = array('id' => $ob['user_id'], 'username' => $ob['user_name'], 'password' => $ob['user_password'], 'email' => $ob['user_email'], 'url' => $ob['user_web'], 'icq' => $ob['user_icq'], 'msn' => $ob['user_msn'], 'yahoo' => $ob['user_yahoo'], 'signature' => $ob['user_sig'], 'timezone' => $ob['user_offset'], 'num_posts' => $ob['user_posts'], 'last_post' => $ob['last_post_time'], 'registered' => $ob['user_joined'], 'last_visit' => $ob['user_lastvisit'], 'location' => $ob['user_location'], 'email_setting' => !$ob['user_hide_email']);
    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);
Esempio n. 23
0
<?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);
Esempio n. 24
0
<?php

// Fetch user info
$res = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'members WHERE ID_MEMBER>' . $start . ' ORDER BY ID_MEMBER LIMIT ' . ceil($_SESSION['limit'] / 5)) or myerror('Unable to fetch user info', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($res)) {
    $last_id = $ob['ID_MEMBER'];
    echo '<br>' . htmlspecialchars($ob['memberName']) . ' (' . $ob['ID_MEMBER'] . ")\n";
    flush();
    // Check for user/guest collision
    if ($ob['ID_MEMBER'] == 1) {
        // Fetch last user id
        $last_result = $fdb->query('SELECT ID_MEMBER FROM ' . $fdb->prefix . "members ORDER BY ID_MEMBER 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_MEMBER'] = ++$last_user_id;
        $_SESSION['admin_id'] = $ob['ID_MEMBER'];
    }
    // Dataarray
    $todb = array('id' => $ob['ID_MEMBER'], 'username' => $ob['memberName'], 'password' => $ob['passwd'], 'url' => $ob['websiteUrl'], 'title' => $ob['usertitle'], 'icq' => $ob['ICQ'], 'aim' => $ob['AIM'], 'msn' => $ob['MSN'], 'yahoo' => $ob['YIM'], 'signature' => $ob['signature'], 'timezone' => $ob['timeOffset'], 'num_posts' => $ob['posts'], 'registered' => $ob['dateRegistered'], 'last_visit' => $ob['lastLogin'], 'email_setting' => $ob['hideEmail'], 'location' => $ob['location'], 'email' => $ob['emailAddress']);
    if ($_SESSION['pun_version'] == '1.1') {
        $todb['last_action'] = $ob['lastLogin'];
    }
    insertdata('users', $todb, __FILE__, __LINE__);
}
convredirect('ID_MEMBER', 'members', $last_id);
Esempio n. 25
0
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['id'];
    echo '<br>' . htmlspecialchars($ob['name']) . ' (' . $ob['id'] . ")\n";
    flush();
    // If parent is zero, it's a categorie
    if ($ob['parent'] == 0) {
        // Dataarray
        $todb = array('id' => $ob['id'], 'cat_name' => $ob['name'], 'disp_position' => $ob['description']);
        // Save data
        insertdata('categories', $todb, __FILE__, __LINE__);
    } else {
        // Get last post information
        $post_result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'messages WHERE catid=' . $ob['id'] . ' ORDER BY id DESC LIMIT 1') or myerror("Unable to fetch last post information", __FILE__, __LINE__, $fdb->error());
        $post = $fdb->fetch_assoc($post_result);
        // Get topic count
        $topic_result = $fdb->query('SELECT count(*) FROM ' . $fdb->prefix . 'messages WHERE catid=' . $ob['id'] . ' AND parent=0 ORDER BY id DESC LIMIT 1') or myerror("Unable to fetch last post information", __FILE__, __LINE__, $fdb->error());
        $topics = $fdb->fetch_row($topic_result);
        $num_topics = $topics[0];
        // Get posts count
        $posts_result = $fdb->query('SELECT count(*) FROM ' . $fdb->prefix . 'messages WHERE catid=' . $ob['id'] . ' ORDER BY id DESC LIMIT 1') or myerror("Unable to fetch last post information", __FILE__, __LINE__, $fdb->error());
        $posts = $fdb->fetch_row($posts_result);
        $num_posts = $posts[0];
        // Dataarray
        $todb = array('id' => $ob['id'], 'forum_name' => $ob['name'], 'forum_desc' => $ob['description'], 'cat_id' => $ob['parent'], 'disp_position' => $ob['ordering'], 'num_topics' => $num_topics, 'num_posts' => $num_posts - $num_topics, 'last_poster' => $post['name'], 'last_post_id' => $post['id'], 'last_post' => $post['time']);
        // Save data
        insertdata('forums', $todb, __FILE__, __LINE__);
    }
}
convredirect('id', 'categories', $last_id);
Esempio n. 26
0
<?php

// Fetch forum info
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'forums WHERE forum_id>' . $start . ' ORDER BY forum_id LIMIT ' . $_SESSION['limit']) or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['forum_id'];
    echo $ob['name'] . ' (' . $ob['forum_id'] . ")<br>\n";
    flush();
    // Dataarray
    $todb = array('id' => $ob['forum_id'], 'forum_name' => $ob['name'], 'forum_desc' => $ob['description'], 'num_topics' => $ob['thread_count'], 'num_posts' => $ob['message_count'], 'disp_position' => $ob['display_order'], 'cat_id' => '1');
    // Fetch last message-id
    $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'messages WHERE forum_id=' . $ob['forum_id'] . ' ORDER BY datestamp DESC LIMIT 1') or myerror('phpBB: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
    if ($db->num_rows($result) > 0) {
        $message = $db->fetch_assoc($result);
        $todb['last_poster'] = $message['author'];
        $todb['last_post_id'] = $message['message_id'];
        $todb['last_post'] = $message['datestamp'];
    }
    // Save data
    insertdata('forums', $todb, __FILE__, __LINE__);
}
convredirect('forum_id', 'forums', $last_id);
Esempio n. 27
0
<?php

// v1.3 - Don't convert bans.
if ($_SESSION['ver'] == "13") {
    echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>';
} else {
    $result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'banfilters WHERE ban_id>' . $start . ' ORDER BY ban_id LIMIT ' . $_SESSION['limit']) or myerror("Unable to get ban list", __FILE__, __LINE__, $fdb->error());
    $last_id = -1;
    while ($ob = $fdb->fetch_assoc($result)) {
        $last_id = $ob['ban_id'];
        // Change ban_type from name to username
        $ob['ban_type'] == 'name' ? $ob['ban_type'] = 'username' : null;
        // Save to database
        $db->query('INSERT INTO ' . $_SESSION['pun'] . 'bans (id,' . $ob['ban_type'] . ') VALUES(' . $ob['ban_id'] . ', \'' . $ob['ban_content'] . '\')') or myerror("PunBB: Unable to add ban info<br>", __FILE__, __LINE__, $db->error());
    }
    convredirect('ban_id', 'banfilters', $last_id);
}