Added full source code

This commit is contained in:
Emmanuel BENOîT 2016-01-10 11:01:49 +01:00
commit 33f8586698
1377 changed files with 123808 additions and 0 deletions

View file

@ -0,0 +1,42 @@
<?
include("menu.en.inc");
$this->title = "About Legacy Worlds";
$this->addStylesheet('text');
$this->startContents();
?>
<h1>About LegacyWorlds</h1>
<p>
Legacy Worlds is an online multiplayer intergalactic war game.
</p>
<p>
Your goal as a player: build up an empire and defeat the other players.
</p>
<p>
How to achieve that: through technological research, alliances with other players and of course conquests.
</p>
<p>
<a href="http://www.deepclone.com/">DeepClone Development</a> is proud to introduce this new version,
Legacy Worlds Public Beta 5. It has been rewritten from scratch since the previous version and keeps evolving as bugs
are fixed and features are added.
</p>
<h1>Online Games Directories</h1>
<p>
Legacy Worlds Beta 5 is listed on the following online games directories:
</p>
<ul>
<li><a href="http://www.rpg.sg">RPG.SG</a>: <a href="http://www.rpg.sg/profile/195/Legacy-Worlds">here</a></li>
<li><a href="http://www.mpogd.com/">Multiplayer Online Games Directory</a>: <a href="http://www.mpogd.com/games/game.asp?ID=3499">here</a></li>
<li><a href="http://www.free-games.com.au">Free Games</a>: <a href="http://www.free-games.com.au/Detailed/1851.html">here</a></li>
<li><a href="http://www.sweetonlinegames.com">Sweet Online Games</a>: <a href="http://www.sweetonlinegames.com/view/549">here</a></li>
</ul>
<p>
Please take the time to vote for Legacy Worlds on these sites, as it means more players, and therefore more fun...
</p>
<h1 id="othergames">Other DeepClone Development games</h1>
<p>
<a href="http://www.gpmanagerpro.com">GP Manager Pro</a> is DeepClone's latest project, a game
in which you play as the manager of a Grand Prix team.
</p>
<? $this->endContents(); ?>

View file

@ -0,0 +1,277 @@
<?
include("menu.en.inc");
$this->title = "My account";
$this->addScript("account");
$this->addStylesheet("account");
$this->startContents();
function displayUnregistered($a) {
static $status = array(
'READY' => 'Open for registration',
'RUNNING' => 'Running',
'VICTORY' => 'Victory',
'ENDING' => 'Ending'
);
?>
<table>
<tr><th style="text-align:left">Game name</th><th>Players</th><th style="text-align:left">Status</th></tr>
<?php
foreach ($a as $g => $c) {
echo "<tr><td>";
if ($c[3]) {
echo "<a href='".makeLink('play')."?g=$g'>{$c[0]}</a>";
} else {
echo "{$c[0]} (closed)";
}
echo "</td><td style='text-align:center'>{$c[1]}</td>";
echo "<td>".$status[$c[2]]."</td>";
echo "</tr>\n";
if ($c[2] == "READY") {
print "<tr><td>&nbsp;</td><td colspan='2' style='text-align:center'>Starting at "
. gmstrftime('%H:%M:%S on %Y-%m-%d', $c[4]) . "</td></tr>";
} elseif ($c[2] == "ENDING") {
print "<tr><td>&nbsp;</td><td colspan='2' style='text-align:center'>Ending at "
. gmstrftime('%H:%M:%S on %Y-%m-%d', $c[4]) . "</td></tr>";
}
}
?>
</table>
<?php
}
function displayRegistered($a) {
static $status = array(
'PRE' => 'Hidden',
'READY' => 'Open',
'RUNNING' => 'Running',
'VICTORY' => 'Victory',
'ENDING' => 'Ending'
);
?>
<table>
<tr><th class="gname">Game name</th><th>Planets</th><th>Cash</th><th>Game status</th></tr>
<?php
foreach ($a as $g => $c) {
echo "<tr><td><a href='".makeLink('play',$g)."'>{$c[0]}</a></td>";
echo "<td style='text-align:center'>{$c[1]}</td><td style='text-align:center'>&euro;"
. number_format($c[2]) . "</td>";
echo "<td style='text-align:center'>" . $status[$c[4]] . "</td></tr>\n";
if ($c[4] == "READY") {
print "<tr><td>&nbsp;</td><td colspan='3' style='text-align:center'>Starting at "
. gmstrftime('%H:%M:%S on %Y-%m-%d', $c[5]) . "</td></tr>";
} elseif ($c[4] == "ENDING") {
print "<tr><td>&nbsp;</td><td colspan='3' style='text-align:center'>Ending at "
. gmstrftime('%H:%M:%S on %Y-%m-%d', $c[5]) . "</td></tr>";
}
}
?>
</table>
<?php
}
?>
<div id='tabs'>
<a href="#acc-games" id="tab-games">Games</a>
<? if (is_null($__quit)) : ?>
<a href="#acc-vacation" id="tab-vacation">Vacation</a>
<? endif; ?>
<a href="#acc-quit" id="tab-quit">Quit LegacyWorlds</a>
</div>
<div id="acc-games" class="acctab">
<h1>Welcome to Legacy Worlds, <?=$_SESSION['login']?>!</h1>
<?php
$vac = $args['vac'];
$onVacation = ($vac['status'] == 'VAC');
if (count($args['play'])) {
echo "<p>You are currently playing the following games:</p>\n";
displayRegistered($args['play']);
if (count($args['other'])) {
if ($onVacation) {
echo "<p>Other games are available, but you must exit vacation mode to see them.</p>\n";
} elseif (!$_SESSION['show_unregistered']) {
echo "<p>You may also register to the following games:";
echo " (<a href='?sw=1'>hide</a>):</p>\n";
displayUnregistered($args['other']);
} else {
echo "<p><a href='?sw=1'>Show all games</a></p>\n";
}
} else {
echo "<p>There are currently no other available games.</p>\n";
}
} else if (!$onVacation) {
?>
<p>
<b>You are currently not registered to any game!</b><br/>
You may register to any of the games in the list below by clicking its name:
</p>
<?php
displayUnregistered($args['other']);
} else {
?>
<p>
<b>You are currently not registered to any game!</b><br/>
You will have to leave vacation mode before selecting a game to play.
</p>
<?php
}
echo "<p>&nbsp;</p>\n";
if ($args['leech']) {
?>
<h1>Contribute to LegacyWorlds!</h1>
<p>
Learn about how you can help in the <a href='<?=makeLink('contrib', 'main')?>'>Contributions</a> page.
</p>
<?php
}
?>
</div>
<?
if (is_null($args['quit'])) {
?>
<div id='acc-vacation' class="acctab">
<h1>Vacation mode</h1>
<p>
<?php
if ($vac['vac_credits'] > 0) {
?>
You have <b><?=$vac['vac_credits']?></b> vacation credit<?=$vac['vac_credits'] > 1 ? "s" : ""?>, which translates to
<?php
$cred = $vac['vac_credits'];
$crMod = ($cred % 4);
$crDays = ($cred - $crMod) / 4;
$crHours = $crMod * 6;
if ($crDays > 0) {
echo "<b>$crDays</b> day" . ($crDays > 1 ? "s" : "") . " ";
if ($crHours > 0) {
echo "and ";
}
}
if ($crHours > 0) {
echo "<b>$crHours</b> hours";
}
echo ".";
} else {
echo "You don't have any vacation credit left.";
}
?>
</p>
<?php
if ($onVacation) {
?>
<p>
You are currently <b>on vacation</b>.
</p>
<p>
You can choose to leave vacation mode by clicking the button below.
However, if you do so, you will not be able to enter vacation mode again for the next 7 days.
</p>
<form method='get' action=''><div>
<input type='hidden' name="evm" value="1" />
<input type='submit' value="Exit vacation mode" class="input" />
</div></form>
<?php
} elseif ($vac['can_set']) {
?>
<p>
Vacation mode allows you to take a break from the actual game. You can activate
it by clicking the button below.
</p>
<form method='get' action=''><div>
<input type='hidden' name="svm" value="1" />
<input type='submit' value="Enter vacation mode" class="input" />
</div></form>
<?php
} elseif (!is_null($vac['vac_start'])) {
$vs = $vac['vac_start'];
$mod = $vs % 21600;
$startDate = $vs - $mod + ($mod ? 21600 : 0);
?>
<p>
Your account will enter vacation mode at <?=gmstrftime("<b>%H:%M:%S (%Y-%m-%d)</b>", $startDate)?> Server Time.
</p>
<p>
Clicking the button below will allow you to prevent your account from entering vacation mode.
</p>
<form method='get' action=''><div>
<input type='hidden' name="cvms" value="1" />
<input type='submit' value="Cancel vacation mode"class="input" />
</div></form>
<?php
} elseif ($vac['vac_credits'] == 0) {
?>
<p>
It is therefore impossible for you to enter vacation mode. You will earn a new credit at the next day tick.
</p>
<?php
} else {
$q = dbQuery("SELECT t FROM main.account_log WHERE account={$_SESSION['userid']} AND action='VEND'");
list($ts) = dbFetchArray($q);
$ts += 24 * 3600 * 7;
?>
<p>
You exited vacation mode less than a week ago, it is therefore impossible for you to re-enter vacation mode
before <b><?=gmstrftime("%H:%M:%S", $ts)?></b> (on <b><?=gmstrftime("%Y-%m-%d", $ts)?></b>).
</p>
<?php
}
echo "</div>\n";
}
?>
<div id="acc-quit" class="acctab">
<h1>Quitting Legacy Worlds</h1>
<?php
if (is_null($args['quit'])) {
?>
<p>
Had enough of Legacy Worlds? Well, you may close your account if you wish to do so.
<br/>
Closing your account will cause you to disappear from all of the games you're
currently playing on Legacy Worlds; it will also disable your account.<br/>
You will be able to use your account again at a later time if you wish to; more
details will be provided later.
</p>
<p>
Click the button below if you wish to close your account.
</p>
<form method="get" action=""><div>
<input type='hidden' name='rq' value='1' />
<input type="submit" value="Close my account" class="input" />
</div></form>
<?php
} else {
$qt = $args['quit'] + 86400;
$mod = $qt % 86400;
$quitDate = $qt - $mod + ($mod ? 86400 : 0) + 7 * 3600;
?>
<p>
Your account will be closed at <?=gmstrftime("<b>%H:%M</b> on the <b>%Y-%m-%d</b>", $quitDate)?> (Server Time).
</p>
<p>
Until then, you can choose to cancel this action by clicking the button below.
</p>
<form method="get" action=""><div>
<input type='hidden' name='crq' value='1' />
<input type="submit" value="Don't close my account" class="input" />
</div></form>
<?php
}
?>
</div>
</div>

