本文整理汇总了PHP中myerror函数的典型用法代码示例。如果您正苦于以下问题:PHP myerror函数的具体用法?PHP myerror怎么用?PHP myerror使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了myerror函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoTask
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: DoTask
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: DoTask
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: checkInputValues
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 .= '   <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 .= ' <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"> ' . implode("<br> ", $list) . '</font>' . '<br><br><a href="?page=settings">Go back to settings</a>');
}
}
示例5: ceil
$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: next_step
// 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: flush
<?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: myerror
// 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: myerror
<?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: myerror
<?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: myerror
<?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: myerror
<?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: myerror
<?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: array
$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: myerror
<?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);