예제 #1
0
파일: gae.php 프로젝트: hdp/brass
function DoTask()
{
    global $GAME, $unexpectederrormessage;
    if ($GAME['GameStatus'] != 'In Progress' and $GAME['GameStatus'] != 'Recruiting Replacement') {
        $mypage = page::standard();
        $mypage->title_body('Cannot abort this game');
        $mypage->leaf('p', 'This game cannot be aborted just now, perhaps because it has finished. Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['MyColour'] == 50) {
        $mypage = page::standard();
        $mypage->title_body('Not playing in this game');
        $mypage->leaf('p', 'You are not currently playing in this game, so you cannot vote to abort it. Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['AbortVoteActive']) {
        myerror($unexpectederrormessage, 'Unexpected vote page "gae.php" reached');
    }
    if ($GAME['CurrentPlayers'] - $GAME['PlayersMissing'] == 1) {
        abortgame(0);
        dbformatgamedata();
        page::redirect(3, 'board.php?GameID=' . $GAME['GameID'], 'Successfully voted and aborted game.');
    }
    $GAME['AbortVote'][$GAME['MyColour']] = 1;
    dbformatgamedata();
    for ($i = 0; $i < MAX_PLAYERS; $i++) {
        if ($GAME['PlayerExists'][$i] == 1 and !$GAME['PlayerMissing'][$i] and $i != $GAME['MyColour'] and $GAME['EmailPrompt'][$i] and $GAME['Email'][$i] != '') {
            $subject = 'There is a vote to abort game number ' . $GAME['GameID'];
            $body = '<p>This is an automated message. One of your fellow players in game number ' . $GAME['GameID'] . ' has initiated a vote to abort the game. In order for the game to be aborted, all of the players must agree; this means that a unanimous vote is required. Please visit the game\'s page and either vote in favour of aborting it, or shut the vote down by voting not to abort. Here is the URL of the game page:</p><p><a href="' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '">' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '</a></p>' . EMAIL_FOOTER;
            send_email($subject, $body, $GAME['Email'][$i], null);
        }
    }
    page::redirect(3, 'board.php?GameID=' . $GAME['GameID'], 'Successfully voted.');
}
예제 #2
0
파일: gal.php 프로젝트: hdp/brass
function DoTask()
{
    global $Administrator, $GAME, $unexpectederrormessage;
    if ($GAME['GameStatus'] != 'Recruiting Replacement') {
        $mypage = page::standard();
        $mypage->title_body('Current player is not missing');
        $mypage->leaf('p', 'The current player is not missing. (Perhaps somebody accepted a replacement player after you had loaded the board page.) Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['MyColour'] == 50) {
        $mypage = page::standard();
        $mypage->title_body('Not playing in this game');
        $mypage->leaf('p', 'You are not currently playing in this game, so you cannot choose replacement players. Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    $ReplacementValid = false;
    for ($i = 0; $i < count($GAME['ReplacementOffers']); $i++) {
        if ($GAME['ReplacementOffers'][$i][2] == $GAME['PlayerToMove'] and $GAME['ReplacementOffers'][$i][0] == @$_POST['whotoaccept']) {
            $ReplacementValid = $i;
        }
    }
    if ($ReplacementValid === false) {
        $mypage = page::standard();
        $mypage->title_body('User ID not found among replacements');
        $mypage->leaf('p', 'The submitted user ID was not found among the candidate replacements. (Perhaps the user withdrew his request after you had loaded the board page.) Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    $QR = dbquery(DBQUERY_READ_SINGLEROW, 'SELECT "Name", "Pronoun", "Email", "EmailPrompt" FROM "User" WHERE "UserID" = :user:'******'user', $GAME['ReplacementOffers'][$ReplacementValid][0]);
    if ($QR === 'NONE') {
        myerror($unexpectederrormessage, 'Candidate replacements list contains invalid user');
    }
    switch ($QR['Pronoun']) {
        case 'He':
            $RepPronoun = 'A';
            break;
        case 'She':
            $RepPronoun = 'B';
            break;
        default:
            $RepPronoun = 'C';
            break;
    }
    $GAME['AltGameTicker'] .= '8E' . callmovetimediff() . letter_end_number($GAME['ReplacementOffers'][$ReplacementValid][0]) . $RepPronoun . letter_end_number($GAME['MyColour']);
    $GAME['GameTickerNames'] .= '|' . $GAME['ReplacementOffers'][$ReplacementValid][1];
    $GAME['PlayerName'][$GAME['PlayerToMove']] = $QR['Name'];
    $GAME['KickVote'] = '00000';
    $GAME['GameStatus'] = 'In Progress';
    $GAME['MoveMade'] = 1;
    dbquery(DBQUERY_WRITE, 'DELETE FROM "ReplacementOffer" WHERE "Game" = :game: AND "Colour" = :colour:', 'game', $GAME['GameID'], 'colour', $GAME['PlayerToMove']);
    dbquery(DBQUERY_WRITE, 'INSERT INTO "PlayerGameRcd" ("User", "Game", "GameResult", "Inherited", "GameCounts", "Colour", "NumLongTurns", "CurrentOccupant") VALUES (:user:, :game:, \'Playing\', 1, :counts:, :colour:, 0, 0)', 'user', $GAME['ReplacementOffers'][$ReplacementValid][0], 'game', $GAME['GameID'], 'counts', $GAME['ReplacementOffers'][$ReplacementValid][3], 'colour', $GAME['PlayerToMove']);
    dbformatgamedata();
    if ($QR['EmailPrompt'] and $QR['Email'] != '') {
        $subject = 'Your request to join game number ' . $GAME['GameID'] . ' has been accepted';
        $body = '<p>This is an automated message. One of the players in game number ' . $GAME['GameID'] . ' has accepted your request to join the game as a replacement player. This means that it is now your turn to move; please visit the game\'s page and take your turn. Here is the URL of the game page:</p><p><a href="' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '">' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '</a></p>' . EMAIL_FOOTER;
        send_email($subject, $body, $QR['Email'], null);
    }
    page::redirect(3, 'board.php?GameID=' . $GAME['GameID'], 'Successfully accepted replacement.');
}
예제 #3
0
파일: gag.php 프로젝트: hdp/brass
function DoTask()
{
    global $GAME, $unexpectederrormessage;
    if ($GAME['GameStatus'] != 'In Progress') {
        $mypage = page::standard();
        $mypage->title_body('Cannot vote to remove players from this game');
        $mypage->leaf('p', 'At the moment you cannot vote to remove players from this game. This might be because the game has finished, or it might be because the game is seeking a replacement player. Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['MyColour'] == 50) {
        $mypage = page::standard();
        $mypage->title_body('Not playing in this game');
        $mypage->leaf('p', 'You are not currently playing in this game, so you cannot vote to remove players. Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['MyColour'] == $GAME['PlayerToMove']) {
        $mypage = page::standard();
        $mypage->title_body('Cannot vote to kick yourself');
        $mypage->leaf('p', 'You cannot vote to kick yourself. If you want to leave the game, please select the option to "Quit" instead. Click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if (!$GAME['CanKickVote']) {
        $mypage = page::standard();
        $mypage->title_body('Kick vote not currently available');
        $mypage->leaf('p', 'The option to vote to kick the current player is not presently available. (Perhaps the player you were waiting for took his turn in the meantime.) Please click <a href="board.php?GameID=' . $GAME['GameID'] . '">here</a> to go to the board page, or <a href="index.php">here</a> to return to the Main Page.');
        $mypage->finish();
    }
    if ($GAME['KickVoteActive']) {
        myerror($unexpectederrormessage, 'Unexpected vote page "gag.php" reached');
    }
    if ($GAME['CurrentPlayers'] - $GAME['PlayersMissing'] == 2) {
        $NameOfKickedPlayer = $GAME['PlayerFullName'][$GAME['PlayerToMove']];
        KickPlayer($GAME['PlayerToMove'], 2);
        dbformatgamedata();
        page::redirect(3, 'board.php?GameID=' . $GAME['GameID'], 'Successfully voted and kicked player.');
    }
    $GAME['KickVote'][$GAME['MyColour']] = 1;
    dbformatgamedata();
    for ($i = 0; $i < MAX_PLAYERS; $i++) {
        if ($GAME['PlayerExists'][$i] == 1 and !$GAME['PlayerMissing'][$i] and $i != $GAME['MyColour'] and $GAME['EmailPrompt'][$i] and $GAME['Email'][$i] != '') {
            if ($i == $GAME['PlayerToMove']) {
                $subject = 'There is a vote to kick you from game number ' . $GAME['GameID'];
                $body = 'This is an automated message. One of your fellow players in game number ' . $GAME['GameID'] . ' has initiated a vote to kick you from the game, as you are taking a long time to make your move. In order for you to be kicked, all of the other players must agree; this means that a unanimous vote is required. However, you can end the vote immediately by taking your turn. Please visit the game\'s page and shut the vote down by taking your turn. Here is the URL of the game page:' . "\n\n" . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . EMAIL_FOOTER;
            } else {
                $subject = 'There is a vote to kick ' . $GAME['PlayerFullName'][$GAME['PlayerToMove']] . ' from game number ' . $GAME['GameID'];
                $body = '<p>This is an automated message. One of your fellow players in game number ' . $GAME['GameID'] . ' has initiated a vote to kick ' . $GAME['PlayerFullName'][$GAME['PlayerToMove']] . ' from the game, as ' . $GAME['PronounLC'][$GAME['PlayerToMove']] . ' is taking a long time to make ' . $GAME['PossessivePronounLC'][$GAME['PlayerToMove']] . ' move. In order for ' . $GAME['OtherPronounLC'][$GAME['PlayerToMove']] . ' to be kicked, all of the players must agree; this means that a unanimous vote is required. Please visit the game\'s page and either vote in favour of kicking ' . $GAME['PlayerName'][$GAME['PlayerToMove']] . ', or shut the vote down by voting not to kick ' . $GAME['OtherPronounLC'][$GAME['PlayerToMove']] . '. Here is the URL of the game page:</p><p><a href="' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '">' . SITE_ADDRESS . 'board.php?GameID=' . $GAME['GameID'] . '</a></p>' . EMAIL_FOOTER;
            }
            send_email($subject, $body, $GAME['Email'][$i], null);
        }
    }
    page::redirect(3, 'board.php?GameID=' . $GAME['GameID'], 'Successfully voted.');
}
예제 #4
0
function checkInputValues()
{
    global $fdb;
    // Check connection
    $conn = @mysql_connect($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password']);
    if (!$conn) {
        myerror('Unable to connect to MySQL server. Please check your settings again.<br><br><a href="?page=settings">Go back to settings</a>');
    }
    // Check databases
    if (!@mysql_select_db($_SESSION['php_db_clean'], $conn)) {
        // Fetch database list
        $list = '';
        $result = @mysql_query('SHOW databases', $conn);
        while ($ob = mysql_fetch_row($result)) {
            $list .= ' &nbsp <a href="?page=settings&newdb=' . $ob[0] . '">' . $ob[0] . '</a><br>' . "\n";
        }
        // Close connection and show message
        mysql_close($conn);
        myerror('Unable to select database.' . '<br><br>Found these databases:<br><font color="gray">' . $list . '</font>' . '<br><a href="?page=settings">Go back to settings</a>');
    }
    mysql_close($conn);
    // Include FORUM's config file
    include './' . $_SESSION['forum'] . '/_config.php';
    // Check prefix
    $fdb = new DBLayer($_SESSION['hostname'], $_SESSION['username'], $_SESSION['password'], $_SESSION['php_db_clean'], $_SESSION['php_prefix'], false);
    $res = $fdb->query('SELECT count(*) FROM ' . $_SESSION['php'] . $tables['Users']);
    if (intval($fdb->result($res, 0)) == 0) {
        // Select a list of tables
        $list = array();
        $res = $fdb->query('SHOW TABLES IN ' . $_SESSION['php_db']);
        while ($ob = $fdb->fetch_row($res)) {
            $list[] = $ob[0];
        }
        // check list size
        sizeof($list) == 0 ? $list[] = 'None' : null;
        // Get list of "proabable" prefixes
        $prefix_list = '';
        $res = $fdb->query('SHOW TABLES FROM ' . $_SESSION['php_db'] . ' LIKE \'%' . $tables['Posts'] . '\'') or myerror('Unable to fetch table list', __FILE__, __LINE__, $fdb->error());
        //			$res = $fdb->query('SHOW TABLES FROM '.$_SESSION['php_db'].' LIKE \'%'.$tables['Users'].'\'') or myerror('Unable to fetch table list', __FILE__, __LINE__, $fdb->error());
        while ($ob = $fdb->fetch_row($res)) {
            $prefix = substr($ob[0], 0, strlen($ob[0]) - strlen($tables['Users']));
            $prefix_list .= ' &nbsp; <a href="?page=settings&newprefix=' . $prefix . '">' . $prefix . '</a><br>' . "\n";
        }
        // Print message
        $prefix = $_SESSION['php_prefix'] == '' ? 'no' : '\'' . $_SESSION['php_prefix'] . '\'';
        myerror('Unable to find ' . $_SESSION['forum'] . ' tables! (using prefix: <i>' . $prefix . '</i>)' . '<br><br>Go back to settings and choose another prefix, or select one of these prefixes:<br><font color="gray">' . $prefix_list . '</font>' . '<br>These are the tables in the selected database:<br><font color="gray"> &nbsp; ' . implode("<br> &nbsp; ", $list) . '</font>' . '<br><br><a href="?page=settings">Go back to settings</a>');
    }
}
예제 #5
0
$res = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'users WHERE user_id>' . $start . ' ORDER BY user_id LIMIT ' . ceil($_SESSION['limit'] / 5)) or myerror('Unable to fetch user info', __FILE__, __LINE__, $fdb->error());
$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);
예제 #6
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);
예제 #7
0
<?php

// Get phpBB config
echo "\n<br>Updating FluxBB settings";
flush();
$phpconfig = array();
// Xoops with newbb module
if ($_SESSION['phpnuke'] == 'bb_') {
    $sql = 'SELECT conf_name, conf_value FROM ' . $fdb->prefix . 'config';
} else {
    $sql = 'SELECT config_name, config_value FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'config';
}
$result = $fdb->query($sql) or myerror('Unable to get forum info', __FILE__, __LINE__, $fdb->error());
while (list($name, $var) = $fdb->fetch_row($result)) {
    $phpconfig[$name] = $var;
}
if (!isset($phpconfig['site_desc'])) {
    $phpconfig['site_desc'] = $phpconfig['slogan'];
}
// Save fluxbb config
$config = array('o_board_title' => "'" . $db->escape($phpconfig['sitename']) . "'", 'o_board_desc' => "'" . $db->escape($phpconfig['site_desc']) . "'", 'o_server_timezone' => "'" . $phpconfig['board_timezone'] . "'", 'o_disp_topics_default' => "'" . intval($phpconfig['topics_per_page']) . "'", 'o_disp_posts_default' => "'" . intval($phpconfig['posts_per_page']) . "'", 'o_webmaster_email' => "'" . $db->escape($phpconfig['board_email']) . "'", 'o_smtp_host' => "'" . $db->escape($phpconfig['smtp_host']) . "'", 'o_smtp_user' => "'" . $db->escape($phpconfig['smtp_username']) . "'", 'o_smtp_pass' => "'" . $db->escape($phpconfig['smtp_password']) . "'");
$config['o_disp_topics_default'] == 0 ? $config['o_disp_topics_default'] = 30 : null;
$config['o_disp_posts_default'] == 0 ? $config['o_disp_posts_default'] = 25 : null;
while (list($conf_name, $conf_value) = @each($config)) {
    $db->query('UPDATE ' . $db->prefix . 'config SET conf_value=' . $conf_value . ' WHERE conf_name=\'' . $conf_name . '\'') or myerror('Unable to save config: ' . $conf_name . '=' . $conf_value, __FILE__, __LINE__, $db->error());
}
// Load global 'end' file
require './end.php';
예제 #8
0
// Fetch forum info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . '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 htmlspecialchars($ob['forum_name']) . ' (' . $ob['forum_id'] . ")<br>\n";
    flush();
    // Check for anonymous poster id problem
    //		$ob['forum_last_post_id'] == -1 ? $ob['forum_last_post_id'] = 1 : null;
    // Xoops with newbb module
    if ($_SESSION['phpnuke'] == 'bb_') {
        $sql = 'SELECT u.uname as username, p.post_time, p.poster_name as post_username, p.uid as poster_id FROM ' . $fdb->prefix . 'users AS u, ' . $fdb->prefix . $_SESSION['phpnuke'] . 'posts AS p WHERE u.uid=p.uid AND p.post_id=' . $ob['forum_last_post_id'];
    } else {
        $sql = 'SELECT u.username, p.post_time, p.post_username, p.poster_id FROM ' . $fdb->prefix . 'users AS u, ' . $fdb->prefix . $_SESSION['phpnuke'] . 'posts AS p WHERE u.user_id=p.poster_id AND p.post_id=' . $ob['forum_last_post_id'];
    }
    $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
예제 #9
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);
예제 #10
0
<?php

// Fetch category info
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'categories') or myerror('Unable to fetch categories', __FILE__, __LINE__, $fdb->error());
while ($ob = $fdb->fetch_assoc($result)) {
    echo $ob['name'] . ' (' . $ob['ID_CAT'] . ")<br>\n";
    flush();
    // Dataarray
    $todb = array('id' => $ob['ID_CAT'], 'cat_name' => $ob['name'], 'disp_position' => $ob['catOrder']);
    // Save data
    insertdata('categories', $todb, __FILE__, __LINE__);
}
// Redirect, don't check for more categories
echo '<script type="text/javascript">window.location="index.php?page=' . ++$_GET['page'] . '"</script>';
예제 #11
0
<?php

// Fetch forum info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . $_SESSION['phpnuke'] . 'groups WHERE group_id > 3') or myerror('Unable to fetch groups', __FILE__, __LINE__, $fdb->error());
while ($ob = $fdb->fetch_assoc($result)) {
    echo htmlspecialchars($ob['group_name']) . ' (' . $ob['group_id'] . ")<br>\n";
    flush();
    if (trim($ob['group_name']) == '') {
        $ob['group_name'] = 'Group';
    }
    // Dataarray
    $todb = array('g_id' => ++$ob['group_id'], 'g_title' => $ob['group_name'], 'g_user_title' => $ob['group_name']);
    // Save data
    insertdata('groups', $todb, __FILE__, __LINE__);
}
예제 #12
0
파일: bans.php 프로젝트: neofutur/MyBestBB
<?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);
예제 #13
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);
예제 #14
0
$categories = array();
while ($cur_cat = $db->fetch_assoc($cat_result)) {
    $categories[] = $cur_cat['id'];
}
if (!$db->field_exists('forums', 'parent_forum_id')) {
    $db->add_field('forums', 'parent_forum_id', 'INT', true, 0);
}
// Fetch forum info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'topicgroups WHERE tg_id>' . $start . ' ORDER BY tg_id LIMIT ' . $_SESSION['limit']) or myerror('Connectix Boards: Unable to get table: forums', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($result)) {
    $last_id = $ob['tg_id'];
    echo htmlspecialchars($ob['tg_name']) . ' (' . $ob['tg_id'] . ")<br>\n";
    flush();
    if ($ob['tg_lasttopic'] > 0) {
        $lastpostres = $fdb->query('SELECT t.topic_lastmessage, m.msg_id, m.msg_timestamp, m.msg_guest, m.msg_userid, u.usr_id, u.usr_name FROM ' . $fdb->prefix . 'topics AS t LEFT JOIN ' . $fdb->prefix . 'messages AS m ON t.topic_lastmessage=m.msg_id LEFT JOIN ' . $fdb->prefix . 'users AS u ON m.msg_userid=u.usr_id WHERE t.topic_id=' . $ob['tg_lasttopic'] . ' ') or myerror("Unable to fetch forum last post infos for forum conversion.", __FILE__, __LINE__, $fdb->error());
        $last_post = $fdb->fetch_assoc($lastpostres);
        if ($last_post['msg_userid'] == 0) {
            $last_post['usr_name'] = $last_post['msg_guest'];
        }
        if ($last_post['usr_name'] == '') {
            $last_post['usr_name'] = $lang_common['Guest'];
        }
        // Change last_post = 0 to null to prevent the time-bug.
        if (!isset($last_post['msg_timestamp']) || $last_post['msg_timestamp'] == 0) {
            $last_post['msg_timestamp'] = 'null';
        }
        if ($ob['tg_lasttopic'] == 0) {
            $ob['tg_lasttopic'] = 'null';
        }
        // Unset variables
예제 #15
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);
예제 #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);
예제 #17
0
파일: emails.php 프로젝트: hdp/brass
        $query = 'SELECT SQL_CALC_FOUND_ROWS "Email"."EmailID", "Email"."Sender", "UserS"."Name" AS "SenderName", "Email"."Recipient", "UserR"."Name" AS "RecipientName", "Email"."DateSent", "Email"."EmailText" FROM "Email" LEFT JOIN "User" AS "UserS" ON "Email"."Sender" = "UserS"."UserID" LEFT JOIN "User" AS "UserR" ON "Email"."Recipient" = "UserR"."UserID" WHERE ("Email"."Recipient" = :userid: OR "Email"."Sender" = :userid:) AND "Email"."DateSent" BETWEEN :start: AND :end: ORDER BY "Email"."DateSent" DESC LIMIT :startpoint:, 20';
        break;
    case 1:
        $title = 'Emails received ' . $timedescription;
        $query = 'SELECT SQL_CALC_FOUND_ROWS "Email"."EmailID", "Email"."Sender", "User"."Name", "Email"."DateSent", "Email"."EmailText" FROM "Email" LEFT JOIN "User" ON "Email"."Sender" = "User"."UserID" WHERE "Email"."Recipient" = :userid: AND "Email"."DateSent" BETWEEN :start: AND :end: ORDER BY "Email"."DateSent" DESC LIMIT :startpoint:, 20';
        break;
    case 2:
        $title = 'Emails sent ' . $timedescription;
        $query = 'SELECT SQL_CALC_FOUND_ROWS "Email"."EmailID", "Email"."Recipient", "User"."Name", "Email"."DateSent", "Email"."EmailText" FROM "Email" LEFT JOIN "User" ON "Email"."Recipient" = "User"."UserID" WHERE "Email"."Sender" = :userid: AND "Email"."DateSent" BETWEEN :start: AND :end: ORDER BY "Email"."DateSent" DESC LIMIT :startpoint:, 20';
        break;
    case 3:
        $title = 'All users\' emails &ndash; ' . $timedescription;
        $query = 'SELECT SQL_CALC_FOUND_ROWS "Email"."EmailID", "Email"."Sender", "UserS"."Name" AS "SenderName", "Email"."Recipient", "UserR"."Name" AS "RecipientName", "Email"."DateSent", "Email"."EmailText" FROM "Email" LEFT JOIN "User" AS "UserS" ON "Email"."Sender" = "UserS"."UserID" LEFT JOIN "User" AS "UserR" ON "Email"."Recipient" = "UserR"."UserID" WHERE "Email"."DateSent" BETWEEN :start: AND :end: ORDER BY "Email"."DateSent" DESC LIMIT :startpoint:, 20';
        break;
    default:
        myerror($unexpectederrormessage, 'Bad "message_type"');
}
$QueryResult = dbquery(DBQUERY_READ_RESULTSET, $query, 'userid', $_SESSION['MyUserID'], 'start', $SQL_Start, 'end', $SQL_End, 'startpoint', $StartPoint);
$CountQueryResult = dbquery(DBQUERY_READ_INTEGER, 'SELECT FOUND_ROWS() AS "Co"');
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
$mypage->script('email_constraints_form.js');
$mypage->title_body($title);
$mypage->loginbox();
$mypage->leaf('h1', $title);
$mypage->opennode('span');
$mypage->text('Show emails');
$mypage->opennode('select', 'id="emailtype_form"');
$mypage->leaf('option', 'sent and received', 'value=0' . $message_type_selected[0]);
$mypage->leaf('option', 'received', 'value=1' . $message_type_selected[1]);
예제 #18
0
<p>This page demonstrates a List/View/Pager web application.</p>
<p>It adds the <b>Pager</b> class to add pagination to our pages.</p>
<p>Take the code from it to enable paging on your pages!</p>
<?php 
#reference images for pager
$prev = '<img src="' . VIRTUAL_PATH . 'images/arrow_prev.gif" border="0" />';
$next = '<img src="' . VIRTUAL_PATH . 'images/arrow_next.gif" border="0" />';
#Create a connection
# connection comes first in mysqli (improved) function
$iConn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die(myerror(__FILE__, __LINE__, mysqli_connect_error()));
# Create instance of new 'pager' class
$myPager = new Pager(2, '', $prev, $next, '');
$sql = $myPager->loadSQL($sql, $iConn);
#load SQL, pass in existing connection, add offset
$result = mysqli_query($iConn, $sql) or die(myerror(__FILE__, __LINE__, mysqli_error($iConn)));
if (mysqli_num_rows($result) > 0) {
    #records exist - process
    if ($myPager->showTotal() == 1) {
        $itemz = "customer";
    } else {
        $itemz = "customers";
    }
    //deal with plural
    echo '<p align="center">We have ' . $myPager->showTotal() . ' ' . $itemz . '!</p>';
    while ($row = mysqli_fetch_assoc($result)) {
        # process each row
        echo '<p align="center">
            <a href="' . VIRTUAL_PATH . 'customer_view.php?id=' . (int) $row['CustomerID'] . '">' . dbOut($row['FirstName']) . '</a>
            </p>';
    }
예제 #19
0
파일: end.php 프로젝트: neofutur/MyBestBB
<?php

// Settings
$info = array();
$result = $fdb->query('SELECT * FROM ' . $_SESSION['php'] . 'setting');
while ($ob = $fdb->fetch_assoc($result)) {
    $info[$ob['varname']] = $ob['value'];
}
// Dataarray
$conf = array('o_board_title' => $info['bbtitle'], 'o_board_desc' => $info['hometitle'], 'o_server_timezone' => $info['timeoffset'], 'o_date_format' => $info['dateformat'], 'o_time_format' => $info['timeformat'], 'o_mailing_list' => $info['webmasteremail']);
// Save settings
foreach ($conf as $var => $value) {
    $db->query('UPDATE ' . $_SESSION['pun'] . 'config SET conf_value=\'' . addslashes($value) . '\' WHERE conf_name=\'' . $var . '\'') or myerror('Unable to update config', __FILE__, __LINE__, $db->error());
}
// Load gloval 'end' file
require './end.php';
// Redirect
$location = '<script type="text/javascript">window.location="index.php?page=done"</script>';
예제 #20
0
$start = 0;
// default number of items to display. 0 = all
$length = 10;
/*
configure mysql parameters here
*/
$TABLENAME = '';
$COLUMN1 = '';
$COLUMN2 = '';
$COLUMN3 = '';
$COlUMN4 = '';
$VALUE1 = '';
$VALUE2 = '';
$VALUE3 = '';
$VALUE4 = '';
$iConn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die(myerror(__FILE__, __LINE__, mysqli_connect_error()));
//$sql = "'INSERT INTO ' . $TABLENAME . '(' . $COLUMN1 . ', ' . $COLUMN2 . ',' . $COLUMN3 . ') VALUES(' . $VALUE1. ',' .  $VALUE2 . ',' .  $VALUE3 .');'" ;
/*
---------------- END CONFIG AREA ---------------------
*/
// if single item, set start to item number and length to 1
if (isset($_GET['item'])) {
    $start = $_GET['item'];
    $length = 1;
}
// set item link to script uri
$link = $_SERVER['REQUEST_URI'];
// loop through items
foreach ($feed->get_items($start, $length) as $key => $item) {
    // set query string to item number
    $queryString = '?item=' . $key;
예제 #21
0
				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);
예제 #22
0
 var_dump($_POST);
 echo '</pre>';
 */
 $to = '*****@*****.**';
 $message = process_post();
 $subject = 'Contact Form from retro site';
 safeEmail($to, $subject, $message);
 //connect to the database in order to add contact data
 $iConn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die(myerror(__FILE__, __LINE__, mysqli_connect_error()));
 //process each post var, adding slashes, using mysqli_real_escape(), etc.
 $Name = dbIn($_POST['Name'], $iConn);
 $Email = dbIn($_POST['Email'], $iConn);
 $Comments = dbIn($_POST['Comments'], $iConn);
 //place question marks in place of each item to be inserted
 $sql = "INSERT INTO test_Contacts (Name,Email,Comments,DateAdded) VALUES(?,?,?,NOW())";
 $stmt = @mysqli_prepare($iConn, $sql) or die(myerror(__FILE__, __LINE__, mysqli_error($iConn)));
 /*
  * second parameter of the mysqli_stmt_bind_param below 
  * identifies each data type inserted: 
  *
  * i == integer
  * d == double (floating point)
  * s == string
  * b == blob (file/image)
  *
  *example: an integer, 2 strings, then a double would be: "issd"
  */
 mysqli_stmt_bind_param($stmt, 'sss', $Name, $Email, $Comments);
 //execute sql command
 mysqli_stmt_execute($stmt) or die;
 //close statement
예제 #23
0
파일: translatei.php 프로젝트: hdp/brass
if (!$_SESSION['LoggedIn']) {
    $mypage->title_body('Not logged in');
    $mypage->leaf('p', 'You are not logged in. Please log in and then return to this page. You can return to the Main Page by clicking <a href="index.php">here</a>.');
    $mypage->finish();
}
if ($Administrator < 2) {
    $mypage->title_body('Not authorised');
    $mypage->leaf('p', 'You are not authorised to make use of this page. Please click <a href="index.php">here</a> to return to the Main Page.');
    $mypage->finish();
}
$TLanguage = sanitise_int(@$_GET['LanguageID']);
$PhraseName = sanitise_str(@$_GET['PhraseName'], STR_GPC | STR_ENSURE_ASCII);
$QR = dbquery(DBQUERY_READ_SINGLEROW, 'SELECT "PhraseInEnglish", "FormInUse" FROM "Phrase" WHERE "PhraseName" = :phrasename:', 'phrasename', $PhraseName);
if ($QR === 'NONE') {
    myerror($unexpectederrormessage, 'Phrase with the specified phrase name "' . htmlspecialchars($PhraseName) . '" was not found');
}
$QRX = dbquery(DBQUERY_READ_SINGLEROW, 'SELECT "Translation" FROM "ChosenTranslatedPhrase" WHERE "PhraseName" = :phrasename: AND "Language" = :language:', 'phrasename', $PhraseName, 'language', $TLanguage);
if ($QRX === 'NONE') {
    myerror($unexpectederrormessage, 'Translation with the specified phrase name "' . htmlspecialchars($PhraseName) . '" and specified language was not found');
}
$mypage->title_body('Edit chosen translation');
$mypage->leaf('h3', 'Edit chosen translation');
$mypage->leaf('div', $QR['PhraseInEnglish'], 'style="position: relative; width: 585px; border: 1pt solid black; padding: 7px; margin-bottom: 7px; background-color: #FFC18A; font-family: monospace;"');
$mypage->leaf('div', $QR['FormInUse'], 'style="position: relative; width: 585px; border: 1pt solid black; padding: 7px; margin-bottom: 7px; background-color: #000000; color: #FFFFFF; font-family: monospace;"');
$mypage->opennode('form', 'action="translated.php" method="POST"');
$mypage->leaf('textarea', $QRX['Translation'], 'name="editedtext" cols=45 rows=6');
$mypage->leaf('p', '<input type="submit" name="FormSubmit" value="Make changes">');
$mypage->emptyleaf('input', 'type="hidden" name="PhraseName" value="' . $PhraseName . '"');
$mypage->emptyleaf('input', 'type="hidden" name="Language" value=' . $TLanguage);
$mypage->finish();
// form, body, html
예제 #24
0
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'categories WHERE id>' . $start . ' ORDER BY id 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['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);
예제 #25
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);
예제 #26
0
// Fetch forum info
$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);
예제 #27
0
<?php

// Fetch forum info
$result = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'boards') or myerror('Unable to fetch forum info', __FILE__, __LINE__, $fdb->error());
while ($ob = $fdb->fetch_assoc($result)) {
    echo htmlspecialchars($ob['name']) . ' (' . $ob['ID_BOARD'] . ")<br>\n";
    flush();
    // Fetch last post info
    $post_res = $fdb->query('SELECT m.posterTime,u.memberName FROM ' . $fdb->prefix . 'messages AS m,' . $fdb->prefix . 'members AS u WHERE u.ID_MEMBER=m.ID_MEMBER AND ID_MSG=' . $ob['ID_LAST_MSG']) or myerror('Unable to fetch last post info', __FILE__, __LINE__, $fdb->error());
    if ($fdb->num_rows($post_res) > 0) {
        $post_ob = $db->fetch_assoc($post_res);
        $ob['last_post'] = $post_ob['posterTime'];
        $ob['last_poster'] = $post_ob['memberName'];
    } else {
        $ob['last_post'] = 'null';
        $ob['last_poster'] = 'null';
    }
    // 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['last_poster'], 'last_post' => $ob['last_post'], 'last_post_id' => $ob['ID_LAST_MSG'], 'cat_id' => $ob['ID_CAT']);
    // Save data
    insertdata('forums', $todb, __FILE__, __LINE__);
}
예제 #28
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);
예제 #29
0
<?php

$groups = array();
$group_result = $db->query('SELECT g_id FROM ' . $db->prefix . 'groups') or myerror('Unable to fetch last user id', __FILE__, __LINE__, $db->error());
while ($cur_group = $db->fetch_assoc($group_result)) {
    $groups[] = $cur_group['g_id'];
}
// Fetch user info
$res = $fdb->query('SELECT * FROM ' . $fdb->prefix . 'users WHERE usr_id>' . $start . ' ORDER BY usr_id LIMIT ' . $_SESSION['limit']) or myerror('Unable to get table: users', __FILE__, __LINE__, $fdb->error());
$last_id = -1;
while ($ob = $fdb->fetch_assoc($res)) {
    $last_id = $ob['usr_id'];
    echo htmlspecialchars($ob['usr_name']) . ' (' . $ob['usr_id'] . ")<br>\n";
    flush();
    // 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'] != '') {
예제 #30
0
<?php

// 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);