View file

@ -0,0 +1,17 @@
<?
$this->title = "Please contribute";
$this->addStylesheet('annoy');
$this->addScript('annoy');
?>
<div id="aframe">
<h1>Please contribute to LegacyWorlds</h1>
<p>
You are seeing this page because you have used quite a few server resources.
</p>
<p>
Contributing doesn't mean you have to pay (although it is an option); you can help
us by reporting bugs or helping us with the Beta 6 development process...
</p>
<p>You will be redirected to the Contributions page in</p>
<h1><span id="redtime"><?=$args['time']?></span>s</h1>
</div>

View file

@ -0,0 +1,116 @@
<?
include('menu.en.inc');
$this->title = 'Beta 6 planets';
$this->addStylesheet('b6pp');
$envType = array(
"0" => "excellent",
"1" => "good",
"2" => "not so great",
"3" => "bad",
"4" => "infernal",
"5" => "not so great",
"6" => "bad",
"7" => "good"
);
$pType = array(
// "0" => array( "Earth-like planet", "this planet is very similar to Earth"),
"0" => array( "temperate planet", "this planet is very similar to Earth, but the temperature is more constant - the planet has no icecaps and no dry deserts"),
"1" => array( "planetary ocean", "this planet's surface is covered by an ocean; it should be quite cloudy, but not to the point of hiding the surface"),
"2" => array( "Mars-like planet", "this planet is very similar to Mars; it has a relatively thin atmosphere, but isn't too friendly" ),
"3" => array( "dead world", "this very rocky planet has almost no atmosphere"),
"4" => array( "lava world", "this planet's volcanism is downright crazy; it has an atmosphere, but you sure as hell wish it didn't." ),
"5" => array( "desert world", "this planet is a sand desert, with a very clear atmosphere." ),
"6" => array( "ice world", "this planet is very cold, covered in snow; even the surface of its ocean is frozen." ),
"7" => array( "jungle world", "this planet is covered in forests and jungles; it doesn't really have seas and oceans, but rather gigantic swamps." )
);
$this->startContents();
?>
<h2>Beta 6 planet pictures</h2>
<p><a href="?c=">Rate a picture</a> - <a href="?c=t">Top ratings</a> - You rated <?=$args['rated']?> out of <?=$args['total']?> pictures.</p>
<p>&nbsp;</p>
<? if ($args['page'] == 'nu'): ?>
<h3>There are no more pictures for you to rate</h3>
<p>
It would seem that you have rated all of the currently available pictures.
</p>
<p>
Please come back later!
</p>
<? elseif ($args['page'] == 'vp') : ?>
<table style="margin: 0px auto; border-width:0px; width: 90%">
<tr>
<td style="vertical-align: middle; border-width:0px; text-align:center">
<img style="border: 1px solid white; margin: 1px" src="<?= getStatic('beta6-planets/' . $args['pic']['id'] . '-small.png') ?>" alt="small" />
</td>
<td style="vertical-align: middle; border-width:0px; text-align:center">
<img style="border: 1px solid white; margin: 1px" src="<?= getStatic('beta6-planets/' . $args['pic']['id'] . '-medium.png') ?>" alt="medium" />
</td>
<td style="vertical-align: top; border-width: 0px; padding: 5px; text-align: left" rowspan="2">
<h3>Planet details</h3>
<p>Planet size: <?= $args['pic']['p_size'] ?> / 10</p>
<p>Environment: <?= $envType[$args['pic']['p_type']] ?></p>
<p>Type: <?= $pType[$args['pic']['p_type']][0] ?></p>
<p>Description: <?= $pType[$args['pic']['p_type']][1] ?></p>
<? if (is_null($args['cr'])) : ?>
<p>&nbsp;</p>
<h3>Rate this picture</h3>
<div>
<form action="?" method="get">
<div><p>
<input type="hidden" name="c" value="r" />
<input type="hidden" name="id" value="<?= $args['pic']['id'] ?>" />
(worst) &nbsp;
<?php
for ($i = 1; $i <= 5; $i ++) {
?>
<input type="radio" name="r" value="<?=$i?>" onclick="this.form.submit();" />&nbsp;<?=$i?> &nbsp;
<?
}
?> &nbsp;(best)
</p></div>
</form>
</div>
<p>&nbsp;</p>
<p>Each planet you rate grants you 120 <a href='<?=makeLink('contrib', 'main')?>'>contribution credits</a>.</p>
<? else: ?>
<h3>Ratings</h3>
<p>Your rating: <?= $args['cr'] ?> / 5</p>
<p>Average rating: <?= $args['ar'] ?></p>
<p>Total votes: <?= $args['nv'] ?></p>
<? endif; ?>
</td>
</tr>
<tr>
<td style="vertical-align: middle; border-width:0px; text-align:center; width: 200px" colspan="2">
<img style="border: 1px solid white; margin: 1px" src="<?= getStatic('beta6-planets/' . $args['pic']['id'] . '-large.png') ?>" alt="large" />
</td>
</tr>
</table>
<? elseif ($args['page'] == 'tt') : ?>
<h3 style="margin: 5px 0px; text-align: center">Top 50 planet pictures</h3>
<table style="margin: 0px auto; border-style: none">
<?php
foreach ($args['pics'] as $pic) {
?>
<tr>
<td style="vertical-align: middle; border-width:0px; text-align:center; width: 36px">
<a href="?c=v&id=<?=$pic['picture']?>"><img style="border: 1px solid white; margin: 1px" src="<?= getStatic('beta6-planets/' . $pic['picture'] . '-small.png') ?>" alt="planet" /></a>
</td>
<td style="vertical-align: middle; border-width:0px; text-align:center; padding: 0px 20px">
<?= $pic['votes'] ?> vote<?= $pic['votes'] > 1 ? "s" : "" ?>
</td>
<td style="vertical-align: middle; border-width:0px; text-align:center; padding: 0px 20px">
<?= sprintf("%.2f", $pic['rating']) ?> / 5.00
</td>
</tr>
<?
}
?>
</table>
<? elseif ($args['page'] == 'nt') : ?>
<h3>No planets have been rated at the moment</h3>
<p>... which kind of explains why this page is blank.</p>
<? endif; ?>
<? $this->endContents(); ?>

View file

@ -0,0 +1,20 @@
<?
include("menu.en.inc");
$this->title = "Cancel account deletion";
$this->addStylesheet("account");
$this->startContents();
?>
<div id="tabs">&nbsp;</div>
<div class="acctab">
<h1>Do you want to keep your account?</h1>
<form action="?#acc-quit" method="post"><div>
<input type="hidden" name="crqc" value="1" />
<p>
Please choose whether you want to cancel the countdown for your account's deletion or keep it going.
</p>
<input type="submit" value="Yes, cancel the countdown" class="input" />
<input type="submit" name="cancel" value="No, get on with it" class="input" />
</div></form>
</div>
<? $this->endContents(); ?>

View file

@ -0,0 +1,20 @@
<?
include("menu.en.inc");
$this->title = "Account confirmation";
$this->startContents();
?>
<form action='?' method='post'><div>
<h1>Account confirmation</h1>
<p>
Please type in the confirmation code that was sent to the email address you specified.
</p>
<p>&nbsp;</p>
<?=$args['error']?"<p><b>Invalid confirmation code</b></p>":""?>
<p>
Confirmation code: <input type='text' name='authcode' class="input" />
</p>
<p>
<input type='submit' value='Validate my account' class="input" />
</p>
</div></form>
<? $this->endContents(); ?>

