function include_racestats_text() { // Get Total Number of Tribes $strSQL = "SELECT COUNT(*) as total " . "FROM " . TBL_STAT . " " . "WHERE " . ALLIANCE . " > 10"; $iTotal = mysql_result(mysql_query($strSQL), 0, 0); $iTotal2 = 0; // Get All Races include_once 'inc/classes/clsRace.php'; $arrRaces = clsRace::getRaces(); $arrActiveRaces = clsRace::getActiveRaces(); // Begin Create Table $strRaceStatsTable = '<table cellspacing="0" cellpadding="0" class="small">' . '<tr class="header">' . '<th colspan="2">' . "Racial Stats" . "</th>" . "</tr>" . '<tr class="subheader">' . "<th>" . "Race" . "</th>" . '<th class="right">' . "%" . "</th>" . "</tr>"; for ($i = 0; $i < count($arrRaces); $i++) { // Give each 3rd row a border down $strStyle = ''; //if (($i % 3) == 0) { $strStyle = ' class = "bsdown" '; } if (!in_array($arrRaces[$i], $arrActiveRaces)) { $strStyle = ' style="font-style:italic;"'; } // Get Number of Tribes of the Current Race $SQL = "SELECT id FROM " . TBL_STAT . " " . "WHERE " . RACE . " = '{$arrRaces[$i]}' AND " . ALLIANCE . " > 10"; $count[$i] = mysql_num_rows(mysql_query($SQL)); $iTotal2 += $count[$i]; $strRaceStatsTable .= '<tr class="data">' . "<th{$strStyle}>" . $arrRaces[$i] . "</th>" . "<td{$strStyle}>" . round($count[$i] / $iTotal * 100, 2) . " %</td>" . "</tr>"; } $strRaceStatsTable .= '<tr class="data">' . "<th>" . "Unknown" . "</th>" . "<td>" . round(($iTotal - $iTotal2) / $iTotal * 100, 2) . " %</td>" . "</tr>" . "</table>"; echo $strRaceStatsTable; }
function include_main_text() { global $Host; // Show / hide content from registered users vs non-registered ones (Martel) $strNotForRegistered = ' style=""'; $strNotForGuests = ' style=""'; if (isset($_COOKIE['check'])) { $strNotForRegistered = ' style="visibility: hidden; display: none;"'; } else { $strNotForGuests = ' style="visibility: hidden; display: none;"'; } include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $strLoginSwitch = $objGame->get_game_switch(LOGIN_STOPPER); include_once 'inc/functions/races.php'; //changed to use clsRace - AI require_once 'inc/races/clsRace.php'; $arrRaces = clsRace::getActiveRaces(); $strRace = $arrRaces[$iRand = rand(1, count($arrRaces) - 1)]; $arrRandRace = getUnitVariables($strRace); ?> <div id="textBig" style="height: 110px;"> <div id="login"> <h2><img src="<?echo $Host;?>first_login.gif" alt="Login" height="26" /></h2> <?php if ($strLoginSwitch == 'on' && !isset($_GET['stagepass'])) { ?> <p> <em class="positive">Logins are temporarily disabled.</em> </p> <p><em>(The gods are updating Orkfia, so be back soon.)</em></p> <?php } else { ?> <form action="main.php?cat=main&page=login2" method="post"> <label for="i1" class="hidden">Username</label> <input maxlength="20" name="login[username]" size="9" class="login" id="i1"/> <label for="i2" class="hidden">Password</label> <input maxlength="20" name="login[password]" size="9" type="password" class="password" id="i2"/> <input type="submit" name="LoginButton" value="Login" class="submit" /> or <a href="main.php?cat=main&page=register1">Sign Up!</a> </form> <?php } // Martel: Safety caution - Do not help kiddies find usernames or guess pws if (isset($_GET['error'])) { switch ($_GET['error']) { case 'error': echo '<p>' . 'Wrong name or password, please try again.' . '</p>'; break; case 'empty': echo '<p>' . 'Empty form, please fill in and try again.' . '</p>'; break; } } // <p>ORKFiA is an <strong>excellent strategy <abbr title="Persistent Browser Based Game"><a href="http://www.pbbg.org/" title="Persistent Browser Based Game" class="gloss">PBBG</a></abbr></strong> ?> </div> <div id="teaser"> <br /> <h3><?php echo SERVER_TAGLINE; ?> </h3> <p>ORKFiA is an <strong>excellent strategy <abbr title="Persistent Browser Based Game">PBBG</abbr></strong> in a fantasy setting.</p> </div> </div> <div id="columns"> <div id="leftcolumn"> <div class="text"<?echo $strNotForRegistered;?>> <h2><img src="<?echo $Host;?>first_intro.gif" alt="Introduction" height="26" /></h2> <?php if ($_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME) { ?> <p>Before ORKFiA Infinity there was a time of furious battles and desperate struggles, but also a time of innocence. The inhabitants of the world Orkfia, who we know as Orkfians, were ruled over by the Empyreons. The Empyreons, who are an unknown species summoned to lead and organize tribes of all known races, were battling against time and against each others, in a futile war that would always end with the Comet's impact. Their rescue, and also their curse, was the time spell which would restore the lands of Orkfia to its untouched state a hundred years back in time. This Era has since been called the Eternal Occurrence, and was ended when the spell's effect wore off and the Comet finally hit Orkfia. Year 93 OE Orkfia was freed from the effects of the time spell, or was it?</p> <h3>Classic ORKFiA: Return of the Comet</h3> <p>The classic version of ORKFiA will take you, as a player, back to where it all started, as one of the Empyreons during the age of the Eternal Recurrence (<strong>10 - 93 OE</strong>). Beginning in a world that have just learnt the tactics of war, the deceitfulness of thieves, the devastation of magic and the fine arts of politics. Once more the world will continually be recreated by the time spell, and the Orkfians will battle against time, and each other, to take control over the world before it disintegrates. </p> <p>We welcome you as a member, and perhaps even as a sponsoring dragon to fund the ongoing of this game, to sign up for the next age in this classic renewal of ORKFiA.</p> <ul> <li><a href="main.php?cat=main&page=register1">Sign Up!</a> </li> </div> <?php } else { ?> <div class="center"><img src="<?php echo HOST_PICS; ?> fighter.gif" title="Invade other tribes to conquer land and resources" alt="" /><img src="<?php echo HOST_PICS; ?> wizard.gif" title="The mystics can cause devastating damage to your enemies" alt="" /><img src="<?php echo HOST_PICS; ?> thief.gif" title="The thieves are usually considered scum, but in war times you need every asset available" alt="" /></div> <p>Grow your tribe in a <span class="highlight" title="Each hour the game is updated 1 time" style="border-bottom: 1px dotted;">real time</span> environment, teamed together <span class="highlight">with friends</span> in an effort to become the largest, strongest and most famous of all alliances!</p> <p>You have to execute the right strategy to grow large, strong and famous. There are many strategies to choose. Your tribe can <span class="highlight">grow</span> by the valuables your citizens find in the mines, or they can <span class="highlight"> do research</span> to improve your efficiency, defense, power and production.</p> <p>The other possibility is to <span class="highlight">kill those who oppose you</span>.</p> <p>Once all your enemies have perished, you will be the greatest leader the world has ever seen.</p> <ul> <li><a href="main.php?cat=main&page=register1">Sign Up!</a> </li> </div> <?php } include_once 'inc/pages/global_news.inc.php'; // Show Global News echo "<br />"; echo showGlobalNews('tiny'); ?> </div> <div id="rightcolumn"> <div class="text"<?echo $strNotForRegistered;?>> <h2><img src="<?echo $Host;?>first_faq.gif" alt="FAQ" height="26" /></h2> <p>Is this your first visit to ORKFiA? If you are a novice—or just curious—<a href="main.php?cat=main&page=faq">we recommend our FAQ</a> with answers to some of the most common questions about this game.</p> </div> <div class="text"<?echo $strNotForRegistered;?>> <h2><img src="<?echo $Host;?>first_join.gif" alt="Join" height="26" /></h2> <p>ORKFiA comes in two versions, both with hundreds of players and both for free. So it's really up to you, do you want to <span class="highlight">play with or without resets</span> between rounds?</p> <ul> <li><a href="http://orkfia.phpsupport.se/main.php?cat=main&page=register1">Infinity Sign Up!</a> (Play until you die)</li> <li><a href="http://dinah.phpsupport.se/main.php?cat=main&page=register1">Classic Sign Up!</a> (Resets between each round)</li> </ul> </div> <div class="text"<?echo $strNotForGuests;?>> <h2><img src="<?echo $Host;?>first_sponsors.gif" alt="Sponsor" height="26" /></h2> <p>ORKFiA owes its success to a dedicated player base. It is very easy to help:</p> <ul> <li>Donate and <a href="main.php?cat=main&page=sponsors">Become a <em>Dragon</em></a></li> <li>Link to <a href="<?php echo HOST; ?> ">ORKFiA <?php echo SERVER_TAGLINE; ?> </a></li> </ul> <div class="center"> <a href="http://orkfia.phpsupport.se/"> <img src="<?php echo HOST_PICS; ?> promotional/ork-button.png" alt="" border="0" /></a> <a href="http://dinah.phpsupport.se/"> <img src="<?php echo HOST_PICS; ?> promotional/ork-button-classic.png" alt="" border="0" /></a><br /><br /> </div> </div> <div class="text"<?echo $strNotForRegistered;?>> <h2><img src="<?echo $Host;?>first_forum.gif" alt="Forum" height="26" /></h2> <p>If you are curious about what happens inside Orkfia, you are most welcome to have a sneak peek. No need to sign up, just go ahead and lurk!</p> <ul> <li><a href="main.php?cat=main&page=forums&set=news&mode=threads">Announcements</a></li> <li><a href="main.php?cat=main&page=forums&set=world&mode=threads">World Forum</a></li> <li><a href="main.php?cat=main&page=forums&set=game&mode=threads">Game Talk</a></li> </ul> </div> <div class="text"<?echo $strNotForGuests;?>> <h2><img src="<?echo $Host;?>first_chat.gif" alt="Chat" height="26" /></h2> <p>Talk to staff and active players in our IRC-channels:</p> <ul> <li><a href="irc://irc.netgamers.org/orkfia" target="_blank" class="newWindowLink">#orkfia</a> (official)</li> <li><a href="irc://irc.netgamers.org/orkfia-classic" target="_blank" class="newWindowLink">#orkfia-classic</a> (official)</li> <li><a href="irc://irc.netgamers.org/orkfiafunroom" target="_blank" class="newWindowLink">#orkfiafunroom</a></li> </ul> </div> <div class="text" <?echo substr($strNotForRegistered, 0, -1) . ' text-align: center;"';?>> <h2><img src="<?echo $Host;?>first_guide.gif" alt="Player's Strategy Guide" height="26" /></h2> <table class="small" cellpadding="0" cellspacing="0" style="margin: 0 auto;"> <tr class="header"> <th colspan="5">Featured: Race <?php echo $iRand . ' of ' . (count($arrRaces) - 1) . ' - <i>' . $strRace; ?> </i></th> </tr> <tr class="subheader"> <th>Class</th> <th>Unit Name</th> <th><span class="militstats" style="color: #000;">Offence</span></th> <th><span class="militstats" style="color: #000;">Defence</span></th> <th class="right">Gold</th> </tr> <?php $arrClass = array(2 => 'Basic', 'Specialist', 'Specialist', 'Elite', 'Thief'); foreach ($arrClass as $i => $strClass) { ?> <tr class="data"> <th><?php echo $strClass; ?> </th> <td class="left"><?php echo $arrRandRace['output'][$i]; ?> </td> <td class="center"><span class="militstats"><?php echo $arrRandRace['offence'][$i]; ?> </span></td> <td class="center"><span class="militstats"><?php echo $arrRandRace['defence'][$i]; ?> </span></td> <td><?php echo number_format($arrRandRace['gold'][$i]); ?> </td> </tr> <?php } ?> </table> <p>Let your journey start at <a href="<?php echo HOST_GUIDE; ?> " target="_blank" class="newWindowLink">the Player Guide</a></p> </div> </div> <?php //========================================================================== // Martel, December 07, 2006 // Age display, identical except for "month" to what is in layout.php //========================================================================== // include_once('inc/classes/clsGame.php'); // $objGame = new clsGame(); // $iGameHours = $objGame->get_game_time(HOUR_COUNTER); // $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); // // age stuff // include_once('inc/classes/clsAge.php'); // $objAge = new clsAge(); // $blnCheck = $objAge->loadAge($iAgeNumber); // either FALSE or TRUE // // display stuff // include_once('inc/functions/orktime.php'); // $arrAgeDisplays = get_age_displays($objGame, $objAge, $blnCheck); // $arrOrkDate = hoursToYears($iGameHours); // // Months // $strMonths = ""; // if($arrOrkDate['months'] > 0) // $strMonths = "Month " . $arrOrkDate['months'] . ", "; // $arrAgeDisplays = get_age_displays($objGame, $objAge, $blnCheck); // // Alliance // $arrGameHistorys = $objGame->get_historys($arrOrkDate['years']); // $strTopAlliance = 'Top Alliance: ' . $arrGameHistorys[ALLI_NAME] . ' (#' . $arrGameHistorys[ALLI_ID] . ')'; // queries for stats $strSQL1 = 'SELECT (COUNT(id) / 2) as wars FROM war WHERE target > 0 LIMIT 1'; $strSQL2 = 'SELECT COUNT(id) as alliances FROM ' . ALLIANCE . ' WHERE id > 10 LIMIT 1'; $strSQL3 = 'SELECT COUNT(id) as players FROM user LIMIT 1'; $strSQL4 = 'SELECT COUNT(id) as oldies FROM user WHERE hours > 948 LIMIT 1'; // $strSQL5 = 'SELECT AVG(land) as avg_land FROM build,user WHERE user.hours > 948 LIMIT 1'; $iWars = intval(mysql_result(mysql_query($strSQL1), 0)); $iAlliances = mysql_result(mysql_query($strSQL2), 0); $iPlayers = mysql_result(mysql_query($strSQL3), 0); $iOldies = mysql_result(mysql_query($strSQL4), 0); // $iAvgLand = mysql_result(mysql_query($strSQL5), 0); echo '<div class="clear"><hr /></div>' . '<div class="text">' . '<h3>Game Overview</h3>' . '<p>' . "<strong>{$iWars}</strong> ongoing wars, <strong>{$iAlliances}</strong> alliances and <strong>{$iPlayers}</strong> tribes. <strong>{$iOldies}</strong> are dying, <strong>more</strong> will be killed." . '</p>' . '<p>' . 'ORKFiA is hosted by <a href="http://phpsupport.se/" target="_blank" title="Swedish PHP & MySQL Support" class="newWindowLink">PHP Support .SE</a>' . '</p>' . '</div>'; //========================================================================== // end nonsense ;) //========================================================================== echo '</div>'; }
function include_faq_text() { include_once 'inc/classes/clsRace.php'; $iAvailable = max(2, count(clsRace::getActiveRaces()) - 1); ?> <div id="textBig" style="margin: 15px auto; text-align: left;"> <h2 style="margin: 15px auto; text-align: center;"> <img src="<?php echo HOST_PICS; ?> first_faq.gif" alt="FAQ - Frequently Asked Questions" /></h2> <a name="top"></a> <ol> <li><a href="#1"> I came here by mistake but I like the graphics, what is this about?</a></li> <li><a href="#2"> Does it cost anything to join?</a></li> <li><a href="#3"> Where do I start?</a></li> <li><a href="#4"> What should be my first actions?</a></li> <li><a href="#5"> Is there anything I must know?</a></li> <li><a href="#6"> How do I win?</a></li> <li><a href="#7"> What do I get if I win?</a></li> <li><a href="#8"> Where do all players hang out?</a></li> <li><a href="#9"> Where can I find more information?</a></li> </ol> <ol> <li><a name="1"></a><h3>I came here by mistake but I like the graphics, what is this about?</h3> <p>ORKFiA is an exciting online strategy game, developed and maintained by its players. It is text based and situated in a fantasy world called “Orkfia”, a world inspired by Tolkien's Middle Earth. Together with other players in your alliance you will be warring others as they step in your way. The combination of strategy and war is the ultimate challenge in ORKFiA, besides basic stuff like training military, constructing buildings and trying to stay alive.</p></li> <li><a name="2"></a><h3>Does it cost anything to join?</h3> <p>It is completely free to play, but we encourage our dedicated players to sponsor the game, with a small donation. Players who do so become <a href="main.php?cat=main&page=sponsors">Dragon Sponsors</a>, getting a dragon next to their names in the forum and the appreciation of all players.</p></li> <li><a name="3"></a><h3>Where do I start?</h3> <p>Pick one of <a href="<?php echo HOST_GUIDE; ?> races.php?chapter=4" target="_blank" class="newWindowLink">the <?php echo $iAvailable; ?> races</a>, and then if you are ready to join, go here to <a href="main.php?cat=main&page=register1">sign up!</a> </p></li> <li><a name="4"></a><h3>What should be my first actions?</h3> <p>Assuming you have already selected a race and created your account, your first actions should be to 1) build your barren land and 2) train about 17,000 basic military units, and then wait 4 hours for them to arrive. More can be found reading our guide—and especially its first article—<a href="<?php echo HOST_GUIDE; ?> crash_course.php?chapter=1" target="_blank" class="newWindowLink">“Crash Course to ORKFiA”</a>.</p></li> <li><a name="5"></a><h3>Is there anything I must know?</h3> <p>Yes, you should read our <a href="main.php?cat=main&page=CoC">Code of Conduct</a>, which contains <em>the rules</em> that are enforced within the game.</p></li> <li><a name="6"></a><h3>How do I win?</h3> <p>After 6 weeks (in orkfia time this measures 84 years) your tribe leader is 100 years old and dying. If you have played well and had a fun time with others in your alliance, you are a winner. But true victory can be measured many ways, is it killing others you put pride in, or maybe winning wars? There are many ways to prove your skill in ORKFiA, the most prestigious ones depending on good teamwork and the success of your alliance.</p></li> <li><a name="7"></a><h3>What do I get if I win?</h3> <p>If you survive the full period of 6 weeks that your leader has to live, you will start your next tribe with a heritage bonus to land, money and fame, based on the success of your previous tribe. </p></li> <li><a name="8"></a><h3>Where do all players hang out?</h3> <p>First and most important place to hang out will be inside your alliance, using the alliance forum. To interact with other players we have two official places: the <a href="<?php echo HOST; ?> main.php?cat=main&page=forums&set=world">Forum </a>, and the <a href="irc://irc.netgamers.org/orkfia" target="_blank" class="newWindowLink">#orkfia IRC-channel</a> (located at the netgamers.org server).</p></li> <li><a name="9"></a><h3>Where can I find more information?</h3> <p>The best place for game information is the <a href="<?php echo HOST_GUIDE; ?> " target="_blank" class="newWindowLink"> ORKFiA Player Guide</a>.</p></li> </ol> <p><em>We wish you the best of luck getting to learn this exciting strategy game, and hope to see you inside the game soon!<br /> ~ The ORKFiA Staff Team</em></p> </div> <?php }
function getActiveRaces() { return clsRace::getActiveRaces(); }
function include_rankings_text() { global $Host; require_once 'inc/races/clsRace.php'; include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); $show = 'alliance'; if (isset($_GET['show'])) { $show = $_GET['show']; } echo get_rankings_links($show); $link = "main.php?cat=game&page=rankings&show={$show}&type="; $rankingsText = '<div id="textBig">'; switch ($show) { case "annual": $rankingsText .= "<h2>History Rankings</h2>" . "<h3>Alliance</h3>" . "<p>" . " | <a href=\"" . $link . "currentage\">Current Age</a> |" . " <a href=\"" . $link . "topalli\">King Of The Hill</a> |" . " <a href=\"" . $link . "topland\">Largest Alliance</a> |" . "</p>"; if (!isset($_GET['type'])) { $_GET['type'] = 'currentage'; } break; case "personal": $rankingsText .= "<h2>Personal Rankings</h2>" . "<p> | <a href=\"" . $link . "pland\">Land</a> |" . " <a href=\"" . $link . "pstr\">Strength</a> |" . " <a href=\"" . $link . "pfame\">Fame</a> |" . "</p><p>"; //modified to find out about races dynamically - AI 17/02/2007 $races = clsRace::getRaces(); $active_races = clsRace::getActiveRaces(); foreach ($races as $number => $race) { if ($number % 3 == 0) { $rankingsText .= '- '; } $style = ''; if (!in_array($race, $active_races)) { $style = 'style="font-style:italic;"'; } $rankingsText .= "<span {$style}>{$race} [ " . "<a href=\"" . $link . "rland&race={$number}\">Land</a> | " . "<a href=\"" . $link . "rstr&race={$number}\">Strength</a> | " . "<a href=\"" . $link . "rfame&race={$number}\">Fame</a> ] </span>"; if ($number % 3 == 2) { $rankingsText .= '<br />'; } } $rankingsText .= "</p>"; if (!isset($_GET['type'])) { $_GET['type'] = 'pland'; } break; case "alliance": $rankingsText .= "<h2>Alliance Rankings</h2>" . "<p>| <a href=\"" . $link . "aland\">Land</a> | " . " <a href=\"" . $link . "astr\">Strength</a> | " . " <a href=\"" . $link . "afame\">Fame</a> | " . "<a href=\"" . $link . "support\">Top Voting Supporters</a></p>"; if (!isset($_GET['type'])) { $_GET['type'] = 'aland'; } break; } $rankingsText .= '</div>'; echo $rankingsText; if (!isset($_GET['type'])) { include_game_down(); exit; } $strType = $_GET["type"]; if ($strType == "pstr") { $strTitle = "Individual Strength Rankings"; $strRankingType = "p"; $type = "Strength"; $dbtype = "nw"; } elseif ($strType == "pfame") { $strTitle = "Individual Fame Rankings"; $strRankingType = "p"; $type = "Fame"; $dbtype = "fame"; } elseif ($strType == "pland") { $strTitle = "Individual Land Rankings"; $strRankingType = "p"; $type = "Acres"; $dbtype = "land"; } elseif ($strType == "astr") { $strTitle = "Alliance Strength Rankings"; $strRankingType = "a"; $type = "Strength"; $dbtype = "nw"; } elseif ($strType == "aland") { $strTitle = "Alliance Land Rankings"; $strRankingType = "a"; $type = "Acres"; $dbtype = "land"; } elseif ($strType == "afame") { $strTitle = "Alliance Fame Rankings"; $strRankingType = "a"; $type = "Fame"; $dbtype = "fame"; } elseif ($strType == "rstr") { $strTitle = "Individual Race Strength Rankings"; $strRankingType = "r"; $type = "Strength"; $dbtype = "nw"; } elseif ($strType == "rland") { $strTitle = "Individual Race Land Rankings"; $strRankingType = "r"; $type = "Acres"; $dbtype = "land"; } elseif ($strType == "rfame") { $strTitle = "Individual Race Fame Rankings"; $strRankingType = "r"; $type = "Fame"; $dbtype = "fame"; } elseif ($strType == "support") { $strTitle = "Top Supporters"; $strRankingType = "s"; } elseif ($strType == "topalli") { $strTitle = "King Of The Hill History"; $strRankingType = "ta"; } elseif ($strType == "topland") { $strTitle = "Largest Alliance History"; $strRankingType = "tl"; } elseif ($strType == "currentage") { $strTitle = "Age {$iAgeNumber} Rankings"; $strRankingType = "ca"; } // elseif ($strType == "truetopalli") { // $strTitle = "King Of The Hill (In Recent History)"; // $strRankingType = "tta"; // $dbtype = "alli_name"; // } elseif ($strType == "truetopalliid") { // $strTitle = "King Of The Hill (In Recent History)"; // $strRankingType = "tta"; // $dbtype = "alli_id"; // } if (isset($_GET['race'])) { $race = $_GET['race']; //modified to be dynamic - AI 17/02/2007 $races = clsRace::getRaces(); $race = $races[$race]; } echo "<br />"; if ($strRankingType == "p") { $res = mysql_query("SELECT id,tribe_name,race,alli_id," . $dbtype . " FROM rankings_personal WHERE alli_id > 10 ORDER BY " . $dbtype . " DESC LIMIT 200"); echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"4\">" . $strTitle . "</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th>Tribe Name</th>"; echo "<th>Race</th>"; echo "<th>Alliance</th>"; echo "<th class=\"right\">" . $type . "</th>"; echo "</tr>"; $iCount = 1; while ($line = mysql_fetch_assoc($res)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th>{$iCount}. " . stripslashes($line["tribe_name"]) . "</th>"; echo "<td class=\"left\">" . $line["race"] . "</td>"; echo "<td class=\"left\">" . "(#<a href=\"main.php?cat=game&page=alliance&aid=" . $line["alli_id"] . "\">" . $line["alli_id"] . "</a>)</td>"; echo "<td>" . number_format($line[$dbtype]) . "</td>"; echo "</tr>"; $iCount++; } } elseif ($strRankingType == "a") { $res = mysql_query("SELECT id,alli_name,alli_desc," . $dbtype . " FROM rankings_alliance WHERE id > 10 ORDER BY " . $dbtype . " DESC LIMIT 50"); echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"5\">" . $strTitle . "</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th width=\"25\"> </th>"; echo "<th>Alliance Name</th>"; echo "<th class=\"left\">Alliance Description</th>"; echo "<th>#</th>"; echo "<th class=\"right\">" . $type . "</th>"; echo "</tr>"; $iCount = 1; while ($line = mysql_fetch_assoc($res)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th class=\"left\">" . $iCount . ".</th>"; echo "<th class=\"left\">" . stripslashes($line["alli_name"]) . "</th>"; echo "<td class=\"left\">" . stripslashes($line["alli_desc"]) . "</td>"; echo "<td class=\"left\">" . "(#<a href=\"main.php?cat=game&page=alliance&aid=" . $line["id"] . "\">" . $line["id"] . "</a>) " . "</td>"; echo "<td>" . number_format($line[$dbtype]) . "</td>"; echo "</tr>"; $iCount++; } } elseif ($strRankingType == "r") { $res = mysql_query("SELECT id,tribe_name,race,alli_id," . $dbtype . " FROM rankings_personal WHERE alli_id > 10 AND race = '" . $race . "' ORDER BY " . $dbtype . " DESC LIMIT 50"); echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"4\">" . $strTitle . "</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th>Tribe Name</th>"; echo "<th>Race</th>"; echo "<th>Alliance</th>"; echo "<th class=\"right\">" . $type . "</th>"; echo "</tr>"; $iCount = 1; while ($line = mysql_fetch_assoc($res)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th>{$iCount}. " . stripslashes($line["tribe_name"]) . "</th>"; echo "<td class=\"left\">" . $line["race"] . "</td>"; echo "<td class=\"left\">" . "(#<a href=\"main.php?cat=game&page=alliance&aid=" . $line["alli_id"] . "\">" . $line["alli_id"] . "</a>)</td>"; echo "<td>" . number_format($line[$dbtype]) . "</td>"; echo "</tr>"; $iCount++; } } elseif ($strRankingType == "s") { $query = mysql_query("SELECT id, name, vote_count FROM `" . ALLIANCE . "` WHERE id > 1 ORDER BY vote_count DESC LIMIT 0 , 50"); echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"2\">Top Supporters</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th>Alliance Name</th>"; echo "<th class=\"right\">Votes</th>"; echo "</tr>"; $iCount = 1; while ($line = mysql_fetch_assoc($query)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th>{$iCount}. " . stripslashes($line['name']) . " (#<a href=\"main.php?cat=game&page=alliance&aid=" . $line['id'] . "\">" . $line['id'] . "</a>)</th>"; echo "<td>" . number_format($line['vote_count']) . "</td>"; echo "</tr>"; $iCount++; } } elseif ($strRankingType == "ta") { include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iCurrentYear = $objGame->get_year_history(); // Nuvarande $resSQL = mysql_query("SELECT alli_id, alli_name, alli_desc, year, land FROM rankings_history WHERE year = {$iCurrentYear} AND year > 105 LIMIT 1"); // Alla genom history $resSQL2 = mysql_query("SELECT year, alli_id, alli_name, alli_desc FROM rankings_history WHERE alli_id > 10 AND year > 105 GROUP BY year ASC"); // Lista Alla För att summera i PHP $old_id = 0; $iCount = 0; while ($arrRow = mysql_fetch_assoc($resSQL2)) { $new_id = $arrRow['alli_id']; if ($new_id != $old_id) { // prepare for new alliance $iCount++; // Copy SQL result row $arrAlliance[$iCount] = $arrRow; // add a starting year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['starting_year'] = $arrRow['year']; // add an ending year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; // add a year counter column, starting value = 1 $arrAlliance[$iCount]['years'] = 1; // Save alliance id for next loop $old_id = $new_id; } elseif ($new_id == $old_id) { // add another year to our counter column $arrAlliance[$iCount]['years']++; // update ending year column $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; } } //====================================================================== // Sort the array //====================================================================== // Obtain the column to sorty by foreach ($arrAlliance as $key => $row) { $years[$key] = $row['years']; } // Sort the data with years descending // Add $arrAlliance as the last parameter, to sort by the common key array_multisort($years, SORT_DESC, $arrAlliance); //====================================================================== // Done sorting ;) //====================================================================== echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"6\">" . $strTitle . "</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th colspan=\"2\"> Alliance Name </th>"; echo "<th width=\"40%\"> Description </th>"; echo "<th> # </th>"; echo "<th> Period </th>"; echo "<th class=\"right\"> Years </th>"; echo "</tr>"; $iCount = 1; while ($arrAlliance1 = mysql_fetch_array($resSQL)) { // pick out the current year alliance from our history array foreach ($arrAlliance as $arrAlliance2) { if ($arrAlliance1['year'] == $arrAlliance2['ending_year']) { $arrAlliance1 = $arrAlliance2; break; } } $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th width=\"25\" class=\"bsdown\">{$iCount}. </th>"; echo "<th class=\"bsdown\">" . stripslashes($arrAlliance1['alli_name']) . "</th>"; echo "<td class=\"bsdown left\">" . $arrAlliance1['alli_desc'] . "</td>"; echo "<td class=\"bsdown left\">" . "(#<a href=\"main.php?cat=game&page=alliance&aid=" . $arrAlliance1['alli_id'] . "\">" . $arrAlliance1['alli_id'] . "</a>)" . "</td>"; echo "<td class=\"bsdown left\">" . $arrAlliance1['starting_year'] . ' - <strong>' . $arrAlliance1['ending_year'] . "</strong> OE</td>"; echo "<td class=\"bsdown\">" . $arrAlliance1['years'] . "</td>"; echo "</tr>"; $iCount++; } foreach ($arrAlliance as $arrAlliance) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th width=\"25\">{$iCount}. </th>"; echo "<th>" . stripslashes($arrAlliance['alli_name']) . "</th>"; echo "<td class=\"left\">" . $arrAlliance['alli_desc'] . "</td>"; echo "<td class=\"left\">" . "(#<a href=\"main.php?cat=game&page=alliance&aid=" . $arrAlliance['alli_id'] . "\">" . $arrAlliance['alli_id'] . "</a>)" . "</td>"; echo "<td class=\"left\">" . $arrAlliance['starting_year'] . ' - ' . $arrAlliance['ending_year'] . " OE</td>"; echo "<td>" . $arrAlliance['years'] . "</td>"; echo "</tr>"; $iCount++; // if ($iCount == 10) // { // break; // } } } elseif ($strRankingType == "tl") { include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iCurrentYear = $objGame->get_year_history(); $query1 = mysql_query("SELECT alli_id,alli_name,alli_desc,year,land FROM rankings_history WHERE year = {$iCurrentYear} AND year > 105 LIMIT 1"); echo "<table class=\"big\" cellpadding=\"0\" cellspacing=\"0\">"; echo "<tr class=\"header\"><th colspan=\"5\">" . $strTitle . "</th></tr>"; echo "<tr class=\"subheader\">"; echo "<th colspan=\"2\"> Alliance Name </th>"; echo "<th> Description </th>"; echo "<th class=\"right\"> Year </th>"; echo "<th class=\"right\"> Acres </th>"; echo "</tr>"; $iCount = 1; while ($line = mysql_fetch_array($query1)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th width=\"25\" class=\"bsdown\">{$iCount}.</th>"; echo "<th class=\"bsdown\">" . stripslashes($line['alli_name']) . " (#<a href=\"main.php?cat=game&page=alliance&aid=" . $line['alli_id'] . "\">" . $line['alli_id'] . "</a>) </th>"; echo "<td class=\"bsdown\">" . $line['alli_desc'] . "</td>"; echo "<td class=\"bsdown\">" . $line['year'] . " OE</td>"; echo "<td class=\"bsdown\">" . number_format($line['land']) . "</td>"; echo "</tr>"; $iCount++; } $query = mysql_query("SELECT alli_id,alli_name,alli_desc,year,MAX(land) as land FROM rankings_history WHERE alli_id > 10 AND year > 105 GROUP BY alli_id ORDER BY land DESC"); // GROUP BY alli_name while ($line = mysql_fetch_array($query)) { $cm = $iCount % 2 == 0 ? " even" : " odd"; echo "<tr class=\"data" . $cm . "\">"; echo "<th width=\"25\">{$iCount}.</th>"; echo "<th>" . stripslashes($line['alli_name']) . " (#<a href=\"main.php?cat=game&page=alliance&aid=" . $line['alli_id'] . "\">" . $line['alli_id'] . "</a>)" . "</th>"; echo "<td>" . $line['alli_desc'] . "</td>"; echo "<td>" . $line['year'] . " OE</td>"; echo "<td>" . number_format($line['land']) . "</td>"; echo "</tr>"; $iCount++; } } elseif ($strRankingType == "ca") { include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iCurrentYear = $objGame->get_year_history(); $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); include_once 'inc/classes/clsAge.php'; $objNewAge = new clsAge(); $objNewAge->loadAge($iAgeNumber); $iFirstYear = $objNewAge->getFirstYear(); $iLastYear = $objNewAge->getLastYear(); // Alla genom history $resSQL2 = mysql_query("SELECT year, alli_id, alli_name, alli_desc FROM rankings_history WHERE alli_id > 10 AND year >= {$iFirstYear} AND year <= {$iLastYear} GROUP BY alli_id,year ASC"); // Lista Alla För att summera i PHP $old_id = 0; $iCount = 0; while ($arrRow = mysql_fetch_assoc($resSQL2)) { $new_id = $arrRow['alli_id']; if ($new_id != $old_id) { // prepare for new alliance $iCount++; // Copy SQL result row $arrAlliance[$iCount] = $arrRow; // add a starting year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['starting_year'] = $arrRow['year']; // add an ending year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; // add a year counter column, starting value = 1 $arrAlliance[$iCount]['years'] = 1; // Save alliance id for next loop $old_id = $new_id; } elseif ($new_id == $old_id) { // add another year to our counter column $arrAlliance[$iCount]['years']++; // update ending year column $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; } } //====================================================================== // Sort the array //====================================================================== // Obtain the column to sorty by foreach ($arrAlliance as $key => $row) { $years[$key] = $row['years']; } // Sort the data with years descending // Add $arrAlliance as the last parameter, to sort by the common key array_multisort($years, SORT_DESC, $arrAlliance); //====================================================================== // Done sorting ;) //====================================================================== echo '<div class="center">' . '<h1 style="margin-top: 0;">Age ' . $iAgeNumber . ' Rankings (' . $iFirstYear . ' - ' . $iLastYear . ' OE)</h1>' . '</div>'; // echo "<h2>Top Alliance History</h2>"; $strTopAllianceCurrentTable = '<table class="big" cellpadding="0" cellspacing="0">' . '<tr class="header">' . '<th colspan="5">King of the Hill</th>' . '</tr>' . '<tr class="subheader">' . '<th> </th>' . '<th>Alliance Name</th>' . '<th>Alliance Description</th>' . '<th>#</th>' . '<th class="right">Years</th>' . '</tr>'; $iCount = 1; foreach ($arrAlliance as $arrAlliance) { $strTopAllianceCurrentTable .= '<tr class="data">' . '<th width="25">' . $iCount . '.</th>' . '<th>' . stripslashes($arrAlliance['alli_name']) . '</th>' . '<td class="left">' . stripslashes($arrAlliance['alli_desc']) . '</td>' . '<td class="left">' . '(#<a href="main.php?cat=game&page=alliance&aid=' . $arrAlliance['alli_id'] . '">' . $arrAlliance['alli_id'] . '</a>)' . '</td>' . '<td>' . $arrAlliance['years'] . ' years on top</td>' . '</tr>'; $iCount++; } $strTopAllianceCurrentTable .= '</table>'; echo $strTopAllianceCurrentTable; //************************************************************************** // 2nd LIST //************************************************************************** function doit1() { include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iCurrentYear = $objGame->get_year_history(); $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); include_once 'inc/classes/clsAge.php'; $objNewAge = new clsAge(); $objNewAge->loadAge($iAgeNumber); $iFirstYear = $objNewAge->getFirstYear(); $iLastYear = $objNewAge->getLastYear(); // echo "<h2>Top Acreage History</h2>"; echo '<br />'; $strTopAcreageCurrentTable = '<table class="big" cellpadding="0" cellspacing="0">' . '<tr class="header">' . '<th colspan="6">Largest Alliance</th>' . '</tr>' . '<tr class="subheader">' . '<th> </th>' . '<th>Alliance Name</th>' . '<th>Alliance Description</th>' . '<th>#</th>' . '<th class="right">Year</th>' . '<th class="right">Acres</th>' . '</tr>'; $iCount = 1; $query = mysql_query("SELECT MAX(land) as land,alli_id,year FROM rankings_history WHERE alli_id > 10 AND year >= {$iFirstYear} AND year <= {$iLastYear} GROUP BY alli_id ORDER BY land DESC"); while ($line = mysql_fetch_array($query)) { $line2 = mysql_fetch_array(mysql_query("SELECT year,alli_name,alli_desc FROM rankings_history WHERE land = {$line['land']} AND alli_id = {$line['alli_id']}")); $cm = $iCount % 2 == 0 ? " even" : " odd"; $strTopAcreageCurrentTable .= '<tr class="data"' . $cm . '">' . '<th width="25">' . $iCount . '.</th>' . '<th>' . stripslashes($line2['alli_name']) . '</th>' . '<td class="left">' . stripslashes($line2['alli_desc']) . '</td>' . '<td class="left">(#<a href="main.php?cat=game&page=alliance&aid=' . $line['alli_id'] . '">' . $line['alli_id'] . '</a>)' . '</td>' . '<td>(' . $line2['year'] . ' OE)</td>' . '<td>' . number_format($line['land']) . ' acres </td>' . '</tr>'; $iCount++; } $strTopAcreageCurrentTable .= '</table>'; echo $strTopAcreageCurrentTable; } doit1(); //************************************************************************** // 3rd LIST //************************************************************************** function doit() { include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iCurrentYear = $objGame->get_year_history(); $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); include_once 'inc/classes/clsAge.php'; $objNewAge = new clsAge(); $objNewAge->loadAge($iAgeNumber); $iFirstYear = $objNewAge->getFirstYear(); $iLastYear = $objNewAge->getLastYear(); // Alla genom history $resSQL2 = mysql_query("SELECT year, alli_id, alli_name, alli_desc FROM rankings_history WHERE alli_id > 10 AND year >= {$iFirstYear} AND year <= {$iLastYear} GROUP BY year ASC"); // Lista Alla För att summera i PHP $old_id = 0; $iCount = 0; while ($arrRow = mysql_fetch_assoc($resSQL2)) { $new_id = $arrRow['alli_id']; if ($new_id != $old_id) { // prepare for new alliance $iCount++; // Copy SQL result row $arrAlliance[$iCount] = $arrRow; // add a starting year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['starting_year'] = $arrRow['year']; // add an ending year column to display period, eg 100 - 106 OE $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; // add a year counter column, starting value = 1 $arrAlliance[$iCount]['years'] = 1; // Save alliance id for next loop $old_id = $new_id; } elseif ($new_id == $old_id) { // add another year to our counter column $arrAlliance[$iCount]['years']++; // update ending year column $arrAlliance[$iCount]['ending_year'] = $arrRow['year']; } } //====================================================================== // Sort the array //====================================================================== // Obtain the column to sorty by foreach ($arrAlliance as $key => $row) { $years[$key] = $row['starting_year']; } // Sort the data with years descending // Add $arrAlliance as the last parameter, to sort by the common key array_multisort($years, SORT_ASC, $arrAlliance); //====================================================================== // Done sorting ;) //====================================================================== // echo '<div class="center"><h2>Timeline</h2></div>'; echo '<br />'; $strTimelineCurrentTable = '<table class="big" cellpadding="0" cellspacing="0">' . '<tr class="header">' . '<th colspan="5">Timeline</th>' . '</tr>' . '<tr class="subheader">' . '<th>Period</th>' . '<th>Alliance Name</th>' . '<th>Alliance Description</th>' . '<th>#</th>' . '<th class="right">Years</th>' . '</tr>'; $iCount = 1; foreach ($arrAlliance as $arrAlliance) { $strTimelineCurrentTable .= '<tr class="data">' . '<td class="left">(' . $arrAlliance['starting_year'] . ' - ' . $arrAlliance['ending_year'] . ' OE) </td>' . '<th>' . stripslashes($arrAlliance['alli_name']) . '</th>' . '<td class="left">' . stripslashes($arrAlliance['alli_desc']) . '</td>' . '<td class="left">' . '(#<a href="main.php?cat=game&page=alliance&aid=' . $arrAlliance['alli_id'] . '">' . $arrAlliance['alli_id'] . '</a>)</td>' . '<td>' . $arrAlliance['years'] . ' years on top </td>' . '</tr>'; $iCount++; } $strTimelineCurrentTable .= '</table>'; echo $strTimelineCurrentTable; } doit(); } // elseif ($strRankingType == 'tta') // { // $strTable = // '<table class="medium" cellpadding="0" cellspacing="0">' . // '<tr class="header">' . // '<th colspan="4">' .$strTitle . '</th>' . // '</tr>' . // '<tr class="subheader">' . // '<th>Alliance Name</th>' . // '<th>#</th>' . // '<th class="center">Years</th>' . // '<th class="right">Active</th>' . // '</tr>'; // $strSQL = "SELECT alli_name, alli_desc, alli_id, count(year) as years, year FROM rankings_history WHERE alli_id > 10 AND year > 105 GROUP BY $dbtype ORDER BY id DESC"; // $resSQL = mysql_query($strSQL); // $iCount = 1; // while ($arrAlliance = mysql_fetch_array($resSQL)) // { // $strTable .= // '<tr class="data">' . // '<th>' . stripslashes($arrAlliance['alli_name']) . '</th>' . // '<td class="left">' . '(#<a href="main.php?cat=game&page=alliance&aid=' . $arrAlliance['alli_id'] . '">' . $arrAlliance['alli_id'] . '</a>)</td>' . // '<td class="center">' . $arrAlliance['years'] . '</td>' . // '<td>~' . $arrAlliance['year'] . ' OE</td>' . // '</tr>'; // $iCount++; // } // echo $strTable; // } echo '</table>'; }
function form_tribe_info() { echo "<div class=\"row\">"; echo "<strong>Tribe Information</strong>"; echo "</div>"; echo "<div class=\"row\">"; echo "<span class=\"label\">Tribe Name:</span>"; echo "<span class=\"formw\"><input maxlength=\"20\" name=\"register[tribe]\" /></span>"; echo "</div>"; echo "<div class=\"row\">"; echo "<span class=\"label\">Leader Name:</span>"; echo "<span class=\"formw\"><input maxlength=\"20\" name=\"register[alias]\" /></span>"; echo "</div>"; echo "<div class=\"row\">"; echo "<span class=\"label\">Choose Race:</span>"; echo "<span class=\"formw\">"; echo "<select size=\"1\" name=\"register[race]\">"; // AI: do this dynamically using getActiveRaces() require_once 'inc/races/clsRace.php'; foreach (clsRace::getActiveRaces() as $raceName) { echo "<option value='{$raceName}'>{$raceName}</option>"; } echo "</select> "; if ($_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME) { echo "<a href=\"" . HOST_GUIDE . "races2.php?chapter=4\" class=\"newWindowLink\" target =\"_blank\" style=\"cursor: help\">Guide</a></span>"; } else { echo "<a href=\"" . HOST_GUIDE . "races.php?chapter=4\" class=\"newWindowLink\" target =\"_blank\" style=\"cursor: help\">Guide</a></span>"; } echo "</div>"; }
function include_main_text() { global $Host; include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $strLoginSwitch = $objGame->get_game_switch(LOGIN_STOPPER); include_once 'inc/functions/races.php'; //$arrRaces = getRaces(); //$strRace = $arrRaces[$iRand = rand(1,15)]; //$arrRandRace = getUnitVariables($strRace); //changed to use clsRace - AI require_once 'inc/races/clsRace.php'; $arrRaces = clsRace::getActiveRaces(); $strRace = $arrRaces[$iRand = rand(1, count($arrRaces) - 1)]; $arrRandRace = getUnitVariables($strRace); ?> <div id="text" style="height: 85px;"> <div id="login"> <h2><img src="<?echo $Host;?>first_login.gif" alt="Login" height="26" /></h2> <p> <?php if ($strLoginSwitch == 'on' && !isset($_GET['stagepass'])) { ?> <em style="color: lightgreen;">Logins are temporarily disabled.</em> </h2> <p>(We're probably just updating the game so be back soon!)</p> <?php } else { ?> <form action="main.php?cat=main&page=login2" method="post"> <label for="1" class="hidden">Username</label> <input maxlength="20" name="login[username]" size="9" class="login" id="1"/> <label for="2" class="hidden">Password</label> <input maxlength="20" name="login[password]" size="9" type="password" class="password" id="2"/> <input type="submit" name="LoginButton" value="Login" align="middle" class="submit" /> or <a href="main.php?cat=main&page=register1">Sign Up!</a> </form> </p> <?php } /* $age1 = mktime(0,0,0,9,3,2006); //hours,mins,secs,month,day,year $timediff = $age1 - time(); $days = intval($timediff / 86400); $remain = $timediff % 86400; $hours = intval($remain / 3600); $remain = $remain % 3600; $mins = intval($remain / 60); if ($timediff > 0) echo ' <i style="color: lightgreen;">New Age Start: <br/>'; if ($days > 1) echo $days . ' days left'; elseif ($days == 1) echo $days . ' day left'; elseif ($hours > 1) echo $hours . ' hours left'; elseif ($hours == 1) echo $hours . ' hour left'; elseif ($hours == 0 && $mins > 0) echo $mins . ' minutes left!'; if ($timediff > 0) echo "</i>"; */ // Martel: Safety caution - Do not help kiddies find usernames or guess pws if (isset($_GET['error'])) { switch ($_GET['error']) { case 'error': echo '<p>' . 'Wrong name or password, please try again.' . '</p>'; break; case 'empty': echo '<p>' . 'Empty form, please fill in and try again.' . '</p>'; break; } } ?> </div> <div id="teaser"> <p>ORKFiA is an excellent <strong>online strategy game</strong> in a fantasy setting. Play in alliances together with your friends, at work, in school or at home, and become the greatest leader of all.</p> </div> </div> <div id="columns"> <div id="intro"> <div class="center"> <h2>Global Game News</h2> </div> <?php include_once 'inc/pages/global_news.inc.php'; // Show Global News echo showGlobalNews('tiny'); ?> <div id="text"> <h2><img src="<?echo $Host;?>first_join.gif" alt="Join" height="26" /></h2 <p>Create and lead your very own tribe inside Orkfia, for absolutely no cost. Go here to <a href="main.php?cat=main&page=sponsors">Sign Up!</a></p> <h2><img src="<?echo $Host;?>first_chat.gif" alt="Chat" height="26" /></h2> <p>Talk to staff and active players in our IRC-channel: <a href="irc://irc.netgamers.org/orkfia" target="_blank" class="newWindowLink">#orkfia</a></p> </div <div class="center" style="text-align: left;"> <h2 style="margin: 0px auto; margin-top: 10px; text-align: center;">Game Stats</h2> <?php //========================================================================== // Martel, December 07, 2006 // Age display, identical except for "month" to what is in layout.php //========================================================================== include_once 'inc/classes/clsGame.php'; $objGame = new clsGame(); $iGameHours = $objGame->get_game_time(HOUR_COUNTER); $iAgeNumber = $objGame->get_game_time(AGE_NUMBER); // age stuff include_once 'inc/classes/clsAge.php'; $objAge = new clsAge(); $blnCheck = $objAge->loadAge($iAgeNumber); // either FALSE or TRUE // display stuff include_once 'inc/functions/orktime.php'; $arrAgeDisplays = get_age_displays($objGame, $objAge, $blnCheck); $arrOrkDate = hoursToYears($iGameHours); // Months $strMonths = ""; if ($arrOrkDate['months'] > 0) { $strMonths = "Month " . $arrOrkDate['months'] . ", "; } $arrAgeDisplays = get_age_displays($objGame, $objAge, $blnCheck); // Alliance $arrGameHistorys = $objGame->get_historys($arrOrkDate['years']); $strTopAlliance = 'Top Alliance: ' . $arrGameHistorys[ALLI_NAME] . ' (#' . $arrGameHistorys[ALLI_ID] . ')'; // queries for stats $strSQL1 = 'SELECT (COUNT(id) / 2) as wars FROM war WHERE target > 0 LIMIT 1'; $strSQL2 = 'SELECT COUNT(id) as alliances FROM ' . ALLIANCE . ' WHERE id > 10 LIMIT 1'; $strSQL3 = 'SELECT COUNT(id) as players FROM user LIMIT 1'; $strSQL4 = 'SELECT COUNT(id) as oldies FROM user WHERE hours > 948 LIMIT 1'; $strSQL5 = 'SELECT AVG(land) as avg_land FROM build,user WHERE user.hours > 948 LIMIT 1'; $iWars = intval(mysql_result(mysql_query($strSQL1), 0)); $iAlliances = mysql_result(mysql_query($strSQL2), 0); $iPlayers = mysql_result(mysql_query($strSQL3), 0); $iOldies = mysql_result(mysql_query($strSQL4), 0); $iAvgLand = mysql_result(mysql_query($strSQL5), 0); echo '<p>' . "Currently in ORKFiA there are <strong style=\"font-size: 1.5em;\">{$iWars}</strong> ongoing wars, <strong style=\"font-size: 1.5em;\">{$iAlliances}</strong> alliances and <strong style=\"font-size: 1.5em;\">{$iPlayers}</strong> tribes." . '</p>'; // '<h2>Game Configuration</h2>' . // '<p>' . // "Max alliances: " . MAX_ALLIANCES . " <br />" . // "Tribes per alliance: " . MAX_ALLIANCE_SIZE . " <br />" . // "Average tribes per alliance: " . round($iPlayers / $iAlliances) . " <br />" . // "Average size of tribes with 5 years to live: " . number_format($iAvgLand) . " acres <br />" . // '</p>'; //========================================================================== // end nonsense ;) //========================================================================== ?> </div> </div> <div id="donate"> <div id="text" style="text-align: left;"> <h2><img src="<?echo $Host;?>first_intro.gif" alt="Strategy Game Introduction" height="26" /></h2> <p><span class="highlight">Grow your tribe in a real time environment</span>, teamed together with friends in an effort to become the largest, strongest and most famous of all alliances!</p> <p>You have to execute the right strategy to grow large, strong and famous. There are <span class="highlight">many strategies to choose</span>. Your tribe can grow by the valuables your citizens find in the mines, or they can do research in many fields to improve your efficiency, defense, power and production.</p> <p>The other possibility is to <span class="highlight">kill those who oppose you</span>. Once all your enemies have perished, you will <span class="highlight">be the greatest leader the world has ever seen</span>.</p> </div> </div> </div> <?php }