コード例 #1
0
ファイル: news.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_news_text()
{
	global $go, $tribeid, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	IF($tribeid && $go =="yes") {
		$result = mysql_query("SELECT time,text from news WHERE duser = $tribeid ORDER BY time DESC") or die(mysql_error());
		echo "<table cellspacing=0 cellpadding=0 width=80% class=\"border\">";
		echo "<tr><td colspan=2 class=\"pd bold dark black bdown\" align=center>";
		echo "The Headlines</td></tr>";
		while ($newsloop =(mysql_fetch_array($result))) {
			echo "<tr><td class=\"pd 11\">";
			echo "$newsloop[time]</td><td class=\"pd 11\">$newsloop[text]</td></tr>";
		}
		echo "</table>";
	}

	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input user id:<input type=text size=20 name=tribeid>";
    ECHO "<input type=hidden name=go value=yes>";
    ECHO "<br><input type=submit value=\"show me\"></form>";
	
}
コード例 #2
0
function call_admin_switches_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    include_once 'inc/classes/clsGame.php';
    $objGame = new clsGame();
    if (isset($_POST[ON])) {
        $strTool = $_POST['tool'];
        $objGame->set_game_switch($strTool, ON);
        echo '<p>' . "Switch '{$strTool}' is now turned on." . '<br /><br />' . '<a href="main.php?cat=game&amp;page=resort_tools&amp;' . 'tool=admin_switches">' . 'Return to Tool' . '</a>' . '</p>';
    } elseif (isset($_POST[OFF])) {
        $strTool = $_POST['tool'];
        $objGame->set_game_switch($strTool, OFF);
        echo '<p>' . "Switch '{$strTool}' is now turned off." . '<br /><br />' . '<a href="main.php?cat=game&amp;page=resort_tools&amp;' . 'tool=admin_switches">' . 'Return to Tool' . '</a>' . '</p>';
    } else {
        $strDiv = '<h2>' . 'Admin Switches' . '</h2>';
        $arrGameSwitches = $objGame->get_game_switches();
        foreach ($arrGameSwitches as $strName => $strValue) {
            switch ($strValue) {
                case ON:
                    $strDiv .= '<form method="post" action="main.php?cat=game&amp;page=' . 'resort_tools&amp;tool=admin_switches"><p><b class="positive">' . $strName . ' is ON. <br />' . '<input type="hidden" name="tool" value="' . $strName . '">' . '<input type="submit" name="' . OFF . '" value="Switch OFF ' . $strName . '">' . '</b></p></form>';
                    break;
                case OFF:
                    $strDiv .= '<form method="post" action="main.php?cat=game&amp;page=' . 'resort_tools&amp;tool=admin_switches"><p><b class="negative">' . $strName . ' is OFF. <br />' . '<input type="hidden" name="tool" value="' . $strName . '">' . '<input type="submit" name="' . ON . '" value="Switch ON ' . $strName . '">' . '</b></p></form>';
                    break;
            }
        }
        echo $strDiv;
    }
}
コード例 #3
0
ファイル: signups.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_signups_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo "<h2>Signup History</h2>";
    //     $show_time = date(TIMESTAMP_FORMAT, strtotime("-7 days"));
    if (TRUE || $_POST['go'] == "yes") {
        $strSQL = 'SELECT YEAR(signup_time) as year, MONTH(signup_time) as month, DAY(signup_time) AS day, count(*) as signups FROM gamestats' . ' GROUP BY year,month,day' . ' ORDER BY year DESC,month DESC,day DESC LIMIT 0, 30';
        echo "<table class=tiny cellspacing=0 cellpadding=0>";
        echo "<tr class=header><th colspan=4>Signup History</th></tr>";
        echo "<tr class=subheader><th> Year </th><td> Month </td><td> Day </td><td> Signups </td></tr>";
        $result = mysql_query($strSQL) or die("query error");
        while ($value = mysql_fetch_array($result, MYSQL_ASSOC)) {
            echo $strTableTr = "<tr class=data>" . "<th>" . $value['year'] . '</th>' . '<td>' . $value['month'] . '</td>' . '<td>' . $value['day'] . '</td>' . '<td>' . $value['signups'] . '</td>' . '</tr>';
        }
        echo "</table> <br />";
        echo "Prediction for tomorrow: ";
    }
    echo "<form method=\"post\" action=\"main.php?cat=game&amp;page=resort_tools&amp;tool=signups\">";
    echo "<br />";
    echo "<input type=hidden name=go value=yes>";
    echo "<br><input type=submit value=\"show me\"></form>";
}
コード例 #4
0
function call_tribe_activities_text(){
	global $go, $tribe_id,$tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	IF($tribe_id && $go =="yes") {
		$result = mysql_query("Select * from news where ouser=$tribe_id");
		$tribe = array();
		while ($arrtribe = mysql_fetch_array ($result, MYSQL_ASSOC)) {
				$tribe[$arrtribe["id"]] = $arrtribe;
			}
		ECHO "<table border=1 width=66%>";
		ECHO "<tr><td colspan=4 align=center><b>Tribe Activity tracking on $tribe_id</b></td></tr>";
		ECHO "<tr><td><b> Time </b></td><td><b> Type </b></td><td><b> Target </b></td><td><b> Text </b></td><td><b> ip </b></td></tr>";
		foreach($tribe as $strKey => $value) {
			$stats = mysql_query("SELECT * from stats where id = $value[duser]");
			$stats = mysql_fetch_array($stats);
			ECHO "<tr><td> $value[time] </td><td> $value[type] </td><td> $stats[tribe](#".$stats[kingdom].")<br>id = $value[duser] </td><td> $value[text]</td><td> $value[ip]</td></tr>";
		}
		ECHO "</table>";
	}

	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input user id to attain activites:<input type=text size=4 name=tribe_id>";
    ECHO "<input type=hidden name=go value=yes>";
    ECHO "<br><input type=submit value=\"show me\"></form>";
	
}
コード例 #5
0
function call_eldervotes_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    $go = '';
    $reset_id = 0;
    if (isset($_POST['go']) && !empty($_POST['go'])) {
        $go = $_POST['go'];
    }
    if (isset($_POST['reset_id']) && !empty($_POST['reset_id'])) {
        $reset_id = intval($_POST['reset_id']);
    }
    if ($go != "sure" && $go != "yes") {
        echo $strResetForm = '<h2>Reset elder votes of an alliance</h2>' . '<form method="post" action="main.php?cat=game&amp;page=resort_tools&amp;tool=eldervotes">' . '<label for="alli_id">Alliance #</label>: ' . '<input type="text" size="5" name="reset_id" id="alli_id" />' . '<input type="hidden" name="go" value="sure" /> ' . '<input type="submit" value="Check alliance" />' . '</form>';
    }
    if ($reset_id > 0 && $go == 'sure') {
        $name = @mysql_query("SELECT id, name FROM " . TBL_ALLIANCE . " WHERE id = {$reset_id}");
        $name = mysql_fetch_array($name);
        echo $strResetForm2 = '<h2>Reset elder votes of an alliance</h2>' . '<h3>Confirm alliance</h3>' . '<p>' . stripslashes($name[NAME]) . ' (#' . $name[ID] . ')</p>' . '<form method="post" action="main.php?cat=game&amp;page=resort_tools&amp;tool=eldervotes">' . '<input type="hidden" name="go" value="yes" />' . '<input type="hidden" name="reset_id" value="' . $reset_id . '" /> ' . '<input type="submit" value="Reset elder votes">' . '</form>';
    }
    if ($reset_id && $go == "yes") {
        echo '<h2>Reset elder votes of an alliance</h2>';
        // Reset votes (an automatic routine will remove it from alliance #0)
        mysql_query("UPDATE " . TBL_STAT . " SET " . VOTE . " = 0 WHERE " . ALLIANCE . " = {$reset_id}") or die('There was an error with the query.');
        echo "<p><strong>Reset successful!</strong> - Alliance #{$reset_id} has had their elder vote reset.</p>";
    }
}
コード例 #6
0
ファイル: view.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_view_text()
{
    global  $id, $op, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input user id: <input name=id size=5><br><br><br>";
    ECHO "<input type=submit value=Vision name=op>";
    ECHO "</form>";
    IF($op && $id)
    {
        IF($op == "Vision")
        {
            include('inc/functions/magic.php');
            include('inc/functions/power.php');
            include('inc/functions/tribe.php');
            $objTrgUser = new clsUser($id);
            echo get_tribe_table($objTrgUser);
        }
    }
}
コード例 #7
0
function call_pausemode_text()
{
	global $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
$res = mysql_query("SELECT PauseModeActive FROM admin_switches");
$line = mysql_fetch_assoc($res);
echo "Pause-mode is currently: " . $line["PauseModeActive"] . "<BR>";
	
	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
	?>
<INPUT type="submit" value="Enable Pause-mode" name="enable">
</FORM>
	<? echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">"; ?>
<INPUT type="submit" value="Disable Pause-mode" name="disable">
</FORM>
<?
	if ($enable)
	{
		mysql_query("UPDATE admin_switches SET PauseModeActive = 'on'");
		echo "Pause-mode enabled!";
	}
	if ($disable)
	{
		mysql_query("UPDATE admin_switches SET PauseModeActive = 'off'");
		echo "Pause-mode disabled!";
	}
}
コード例 #8
0
ファイル: authcode.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_authcode_text()
{
    global $id,$confirm,$Aname,$tool;

    include_once('inc/functions/resort_tools.php');
    if (! user_has_access($tool))
    {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }

    ECHO "<p>Just enter verified to stop the auth request, or to require them to read their new email use something random.</p>";
    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input ID#: <input name=id size=5><br>";
    ECHO "Change authcode to: <input type=text name=Aname maxlength=30 size=25><br>";
    ECHO "<input type=submit value=Send name=confirm>";
    ECHO "</form>";
    ECHO "<br><br>";

    IF($confirm && $id && $Aname)
    {
        $result = mysql_query("UPDATE preferences SET email_activation = '$Aname' where id = $id");
        $result = mysql_query ("SELECT * FROM preferences WHERE id = $id");
        $check  =mysql_fetch_array($result);

        ECHO "<p>Activation code changed to: $Aname  . Email sent to $check[email]</p>";
        mail("$check[email]","ORKFiA Activation","Welcome to ORKFiA =) \n\nHere is your activation code: $Aname \n\n\nIt is recommended you tend to your tribe at least once per day. If you require help or this is your first time playing ORKFiA, you may find the forums and the manual useful.\n\nWe hope you enjoy this age in ORKFiA =)\n\n- The ORKFiA Team\n\n\nThis email is php generated, you cannot successfully reply." , "From: Admins@orkfia.net");
    }
}
コード例 #9
0
ファイル: ip2.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_ip2_text()
{
    global $go, $ip2, $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo "<h2>User Logins from 1 IP the last 7 days</h2>";
    echo "Remember not to only rely on IP, while many logins is a safe bet don't <br />stare yourself blind at these. 1337 cheaters will have many and different IPs.<br />Remember AOL too.<br /><br />";
    $show_time = date(TIMESTAMP_FORMAT, strtotime("-7 days"));
    if ($ip2 && $go == "yes") {
        $ip2 = trim($ip2);
        $strSQL = "SELECT userid, ip, COUNT(*) AS logins, time " . "FROM logins " . "WHERE ip = '{$ip2}' AND time > {$show_time} " . "GROUP BY userid " . "ORDER BY id ASC, time DESC";
        echo "<table class=medium cellspacing=0 cellpadding=0>";
        echo "<tr class=header><th colspan=5>Login IP tracking on {$ip2}</th></tr>";
        echo "<tr class=subheader><th> Userid </th><td> IP </td><td> Logins </td><td> Last(?) Login </td><td> Check: </td></tr>";
        $result = mysql_query($strSQL) or die("query error");
        while ($value = mysql_fetch_array($result, MYSQL_ASSOC)) {
            echo $strTableTr = "<tr class=data>" . "<th>" . '<a href="main.php?cat=game&amp;page=resort_tools&amp;tool=checkinfo&id=' . $value['userid'] . '">' . $value['userid'] . "</a>" . '</th>' . '<td>' . $value['ip'] . '</td>' . '<td>' . $value['logins'] . '</td>' . '<td>' . $value['time'] . '</td>' . "<td>" . '<a href="main.php?cat=game&amp;page=resort_tools&amp;tool=tribe_ip&amp;go=yes&amp;tribe_id=' . $value['userid'] . '">' . "Tribe IP" . "</a>" . '</td>' . '</tr>';
        }
        echo "</table> <br />";
    }
    echo "<form method=\"post\" action=\"main.php?cat=game&amp;page=resort_tools&amp;tool=ip2\">";
    echo "Input user ip to attain userid details: <input type=text size=20 name=ip2>";
    echo "<br />";
    echo "<input type=hidden name=go value=yes>";
    echo "<br><input type=submit value=\"show me\"></form>";
}
コード例 #10
0
function call_tribename_text(){
    global $id,$confirm,$Aname,$tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input ID#: <input name=id size=5><br>";
    ECHO "Change Name to: <input type=text name=Aname maxlength=30 size=25><br>";
    ECHO "<input type=submit value=Save name=confirm>";
    ECHO "</form>";
    ECHO "<br><br>";
    IF($confirm && $id && $Aname)
    {
    	$Aname = quote_smart(strip_tags(trim($Aname)));
        $check = mysql_query("SELECT * FROM stats WHERE tribe = $Aname AND id != $id");
        if(mysql_num_rows($check) != 0){
            echo "that name is already in use";
        } else {
            $result = mysql_query("UPDATE stats SET tribe = $Aname where id = $id");
            $result = mysql_query("UPDATE ranking_write SET tribe_name = $Aname where id = $id");
            ECHO "Done =)";
        }
    }
}
コード例 #11
0
function call_namechanges_text()
{
    global $enable,$disable, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	IF (!$enable && !$disable) {
		$namechanges = mysql_query("SELECT names FROM admin_switches");
		$namechanges = mysql_fetch_array($namechanges);
		if ($namechanges['names'] == "on") {
			$value = "disable";
		} else {
			$value = "enable";
		}
    	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
		ECHO "<input type=submit value=$value name=$value></form>";
	}
	IF($enable) {
		mysql_query("UPDATE admin_switches SET names = 'on'");
		ECHO "The name changes tool has been activated.";
	}
	IF($disable) {
		mysql_query("UPDATE admin_switches SET names = 'off'");
		ECHO "The name changes tool is turned off now.";
	}
}
コード例 #12
0
function call_mergehistory_text(){
	global $go, $id, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    	
	IF($id && $go =="yes")
	{
    	$fetch = mysql_query("SELECT * FROM mergers WHERE request_status = 'done' AND tribe = '$id' order by merge_time desc");
		$mergers = array();
		while ($arrmergers = mysql_fetch_array ($fetch, MYSQL_ASSOC))
		{
            $mergers[$arrmergers["id"]] = $arrmergers;
        }
		ECHO "<br><br><table border=0 cellspacing=0 cellpadding=0 width=75% class='border'>";
		ECHO "<tr><td colspan=5 align=center class='pd black bold dark bdown'><b>Done Mergers</b></td></tr>";
		ECHO "<tr><td class='pd black bold darker bdown'>Merge Time</td><td class='pd black bold darker bdown'>Tribe ID</td><td class='pd black bold darker bdown'>Old Location</td><td class='pd black bold darker bdown'>New Location</td></tr>";
		foreach($mergers as $strKey => $value) 
		{
			ECHO "<tr><td class='pd bdown'> $value[merge_time] </td><td class='pd bdown'> $value[tribe] </td><td class='pd bdown'> $value[oldname] (#$value[origin]) </td><td class='pd bdown'> $value[newname] (#$value[target]) </td></tr>";
		}
		ECHO "</table>";
	}

	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input user id to attain merge history (if there is any):<input type=text size=20 name=id>";
    ECHO "<input type=hidden name=go value=yes>";
    ECHO "<br><input type=submit value=\"Show me\"></form>";
	
}
コード例 #13
0
function call_suspension_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo $strHeader = '<h2>L&O: Player Suspension (aka Forced Vacation Mode)</h2>';
    echo $strForm = '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">' . 'User-id: ' . '<input type="text" size="11" name="suspend_id">' . '<br />' . 'Updates: ' . '<select name="suspend_updates">' . '<option>12</option>' . '<option>24</option>' . '<option selected>48</option>' . '</select>' . '<br /><br />' . '<input type="submit" value="Suspend Tribe!">' . '</form>' . '<br /><br />';
    if (isset($_POST['suspend_id']) && $_POST['suspend_id'] > 1) {
        include_once 'inc/classes/clsUser.php';
        $objTmpUser = new clsUser($_POST['suspend_id']);
        // Pause Account Routines. Martel July 13, 2006
        $arrSrcUser = $objTmpUser->get_user_infos();
        if ($arrSrcUser[NEXT_ATTACK] <= 1) {
            $arrSrcUser[NEXT_ATTACK] = 1;
        }
        $arrNewSrcUser = array(NEXT_ATTACK => $arrSrcUser[NEXT_ATTACK], PAUSE_ACCOUNT => $_POST['suspend_updates']);
        $objTmpUser->set_user_infos($arrNewSrcUser);
        // Empty Magic and Thievery Points
        $objTmpUser->set_spell(POWER, 0);
        $objTmpUser->set_thievery(CREDITS, 0);
        // Forced Ranking Update
        include_once 'inc/functions/update_ranking.php';
        doUpdateRankings($objTmpUser, 'yes');
        echo stripslashes($objTmpUser->get_stat(TRIBE)) . " will be paused for " . $_POST['suspend_updates'] . " updates. Don't forget to send a notice.";
        echo '<div id="textSmall">' . '<p><b>' . 'Standard notice to copy+paste:' . '</b></p>' . '<p>' . 'Your account has been suspended by the Law & Order Resort (found in alliance #2), you will not recieve updates, or be able to interact with the game, this may be because of a Code of Conduct violation or for some other action.  Usually a staff member will contact you, if they have not, it is highly advised that you contact them, especially if you are not guilty of what you have been suspended for.' . '</p>' . '</div>';
    }
}
コード例 #14
0
ファイル: banner.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_banner_text(){
    global $local_stats, $id, $confirm, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	IF($confirm && $id){
		IF($id == 1) 
		{
			ECHO "ohhhh you dont want to do that, trust me $local_stats[name] =P";
		}else {
		ECHO "Alliance #$id has had its banner removed!";
        $result = mysql_query("UPDATE kingdom SET image = '' where id = $id");
	    }
    }
	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input alliance #: <input name=id size=5><br>";
    ECHO "<input type=submit value=Remove_banner name=confirm>";
    ECHO "</form>";
    ECHO "<br><br>";
    
}
コード例 #15
0
function call_checkinfo2_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo $strDiv = '<h2>' . 'Check User(s) Registration Info' . '</h2>' . '<p>' . 'Enter one or several user-ids, separate each by a space and ' . '<br />they will be listed if they exist in the database. Staff excluded.' . '</p>';
    echo $strForm = '<form method="post" action="main.php?cat=game&amp;page=resort_tools&amp;tool=' . $tool . '">' . '<input type="text" size="60" name="user_ids" value="' . $_POST['user_ids'] . '" />' . '<br /><br />' . '<input type="submit" value="List User(s)" />' . '<br /><br />' . '</form>';
    if (isset($_POST['user_ids']) && trim($_POST['user_ids']) != '') {
        echo $strTable = '<table class="big" cellspacing="0" cellpadding="0">' . '<tr class="header">' . '<th colspan="12">' . 'Check User Info' . '</th>' . '</tr>' . '<tr class="subheader">' . '<th>' . "ID" . '</th>' . '<th>' . "Name" . '</th>' . '<th>' . "From" . '</th>' . '<th>' . "E-mail" . '</th>' . '<th>' . "Login" . '</th>' . '<th>' . "Alias" . '</th>' . '<th>' . "Tribe" . '</th>' . '<th>' . "Alli#" . '</th>' . '<th>' . "Logins" . '</th>' . '<th>' . "TWG" . '</th>' . '<th>' . "RPs" . '</th>' . '</tr>';
        $strUserIds = trim($_POST['user_ids']);
        $arrUserIds = explode(" ", $strUserIds);
        foreach ($arrUserIds as $iUserId) {
            $iUserId = intval($iUserId);
            $strSQL = "SELECT * " . "FROM user, stats, preferences " . "WHERE user.id = {$iUserId} " . "AND user.id = stats.id " . "AND user.id = preferences.id " . "AND stats.kingdom > 10";
            $result = mysql_query($strSQL) or die("query error");
            while ($value = mysql_fetch_array($result, MYSQL_ASSOC)) {
                echo $strTableTr = '<tr class="data">' . '<th>' . $value['id'] . '</th>' . '<td class="left">' . stripslashes($value['realname']) . '</td>' . '<td class="left">' . $value['country'] . '</td>' . '<td class="left">' . $value['email'] . '</td>' . '<td class="left">' . stripslashes($value['username']) . '</td>' . '<td class="left">' . stripslashes($value['name']) . '</td>' . '<td class="left">' . stripslashes($value['tribe']) . '</td>' . '<td>' . $value['kingdom'] . '</td>' . '<td>' . $value['logins'] . '</td>' . '<td>' . $value['twg_vote'] . '</td>' . '<td>' . $value['invested'] . '</td>' . '</tr>';
            }
        }
        echo "</table>";
        echo "<p>(TWG = Last week a tribe voted, 0 by default)</p>";
    }
}
コード例 #16
0
function call_fix_alliances_text()
{
    global $sure, $orkTime, $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    // This query find alliances that lack a kingdom table
    $query1 = "SELECT stats.kingdom AS id FROM stats GROUP BY kingdom HAVING id NOT IN (SELECT kingdom.id AS id FROM kingdom)";
    $query1 = mysql_query($query1);
    $amount1 = mysql_num_rows($query1);
    if (isset($_POST['sure'])) {
        // Perform post-action
        $i = 0;
        while ($resIds = mysql_fetch_array($query1)) {
            if ($resIds[id] != '0') {
                mysql_query("REPLACE INTO " . TBL_ALLIANCE . " SET ID={$resIds['id']}") or die("alliance table");
                mysql_query("REPLACE INTO " . TBL_RANKINGS_ALLIANCE . " SET ID={$resIds['id']}") or die("alliance_rankings table");
                mysql_query("REPLACE INTO " . TBL_WAR . " SET ID={$resIds['id']}") or die("war table");
                $i++;
            } else {
                echo "(alliance #0 cannot be created - instead visit tribe page to remedy this)";
            }
        }
        echo "{$i} DONE";
    } else {
        echo "<form method=\"post\" action=\"" . $_SERVER['REQUEST_URI'] . "\">";
        echo "Missing: " . $amount1 . " tables";
        echo "<br>Add tables for these alliances? (alliance, rankings_aliance & war): <input type='checkbox' name='sure'>";
        echo "<br><input type=submit value=Insert></form>";
    }
}
コード例 #17
0
function call_mail_to_user_text(){
    global $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	$id = $_POST['id'];
	$email = $_POST['email'];
	$message = $_POST['message'];
	$subject = $_POST['subject'];
	IF ($subject && $message && $email) {
		mail("$email","$subject","$message \n\n\nThis email is php generated, you cannot successfully reply." , "From: admins@orkfia.org");
        ECHO "<b><i>sent</b></i><br>";
	} else if($subject && $message && $id) {
		$seek = mysql_query("Select * from preferences where id = $id");
		$seek = mysql_fetch_array($seek);
		mail("$seek[email]","$subject","$message \n\n\nThis email is php generated, you cannot successfully reply." , "From: admins@orkfia.org");
        ECHO "<b><i>sent to $seek[email]</b></i><br>";
	}

	ECHO "<br><br><b>Only 1 address or id at a time....</b><br> Resort heads, this is not overly for your use, but in emergencies or when you really need to mail a user, you can use this, instead of your actual email addys, it does go without saying, if there is any abuse at all, it will no longer be availible.<br><br>";
	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
	ECHO "Email: <input name=email size=40> OR ID: <input name=id size=5>";
	ECHO "<br><br>Subject: <input name=subject size=40><br>";
	ECHO "<br>Message: <br>     <textarea rows=7 cols=50 wrap=on name=message></textarea><br>";
	ECHO "<input type=submit value=Send name=confirm>";
    ECHO "</form>";
}
コード例 #18
0
function call_classic_reset_text()
{
    global $check_inactives, $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    if (isset($_POST['confirm']) && !empty($_POST['confirm'])) {
        $objSrcUser = $GLOBALS['objSrcUser'];
        // HARD RESET
        //         mysql_query("UPDATE stats SET " . ALLIANCE . " = 0 WHERE " . ALLIANCE . " > 9");
        // SOFT RESET
        mysql_query("UPDATE stats SET invested = 0, reset_option = 'yes', killed = 0 WHERE kingdom > 9");
        mysql_query("UPDATE " . ALLIANCE . " SET name = 'Unitled', image = '', private = 'no', money = 0, food = 0, research = 0, wood = 0, soldiers = 0, income_bonus = 0, home_bonus = 0, offence_bonus = 0, defence_bonus = 0, war_target = 0, vote_count = 0, description = '', market_hour = 120, research_hour = 120 WHERE id > 10");
        mysql_query("UPDATE rankings_personal SET race = 'Unknown', land = " . STARTING_LAND . ", fame = 5000, nw = 6000, hours = 0, tribe_name = 'Untitled' WHERE alli_id > 9");
        mysql_query("UPDATE rankings_alliance SET alli_name = 'Untitled', alli_desc = '', land = 0, nw = 0, fame = 0, last_update = 120 WHERE id > 10");
        mysql_query("UPDATE war SET target = 0, war_started = 0, truce = 0, surrender = 0, defeat = 0, victory = 0, last_target = 0, last_outgoing = 0, last_end = 0, event_id = 0, start_land = 0, truce_offer = 0");
        // BOTH SOFT OR HARD RESET
        mysql_query("TRUNCATE TABLE blocks;");
        mysql_query("UPDATE admin_global_time SET hour_counter = 120");
        mysql_query("TRUNCATE TABLE rankings_history");
        mysql_query("UPDATE records SET agestart = " . strtotime($_POST['time']) . ", online = 0, grab = 0, grab_id = 0, fireball = 0, fireball_id = 0, arson = 0, arson_id = 0, killed = 0, killed_id = 0, pest = 0 WHERE records.id = 1 LIMIT 1");
        // GLOBAL NEWS
        mysql_query("INSERT INTO news SET time = NOW(), type = 'global', kingdom_text='<span class=\"admin\"><strong>The game has been reset! The age will begin " . $_POST['time'] . " Server Time ~" . $objSrcUser->get_stat(TRIBE) . "</strong></span>'");
        echo '<p>' . 'SOFT RESET - ORKFiA Classic has been reset.' . '</p><p>' . 'IMPORTANT: Remember to <a href="main.php?cat=game&amp;page=resort_tools&amp;tool=manual_updater">Update Users -> [Update]</a> <strong>the same hour, BEFORE you switch OFF global_pause, which in turn is done AFTER 00:00:00. Easy as pie =)</strong>.' . '</p>';
    } else {
        echo '<h2>ORKFiA Classic Reset</h2>' . '<h3>Step 1:</h3>' . '<p><a href="main.php?cat=game&amp;page=resort_tools&amp;tool=admin_switches">Switch ON login_stopper</a>.</p>' . '<h3>Step 2:</h3>' . '<p><a href="main.php?cat=game&amp;page=resort_tools&amp;tool=admin_switches">Switch ON global_pause</a>.</p>' . '<form id="center" method="post" action="main.php?cat=game&amp;page=resort_tools&amp;tool=classic_reset">' . '<table cellpadding="0" cellspacing="0" border="0" class="small">' . '<tr class="header">' . '<th>' . 'Step 3: Prepare Mystics' . '</th>' . '</tr>' . '<tr class="subheader">' . '<th>' . 'Action' . '</th>' . '</tr>' . '<tr class="data">' . '<th>' . '<label>Spell: <select><option>Time (GOD) - 10000</option></select></label>' . '</th>' . '</tr>' . '<tr class="data">' . '<th>' . '<label>Age Start: <input type="text" length="40" name="time" value="' . date('Y-m-d H:i:s') . '" /></label>' . '</th>' . '</tr>' . '<tr class="data">' . '<th>' . '<label>Confirm resetting ORKFiA: <input type="checkbox" name="confirm" /></label>' . '</th>' . '</tr>' . '</table><br />' . '<input type="submit" value="Request mystics to cast spell" />' . '</form>' . '<h3>Step 4:</h3>' . '<p>Do stuff with the "Age Tool" that has to be re-coded for classic... Perhaps a working solution is to just go with the orkfia calendar, and create ages based on it just like current procedure for infinity?</p>';
    }
}
コード例 #19
0
ファイル: userpw.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_userpw_text()
{
    global $id, $confirm, $level, $tool;
    
    include_once('inc/functions/resort_tools.php');
    if (! user_has_access($tool))
    {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input user id: <input name=id size=5><br>";
    ECHO "<br><br>This function will randomize a new password and send it by mail.";
    ECHO "<br><br>";
    ECHO "<input type=submit value=Save name=confirm>";
    ECHO "</form>";
    
    IF($confirm && $id)
    {
        $objUser   = new clsUser ($id);
        $email     = $objUser->get_preference(EMAIL);
        $password  = generatePassword();
        $cpassword = $password;
        
        mysql_query("UPDATE user SET password = sha1('$cpassword') WHERE id = $id");
        $username = $objUser->get_user_info(USERNAME);
        mail("$email","ORKFiA New Password","Hello, \nYour password has been updated with a new one =) \n\nUsername: $username \nPassword: $password \n\n- The ORKFiA Team\n\n\nThis email is php generated, you cannot successfully reply." , "From: registration@orkfia.org\r\nX-Mailer: PHP/4.3.0\r\nX-Priority: Normal");
        echo "User " . $id . " will have a new pw sent within minutes to: " . $email;
    }
}
コード例 #20
0
ファイル: resort_tools.php プロジェクト: BrorHolm/Orkfia-2008
function check_access($tool)
{
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
}
コード例 #21
0
ファイル: design.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_design_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    $green = mysql_query("SELECT count(*) as green FROM design WHERE color = 'green'");
    $green = mysql_fetch_array($green);
    $blue = mysql_query("SELECT count(*) as blue FROM design WHERE color = 'blue'");
    $blue = mysql_fetch_array($blue);
    $black = mysql_query("SELECT count(*) as black FROM design WHERE color = 'black_v2'");
    $black = mysql_fetch_array($black);
    $ice = mysql_query("SELECT count(*) as ice FROM design WHERE color = 'ice'");
    $ice = mysql_fetch_array($ice);
    $original = mysql_query("SELECT count(*) as original FROM design WHERE color = 'original'");
    $original = mysql_fetch_array($original);
    $forest = mysql_query("SELECT count(*) as forest FROM design WHERE color = 'forest_v1'");
    $forest = mysql_fetch_array($forest);
    $red = mysql_query("SELECT count(*) as red FROM design WHERE color = 'red'");
    $red = mysql_fetch_array($red);
    echo "<br><br>";
    echo "<table class=\"small\" cellpadding=\"0\" cellspacing=\"0\">";
    echo "<tr class=header><th colspan=2>Color Schemes</th></tr>";
    echo "<tr class=subheader><th>Color</th>";
    echo "<th class=right>Amount</th></tr>";
    echo "<tr class=data><th>Forest Greens:</th>";
    echo "<td>" . $forest['forest'] . "</td></tr>";
    echo "<tr class=data><th>Original:</th>";
    echo "<td>" . $original['original'] . "</td></tr>";
    echo "<tr class=data><th>Green:</th>";
    echo "<td>" . $green['green'] . "</td></tr>";
    echo "<tr class=data><th>Blue:</th>";
    echo "<td>" . $blue['blue'] . "</td></tr>";
    echo "<tr class=data><th>Cursed Nights:</th>";
    echo "<td>" . $black['black'] . "</td></tr>";
    echo "<tr class=data><th>Ice:</th>";
    echo "<td>" . $ice['ice'] . "</td></tr>";
    echo "<tr class=data><th>Red:</th>";
    echo "<td>" . $red['red'] . "</td></tr>";
    echo "</table>";
    $small = mysql_query("SELECT count(*) as small FROM design WHERE width = '750'");
    $small = mysql_fetch_array($small);
    $medium = mysql_query("SELECT count(*) as medium FROM design WHERE width = '1060'");
    $medium = mysql_fetch_array($medium);
    echo "<br><br>";
    echo "<table class=\"small\" cellpadding=\"0\" cellspacing=\"0\">";
    echo "<tr class=header><th colspan=2>Resolution</th></tr>";
    echo "<tr class=subheader><th>Width</th>";
    echo "<td>Amount</td></tr>";
    echo "<tr class=data><th>750:</th>";
    echo "<td>" . $small['small'] . "</td></tr>";
    echo "<tr class=data><th>1060:</th>";
    echo "<td>" . $medium['medium'] . "</td></tr>";
    echo "</table>";
}
コード例 #22
0
function call_manual_updater_text()
{
    global $upper, $lower, $submit1, $submit2, $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    // 30 minutes rather than 30 seconds until script times out
    set_time_limit(1800);
    if ($upper && $lower && $submit1) {
        $checker = 0;
        for ($i = $lower; $i < $upper; $i++) {
            //          echo "<br>" . $i . " :: ";
            $check = mysql_query("Select * from user where id = {$i}");
            $check = mysql_fetch_array($check);
            $check3 = mysql_query("Select * from stats where id = {$i}");
            $check3 = mysql_fetch_array($check3);
            if ($check[USERNAME] && $check3[TRIBE]) {
                //              echo $i;
                include_once 'inc/functions/update.php';
                check_to_update($check[ID]);
                include_once 'inc/classes/clsUser.php';
                $objTmpUser = new clsUser($check[ID]);
                include_once 'inc/functions/update_ranking.php';
                doUpdateRankings($objTmpUser, 'yes');
                $checker++;
            }
        }
        echo "<br><br>{$checker} successfully updated =)<br><br>";
    } elseif ($upper && $lower && $submit2) {
        $checker = 0;
        for ($i = $lower; $i < $upper; $i++) {
            echo "<br>" . $i . " :: ";
            $check = mysql_query("Select * from user where id = {$i}");
            $check = mysql_fetch_array($check);
            $check3 = mysql_query("Select * from stats where id = {$i}");
            $check3 = mysql_fetch_array($check3);
            if ($check[USERNAME] && $check3[TRIBE]) {
                echo $i;
                include_once 'inc/classes/clsUser.php';
                $objTmpUser = new clsUser($check[ID]);
                include_once 'inc/functions/update_ranking.php';
                doUpdateRankings($objTmpUser, 'yes');
                $checker++;
            }
        }
        echo "<br><br>{$checker} successfully updated =)<br><br>";
    }
    if ($upper) {
        $bleh = $upper + 100;
    } else {
        $bleh = 100;
        $upper = 2;
    }
    echo $strForm = '<form method="post" action="' . $_SERVER['REQUEST_URI'] . '">' . 'Input lower: <input name="lower" size="5" value="' . $upper . '">' . '<br />' . 'Input upper: <input name="upper" size="5" value="' . $bleh . '">' . '<br /><br />' . '<input type="submit" value="Update" name="submit1">&nbsp;' . '<input type="submit" value="Rankings Only" name="submit2">' . '</form>';
}
コード例 #23
0
ファイル: explore2.inc.php プロジェクト: BrorHolm/Orkfia-2008
function include_explore2_text()
{
    global $Host;
    $objSrcUser =& $GLOBALS["objSrcUser"];
    $explored_acres = intval($_POST['explored_acres']);
    include_once 'inc/functions/explore.php';
    $iMaxAcres = getMaxExplore($objSrcUser);
    $arrExploreCost = getExploreCosts($objSrcUser);
    $money_used = $explored_acres * $arrExploreCost['crowns'];
    $used_citizens = $explored_acres * $arrExploreCost['citizens'];
    $used_basics = $explored_acres * $arrExploreCost['basics'];
    include_once 'inc/functions/races.php';
    $arrUnitVars = getUnitVariables($objSrcUser->get_stat(RACE));
    $arrUnitNames = $arrUnitVars['output'];
    $strRace = $objSrcUser->get_stat(RACE);
    if ($strRace == 'Nazgul') {
        echo $strDiv = '<div id="textMedium"><p>' . "Your proud nazgul military will not lower itself to exploring for land." . '</p></div>';
        include_game_down();
        exit;
    }
    if ($explored_acres < 1) {
        echo $strDiv = '<div id="textMedium"><p>' . "You tried to explore 0 acres." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>';
        include_game_down();
        exit;
    }
    $iCitz = $objSrcUser->get_pop(CITIZENS);
    $iNewCitz = $iCitz - $used_citizens;
    if ($iNewCitz < 800) {
        echo $strDiv = '<div id="textMedium"><p>' . "Exploring this many acres would result in less than 800 citizens " . "remaining on your lands. Your citizens refuse to venture forth." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>';
        include_game_down();
        exit;
    }
    $arrSpells = $objSrcUser->get_spells();
    if ($arrSpells[STUNTED_GROWTH] > 0) {
        echo $strDiv = '<div id="textMedium"><p>' . "Bewitched by your enemies, your exploration team do not dare " . "prospecting new lands for yet another " . $arrSpells[STUNTED_GROWTH] . " months." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>';
        include_game_down();
        exit;
    }
    $iMaxExplore = getMaxExplore($objSrcUser);
    if ($explored_acres > $iMaxExplore) {
        echo $strDiv = '<div id="textMedium"><p>' . "You tried to explore {$explored_acres} acres, however you can " . "only explore {$iMaxExplore} acres. " . "<br /><br />" . "You can send expeditions out to explore a maximum of 25% of " . "your current acres plus incoming." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>';
        include_game_down();
        exit;
    } else {
        if (doExplore($objSrcUser, $explored_acres)) {
            // Return HTML Output
            $plural = 's';
            if ($explored_acres == 1) {
                $plural = '';
            }
            echo $strDiv = '<div id="textMedium">' . '<h2>' . 'Explore Report' . '</h2>' . '<p>' . "Congratulations, you have explored " . "<b>" . number_format($explored_acres) . " acre{$plural}</b>." . '</p><p>' . "This expedition cost you <b>" . number_format($money_used) . " crowns</b> and required <b>" . number_format($used_citizens) . " " . strtolower($arrUnitNames[1]) . "s</b> and <b>" . number_format($used_basics) . " " . strtolower($arrUnitNames[2]) . "s</b> to send off." . '</p><p align="center">' . '<img src="' . $Host . 'explorers_medium.gif" width="375" />' . '</p><p>' . "Your new land will be ready for construction in <b>4 months</b>." . '</p><p>' . '<a href="main.php?cat=game&amp;page=explore">Continue</a>' . "</p></div>";
        } else {
            echo '<div class="center">' . "Your explore seem to have failed, please check your tribe " . "for any eventual errors caused by this, and report these " . "together with your tribe name and alliance # to an admin." . "<br />Thank you, and sorry for any inconvenience caused by " . "this.";
            echo "<br><br><a href=main.php?cat=game&amp;page=explore>Return to Exploration</a></div";
        }
    }
}
コード例 #24
0
ファイル: bootcamp.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_bootcamp_text()
{
    global $id, $submit, $tool;

    include_once('inc/functions/resort_tools.php');
    if (! user_has_access($tool))
    {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }

    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "<b>Boot Camp Tools</b><br><br>";

    $query = mysql_query("SELECT id,name from kingdom WHERE bootcamp='yes'") or die("Sql error: " . mysql_error());

    ECHO "<table class=small cellpadding=0 cellspacing=0>";
    ECHO "<tr class=header><th colspan=4>Existing Boot Camps</th></tr>";
    ECHO "<tr class=subheader><th>Alliance Name</th></tr>";
    $i = 1;
    while ($row = mysql_fetch_array($query))
    {
        ECHO "<tr class=data><td>$i. $row[name] (#$row[id])</td></tr>";
        $i++;
    }
    if ($i == 1)
        ECHO "<tr class=data><td class=center><i>There Are No Bootcamps</i></td></tr>";

    ECHO "</table><br>";

    ECHO "Enter alliance number: <input name=id size=5><br>";
    ECHO "Should this alliance be a boot camp?<br><br>";
    ECHO "<input type=submit value=yes name=submit>";
    ECHO "<input type=submit value=no name=submit>";
    ECHO "</form>";

    if ($id && $submit) // make sure that an alliance number has been provided
    {
        if ($id > 10)
        {
            mysql_query("UPDATE kingdom SET bootcamp='$submit' where id='$id'") or die("Sql error: " . mysql_error());
            header('location: main.php?cat=game&page=resort_tools&tool=bootcamp');
        }
        elseif ($id < 11 && $id > 0)
        {
            ECHO "You can't change boot camp status for staff alliances.";
        }
        else
        {
            ECHO "Invalid alliance number. ";
        }
    }
}
コード例 #25
0
ファイル: delete.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_delete_text()
{
    global $go, $delete_id, $tool;

    include_once('inc/functions/resort_tools.php');
    if (! user_has_access($tool))
    {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }

    if ($go != "sure" && $go != "yes")
    {
        ECHO "<br><b>THIS IS THE DELETE FUNCTION!! MAKE SURE YOU DONT MISCLICK AND DOUBLE CHECK ALL IDs</b>";
        echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
        ECHO "Input user id to delete:<input type=text size=5 name=delete_id>";
        ECHO "<input type=hidden name=go value=sure>";
        ECHO "<br><input type=submit value=delete></form>";
    }

    if ($delete_id && $go == "sure" && $delete_id != '1')
    {
        $name = mysql_query("SELECT tribe, kingdom FROM stats WHERE id = $delete_id");
        $name = mysql_fetch_array($name);
        echo "THE USER YOU ARE ABOUT TO DELETE IS:<BR>";
        echo "$name[tribe](#$name[kingdom])<br><br>";
        echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
        echo "<input type=hidden name=go value=yes>";
        echo "<input type=hidden name=delete_id value=$delete_id>";
        echo "<br><input type=submit value=delete></form>";
    }

    if ($delete_id && $go == "yes" && $delete_id != '1')
    {
        if (doBackupTribe($delete_id, 'delete'))
        {
            ECHO "User #$delete_id has been deleted <br /><br /> (Comment by Martel: back-up exists.)";
        }
        else
        {
            echo "(Backup failed!) User #$delete_id has been deleted.";
        }

        // Remove invested RPs
//         include_once("inc/functions/research.php");
//         delete_my_rps($delete_id);

        // Delete Tribe (an automatic routine will remove it from alliance #0)
        mysql_query("UPDATE " . TBL_STAT . " SET " . ALLIANCE . " = 0 WHERE id = $delete_id");
        mysql_query("UPDATE " . TBL_RANKINGS_PERSONAL . " SET " . ALLI_ID . " = 0 WHERE id = $delete_id");
    }
}
コード例 #26
0
ファイル: phpinfo.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_phpinfo_text()
{
    global $tool;
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo "<br /><br /><br /><br /><br />";
    echo phpinfo();
}
コード例 #27
0
function call_view_market_text(){
	global $go, $alli_id,$tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    
	IF($alli_id && $go =="yes") {
		   $result = @mysql_query("SELECT * FROM market_log WHERE alliance='$alli_id' ");
		   $arrSrcMarket = @mysql_fetch_array($result);

		   $result = @mysql_query("SELECT * FROM market_log WHERE alliance='$alli_id' ORDER BY time DESC");
		?>
		  <table cellspacing=0 cellpadding=0 class="border" width=650>
		  <tr><td colspan=7 align=center class="pd bold black dark bdown">The Market Log</td></tr>
		  <tr>
		  <td class="pd black bold darker bdown" align=center>Time</td>
		  <td class="pd black bold darker bdown" >Tribe</td>
		  <td class="pd black bold darker bdown" align=right>Action</td>
		  <td class="pd black bold darker bdown" align=right>Money</td>
		  <td class="pd black bold darker bdown" align=right>Food</td>
		  <td class="pd black bold darker bdown" align=right>Wood</td>
		  <td class="pd black bold darker bdown" align=right>Soldiers</td>
		  </tr>
		<?
		  while($arrSrcMarket = @mysql_fetch_array($result)){
				ECHO "<tr>";
				ECHO "<td class=\"blue pd bold\" align=center>$arrSrcMarket[time]</td>";
				ECHO "<td class=\"pd\">$arrSrcMarket[tribe]</td>";
				ECHO "<td class=\"pd\" align=right>".$arrSrcMarket[type]."</td>";
				ECHO "<td class=\"pd\" align=right>".number_format($arrSrcMarket[money])."</td>";
				ECHO "<td class=\"pd\" align=right>".number_format($arrSrcMarket[food])."</td>";
				ECHO "<td class=\"pd\" align=right>".number_format($arrSrcMarket[wood])."</td>";
				ECHO "<td class=\"pd\" align=right>".number_format($arrSrcMarket[unit1])."</td>";
				ECHO "</tr>";

		   }


		  ECHO "</table>";    
	}

	echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
    ECHO "Input alliance id:<input type=text size=4 name=alli_id>";
    ECHO "<input type=hidden name=go value=yes>";
    ECHO "<br><input type=submit value=\"show market history\"></form>";
	
}
コード例 #28
0
ファイル: mail.inc.php プロジェクト: BrorHolm/Orkfia-2008
function call_mail_text()
{
    $orkTime = $GLOBALS['orkTime'];
    $tool = $_GET['tool'];
    $objSrcUser = $GLOBALS['objSrcUser'];
    $userid = $objSrcUser->get_userid();
    include_once 'inc/functions/resort_tools.php';
    if (!user_has_access($tool)) {
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }
    echo "<h2>Orkfia Mass Mailer (Ingame PM)</h2>";
    echo "<p>Use this carefully and responsibly. The sender will be your own tribe.</p>";
    echo "<form method=\"post\" action=\"{$_SERVER['REQUEST_URI']}\">";
    echo "<label>Who would you like to mail:</label> ";
    echo "<Select name='who' size=1>";
    echo "<option value='all'>Mail Everyone</option>";
    echo "<option value='admins'>Mail Heads of ORKFiA</option>";
    echo "<option value='heads'>Mail Heads of Resorts</option>";
    echo "<option value='staff' SELECTED>Mail Staff</option>";
    echo "<option value='elders'>Elders</option>";
    echo "</select>";
    echo "<br /><br />";
    echo "<label>Subject:</label><br />";
    echo "<input name=subject size=50 />";
    echo "<br /><br />";
    echo "<label>Message:</label><br />";
    echo "<textarea rows=7 cols=50 wrap=on name=message>\n\n\n~ The ORKFiA Staff Team</textarea>";
    echo "<br /><br />";
    echo "<input type=submit name='submit' value='Send mass pm' />";
    echo "</form>";
    //==============================================================================
    // Don't send the mail if noone pressed the button...              - AI 30/10/06
    //==============================================================================
    if (isset($_POST['submit'])) {
        $subject = $_POST['subject'];
        $message = $_POST['message'];
        $who = $_POST['who'];
        if (!$subject) {
            $subject = "No Subject";
        }
        $result = mysql_query("SELECT id,level,type FROM stats");
        while ($tribe = mysql_fetch_assoc($result)) {
            if (is_mail_target($who, $tribe['type'], $tribe['level'])) {
                $query = "INSERT INTO messages\n                      (for_user, from_user, date, subject, text, new, action)\n                      VALUES ({$tribe['id']}, {$userid}, '{$orkTime}', " . quote_smart($subject) . ", " . quote_smart($message) . ", 'new', 'received')";
                mysql_query($query);
            }
        }
    }
}
コード例 #29
0
function call_tour_move_text()
{
    global $local_stats, $id, $confirm, $target, $tool;
    include_once 'inc/functions/resort_tools.php';
    check_access($tool);
    $alli_id = '';
    if (isset($_POST['alli_id'])) {
        $alli_id = intval($_POST['alli_id']);
    }
    echo '<h2>ORKFiA Tour!</h2>';
    $strForm = "<form method=\"post\" action=\"" . $_SERVER['REQUEST_URI'] . "\">" . '<label>Where is our touring tribe? Alliance #</label> ' . '<input name="alli_id" size="3" value="' . $alli_id . '"/><br /><br />';
    if (isset($_POST['alli_id']) && !empty($_POST['alli_id'])) {
        $iAlliance = intval($_POST['alli_id']);
        include 'inc/functions/vote.php';
        // select everyone in this alliance
        $strSQL = "SELECT * " . "  FROM stats " . " WHERE kingdom = " . $iAlliance . " ORDER BY tribe ASC";
        $result = mysql_query($strSQL) or die("Elder Defect:" . mysql_error());
        $strForm .= "<label>Select the lucky tribe</label>: " . '<select name="id" size="1">' . render_option_list($result, TRIBE, ID, 0) . '</select><br /><br />' . '<label>Where will they apparate to? Alliance #</label>: ' . '<input name="target" size="5" /><br /><br />' . '<input type="submit" value="Move Tourer" name="confirm">';
    } else {
        $strForm .= '<input type="submit" value="Choose Alliance" name="confirm">';
    }
    $strForm .= "</form>";
    echo $strForm;
    if (isset($_POST['confirm']) && isset($_POST['id']) && !empty($_POST['id']) && isset($_POST['target']) && !empty($_POST['target'])) {
        $id = intval($_POST['id']);
        $target = intval($_POST['target']);
        $trgTmpUser = new clsUser($id);
        $strTribeName = ucwords(stripslashes($trgTmpUser->get_stat(TRIBE)));
        if ($trgTmpUser->get_build(LAND) != 1) {
            echo '<p>"W-T-F mate?" That was not a tourer tribe.</p></div>';
            include_game_down();
            exit;
        } elseif ($target < 11) {
            echo '<p>"W-T-F mate?" No apparating into staff alliances.</p></div>';
            include_game_down();
            exit;
        }
        echo "<p>Leader! The tribe of " . $strTribeName . " has now apparated to alliance #<strong>{$target}</strong>. Let us hope that neither of their citizens got splinched.</p>";
        $orkTime = date(TIMESTAMP_FORMAT);
        $search = mysql_query("SELECT * FROM stats WHERE id = {$id}");
        $search = mysql_fetch_array($search);
        //mysql_query("UPDATE stats SET kingdom = $target, type ='player', invested = 0 where id = $id");
        //mysql_query("UPDATE rankings_personal SET alli_id = $target where id = $id");
        //mysql_query("UPDATE stats SET vote = 0, invested = 0 WHERE vote = $id");
        //mysql_query("UPDATE goods SET credits = 0, market_money = 0, market_food = 0, market_soldiers = 0, market_wood = 0 WHERE id = $id");
        include_once 'inc/staff/move.inc.php';
        move_tribe($id, $target);
        mysql_query("INSERT INTO news (id, time, ip, type, duser, ouser, result, text, kingdom_text, kingdoma, kingdomb) VALUES ('', '{$orkTime}', '---', 'Tour Move', '0', '0', '1', '', '<span class=\"indicator\">{$search['tribe']} has joined our alliance. Long live Orkfia! Long live the tour!</span>', '', '{$target}')");
    }
}
コード例 #30
0
function call_clean_inactives_text()
{
	global $check_inactives, $tool;
	
	include_once('inc/functions/resort_tools.php');
	if (! user_has_access($tool))
	{
        echo "Sorry, this page is restricted to ORKFiA Staff";
        include_game_down();
        exit;
    }

	$old_time = date(TIMESTAMP_FORMAT, strtotime("-2 days"));
	$strSQL =
	    "SELECT user.id, stats.kingdom " .
        "FROM user, stats, preferences " .
        "WHERE user.last_login < '$old_time' " .
        "AND stats.kingdom > 10 " .
        "AND user.id > 1 " .
        "AND user.id = stats.id " .
        "AND user.id = preferences.id " .
        "AND preferences.email_activation != 'verified'";
    $result = mysql_query($strSQL);
	
	$inactives = array();
	while ($arrinactives = mysql_fetch_array ($result, MYSQL_ASSOC)) {
		$inactives[$arrinactives["id"]] = $arrinactives;
	}
	$count = 0;
	foreach($inactives as $strKey => $value) {
		$count++;
		IF($check_inactives){ 
			
				$sql =mysql_query("UPDATE stats SET kingdom=0 WHERE id=$value[id]");
				$sql =mysql_query("DELETE FROM rankings_personal WHERE id =$value[id]");
			
		}
		
	}
	IF($check_inactives) {
		ECHO "Removed $count accounts. ";	
	} ELSE {
		ECHO "$count non verified accounts (48 hours waiting time) will be removed, go through with this?";
	    echo "<form method=\"post\" action=\"".$_SERVER['REQUEST_URI']."\">";
		ECHO "yes : <input type='checkbox' name='check_inactives'>";
		ECHO "<br><input type=submit value=delete></form>";
	}
}