View file

@ -0,0 +1,33 @@
<?
include('menu.en.inc');
$this->title = 'Contributions';
$this->addStylesheet('text');
$this->startContents();
?>
<h2>Help us keep Legacy Worlds alive!</h2>
<p>
There are three ways you can help us at the moment.
</p>
<p>
You can choose to <a href='<?=makeLink('donate', 'main')?>'>donate some money</a>; while we certainly don't expect
to make a living out of it, the server costs quite a lot of money, and any amount you donate helps.
</p>
<p>
You can help us with the new version by <a href='<?=makeLink('b6pp', 'main')?>'>rating planet pictures</a> for the
new version of Legacy Worlds or commenting on the <a href='http://blog.legacyworlds.com' target='_blank'>Beta 6 blog</a>.
</p>
<p>
Finally, if you report a bug that no-one knew about, you will be credited for it.
</p>
<h3>Your current status</h3>
<p>
The figures below are an estimate of how much of the server's resources you used while playing the game along with
an estimate of your contributions to Legacy Worlds (all players start with 9,000 in this field).
</p>
<p style="padding-left: 50px">Resources used: <b><?= number_format($args['resources_used']) ?></b></p>
<p style="padding-left: 50px">Contribution: <b><?= number_format($args['credits_obtained']) ?></b></p>
<p>
Note: if the resources you used are higher than the estimate of your contributions, you will start getting an
annoying message every time you log on to LegacyWorlds.
</p>
<? $this->endContents(); ?>

View file

@ -0,0 +1,135 @@
<?php
function htmlq($v) {
return preg_replace('/"/', '&quot;', $v);
}
include("menu.en.inc");
$this->title = "Create an account";
$this->addStylesheet("create");
$this->startContents();
?>
<form action ="?" method="post"><div>
<h1>Legacy Worlds account creation</h1>
<div class="fsection" id="name-lang">
<?php
$eAccount = array(
"Valid characters: letters, numbers, spaces, and _@.+'/",
"Username is too long (maximum 15 characters).",
"Username contains invalid characters.<br/>Use letters, numbers, spaces and _.@-+'/ only).",
"Spaces are not allowed at the beginning or at the end of the username.",
"Multiple spaces are not allowed.",
"Username is too short (minimum 2 characters).",
"Username must contain at least one letter.",
"This username is not available."
);
if ($args['err1']) {
$aClass = " error";
} else {
$aClass = "";
}
echo "<div class='sechd$aClass'>{$eAccount[(int) $args["err1"]]}</div>";
?>
<div class="formline">
<div class="fcol1 pad">
<span>Username:</span>
<input type='text' name='username' maxlength='15' value="<?=htmlq($args['username'])?>" class="input" />
</div>
<div class="fcol2">
<span>Language:</span>
<select name='lang' class="input">
<option value='en' selected='selected'>English</option>
</select>
</div>
</div>
</div>
<?php
$eMail = array(
"The e-mail address <i>MUST</i> exist.",
"E-mail fields do not match, please verify.",
"Invalid address.",
"You already have a Legacy Worlds account."
);
if ($__err2) {
$aClass = " error";
} else {
$aClass = "";
}
?>
<div class="fsection" id="email">
<div class='sechd<?= $aClass ?>'><?= $eMail[(int) $__err2] ?></div>
<div class='formline'>
<div class="fcol1">
<span>E-mail:</span>
<input type='text' name='email' value="<?=htmlq($args['mail'])?>" class="input" />
</div>
<div class="fcol2">
<span>Confirm e-mail:</span>
<input type='text' name='email2' value="<?=htmlq($args['mail2'])?>" class="input" />
</div>
</div>
</div>
<?php
$ePass = array(
"4 to 64 characters ; must be different from your username",
"The password and its confirmation are different.",
"The password is too short (minimum 4 characters).",
"The password is too long (maximum 64 characters).",
"The password must be different from your user name."
);
if ($__err3) {
$aClass = " error";
} else {
$aClass = "";
}
?>
<div class="fsection" id="passwd">
<div class='sechd<?= $aClass ?>'><?= $ePass[(int) $__err3] ?></div>
<div class='formline'>
<div class="fcol1">
<span>Password:</span>
<input type='password' name='password' maxlength='64' class="input" />
</div>
<div class="fcol2">
<span>Confirm password:</span>
<input type='password' name='password2' maxlength='64' class="input" />
</div>
</div>
</div>
<?
$ePlanet = array(
"Valid characters: letters, numbers, spaces, and _@.+'/",
"The planet name is too long.",
"The planet name contains invalid characters.<br/>Use letters, numbers, spaces and _.@-+'/ only).",
"The planet name must not contain sequences of spaces.",
"The planet name is too short.",
"The planet name must contain at least one letter.",
"This planet name is unavailable.",
"The planet name must not start or end with spaces."
);
if ($__err4) {
$aClass = " error";
} else {
$aClass = "";
}
?>
<div class="fsection" id="planet">
<div class='sechd<?= $aClass ?>'><?= $ePlanet[(int) $__err4] ?></div>
<div class='formline'>
<div class="fcol1">
<span>Planet name:</span>
<input type='text' name='planet' maxlength='15' value="<?=htmlq($args['planetname'])?>" class="input" />
</div>
</div>
</div>
<div class="fsection" id="confirm">
<div class="formline"><input type='submit' name='create' value='Create account' class="input" /></div>
</div>
</div></form>
<? $this->endContents(); ?>

View file

@ -0,0 +1,25 @@
<?
include("menu.en.inc");
$this->title = "Account creation";
$this->addStylesheet('text');
$this->startContents();
if ($args['success']) {
?>
<h1>Your Legacy Worlds account has been created!</h1>
<p>
An e-mail has been sent to you with your account's details as well as
the validation procedure that will confirm your account's creation.
</p>
<?php
} else {
?>
<h1>An error has occured!</h1>
<p>
Something went wrong in the process of creating your account. This should never have
happened, please contact our <a href='mailto:webmaster@legacyworlds.com'>staff</a> to
report this.
</p>
<?php
}
$this->endContents();
?>

View file

@ -0,0 +1,40 @@
<?
include("menu.en.inc");
$this->title = "Credits";
$this->addStylesheet("credits");
$this->startContents();
?>
<div id="gamename">Legacy Worlds</div>
<div id="gameby">A <a href="http://www.deepclone.com">DeepClone Development</a> game</div>
<div class="category">Original concept</div>
<div class="who">El Christoph</div>
<div class="category">Programming &amp; design</div>
<div class="who">TSeeker</div>
<div class="category">Additional programming</div>
<div class="who">Ju</div>
<div class="who">Lord_Omega</div>
<div class="category">Manual</div>
<div class="who">Ju</div>
<div class="who">Sycophant</div>
<div class="category">Administration</div>
<div class="who">Gilgamesh</div>
<div class="who">Ju</div>
<div class="who">Lord_Omega</div>
<div class="who">Sycophant</div>
<div class="who">TSeeker</div>
<div class="category">Tools</div>
<div class="who"><a href="http://www.php.net">PHP</a> - <a href="http://www.perl.com">Perl</a></div>
<div class="who"><a href="http://www.postgresql.org">PostgreSQL</a> - <a href="http://www.vim.org/">VIM</a></div>
<div class="who"><a href="http://www.gimp.org">The Gimp</a> - <a href="http://www.povray.org">POVRay</a></div>
<div class="misc">Thanks to everyone who contributed to the game with various ideas or by reporting bugs...</div>
<div class="misc">Many bottles of beer were harmed during the making of this game.</div>
<? $this->endContents(); ?>

View file

@ -0,0 +1,31 @@
<?
include("menu.en.inc");
$this->title = "Disclaimer";
$this->addStylesheet('text');
$this->startContents();
?>
<h1>Terms of use</h1>
<p>Hey! Welcome to Legacy Worlds.</p>
<p>
The email address you supply when registering to Legacy Worlds is for
internal use only; it will not be given to any third party under any
circumstances, and will only be used to send the first time authentication
code, lost passwords and very occasional informations.
</p>
<p>
Please do not use a password for your account that you use for bank, email,
or other accounts. Although every attempt is used to keep the data secure
there is always the possibility of hackers, etc... Also, don't forget that
we can see the information!
</p>
<p>
<b><em>ONE ACCOUNT PER PERSON</em></b>: although this is just a test,
people need to play fairly or neither the fun aspect nor the balancing
aspect of the game can be measured.
</p>
<p>
You will find more informations regarding Legacy World's terms of use in
the <a href="<?=makeLink('manual')?>?p=general_rules">manual</a>.
</p>
<?=$args?"<p>&nbsp;</p><p><a href='?'>Continue to account creation</a></p>":""?>
<? $this->endContents(); ?>

View file

