Exemple #1
0
function main_page()
{
    // database object
    $db = new SmrMySqlDatabase();
    // list of all first letter nicks
    create_link_list();
    // news
    echo '<p><u>Space Merchant Realms Photo Album Rules</u>';
    echo '<ol>';
    echo '<li>500 x 500 maximum pixel size only.</li>';
    echo '<li>Only .JPG or .GIF files will be accepted.</li>';
    echo '<li>NO derogatory or vulgar pictures will be accepted.</li>';
    echo '<li>ALL pictures MUST depict the real you. No anime, fictitional, or otherwise \'fake\' pictures are allowed.</li>';
    echo '<li>Please watch your language while posting within the album. Same general rules apply here as they do in the SMR chat room.</li>';
    echo '<li>Please respect all members in this area. Treat them as you would want to be treated. Do not post cruel or otherwise unneeded comments about someone or their property.</li>';
    echo '<li>You must be logged into your account to post within this album, therefore if you break any of these rules your account may be subject to disablement. Prolonged periods will incur if you break any of these rules more than once.</li>';
    echo '</ol>';
    echo '<small><b>Please Note:</b> Your warning is written here. You will not be warned beyond this point. It will be a 24 hour disablement beyond this warning the first time you break a rule. (IF you break a rule)</small>';
    echo '</p>';
    echo '<p>&nbsp;</p>';
    // most hits
    echo '<p><u>Top 5 Pictures</u><br /><br />';
    $db->query('SELECT *
				FROM album
				WHERE approved = \'YES\'
				ORDER BY page_views DESC
				LIMIT 5');
    if ($db->getNumRows()) {
        while ($db->nextRecord()) {
            $page_views = $db->getField('page_views');
            $nick = get_album_nick($db->getField('account_id'));
            echo '<a href="' . URL . '/album/?' . urlencode($nick) . '">' . $nick . '</a> (' . $page_views . ')<br />';
        }
    }
    // latest picture
    echo '<p><u>Latest Picture</u><br /><br />';
    $db->query('SELECT *
				FROM album
				WHERE approved = \'YES\'
				ORDER BY created DESC
				LIMIT 5');
    if ($db->getNumRows()) {
        while ($db->nextRecord()) {
            $created = $db->getField('created');
            $nick = get_album_nick($db->getField('account_id'));
            echo '<span style="font-size:85%;"><b>[' . date(defined('DATE_FULL_SHORT') ? DATE_FULL_SHORT : DEFAULT_DATE_FULL_SHORT, $created) . ']</b> Picture of <a href="' . URL . '/album/?' . urlencode($nick) . '">' . $nick . '</a> added</span><br />';
        }
    } else {
        echo '<span style="font-size:85%;">no entries</span>';
    }
    echo '</p>';
}
Exemple #2
0
function channel_msg_rank($fp, $rdata)
{
    global $channel, $nick;
    // did he gave us no parameter?
    if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $channel . '\\s:!rank\\s$/i', $rdata, $msg) || preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $nick . '\\s:rank\\s$/i', $rdata, $msg)) {
        echo_r($msg);
        fputs($fp, 'NOTICE ' . $msg[1] . ' :SYNTAX !rank <nick>' . EOL);
        return true;
    }
    // in channel we only accept !rank
    // in private msg we accept both
    if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $channel . '\\s:!rank\\s(.*)\\s$/i', $rdata, $msg) || preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $nick . '\\s:?rank\\s(.*)\\s$/i', $rdata, $msg)) {
        echo_r($msg);
        $db = new SmrMySqlDatabase();
        $db2 = new SmrMySqlDatabase();
        $db->query('SELECT * FROM player WHERE player_name = ' . $db->escape_string($msg[4], true));
        if ($db->getNumRows()) {
            while ($db->nextRecord()) {
                $player_name = stripslashes($db->getField('player_name'));
                $experience = $db->getField('experience');
                $game_id = $db->getField('game_id');
                $db2->query('SELECT COUNT(*) as our_rank FROM player ' . 'WHERE game_id = ' . $game_id . ' AND ' . '(experience > ' . $experience . ' OR ' . '(experience = ' . $experience . ' AND ' . 'player_name <= ' . $db->escape_string($player_name, true) . ' ))');
                if ($db2->nextRecord()) {
                    $our_rank = $db2->getField('our_rank');
                }
                // how many players are there?
                $db2->query('SELECT COUNT(*) as total_player FROM player WHERE game_id = ' . $game_id);
                if ($db2->nextRecord()) {
                    $total_player = $db2->getField('total_player');
                }
                $db2->query('SELECT game_name FROM game WHERE game_id = ' . $game_id);
                if ($db2->nextRecord()) {
                    $game_name = $db2->getField('game_name');
                }
                fputs($fp, 'NOTICE ' . $msg[1] . ' :' . $msg[1] . ' you are ranked ' . $our_rank . ' out of ' . $total_player . ' in ' . $game_name . '!' . EOL);
            }
        } else {
            fputs($fp, 'NOTICE ' . $msg[1] . ' :No Trader found that matches your query!' . EOL);
        }
        return true;
    }
    return false;
}
Exemple #3
0
 $PHP_OUTPUT .= create_submit('Select All');
 $PHP_OUTPUT .= '</form>';
 $PHP_OUTPUT .= create_echo_form(create_container('password_check_processing.php', ''));
 $PHP_OUTPUT .= '<table>';
 $PHP_OUTPUT .= '<tr>';
 $PHP_OUTPUT .= '<th>ID</th>';
 $PHP_OUTPUT .= '<th>Login</th>';
 $PHP_OUTPUT .= '<th>eMail</th>';
 $PHP_OUTPUT .= '<th>Action</th>';
 $PHP_OUTPUT .= '</tr>';
 while ($db->nextRecord()) {
     $db2->query('SELECT * FROM account WHERE password = '******'password')));
     while ($db2->nextRecord()) {
         $curr_account_id = $db2->getField('account_id');
         $db3->query('SELECT * FROM account_is_closed WHERE account_id = ' . $db->escapeNumber($curr_account_id) . ' LIMIT 1');
         $isDisabled = $db3->getNumRows() > 0;
         $PHP_OUTPUT .= '<tr' . ($isDisabled ? ' class="red"' : '') . '>';
         $PHP_OUTPUT .= '<td>' . $db2->getField('account_id') . '</td>';
         $PHP_OUTPUT .= '<td>' . $db2->getField('login') . '</td>';
         $PHP_OUTPUT .= '<td' . ($db2->getBoolean('validated') ? '' : ' style="text-decoration:line-through;"') . '>' . $db2->getField('email') . ' (' . ($db2->getBoolean('validated') ? 'Valid' : 'Invalid') . ')</td>';
         $PHP_OUTPUT .= '<td align="center"><input type="checkbox" name="disable_account[]" value="' . $curr_account_id . '"';
         // check if this guy is maybe already disabled
         $db3->query('SELECT * FROM account_is_closed WHERE account_id = ' . $db->escapeNumber($curr_account_id));
         if ($isDisabled) {
             $PHP_OUTPUT .= ' checked';
         } else {
             if ($action == 'Select All') {
                 $PHP_OUTPUT .= ' checked';
             }
         }
         $PHP_OUTPUT .= '></td>';
Exemple #4
0
    $file .= addbyte(sqrt($db->getField('num_sec')));
}
//planet definitions (num of, [size of name, name])
$file .= addbyte(2);
$file .= addbyte(8);
$file .= 'Friendly';
$file .= addbyte(5);
$file .= 'Enemy';
//done with all header info
$db2 = new SmrMySqlDatabase();
$db3 = new SmrMySqlDatabase();
$db->query('SELECT * FROM sector WHERE game_id = ' . $game_id . ' ORDER BY sector_id');
while ($db->nextRecord()) {
    $sector_id = $db->getField('sector_id');
    $db2->query('SELECT * FROM player_visited_sector WHERE sector_id = ' . $sector_id . ' AND game_id = ' . $game_id . ' AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' LIMIT 1');
    if ($db2->getNumRows() > 0) {
        $CurrByte = 3;
        $up = $db->getField('link_up');
        $db2->query('SELECT * FROM player_visited_sector WHERE sector_id = ' . $up . ' AND game_id = ' . $game_id . ' AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' LIMIT 1');
        if ($db2->getNumRows() == 0 && $up != 0) {
            $CurrByte += 128;
        }
        $right = $db->getField('link_right');
        $db2->query('SELECT * FROM player_visited_sector WHERE sector_id = ' . $right . ' AND game_id = ' . $game_id . ' AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' LIMIT 1');
        if ($db2->getNumRows() == 0 && $right != 0) {
            $CurrByte += 64;
        }
        $down = $db->getField('link_down');
        $db2->query('SELECT * FROM player_visited_sector WHERE sector_id = ' . $down . ' AND game_id = ' . $game_id . ' AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' LIMIT 1');
        if ($db2->getNumRows() == 0 && $down != 0) {
            $CurrByte += 32;
Exemple #5
0
 }
 while ($continue) {
     if (isset($stop) && $stop != '') {
         $continue = '0';
         continue;
     }
     if ($continue == 'next') {
         if (isset($match_sec) && $match_sec != '') {
             $isset = 'yes';
         } else {
             $match_sec = $login_name;
             $isset = 'no';
         }
         $db3->query('SELECT * FROM account_is_closed WHERE suspicion = ' . $db->escapeString($match_sec));
         $db2->query('SELECT * FROM account WHERE login = '******'account_id'));
                 $id = $curr_acc->getAccountID();
                 $match_sec = $curr_acc->getLogin();
                 if (!in_array($match_sec, $names)) {
                     $continue = 'next';
                     $PHP_OUTPUT .= $login_name . ' is disabled matching ' . $match_sec . '<br />';
                 } elseif (in_array($match_sec, $next_arr)) {
                     $stop = 'yes';
                     continue;
                 } else {
                     $next_arr[] = $match_sec;
                 }
             }
reset($planet);
foreach ($planet as $galaxy_id => $amount) {
    $count = 0;
    // get a sector with none port
    $db->query('SELECT * FROM sector
				WHERE game_id = ' . $db->escapeNumber($var['game_id']) . '
				AND galaxy_id = ' . $db->escapeNumber($galaxy_id) . '
				ORDER BY rand()');
    while ($count < $amount && $db->nextRecord()) {
        $sector_id = $db->getInt('sector_id');
        // does this sector have a fed beacon??
        $db2->query('SELECT * FROM location
					WHERE game_id = ' . $db->escapeNumber($var['game_id']) . '
						AND sector_id = ' . $db->escapeNumber($sector_id) . '
						AND location_type_id = 1');
        if ($db2->getNumRows() > 0) {
            continue;
        }
        // ok we did $count planets so far
        $count++;
        $inhabitable_time = $time + pow(mt_rand(45, 85), 3);
        // insert planet into db
        $db2->query('INSERT INTO planet (game_id, sector_id, inhabitable_time)
					VALUES (' . $db->escapeNumber($var['game_id']) . ', ' . $db->escapeNumber($sector_id) . ', ' . $db->escapeNumber($inhabitable_time) . ')');
    }
}
$container = array();
$container['url'] = 'skeleton.php';
$container['body'] = 'universe_create_ships.php';
$container['game_id'] = $var['game_id'];
forward($container);
        SmrSession::update();
        if ($disabled['Reason'] == 'Invalid eMail') {
            header('Location: ' . URL . '/email.php');
            exit;
        } else {
            header('Location: ' . URL . '/disabled.php');
            exit;
        }
    }
    // *********************************
    // *
    // * a u t o   n e w b i e   t u r n
    // *
    // *********************************
    $db->query('SELECT * FROM active_session ' . 'WHERE last_accessed > ' . $db->escapeNumber(TIME - TIME_BEFORE_NEWBIE_TIME));
    if ($db->getNumRows() == 0) {
        $db->query('UPDATE player SET newbie_turns = 1
					WHERE newbie_turns = 0 AND
						  land_on_planet = \'FALSE\'');
    }
    // ******************************************
    // *
    // * r e m o v e   e x p i r e d   s t u f f
    // *
    // ******************************************
    $db->query('DELETE FROM player_has_ticker WHERE expires <= ' . $db->escapeNumber(TIME));
    $db->query('DELETE FROM cpl_tag WHERE expires <= ' . $db->escapeNumber(TIME) . ' AND expires > 0');
    // save ip
    $account->updateIP();
    //now we set a cookie that we can use for mult checking
    if (!isset($_COOKIE['Session_Info'])) {
        case 3:
            $PHP_OUTPUT .= '<span class="yellow">' . $_REQUEST['PlayerName'] . '</span> has been added to your blacklist.';
            break;
        case 4:
            $PHP_OUTPUT .= '<span class="red bold">ERROR: </span>No entries selected for deletion.';
            break;
        default:
            $PHP_OUTPUT .= '<span class="red bold">ERROR: </span>Unknown error event.';
            break;
    }
    $PHP_OUTPUT .= '<br /><br />';
}
$PHP_OUTPUT .= '<h2>Blacklisted Players</h2><br />';
$db = new SmrMySqlDatabase();
$db->query('SELECT p.player_name, p.game_id, b.entry_id FROM player p JOIN message_blacklist b ON p.account_id = b.blacklisted_id AND b.game_id = p.game_id WHERE b.account_id=' . $db->escapeNumber($player->getAccountID()) . ' ORDER BY p.game_id, p.player_name');
if ($db->getNumRows()) {
    $container = array();
    $container['url'] = 'message_blacklist_del.php';
    $form = create_form($container, 'Remove Selected');
    $PHP_OUTPUT .= $form['form'];
    $PHP_OUTPUT .= '<table class="standard"><tr><th>Option</th><th>Name</th><th>Game ID</th>';
    while ($db->nextRecord()) {
        $row = $db->getRow();
        $PHP_OUTPUT .= '<tr>';
        $PHP_OUTPUT .= '<td class="center shrink"><input type="checkbox" name="entry_ids[]" value="' . $row['entry_id'] . '"></td>';
        $PHP_OUTPUT .= '<td>' . $row['player_name'] . '</td>';
        $PHP_OUTPUT .= '<td>' . $row['game_id'] . '</td>';
        $PHP_OUTPUT .= '</tr>';
    }
    $PHP_OUTPUT .= '</table><br />';
    $PHP_OUTPUT .= $form['submit'];
Exemple #9
0
	<tr>
	<td width="1" bgcolor="#0B8D35"></td>
	<td align="left" valign="top" bgcolor="#06240E">
	<table width="100%" height="100%" border="0" cellspacing="5" cellpadding="5">
	<tr>
	<td valign="top">
	<?php 
    if (!empty($_SERVER['QUERY_STRING'])) {
        // query string should be a nick or some letters of a nick
        $query = urldecode($_SERVER['QUERY_STRING']);
        $db->query('SELECT account_id as album_id
					FROM album JOIN account USING(account_id)
					WHERE hof_name LIKE ' . $db->escapeString($query . '%') . ' AND
						  approved = \'YES\'
					ORDER BY hof_name');
        if ($db->getNumRows() > 1) {
            $db2->query('SELECT account_id as album_id
					FROM album JOIN account USING(account_id)
					WHERE hof_name = ' . $db->escapeString($query) . ' AND
						  approved = \'YES\'
					ORDER BY hof_name');
            if ($db2->nextRecord()) {
                album_entry($db2->getField('album_id'));
            } else {
                // get all id's and build array
                $album_ids = array();
                while ($db->nextRecord()) {
                    $album_ids[] = $db->getField('album_id');
                }
                // double check if we have id's
                if (count($album_ids) > 0) {
         $account_numbers[] = $acc_id;
     }
 }
 foreach ($ip_numbers as $something) {
     $amount += 1;
 }
 reset($ip_numbers);
 array_multisort($ip_numbers, $account_numbers);
 $i = 0;
 while ($i < $amount) {
     $account_wanted = array_shift($account_numbers);
     $ip_wanted = array_shift($ip_numbers);
     $new_acc =& SmrAccount::getAccount($account_wanted);
     $last_acc =& SmrAccount::getAccount($last_acc_id);
     $db2->query('SELECT * FROM account_is_closed WHERE account_id = ' . $db2->escapeNumber($acc_id));
     if ($db2->getNumRows() && $db_ip != $last_ip) {
         continue;
     }
     $PHP_OUTPUT .= '<tr>';
     $PHP_OUTPUT .= '<td align=center>' . $new_acc->getLogin() . ' (' . $new_acc->getAccountID() . ')</td>';
     $PHP_OUTPUT .= '<td align=center>' . $ip_wanted . '</td>';
     if ($ip_wanted == $last_ip && !$db2->nextRecord()) {
         $PHP_OUTPUT .= '<td align=center><span class="red">MATCH w/ ' . $last_acc->getLogin() . '</span></td>';
     } elseif ($ip_wanted == $last_ip) {
         $PHP_OUTPUT .= '<td align=center><span class="red">(Already disabled) MATCH w/ ' . $last_acc->getLogin() . '</span></td>';
     } else {
         $PHP_OUTPUT .= '<td align=center>&nbsp;</td>';
     }
     $PHP_OUTPUT .= '<td><input type="checkbox" name="account_id[]" value="' . $new_acc->getAccountID() . '"></td>';
     $PHP_OUTPUT .= '</tr>';
     $i += 1;
     //}
     $country_code = $_REQUEST['country_code'];
     //if (empty($country_code)) {
     //
     //	$msg = 'Please choose a country!';
     //	header('Location: '.URL.'/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
     //	exit;
     //}
 }
 if ($login == $password) {
     $msg = 'Your chosen password is invalid!';
     header('Location: ' . URL . '/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
     exit;
 }
 $db->query('SELECT * FROM account WHERE login = '******'This user name is already registered.';
     header('Location: ' . URL . '/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
     exit;
 }
 $db->query('SELECT * FROM account WHERE email = ' . $db->escapeString($email));
 if ($db->getNumRows() > 0) {
     $msg = 'This email address is already registered.';
     header('Location: ' . URL . '/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
     exit;
 }
 $referral = !empty($_REQUEST['referral_id']) ? $_REQUEST['referral_id'] : 0;
 if (!is_numeric($referral)) {
     $msg = 'Referral ID must be a number if entered!';
     header('Location: ' . URL . '/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
     exit;
<?php

$template->assign('PageTopic', 'Galactic Post');
require_once get_file_loc('menu.inc');
create_galactic_post_menu();
$db2 = new SmrMySqlDatabase();
$db3 = new SmrMySqlDatabase();
$db->query('SELECT * FROM galactic_post_online WHERE game_id = ' . $db->escapeNumber($player->getGameID()));
if ($db->nextRecord()) {
    $paper_id = $db->getField('paper_id');
    $db2->query('SELECT * FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND paper_id = ' . $paper_id);
    $db2->nextRecord();
    $paper_name = bbifyMessage($db2->getField('title'));
    $template->assign('PageTopic', 'Reading <i>Galactic Post</i> Edition : ' . $paper_name);
    $db2->query('SELECT * FROM galactic_post_paper_content WHERE paper_id = ' . $db2->escapeNumber($paper_id) . ' AND game_id = ' . $db2->escapeNumber($player->getGameID()));
    $even = $db2->getNumRows() % 2 == 0;
    $curr_position = 0;
    $PHP_OUTPUT .= '<table align="center" spacepadding="20" cellspacing="20">';
    $amount = $db2->getNumRows();
    if ($even === false) {
        $amount += 1;
    }
    while ($curr_position < $amount) {
        $curr_position += 1;
        if ($even === false && $db2->getNumRows() + 1 == $curr_position) {
            $PHP_OUTPUT .= '<td>&nbsp;</td>';
            continue;
        }
        $db2->nextRecord();
        //now we have the articles in this paper.
        $db3->query('SELECT * FROM galactic_post_article WHERE game_id = ' . $db3->escapeNumber($player->getGameID()) . ' AND article_id = ' . $db3->escapeNumber($db2->getField('article_id')) . ' LIMIT 1');
Exemple #13
0
    $alliance_eyes = array();
    while ($db->nextRecord()) {
        $threadID = $db->getInt('thread_id');
        $alliance_eyes[$i] = $db->getInt('alliance_only') == 1;
        $threads[$i]['ThreadID'] = $threadID;
        $thread_ids[$i] = $threadID;
        $thread_topics[$i] = $db->getField('topic');
        $threads[$i]['Topic'] = $db->getField('topic');
        $db2->query('SELECT time
					FROM player_read_thread 
					WHERE account_id=' . $db2->escapeNumber($player->getAccountID()) . '
					AND game_id=' . $db2->escapeNumber($player->getGameID()) . '
					AND alliance_id =' . $db2->escapeNumber($alliance->getAllianceID()) . '
					AND thread_id=' . $db2->escapeNumber($threadID) . '
					AND time>' . $db2->escapeNumber($db->getInt('sendtime')) . ' LIMIT 1');
        $threads[$i]['Unread'] = $db2->getNumRows() == 0;
        if ($db->getInt('sender_id') > 0) {
            $db2->query('SELECT
						player.player_name as player_name,
						alliance_thread.sender_id as sender_id
						FROM player
						JOIN alliance_thread ON alliance_thread.game_id = player.game_id AND player.account_id=alliance_thread.sender_id
						WHERE player.game_id=' . $db2->escapeNumber($player->getGameID()) . '
						AND alliance_thread.alliance_id=' . $db2->escapeNumber($alliance->getAllianceID()) . '
						AND alliance_thread.thread_id=' . $db2->escapeNumber($threadID) . '
						AND alliance_thread.reply_id=1 LIMIT 1
						');
            if ($db2->nextRecord()) {
                $sender_id = $db2->getInt('sender_id');
                $author =& SmrPlayer::getPlayer($sender_id, $player->getGameID());
                $playerName = $author->getLinkedDisplayName(false);
Exemple #14
0
 $PHP_OUTPUT .= create_link(create_container('skeleton.php', 'galactic_post_view_article.php'), 'View the articles');
 $PHP_OUTPUT .= '<br />';
 $PHP_OUTPUT .= create_link(create_container('skeleton.php', 'galactic_post_make_paper.php'), 'Make a paper');
 $PHP_OUTPUT .= '<br />';
 $PHP_OUTPUT .= create_link(create_container('skeleton.php', 'galactic_post_view_members.php'), 'View Members');
 $PHP_OUTPUT .= '<br />';
 $db->query('SELECT * FROM galactic_post_paper WHERE game_id = ' . $db->escapeNumber($player->getGameID()));
 if ($db->getNumRows()) {
     $PHP_OUTPUT .= 'The following papers are already made (note papers must have 3-8 articles to go to the press)';
 }
 while ($db->nextRecord()) {
     $paper_name = $db->getField('title');
     $paper_id = $db->getField('paper_id');
     $PHP_OUTPUT .= '<span class="red">***</span><i>' . $paper_name . '</i>';
     $db2->query('SELECT * FROM galactic_post_paper_content WHERE paper_id = ' . $db2->escapeNumber($paper_id) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()));
     $PHP_OUTPUT .= ' which contains <span class="red"> ' . $db2->getNumRows() . ' </span>articles. ';
     if ($db2->getNumRows() > 2 && $db2->getNumRows() < 9) {
         $container = array();
         $container['url'] = 'galactic_post_make_current.php';
         $container['id'] = $paper_id;
         $PHP_OUTPUT .= create_link($container, '<b>HIT THE PRESS!</b>');
     }
     $PHP_OUTPUT .= '<br />';
     $container = array();
     $container['url'] = 'skeleton.php';
     $container['body'] = 'galactic_post_delete_confirm.php';
     $container['paper'] = 'yes';
     $container['id'] = $paper_id;
     $PHP_OUTPUT .= create_link($container, 'Delete ' . $paper_name);
     $PHP_OUTPUT .= '<br />';
     $container = array();
Exemple #15
0
            $PHP_OUTPUT .= '<span class="red bold">ERROR: </span>Invalid input.';
            break;
        case 2:
            $PHP_OUTPUT .= '<span class="yellow">' . strtoupper(trim($_REQUEST['Word'])) . '</span> will now be replaced with <span class="yellow">' . strtoupper(trim($_REQUEST['WordReplacement'])) . '</span>.';
            break;
        case 3:
            $PHP_OUTPUT .= '<span class="red bold">ERROR: </span>No entries selected for deletion.';
            break;
        default:
            $PHP_OUTPUT .= '<span class="red bold">ERROR: </span>Unknown error event.';
            break;
    }
    $PHP_OUTPUT .= '<br /><br />';
}
$PHP_OUTPUT .= '<h2>Filtered Words</h2><br />';
if (!$db->getNumRows()) {
    $PHP_OUTPUT .= 'No words are currently being filtered.<br /><br />';
} else {
    $container = array();
    $container['url'] = 'word_filter_del.php';
    $form = create_form($container, 'Remove Selected');
    $PHP_OUTPUT .= $form['form'];
    $PHP_OUTPUT .= '<table class="standard"><tr><th>Option</th><th>Word</th><th>Replacement</th></tr>';
    while ($db->nextRecord()) {
        $row = $db->getRow();
        $PHP_OUTPUT .= '<tr>';
        $PHP_OUTPUT .= '<td class="center shrink"><input type="checkbox" name="word_ids[]" value="' . $row['word_id'] . '"></td>';
        $PHP_OUTPUT .= '<td>' . $row['word_value'] . '</td>';
        $PHP_OUTPUT .= '<td>' . $row['word_replacement'] . '</td>';
        $PHP_OUTPUT .= '</tr>';
    }
Exemple #16
0
 if ($db->getField('link_left') > 0) {
     $CurrByte += 16;
 }
 //do we have a planet here?
 $db2->query('SELECT * FROM planet WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector_id);
 if ($db2->nextRecord()) {
     $CurrByte += 8;
 }
 //do we have a port here?
 $db2->query('SELECT * FROM port WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector_id);
 if ($db2->nextRecord()) {
     $CurrByte += 4;
 }
 //sector friendliness
 $db2->query('SELECT * FROM sector_has_forces WHERE sector_id = ' . $sector_id . ' AND mines > 0 AND owner_id IN ' . $alliance);
 if ($db2->getNumRows() > 0) {
     //we want a green 'friendly' sector
     $CurrByte += 1;
 } else {
     //we want a blue 'neutral' sector
     $CurrByte += 0;
 }
 $file .= addbyte($CurrByte);
 $db2->query('SELECT * FROM port WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector_id);
 $race = 0;
 $has_port = FALSE;
 if ($db2->nextRecord()) {
     $has_port = TRUE;
     $race = $db2->getField('race_id');
     if ($race == 1) {
         $race = 9;
Exemple #17
0
        $db->query('SELECT * FROM message_type
					WHERE message_type_id != ' . $db->escapeNumber(MSG_POLITICAL) . '
					ORDER BY message_type_id');
    }
    $messageBoxes = array();
    while ($db->nextRecord()) {
        $message_type_id = $db->getField('message_type_id');
        $messageBox['Name'] = $db->getField('message_type_name');
        // do we have unread msges in that folder?
        $db2->query('SELECT 1 FROM message
					WHERE account_id = ' . $db2->escapeNumber($player->getAccountID()) . '
						AND game_id = ' . $db2->escapeNumber($player->getGameID()) . '
						AND message_type_id = ' . $db2->escapeNumber($message_type_id) . '
						AND msg_read = ' . $db2->escapeBoolean(false) . '
						AND receiver_delete = ' . $db2->escapeBoolean(false) . ' LIMIT 1');
        $messageBox['HasUnread'] = $db2->getNumRows() != 0;
        $messageBox['MessageCount'] = 0;
        // get number of msges
        $db2->query('SELECT count(message_id) as message_count FROM message
					WHERE account_id = ' . $db2->escapeNumber($player->getAccountID()) . '
						AND game_id = ' . $db2->escapeNumber($player->getGameID()) . '
						AND message_type_id = ' . $db2->escapeNumber($message_type_id) . '
						AND receiver_delete = ' . $db2->escapeBoolean(false));
        if ($db2->nextRecord()) {
            $messageBox['MessageCount'] = $db2->getField('message_count');
        }
        $container = create_container('skeleton.php', 'message_view.php');
        $container['folder_id'] = $message_type_id;
        $messageBox['ViewHref'] = SmrSession::getNewHREF($container);
        $container = create_container('message_delete_processing.php');
        $container['folder_id'] = $message_type_id;
Exemple #18
0
function private_msg_weapon($fp, $rdata)
{
    global $channel;
    $type = 0;
    if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $channel . '\\s:!weapon\\sname\\s(.*)\\s$/i', $rdata, $msg_1)) {
        $name = $msg_1[1];
        sleep(2);
        $type = 1;
    } elseif (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $channel . '\\s:!weapon\\slevel\\s(.*)\\s(.*)\\s$/i', $rdata, $msg_2)) {
        $name = $msg_2[1];
        sleep(2);
        $type = 2;
    } elseif (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s' . $channel . '\\s:!weapon\\srange\\s(.*)\\s(.*)\\s(.*)\\s(.*)\\s$/i', $rdata, $msg_3)) {
        $name = $msg_3[1];
        sleep(2);
        $type = 3;
    }
    //first lets get our orders so we can make sure our query will work
    $a = array();
    $a[] = 'cost';
    $a[] = 'weapon_name';
    $a[] = 'shield_damage';
    $a[] = 'armour_damage';
    $a[] = 'accuracy';
    $a[] = 'race_id';
    $a[] = 'buyer_restriction';
    $a[] = 'power_level';
    $db = new SmrMySqlDatabase();
    if ($type == 1) {
        $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE weapon_name LIKE ' . $db->escape_string('%' . $msg_1[4] . '%'));
    } elseif ($type == 2) {
        if (in_array($msg_2[5], $a)) {
            $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE power_level = ' . $msg_2[4] . ' ORDER BY ' . $msg_2[5] . ' DESC');
        } else {
            $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE power_level = ' . $msg_2[4]);
        }
    } elseif ($type == 3) {
        //[4] = object
        //[5] = lower limit
        //[6] = upper limit
        //[7] = order
        //first make sure we arent flooding
        sleep(2);
        if (in_array($msg_3[4], $a) && in_array($msg_3[7], $a)) {
            $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE ' . $msg_3[4] . ' > ' . $msg_3[5] . ' AND ' . $msg_3[4] . ' < ' . $msg_3[6] . ' ORDER BY ' . $msg_3[7] . ' DESC');
        } elseif (in_array($msg_3[4], $a)) {
            $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE ' . $msg_3[4] . ' > ' . $msg_3[5] . ' AND ' . $msg_3[4] . ' < ' . $msg_3[6]);
        } else {
            $rand = mt_rand(0, 7);
            $object = $a[$rand];
            $db->query('SELECT * FROM weapon_type JOIN race USING(race_id) WHERE ' . $object . ' > ' . $msg_3[5] . ' AND ' . $object . ' < ' . $msg_3[6]);
        }
    }
    if ($db->getNumRows()) {
        fputs($fp, 'PRIVMSG ' . $name . ' :Name | Cost | Shield Damage | Armour Damage | Accuracy | Race | Restriction' . EOL);
        sleep(2);
        while ($db->nextRecord()) {
            $weapon_name = $db->getField('weapon_name');
            $hardpoint = $db->getField('power_level');
            $shield = $db->getField('shield_damage');
            $armour = $db->getField('armour_damage');
            $acc = $db->getField('accuracy');
            $race = $db->getField('race_name');
            $restrict = $db->getField('buyer_restriction');
            $cost = $db->getField('cost');
            $private_message = 'PRIVMSG ' . $name . ' :' . $weapon_name . ' | ' . $cost . ' | ' . $shield . ' | ' . $armour . ' | ' . $acc . ' | ' . $race . ' | ';
            if ($restrict == 1) {
                $private_message .= 'Good';
            } elseif ($restrict == 2) {
                $private_message .= 'Evil';
            } else {
                $private_message .= 'None';
            }
            $private_message .= EOL;
            fputs($fp, $private_message);
            sleep(2);
        }
    } elseif ($type == 1) {
        fputs($fp, 'PRIVMSG ' . $name . ' :There is no weapon called ' . $msg_1[5] . '!' . EOL);
    } elseif ($type == 2) {
        fputs($fp, 'PRIVMSG ' . $name . ' :There is no weapon with ' . $msg_2[4] . ' power level!' . EOL);
    } elseif ($type == 3) {
        fputs($fp, 'PRIVMSG ' . $name . ' :There is no weapon in the cost range of ' . $msg_3[4] . ' - ' . $msg_3[5] . '!' . EOL);
    }
    if (isset($type)) {
        return true;
    }
    return false;
}
    $alliance_vs = array();
    $db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY alliance_kills DESC, alliance_name LIMIT 5');
    while ($db->nextRecord()) {
        $alliance_vs[] = $db->getField('alliance_id');
    }
    //$PHP_OUTPUT.=('empty '.$alliancer);
} else {
    $alliance_vs = $alliancer;
}
$alliance_vs[] = 0;
foreach ($alliance_vs as $key => $id) {
    // get current alliance
    $curr_alliance_id = $id;
    if ($id > 0) {
        $db->query('SELECT 1 FROM player WHERE alliance_id = ' . $db->escapeNumber($id) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()));
        $out = $db2->getNumRows() == 0;
        $PHP_OUTPUT .= '<td width=15% valign="top"';
        if ($player->getAllianceID() == $curr_alliance_id) {
            $PHP_OUTPUT .= ' class="bold"';
        }
        $PHP_OUTPUT .= '>';
        /*$container = array();
        		$container['url']			= 'skeleton.php';
        		$container['body']			= 'alliance_roster.php';
        		$container['alliance_id']	= $curr_alliance_id;
        		$PHP_OUTPUT.=create_link($container, '.$db->escapeString($curr_alliance->getAllianceName()');*/
        $PHP_OUTPUT .= '<select name="alliancer[]" style="width:105">';
        $db->query('SELECT * FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND (alliance_deaths > 0 OR alliance_kills > 0) ORDER BY alliance_name');
        while ($db->nextRecord()) {
            $curr_alliance =& SmrAlliance::getAlliance($db->getField('alliance_id'), $player->getGameID());
            $PHP_OUTPUT .= '<option value=' . $db->getField('alliance_id');
$db2 = new SmrMySqlDatabase();
if (!file_exists($file_name)) {
    //we are good to create!
    if (touch($file_name)) {
        if (!($db_file = fopen($file_name, 'a'))) {
            echo 'Cannot open file (' . $file_name . ')';
            exit;
        }
        //we are good to add entries
        $db->query('SHOW TABLES');
        $db2 = new SmrMySqlDatabase();
        while ($db->nextRecord()) {
            $table = $db->getField(0);
            $db2->query('SHOW COLUMNS FROM ' . $table);
            $insert = 'INSERT INTO ' . $table . ' (';
            $i = $db2->getNumRows() - 1;
            $cols = $db2->getNumRows() - 1;
            while ($db2->nextRecord()) {
                $field = $db2->getField(0);
                $insert .= $field;
                if ($i != 0) {
                    $insert .= ',';
                }
                $i--;
            }
            $i = $cols;
            $insert .= ') VALUES (';
            $db2->query('SELECT * FROM ' . $table);
            while ($db2->nextRecord()) {
                $db_ent = $insert;
                for ($j = 0; $j <= $cols; $j++) {