@ -0,0 +1,105 @@
<?php
if ($args['doit']) {
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="paypalform"><div>
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="tseeker@legacyworlds.com" />
<input type="hidden" name="item_name" value="Contribution to LegacyWorlds" />
<input type="hidden" name="item_number" value="<?=$args['pid']?>" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="tax" value="0" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="lc" value="GB" />
<input type="hidden" name="return" value="http://www.legacyworlds.com/index.php/main/donate" />
<input type="hidden" name="cancel_return" value="http://www.legacyworlds.com/index.php/main/donate" />
<h2>Please wait ...</h2>
<p>
You are being redirected to the PayPal website. If nothing happens after about 10 seconds, please click the button below:<br/>
<input type="image" src="http://images.paypal.com/images/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
</p>
</div></form>
<script type="text/javascript">
document.paypalform.submit();
</script>
<?php
return;
}
include("menu.en.inc");
$this->title = "Donate";
$this->addStylesheet('text');
$this->startContents();
?>
<h1>Donating to Legacy Worlds</h1>
<h2 style="margin:5px 0px 0px 10px">Why donate?</h2>
<p>
As you know, the current version is a Beta; therefore we don't want to force people to pay as we feel it
would be unethical. There are <a href='<?=makeLink('contrib', 'main')?>'>other ways</a> you can contribute...
</p>
<p>
However, if you really like Legacy Worlds, you are encouraged to contribute a little money. This money will
be used to pay for the hosting and server.
</p>
<h3>Please read this if you want to make a donation:</h3>
<ul>
<li>Donations won't give you an in-game advantage.</li>
<li>You will not get refunds.</li>
<li>The amount you donate is free for you to determine.</li>
<li>One euro donated will earn you to 10,000 <a href='<?=makeLink('contrib', 'main')?>'>contribution credits</a>.</li>
<li>Donations are made through PayPal; we, at LegacyWorlds, only receive the money, but have
no access to your personal data (credit card number, etc...) in any case.</li>
</ul>
<p>
If you agree with this, you can proceed to <a href='?doit=1'>making a donation</a>.
</p>
<h2>Current status</h2>
<p>
<?php
if ($args['selfContrib'] == 0) {
echo "You have not contributed to LegacyWorlds yet.";
} else {
echo "You have contributed <b>&euro;" . number_format($args['selfContrib']) . "</b> to LegacyWorlds! Thanks!";
}
?></p><p>
<?php
if ($args['totalContrib'] == 0) {
echo "No contributions to LegacyWorlds have been made yet.";
} else {
echo "A total amount of <b>&euro;" . number_format($args['totalContrib']) . "</b> has been contributed to LegacyWorlds (";
if ($args['totalMonth'] == 0) {
echo "no contributions for the past 30 days";
} else {
echo "<b>&euro;" . number_format($args['totalMonth']) . "</b> in the past 30 days";
}
echo ").";
}
?></p>
<p>
<b>NOTE:</b> if you just made a contribution, it may not have been accounted for yet.
</p>
<h2>History</h2>
<?php
if (count($args['hist']) == 0) {
echo "<p>No donations have been accounted for at this time.</p>";
} else {
?>
<table style="width:90%;margin: 0% 4%">
<tr>
<th style="text-align: left">Date &amp; time</th>
<th style="text-align: left">Amount</th>
</tr>
<?php
foreach ($args['hist'] as $d) {
echo "<tr><td>{$d['time']}</td><td>&euro;{$d['amount']}</td></tr>\n";
}
echo "</table>\n";
}
$this->endContents();
?>

View file

@ -0,0 +1,10 @@
<? $this->addStylesheet('home'); ?>
<? include('menu.en.inc'); ?>
<div id="gamedesc">
Legacy Worlds is a free, massively multiplayer, browser-based strategy game.<br/>
You don't need any plugins to play it, nor do you need to download anything.<br/>
This game works best with modern browsers such as
<a title="Firefox" href="http://www.mozilla.com/firefox/">Firefox 2</a>
or Internet Explorer 7.<br/>
<b>JavaScript must be enabled to play!</b>
</div>

View file

@ -0,0 +1,24 @@
<?
include("menu.en.inc");
$this->title = "Banned";
$this->addStylesheet('text');
$this->startContents();
?>
<h1>Banned!</h1>
<p>
You have been banned from the game.
</p>
<p>
Don't even think about coming back.
</p>
<?
$q = dbQuery("SELECT reason FROM account WHERE id=" . tracking::$data['uid'] . " AND status='KICKED'");
list($reason) = dbFetchArray($q);
if ($reason != "") {
echo "<p><b>Reason:</b> $reason</p>";
}
$this->endContents();
?>

View file

@ -0,0 +1,189 @@
<?php
function displaySubmitLink() {
if (is_array($_SESSION) && !is_null($_SESSION['userid'])) {
echo "<p><a href='?sl=1'>Submit link</a> - <a href='?rbl=1'>Report broken link</a></p>";
}
}
function displayLinks($categories) {
echo "<h1>Sites related to Legacy Worlds</h1>";
if (!count($categories)) {
echo "<p>No sites are currently registered.</p>";
displaySubmitLink();
return;
}
$hasAccount = (is_array($_SESSION) && !is_null($_SESSION['userid']));
for ($i=0;$i<count($categories);$i++) {
echo "<p style='margin:10px 0px 5px 20px;text-align:justify'><b style='text-decoration: underline'>" . utf8entities($categories[$i]['title']) . "</b>";
if (!is_null($categories[$i]['description'])) {
echo "<br/>" . preg_replace('/\n/', '<br/>', utf8entities($categories[$i]['description']));
}
echo "</p>";
echo "<ul style='margin:0px 30px 0px 10px'>";
if (!count($categories[$i]['links'])) {
echo "<li><i>No links in this category.</i></li>";
} else {
foreach ($categories[$i]['links'] as $l) {
echo "<li><a href='{$l['url']}' title=\"" . utf8entities($l['title']) . "\">" . utf8entities($l['title']) . "</a>";
if (!is_null($l['description'])) {
echo "<br/>" . preg_replace('/\n/', '<br/>', utf8entities($l['description']));
}
echo "<br/>&nbsp;</li>";
}
}
echo "</ul>";
}
displaySubmitLink();
}
function displayReportList($list) {
?>
<h1>Report a broken link</h1>
<form method='get' action='?'><div>
<input type="hidden" name="rbl" value="1" />
<p>
Please select the link to report from the list below.<br/>
<b>NOTE:</b> users who repeatedly report links as broken for no good reason will be banned from the game. If you made a mistake, please send an in-game private message to TSeeker or send an e-mail to <a href='mailto:staff@legacyworlds.com'>the staff</a>.<br/>
<br/>
<select name='id' class="input">
<option value="">----------------------------------------</option>
<?php
foreach ($list as $id => $text) {
echo " <option value='$id'>$text</option>\n";
}
?>
</select><br/>
<br/>
<input type="submit" value="Report selected link" class="input" />
<input type="submit" name='cancel' value="Cancel" class="input" />
</p>
</div></form>
<?php
}
function displayReportConfirm($link) {
?>
<h1>Report a broken link</h1>
<form method='get' action='?'><div>
<input type="hidden" name="rbl" value="1" />
<input type="hidden" name="id" value="<?=$link['id']?>" />
<p>
You are about to report the following link as being broken:<br/>
<br/>
<b>Link name:</b> <?=$link['long_title']?><br/>
<b>URL:</b> <a href="<?=$link['url']?>"><?=utf8entities($link['url'])?></a><br/>
<br/>
<b>WARNING:</b> users who repeatedly report links as broken for no good reason will be banned from the game. If you make a mistake, please send an in-game private message to TSeeker or send an e-mail to <a href='mailto:staff@legacyworlds.com'>the staff</a>.<br/>
<br/>
<input type="submit" name="confirm" value="Confirm report" class="input" />
<input type="submit" name='cancel' value="Cancel" class="input" />
</p>
</div></form>
<?php
}
function displayReportDone($link) {
?>
<h1>Link reported</h1>
<p>
Your report stating that the <b><?=$link['long_title']?></b> link is broken has been registered.<br/>
The link will be removed after the staff verifies your report.<br/>
<br/>
<a href='?'>Back to the list</a>
</p>
<?php
}
function displaySubmitForm($data) {
?>
<h1>Submit a new link</h1>
<form method="post" action="?"><div>
<input type="hidden" name="sl" value="2" />
<p>
Please fill in the form below to submit a new website to be added to the links page.<br/>
<br/>
<b>NOTE:</b> the links will be reviewed by the staff before they appear anywhere on the links page. Users who repeatedly submit unrelated websites (and especially commercial, pornographic or illegal sites) will be banned from the game.
</p>
<table style="margin:0px 0px 10px 30px;width:80%;min-width:200px;max-width:800px;border-style:none">
<tr>
<th style="width:30%;max-width:150px;text-align:left">Link title:</th>
<td><input type="text" name="title" style="width:100%" value="<?=utf8entities($data['title'])?>" class="input"/></td>
</tr>
<?php
if ($data['err'] == 1 || $data['err'] == 2) {
echo "<tr><td>&nbsp;</td><td style='color:red;font-weight:bold'>This title is too ";
echo ($data['err'] == 1 ? "short" : "long");
echo "</td></tr>\n";
}
?>
<tr>
<th style="width:30%;max-width:150px;text-align:left">URL:</th>
<td><input type="text" name="url" style="width:100%" value="<?=utf8entities($data['url'])?>" class="input"/></td>
</tr>
<?php
if ($data['err'] == 4) {
echo "<tr><td>&nbsp;</td><td style='color:red;font-weight:bold'>This URL is invalid.</td></tr>\n";
} elseif ($data['err'] == 5) {
echo "<tr><td>&nbsp;</td><td style='color:red;font-weight:bold'>This server does not exist.</td></tr>\n";
} elseif ($data['err'] == 6) {
echo "<tr><td>&nbsp;</td><td style='color:red;font-weight:bold'>You have already submitted this URL.</td></tr>\n";
}
?>
<tr>
<td style="width:30%;max-width:150px;vertical-align:top">Description <i>(optional)</i>:</td>
<td><textarea class="input" name="desc" cols="auto" rows="5" style="width:100%"><?=utf8entities($data['desc'])?></textarea></td>
</tr>
<?php
if ($data['err'] == 3) {
echo "<tr><td>&nbsp;</td><td style='color:red;font-weight:bold'>Please type in a longer description.</td></tr>\n";
}
?>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" name="confirm" value="Submit this link" class="input" />
<input type="submit" name='cancel' value="Cancel" class="input" />
</td>
</tr>
</table>
</div></form>
<?php
}
function displaySubmitDone($link) {
?>
<h1>Link submitted</h1>
<p>
The link to <b><?=utf8entities($link)?></b> has been submitted.<br/>
It will be added after the staff verifies it.<br/>
<br/>
<a href='?'>Back to the list</a>
</p>
<?php
}
include("menu.en.inc");
$this->title = "Links";
$this->startContents();
switch($args['mode']) :
case 1: displayReportList($args['data']); break;
case 2: displayReportConfirm($args['data']); break;
case 3: displayReportDone($args['data']); break;
case 4: displaySubmitForm($args['data']); break;
case 5: displaySubmitDone($args['data']); break;
default: displayLinks($args['data']); break;
endswitch;
$this->endContents();
?>

View file

@ -0,0 +1,20 @@
<?php
include("menu.en.inc");
$this->addStylesheet('text');
$this->startContents();
$this->title = "Please log in";
if ($args['error']) {
?>
<h1>Invalid credentials</h1>
<p>The username or password you entered are invalid.</p>
<p>Please try typing them again.</p>
<?php
} else {
?>
<h1>Please log in</h1>
<p>The page you are trying to view requires you to be a registered LegacyWorlds player.</p>
<p>Please type in your username and password into the login form at the top right corner of this page.</p>
<?php
}
$this->endContents();
?>

View file

@ -0,0 +1,20 @@
<?
include("menu.en.inc");
$this->addStylesheet('text');
$this->title = "Logged out";
$this->startContents();
?>
<h1>Logged out</h1>
<p>
You are now logged out of Legacy Worlds.
</p>
<p>
Thanks for playing!
</p>
<p>
In the meantime, feel free to visit our <a href="<?=makeLink('about')?>#other">other games.</a>
</p>
<p>
See you soon!
</p>
<? $this->endContents(); ?>

View file

@ -0,0 +1,114 @@
<?
include("menu.en.inc");
$this->title = "Password recovery";
$this->startContents();
?>
<?php
if ($args === false || is_array($args) && $args['error'] < 2) {
if ($args === false) {
$args = array();
}
?>
<form action="?" method="post"><div>
<h1>Forgot your password?</h1>
<p>
This page allows you to have the server change your password to a new, random password. In order to do that, you will first have to enter your username as well as the email address you used when you created your account. You will then receive a confirmation code.
</p>
<p>&nbsp;</p>
<table style="width:100%">
<tr>
<th style="width:20%;max-width:250px;text-align:left">Username:</th>
<td><input type="text" name="u" value="<?=preg_replace('/"/', '&quot;', $args['name'])?>" size="17" maxlength="16" class="input" /></td>
</tr>
<tr>
<th style="text-align:left">E-mail address:</th>
<td><input type="text" name="m" value="<?=preg_replace('/"/', '&quot;', $args['mail'])?>" style="width:80%" class="input" /></td>
</tr>
<?php
if ($args['error'] == 1) {
?>
<tr><td>&nbsp;</td><td><b>Invalid or unknown username or mail address.</b></td></tr>
<?php
sleep(2);
}
?>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Send me the confirmation code" class="input" /></td>
</tr>
</table>
</div></form>
<?
} elseif ($args === true) {
?>
<h1>Your password has been changed!</h1>
<p>
You will receive an email containing your new password in a few minutes.<br/>
Thank you!
</p>
<?php
} elseif ($args['error'] == 2) {
?>
<h1>Unable to send the confirmation mail</h1>
<p>
The server was unable to send the email containing the confirmation code.<br/>
It's possible the server is too loaded at the moment; please try again later.<br/>
Sorry for the inconvenience.
</p>
<?php
} elseif ($args['error'] == 4 || $args['error'] == 3) {
?>
<h1>Confirmation of the request</h1>
<p>
An email has been sent to the address associated with your account; it contains a confirmation code.<br/>
Please copy this confirmation code in the box below in order to confirm that you want your password to be reset to a random value which will be mailed to you.
</p>
<p>&nbsp;</p>
<form action="?" method="post"><div>
<input type="hidden" name="u" value="<?=preg_replace('/"/', '&quot;', $args['name'])?>" class="input" />
<input type="hidden" name="m" value="<?=preg_replace('/"/', '&quot;', $args['mail'])?>" class="input" />
<table style="width:100%">
<tr>
<th style="width:20%;max-width:250px;text-align:left">Confirmation code:</th>
<td><input type="text" name="c" value="<?=preg_replace('/"/', '&quot;', $args['code'])?>" size="17" maxlength="16" class="input" /></td>
</tr>
<?php
if ($args['error'] == 3) {
?>
<tr><td>&nbsp;</td><td><b>Invalid confirmation code.</b></td></tr>
<?php
sleep(2);
}
?>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Reset my password" class="input" /></td>
</tr>
</table>
</div></form>
<?php
} elseif ($args['error'] == 5) {
?>
<h1>Unable to send the new password</h1>
<p>
The server was unable to send the email containing the new password; your password was therefore kept unmodified.<br/>
It's possible the server is too loaded at the moment; please try again later.<br/>
Sorry for the inconvenience.
</p>
<?php
} else {
$rVal = "LP" . rand(1000000,9999999);
l::error("main/lostpass: error $rVal ($args)");
?>
<h1>Something unexpected happened ...</h1>
<p>
Apparently, this script smoked too much Space Weed and just had a fleeting moment of randomness. Of course, what we mean is the this is a bug. Please contact the Legacy Worlds <a href="mailto:staff@legacyworlds.com">staff</a> regarding this error and give them the following value: <?=$rv?>.
</p>
<?php
}
?>
<? $this->endContents(); ?>

View file

@ -0,0 +1,71 @@
<?
$game = config::getDefaultGame();
$man = $game->getLib('main/manual');
// We're in the manual, display manual controls
$manual = $man->call('getStructure', 'en');
$txt = array('Top', 'Up', 'Previous', 'Next');
if (!is_null(handler::$h->page)) {
$pid = handler::$h->page['id'];
$navLinks = $man->call('getNavLinks', $pid);
for ($i=0;$i<4;$i++) {
$t = is_null($navLinks[$i]) ? "" : "<a href='?p={$navLinks[$i]}'>";
$t .= $txt[$i] . (is_null($navLinks[$i]) ? "" : "</a>");
$navLinks[$i] = $t;
}
} else {
$pid = null;
$navLinks = $txt;
}
ob_start();
?>
<div id="msidebox-top">
<ul id="msb-nav">
<li id="msb-top"><?= $navLinks[0] ?></li>
<li id="msb-left"><?= $navLinks[2] ?></li>
<li id="msb-up"><?= $navLinks[1] ?></li>
<li id="msb-right"><?= $navLinks[3] ?></li>
</ul>
<form action="?" method="post" id="msb-form">
<div>
<input type="text" name="ss" value="<?= preg_replace('/"/', '&quot;', handler::$h->searchText) ?>" class="input" id="msb-stext" />
<input type="submit" value="Search" class="input" id="msb-sbutton" />
</div>
</form>
<span id="msb-title">Contents</span>
</div>
<div id="msb-links">
<?
function dumpManualStructure(&$sections, $depth) {
$br = false;
foreach ($sections as $id => $sd) {
if ($br) {
echo "<br/>";
} else {
$br = true;
}
if ($depth > 0) {
echo str_repeat('&nbsp;', $depth * 2);
}
echo " <a href='?p={$sd['name']}'>" . utf8entities($sd['title']) . "</a>";
if (count($sd['subs'])) {
echo "<br/>";
dumpManualStructure($sd['subs'], $depth + 1);
}
}
}
dumpManualStructure($manual, 0);
?>
</div>
<?
$sbContents = ob_get_contents();
ob_end_clean();
include("side-box.en.inc");
?>

View file

@ -0,0 +1,135 @@
<?php
function drawContents (&$list) {
$kl = array_keys($list);
foreach ($kl as $k) {
echo "<li><a href='#ac-{$list[$k]['name']}'>{$list[$k]['title']}</a>";
if (count($list[$k]['subsections'])) {
echo "<ul>";
drawContents($list[$k]['subsections']);
echo "</ul>";
}
echo "</li>";
}
}
function displayLinks($text) {
$l = explode('<mlink ', $text);
$nText = array_shift($l);
while (count($l)) {
$t = preg_replace('/^\s*to=[\'"]/', '', array_shift($l));
$toName = preg_replace('/^([A-Za-z0-9_\-]+)[\'"]>(.*\n)*.*/', '\1', $t);
$toName = preg_replace('/\s/', '', $toName);
$t = preg_replace('/^[A-Za-z0-9_\-]+[\'"]>/', '', $t);
$secId = handler::$h->lib->call('getSectionId', handler::$h->lang, $toName);
$link = "";
if (!is_null($secId)) {
$pageId = handler::$h->lib->call('getPageId', $secId);
if (!is_null($pageId)) {
$lt = handler::$h->lib->call('readSectionRecord', $secId);
if ($pageId == handler::$h->page['id']) {
$link = "<a href='#ac-{$lt['name']}'>";
} else {
$pg = handler::$h->lib->call('readSectionRecord', $pageId);
$link = "<a href='?c=0&amp;p={$pg['name']}#ac-{$lt['name']}'>";
}
}
}
$nText .= $link . preg_replace('/^(.*)<\/mlink>(.*\n)*.*/', '\1', $t) . ($link != '' ? "</a>" : "")
. preg_replace('/^.*<\/mlink>/', '', $t);
}
return $nText;
}
function drawTitle(&$section, $depth) {
$pgLink = "";
if ($section['linkto'] != "") {
$pageId = handler::$h->lib->call('getPageId', $section['linkto']);
if (!is_null($pageId)) {
$lt = handler::$h->lib->call('readSectionRecord', $section['linkto']);
if ($pageId == handler::$h->page['id']) {
$pgLink = "<a class='mlink' href='#ac-{$lt['name']}'>";
} else {
$pg = handler::$h->lib->call('readSectionRecord', $pageId);
$pgLink = "<a class='mlink' href='?c=0&amp;p={$pg['name']}#ac-{$lt['name']}'>";
}
}
}
$mDepth = ($depth - 2) * 10;
$tMargin = ($pgLink == "") ? "5px $mDepth 15px 0px" : "5px $mDepth 5px 0px";
?>
<? if ($depth == 2) : ?>
<a class="toplnk" href='#ac-<?= handler::$h->page['name'] ?>'>Top</a>
<? endif; ?>
<h<?= $depth ?> id='ac-<?= $section['name'] ?>'><?= $section['title'] ?></h<?= $depth ?>>
<? if ($pgLink != "") : ?>
<?= $pgLink ?>-&gt; Main article</a>
<? endif;
}
function drawSections (&$list, $depth = 2) {
$kl = array_keys($list);
foreach ($kl as $k) {
/*
if ($depth == 2) {
echo "<hr style='margin: 30px 0px 0px 0px'/>";
}
*/
?>
<? if ($depth == 2) : ?>
<div class="mtopsec">
<? else : ?>
<div class="msec">
<? endif; ?>
<? drawTitle($list[$k], $depth);
if (trim($list[$k]['contents']) != '') {
echo "<div class='mancontents'>" . displayLinks($list[$k]['contents']) . "</div>";
}
if (count($list[$k]['subsections'])) {
drawSections($list[$k]['subsections'], $depth + 1);
}
?>
</div>
<?
}
}
include("manual-box.en.inc");
$this->title = "Manual";
$this->addStylesheet("manual");
$this->addScript("manual");
if (is_null(handler::$h->page)) {
include('manual_notfound.en.inc');
} else {
?>
<div id="manpage">
<h1 id="ac-<?=handler::$h->page['name']?>"><?=handler::$h->page['title']?></h1>
<? if (count(handler::$h->page['subsections'])) : ?>
<div id='clist'>
<div id='chead'>
<b>Page contents</b>
[ <span id='hidecontents'>Hide</span><span id='showcontents'>Show</span> ]
</div>
<div id='pcontents'>
<ul>
<? drawContents(handler::$h->page['subsections']); ?>
</ul>
</div>
</div>
<? drawSections(handler::$h->page['subsections']); ?>
<? endif; ?>
</div>
<?
}
$this->endContents();
?>

View file

@ -0,0 +1,5 @@
<h1>Page not found!</h1>
<p>
The page you were looking for could not be found in the manual. Maybe the manual
has been updated in the meantime.
</p>

View file

@ -0,0 +1,35 @@
<?php
include("manual-box.en.inc");
$this->title = "Manual";
$this->addStylesheet("manual");
$this->addScript("manual");
?>
<div id="manpage">
<h2>Search results for '<?=utf8entities($args['text'])?>'</h2>
<?php
if (empty($args['results'])) {
echo " <p>Sorry, no results were found.</p>\n";
} else {
$c = count($args['results']);
echo " <p><b>$c</b> result" . ($c > 1 ? "s were" : " was") . " found:</p>";
echo "<div class='mansection'><ol>";
$error = false;
foreach ($args['results'] as $p) {
$pData = handler::$h->lib->call('readSectionRecord', $p);
if (is_null($pData)) {
$error = true;
continue;
}
echo "<li><a href='?p={$pData['name']}'>{$pData['title']}</a></li>";
}
echo "</ol>";
if ($error) {
echo "<b>Some results could not be displayed because of a database error.</b>";
}
echo "</div>";
}
?>
</div>
</div>

View file

@ -0,0 +1,12 @@
<? if ($_SESSION['authok']) : ?>
<a class="mbutton" id="b0" href="<?= makeLink('index', 'main') ?>" title="Manage your account">My account</a>
<a class="mbutton" id="b1" href="<?= makeLink('contrib', 'main') ?>" title="Contributions">Contributions</a>
<? else : ?>
<a class="mbutton" id="b0" href="<?= makeLink('create', 'main') ?>" title="Register">Create an account</a>
<a class="mbutton" id="b1" href="<?= makeLink('about', 'main') ?>" title="About">About this game</a>
<? endif; ?>
<a class="mbutton" id="b2" href="<?= makeLink('screenshots', 'main') ?>" title="Screenshots">Screenshots</a>
<a class="mbutton" id="b3" href="<?= makeLink('manual', 'main') ?>" title="Manual">Manual</a>
<a class="mbutton" id="b4" href="<?= makeLink('rankings', 'main') ?>" title="Rankings">Rankings</a>
<a class="mbutton" id="b5" href="<?= makeLink('links', 'main') ?>" title="Links">Links</a>
<a class="mbutton" id="b6" href="<?= makeLink('credits', 'main') ?>" title="Credits">Credits</a>

View file

@ -0,0 +1,14 @@
<?
include("menu.en.inc");
$this->title = "Page not found";
$this->addStylesheet('text');
$this->startContents();
?>
<h1>Page not found</h1>
<p>
The page you requested could not be found on this server.
</p>
<p>
Sorry :-\
</p>
<? $this->endContents(); ?>

View file

@ -0,0 +1,14 @@
<?
include("menu.en.inc");
$this->title = "Registration required";
$this->addStylesheet('text');
$this->startContents();
?>
<h1><?=$args['name']?></h1>
<p>
You are not registered to this game.
</p>
<p>
Before you can access the game, you have to <a href='<?=makeLink('play', 'main')?>?g=<?=$args['id']?>'>register</a>.
</p>
<? $this->endContents(); ?>

View file

@ -0,0 +1 @@
<?=$args?>

View file

@ -0,0 +1,120 @@
<?
include("menu.en.inc");
$this->title = "Registration";
$this->startContents();
?>
<?php
function redirect($game) {
$rTo = makeLink('play', $game);
?>
<h1>Please wait ...</h1>
<p>
You should be redirected to the game's main page shortly.<br/>
If nothing happens after 10 seconds, please click <a href='<?=$rTo?>'>here</a>.</p>
<script language='javascript'>
setTimeout("window.location='<?=$rTo?>'", 100);
</script>
<?php
}
function displayError($error) {
switch ($error) :
case 0:
$title = "Game not found";
$descr = "The game you requested to join could not be found in the database. It may have been removed in the meantime.";
break;
case 1:
$title = "You already registered to this game";
$descr = "It is likely you already registered to this game using a different browser window or a different browser tab. Please go back to "
. "your <a href='" . makeLink('index', 'main') . "'>account page</a> and enter the game from there.";
break;
case 2:
$title = "Registration failed :-(";
$descr = "An internal error prevented you from joining the game.<br/>Please contact the <a href='mailto:staff@legacyworlds.com'>staff</a> "
. "so that we can help you with it.";
break;
default:
$title = "Unknown error";
$descr = "An unknown error has occured.<br/>Please contact the <a href='mailto:staff@legacyworlds.com'>staff</a>.";
break;
endswitch;
echo "<h1>$title</h1>\n<p>$descr</p>";
}
function displayForm($args) {
?>
<form method='post' action='?'><div>
<input type='hidden' name='g' value='<?=$args['game']?>' />
<h1>You are about to join <?=$args['gName']?></h1>
<p><?=utf8entities($args['desc'])?></p>
<table style="margin:0px 0px 0px 15px;width:80%">
<?php
if ($args['planetError']) {
echo "<tr><td colspan='2' class='center'>";
switch ($args['planetError']) :
case 1: echo "This planet name is too long (maximum 15 characters)"; break;
case 2: echo "This planet name is incorrect (letters, numbers, spaces and _.@-+'/ only)"; break;
case 3: echo "Multiple spaces are not allowed"; break;
case 4: echo "This planet name is too short (minimum 2 characters)"; break;
case 5: echo "Planet names must contain at least a letter"; break;
case 6: echo "A planet by that name already exists."; break;
case 7: echo "Spaces are not allowed at the beginning or at the end of the planet's name"; break;
endswitch;
echo ".</td></tr>";
}
?>
<tr>
<th style="width:200px">Name of your first planet:</th>
<td><input type='text' name='p' value="<?=utf8entities($args["planet"])?>" size='16' maxlength='15' class="input" /></td>
</tr>
<?php
if ($args['returning']) {
if ($args['playerError']) {
echo "<tr><td colspan='2' class='center'>";
switch ($args['playerError']) :
case 1: echo "This player name is too long (maximum 15 characters)"; break;
case 2: echo "This player name is incorrect (letters, numbers, spaces and _.@-+'/ only)"; break;
case 3: echo "Spaces are not allowed at the beginning or at the end of the player name"; break;
case 4: echo "Multiple spaces are not allowed"; break;
case 5: echo "This player name is too short (minimum 2 characters)"; break;
case 6: echo "A player by that name already exists."; break;
endswitch;
echo ".</td></tr>";
}
?>
<tr>
<th>Choose a player name:</th>
<td><input type='text' name='n' value="<?=utf8entities($args['player'])?>" size='16' maxlength='15' class="input" /></td>
</tr>
<?php
}
?>
<tr><td colspan='2'>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td><input type='submit' name='c' value='Play this game' class="input" /></td></tr>
</table>
</div></form>
<?php
}
if (is_null($args['registered'])) {
if (is_null($args['error'])) {
displayForm($args);
} else {
$this->addStylesheet('text');
displayError($args['error']);
}
} else {
$this->addStylesheet('text');
redirect($args['registered']);
}
?>
<? $this->endContents(); ?>

View file

@ -0,0 +1 @@
Paypal IPN page

View file

@ -0,0 +1,60 @@
<?
include("menu.en.inc");
$this->addStylesheet("account");
$this->title = "Close account";
$this->startContents();
?>
<div id="tabs">&nbsp;</div>
<div class="acctab" id="quit">
<h1>You are about to close your account</h1>
<form action="?#acc-quit" method="post"><div>
<input type="hidden" name="rqc" value="1" />
<p id="header">
If you go ahead with this action, a countdown ranging from 24h to 48h will be set on your account, and it will be
closed at the end of the countdown.<br/>
An email will be sent to confirm the account's deletion at this moment.<br/>
When your account is closed, you will automatically be removed from all of the games you are playing; you will
lose your rankings as well.<br/>
The account itself will however not be deleted, and you can choose to open it again at any time.
</p>
<p>
In order to close your account, you must provide the following details to make sure it really is you:
</p>
<table style="margin:0px 0px 0px 20px;width:80%">
<tr>
<th style="width:20%;text-align:left">Password:</th>
<td><input type="password" name="q_pass" value="" size="30" class="input" /></td>
</tr>
<?php
if ($args['ePass']) {
?>
<tr>
<td>&nbsp;</th>
<td style="color:white;background-color:red">The password you provided is incorrect.</td>
</tr>
<?php
}
?>
</table>
<p>
In addition, you may provide us with a reason why you're quitting the game, as it could allow us to make it better. But that is of course optional.<br/>
</p>
<table style="margin:0px 0px 0px 20px;width:80%">
<tr>
<th style="text-align:left;vertical-align:top;width:20%">Why are you leaving?</th>
<td><textarea name="q_reason" style="width:90%" cols="auto" rows="5" class="input"><?=preg_replace(array('/</','/>/','/&/'), array('&lt;','&gt;','/&amp;/'), $args['reason'])?></textarea></td>
</tr>
</table>
<p>
<input type="submit" value="I really want to close my account" class="input" />
<input type="submit" name="cancel" value="No, wait, I was just kidding" class="input" />
</p>
</div></form>
</div>
<? $this->endContents(); ?>

View file

@ -0,0 +1,48 @@
<?
include("menu.en.inc");
$this->addStylesheet('rankings');
$this->title = "Rankings";
$this->startContents();
?>
<form action="?" method="get">
<div style="text-align:center; margin: 0px 0px 10px 0px">
<select class="input" name="g" onchange="this.form.submit();"><?
foreach ($args['games'] as $v => $t) {
echo " <option value='$v'";
if ($v == $args['cGame'])
echo " selected='selected'";
echo ">" . utf8entities($t) . "&nbsp;&nbsp;&nbsp;</option>\n";
}
?></select> / <select class="input" name="t" onchange="this.form.submit();"><?
foreach ($args['types'] as $t => $d) {
echo " <option value='$t'";
if ($t == $args['cType'])
echo " selected='selected'";
echo ">" . utf8entities($d['name']) . "</option>\n";
}
?></select>
<input class="input" type="submit" value="Display rankings" /></div>
</form>
<div style="text-align: justify; margin: 0px 5px 10px 5px">
<?=utf8entities($args['types'][$args['cType']]['description'])?>
</div>
<table style="width:100%;border-style:none;">
<tr class="chead">
<th style="text-align:center;width: 10%;">Rank</th>
<th style="text-align:left">Name</th>
<th style="text-align:center;width: 20%">Points</th>
</tr>
<?
foreach ($args['rankings'] as $data)
echo " <tr>\n <td style='text-align:center;'><b>#"
. $data['ranking'] . "</b></td>\n <td>" . utf8entities($data['id'])
. "</td>\n <td style='text-align:center;'>"
. number_format($data['points']) . "</td>\n </tr>\n";
?>
</table>
<? $this->endContents(); ?>

View file

@ -0,0 +1,31 @@
<?
include("menu.en.inc");
$this->addStylesheet('text');
$this->title = "Account re-activation";
$this->startContents();
?>
<form action='?' method='post'><div>
<h1>Welcome back!</h1>
<p>
Since you had left the game, you will need to confirm that you want to
re-activate this account.
</p>
<p>
Your email address is <b><?=$args['email']?></b>; a confirmation code
will be sent to that address after you click the button below.
</p>
<p>
Once you have received the email containing the confirmation code, you
will need to log in again and type in the code.
</p>
<p>
<input type='submit' name="ac_restart" value='Re-enable my account' class="input" />
</p>
<p>
<u>Note:</u> if your email address has changed and you still want to
keep this account, please send an email to the
<a href="mailto:staff@legacyworlds.com">staff</a>; you must indicate your
user name and password in the email.
</p>
</div></form>
<? $this->endContents(); ?>

View file

@ -0,0 +1,67 @@
<?php
include("menu.en.inc");
$this->title = "Screenshots";
$this->addStylesheet("screenshots");
$this->startContents();
if (is_null($__category)) {
?>
<div class="category" style="top: 0px">
<div class="catname">Screenshots</div>
<div class="catpics">Select a category</div>
</div>
<?php
$y = 120;
foreach ($__list as $id => $data) {
?>
<div class="category" style="top:<?= $y ?>px">
<div class="catname">
<a href="<?= makeLink('screenshots', 'main') ?>?c=<?= $id ?>"><?= utf8entities($data['title']) ?></a>
</div>
<div class="catpics">
<?= count($data['pics']) ?> pictures
</div>
</div>
<?
$y += 75;
}
} elseif (is_null($__picture)) {
$category = $__list[$__category];
?>
<div class="category" style="top: 0px">
<div class="catname">Screenshots - <?= utf8entities($category['title']) ?></div>
<div class="catpics"><a href="<?= makeLink('screenshots', 'main') ?>">Back</a></div>
</div>
<?
$y = 70;
$x = 0;
foreach ($category['pics'] as $id => $title) {
?>
<div class="thumbnail" style="top: <?= $y ?>px; left: <?= $x * 33 ?>%">
<div class="thumbpic"><a href="<?= makeLink('screenshots', 'main') ?>?c=<?= $__category ?>&amp;s=<?= $id ?>"><img src="<?= config::$main['staticurl'] ?>/main/screens/<?= $__category ?>-<?= $id ?>-s.jpg" alt="<?= utf8entities($title) ?>" /></a></div>
<div class="thumbname"><a href="<?= makeLink('screenshots', 'main') ?>?c=<?= $__category ?>&amp;s=<?= $id ?>"><?= utf8entities($title) ?></a></div>
</div>
<?
$x = ($x + 1) % 3;
if ($x == 0) {
$y += 120;
}
}
} else {
$category = $__list[$__category];
$title = $category['pics'][$__picture];
?>
<div class="category" style="top: 0px">
<div class="catname"><?= utf8entities($category['title'] . ' - ' . $title) ?></div>
<div class="catpics"><a href="<?= makeLink('screenshots', 'main') ?>?c=<?= $__category ?>">Back</a></div>
</div>
<div class="showpic">
<a href="<?= config::$main['staticurl'] ?>/main/screens/<?= $__category ?>-<?= $__picture ?>.jpg"><img src="<?= config::$main['staticurl'] ?>/main/screens/<?= $__category ?>-<?= $__picture ?>-m.jpg" alt="<?= utf8entities($title) ?>" /></a>
</div>
<?
}
$this->endContents();
?>

View file

@ -0,0 +1,136 @@
<?
include("menu.en.inc");
$this->title = "Preferences";
$this->startContents();
?>
<?php
function makeOpt($a,$n,$v)
{
$t = "<option value='$v'";
if ($a[$n] == $v)
$t .= " selected='selected'";
$t .= ">";
return $t;
}
?>
<form method='post' action='?'><div>
<h3 style="text-align: center"><?=$_SESSION['login']?>'s general preferences</h3>
<p>&nbsp;</p>
<table style="width: 100%">
<?php
if (!is_null($args['err1']))
echo "<tr><td colspan='4' style='text-align:center'>The address you entered is invalid, please correct it.</td></tr>\n";
?>
<tr>
<td>E-mail address:</td>
<td><input type='text' name='mail' value="<?=is_null($args['err1'])?$args['mail']:$args['err1']?>" class="input"/></td>
<td>Language:</td>
<td><select name='lang' class="input">
<?=makeOpt($args,'lang','en')?>English</option>
</select></td>
</tr>
<tr>
<td>Colour scheme:</td>
<td><select name='col' class="input">
<?=makeOpt($args,'col','red')?>red</option>
<?=makeOpt($args,'col','green')?>green</option>
<?=makeOpt($args,'col','blue')?>blue</option>
<?=makeOpt($args,'col','grey')?>grey</option>
<?=makeOpt($args,'col','purple')?>purple</option>
<?=makeOpt($args,'col','yellow')?>yellow</option>
</select></td>
<td>Font size:</td>
<td><select name='fs' class="input">
<?=makeOpt($args,'fs',0)?>tiny</option>
<?=makeOpt($args,'fs',1)?>small</option>
<?=makeOpt($args,'fs',2)?>normal</option>
<?=makeOpt($args,'fs',3)?>big</option>
<?=makeOpt($args,'fs',4)?>huge</option>
</select></td>
</tr>
<tr><td colspan='4'>&nbsp;</td></tr>
<tr><th colspan='4'>Forums</th></tr>
<tr><td colspan='4'>
<tr>
<td>Topics/page:</td>
<td><select name='tpp' class="input"><?php
for ($i=1;$i<6;$i++)
echo "<option" . ($i*10==$args['tpp']?" selected='selected'":"") . ">" . ($i*10) . "</option>";
?></td>
<td>Messages/page:</td>
<td><select name='mpp' class="input"><?php
for ($i=1;$i<6;$i++)
echo "<option" . ($i*10==$args['mpp']?" selected='selected'":"") . ">" . ($i*10) . "</option>";
?></td>
</tr>
<tr>
<td>Graphical smileys:</td>
<td><select name='gsm' class="input">
<option value='0'>Disabled</option>
<option value='1'<?=$args['gsm']?" selected='selected'":""?>>Enabled</option>
</td>
<td>Forum tags:</td>
<td><select name='gft' class="input">
<option value='0'>Disabled</option>
<option value='1'<?=$args['gft']?" selected='selected'":""?>>Enabled</option>
</td>
</tr>
<tr>
<td>Display mode:</td>
<td><select name='fdm' class="input">
<option value='0'>Linear</option>
<option value='1'<?=$args['fdm']?" selected='selected'":""?>>Threaded</option>
</td>
<td>Messages order:</td>
<td><select name='fmo' class="input">
<option value='0'>Oldest first</option>
<option value='1'<?=$args['fmo']?" selected='selected'":""?>>Newest first</option>
</td>
</tr>
<tr>
<td>Signature:</td>
<td colspan='3'><textarea name='fsig' cols='60' class="input" rows="2"><?=utf8entities($args['fsig'])?></textarea></td>
</tr>
<tr><td colspan='4'>&nbsp;</td></tr>
<tr><th colspan='4'>Password modification</th></tr>
<tr><td colspan='4'>
Please leave theses fields empty if you do not intend to change your password.
</td></tr>
<?php
if (!is_null($args['err2']))
{
echo "<tr><td colspan='4'><center>";
switch ($args['err2']) :
case 1: echo "A database access error has occured"; break;
case 2: echo "The current password is incorrect"; break;
case 3: echo "The new password and its confirmation are different"; break;
case 4: echo "The new password is too short (minimum 4 characters)"; break;
case 5: echo "The new password is too long (maximum 64 characters)"; break;
case 6: echo "The new password must be different from your user name"; break;
endswitch;
echo ".</center></td></tr>\n";
}
?>
<tr><td colspan='4'>&nbsp;</td></tr>
<tr>
<td colspan='2'>Current password:</td>
<td colspan='2'><input type='password' name='opass' class="input" /></td>
</tr>
<tr>
<td colspan='2'>New password:</td>
<td colspan='2'><input type='password' name='npass' class="input" /></td>
</tr>
<tr>
<td colspan='2'>Confirm new password:</td>
<td colspan='2'><input type='password' name='cpass' class="input" /></td>
</tr>
<tr><td colspan='4'>&nbsp;</td></tr>
<tr><td colspan='4' style="text-align:center"><input type='submit' value='Update my preferences' class="input" /></td></tr>
</table>
</div></form>
<? $this->endContents(); ?>

View file

@ -0,0 +1,21 @@
<?
$this->addStylesheet("sidebox");
$this->addScript("sidebox");
?>
<div id="sbox">
<ul id="slbox">
<li class="slcol" id="slleft">
<span>Manual</span>
<div id="slcontent">
<?= $sbContents ?>
</div>
</li>
<li class="slcol" id="slright">
<span>Menu</span>
<div>
<? include("menu.en.inc"); ?>
</div>
</li>
</ul>
</div>
<div id="cframe">

View file

@ -0,0 +1,22 @@
<?
include("menu.en.inc");
$this->title = "Cancel vacation mode";
$this->addStylesheet("account");
$this->startContents();
?>
<div id="tabs">&nbsp;</div>
<div class="acctab">
<h1>You are about to cancel your request for vacation mode</h1>
<p>
Your account will no longer enter vacation mode at the indicated time and re-entering vacation mode after that will take another 24 to 30 hours.
</p>
<p>
Are you sure you want to do that?
</p>
<form method="post" action="?#acc-vacation"><div>
<input type="hidden" name="cvmsc" value="1" />
<input type="submit" value="Yes, cancel vacation countdown" class="input" />
<input type="submit" name="cancel" value="No, continue with the countdown" class="input" />
</div></form>
</div>
<? $this->endContents(); ?>

View file

@ -0,0 +1,23 @@
<?
include("menu.en.inc");
$this->title = "Leave vacation mode";
$this->addStylesheet("account");
$this->startContents();
?>
<div id="tabs">&nbsp;</div>
<div class="acctab">
<h1>You are about to leave vacation mode</h1>
<p>
You will be able to play the game again.<br/>
However, you will not be able to enter vacation mode for the next seven days.
</p>
<p>
Are you sure you want to do that?
</p>
<form method="post" action="?#acc-vacation"><div>
<input type="hidden" name="evmc" value="1" />
<input type="submit" value="Yes, exit vacation mode" class="input" />
<input type="submit" name="cancel" value="No, stay in vacation mode" class="input" />
</div></form>
</div>
<? $this->endContents(); ?>

View file

@ -0,0 +1,28 @@
<?
include("menu.en.inc");
$this->title = "Enter vacation mode";
$this->addStylesheet("account");
$this->startContents();
?>
<div id="tabs">&nbsp;</div>
<div class="acctab">
<h1>You are about to enter vacation mode</h1>
<p>
For the first 30h or so, the account will still be accessible normally and vacation mode rules will not apply in the games you are playing.
</p>
<p>
After this delay, vacation mode will be enabled. You will no longer be able to play the games or register to new games, but you will still be
able to access your private messages and the games' forums.
</p>
<p>
Vacation mode will end either when you decide to exit vacation mode, or when you run out of vacation credits; whichever comes first.
<p>
Are you sure you want to do that?
</p>
<form method="post" action="?#acc-vacation"><div>
<input type="hidden" name="svmc" value="1" />
<input type="submit" value="Yes, start the countdown" class="input" />
<input type="submit" name="cancel" value="No, don't activate vacation mode" class="input" />
</div></form>
</div>
<? $this->endContents(); ?>