Remaining user pages have been updated to new renderer

This commit is contained in:
Sky Johnson 2024-12-14 13:39:22 -06:00
parent 10fa8e423a
commit 240f121298
9 changed files with 42 additions and 102 deletions

View File

@ -114,7 +114,7 @@ function dotown()
HTML;
}
return parsetemplate(gettemplate("towns"), $townrow);
return render('towns', ['town' => $townrow]);
}
/**

View File

@ -200,7 +200,7 @@ function fight()
}
// Finalize page and display it
display(parsetemplate(gettemplate("fight"), $pagearray), "Fighting");
display(render('fight', ['page' => $pagearray]), "Fighting");
}
function victory()

View File

@ -127,8 +127,7 @@ function verify()
display("Your account was verified successfully.<br><br>You may now continue to the <a href=\"/login\">Login Page</a> and start playing the game.<br><br>Thanks for playing!","Verify Email",false,false,false);
}
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
display(gettemplate("verify"), "Verify Email", false, false, false);
display(render('verify'), "Verify Email", true, false, false);
}
function lostpassword()
@ -150,7 +149,7 @@ function lostpassword()
}
}
display(gettemplate("lostpassword"), "Lost Password", true, false, false);
display(render('lostpassword'), "Lost Password", true, false, false);
}
function changepassword()
@ -183,8 +182,7 @@ function changepassword()
display("Your password was changed successfully.<br><br>You have been logged out of the game to avoid errors.<br><br>Please <a href=\"/login\">log back in</a> to continue playing.","Change Password",false,false,false);
}
$topnav = "<a href=\"/login\"><img src=\"/img/button_login.gif\" alt=\"Log In\" border=\"0\" /></a><a href=\"users.php?do=register\"><img src=\"/img/button_register.gif\" alt=\"Register\" border=\"0\" /></a><a href=\"/help\"><img src=\"/img/button_help.gif\" alt=\"Help\" border=\"0\" /></a>";
display(gettemplate("changepassword"), "Change Password", false, false, false);
display(render('changepassword'), "Change Password", true, false, false);
}
function sendpassemail($emailaddress, $password)

View File

@ -1,14 +1,10 @@
<?php
$template = <<<THEVERYENDOFYOU
<form action="users.php?do=changepassword" method="post">
<table width="100%">
<tr><td colspan="2">Use the form below to change your password. All fields are required. New passwords must be 10 alphanumeric characters or less.</td></tr>
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
<tr><td>Old Password:</td><td><input type="password" name="password" /></td></tr>
<tr><td>New Password:</td><td><input type="password" name="new_password" /></td></tr>
<tr><td>Verify New Password:</td><td><input type="password" name="new_password2" /><br><br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
</table>
<form action="/changepassword" method="post">
<table width="100%">
<tr><td colspan="2">Use the form below to change your password. All fields are required. New passwords must be 10 alphanumeric characters or less.</td></tr>
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
<tr><td>Old Password:</td><td><input type="password" name="password" /></td></tr>
<tr><td>New Password:</td><td><input type="password" name="new_password" /></td></tr>
<tr><td>Verify New Password:</td><td><input type="password" name="new_password2" /><br><br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
</table>
</form>
THEVERYENDOFYOU;
?>

View File

@ -1,14 +1,10 @@
<?php
$template = <<<THEVERYENDOFYOU
<table width="100%">
<tr><td class="title"><img src="/img/title_fighting.gif" alt="Fighting" /></td></tr>
<tr><td>
You are fighting a <b>{{monstername}}</b><br><br>
{{monsterhp}}
{{yourturn}}
{{monsterturn}}
{{command}}
</td></tr>
<tr><td class="title"><img src="/img/title_fighting.gif" alt="Fighting" /></td></tr>
<tr><td>
You are fighting a <b><?= $page['monstername'] ?></b><br><br>
<?= $page['monsterhp'] ?>
<?= $page['yourturn'] ?>
<?= $page['monsterturn'] ?>
<?= $page['command'] ?>
</td></tr>
</table>
THEVERYENDOFYOU;
?>

View File

@ -1,11 +1,7 @@
<?php
$template = <<<THEVERYENDOFYOU
<form action="users.php?do=lostpassword" method="post">
<table width="80%">
<tr><td colspan="2">If you've lost your password, enter your email address below and you will be sent a new one.</td></tr>
<tr><td width="20%">Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
</table>
<form action="/lostpassword" method="post">
<table width="80%">
<tr><td colspan="2">If you've lost your password, enter your email address below and you will be sent a new one.</td></tr>
<tr><td width="20%">Email Address:</td><td><input type="text" name="email"></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
</table>
</form>
THEVERYENDOFYOU;
?>

View File

@ -1,39 +0,0 @@
<?php
$template = <<<HTML
Here is the character profile for <b>{{username}}</b>.<br><br>
When you're finished, you may <a href="/">return to town</a>.<br><br>
<table width="200">
<tr><td class="title"><img src="/img/button_character.gif" alt="Character" title="Character" /></td></tr>
<tr><td>
<b>{{username}}</b><br><br>
Class: {{charclass}}<br><br>
Level: {{level}}<br>
Experience: {{experience}}<br>
Gold: {{gold}}<br>
Hit Points: {{currenthp}} / {{maxhp}}<br>
Magic Points: {{currentmp}} / {{maxmp}}<br>
Travel Points: {{currenttp}} / {{maxtp}}<br><br>
Strength: {{strength}}<br>
Dexterity: {{dexterity}}<br>
Attack Power: {{attackpower}}<br>
Defense Power: {{defensepower}}<br>
</td></tr>
</table><br>
<table width="200">
<tr><td class="title"><img src="/img/button_inventory.gif" alt="Inventory" title="Inventory" /></td></tr>
<tr><td>
<table width="100%">
<tr><td><img src="/img/icon_weapon.gif" alt="Weapon" title="Weapon" /></td><td width="100%">Weapon: {{weaponname}}</td></tr>
<tr><td><img src="/img/icon_armor.gif" alt="Armor" title="Armor" /></td><td width="100%">Armor: {{armorname}}</td></tr>
<tr><td><img src="/img/icon_shield.gif" alt="Shield" title="Shield" /></td><td width="100%">Shield: {{shieldname}}</td></tr>
</table>
Slot 1: {{slot1name}}<br>
Slot 2: {{slot2name}}<br>
Slot 3: {{slot3name}}
</td></tr>
</table><br>
HTML;

View File

@ -1,8 +1,6 @@
<?php
$template = <<<HTML
<div class="town-content">
<div class="options">
<div class="title"><img src="/img/town_{{id}}.gif" alt="Welcome to {{name}}" title="Welcome to {{name}}"></div>
<div class="title"><img src="/img/town_<?= $town['id'] ?>.gif" alt="Welcome to <?= $town['name'] ?>" title="Welcome to <?= $town['name'] ?>"></div>
<b>Town Options:</b><br>
<ul>
<li><a href="/inn">Rest at the Inn</a></li>
@ -12,15 +10,14 @@ $template = <<<HTML
</div>
<div class="news">
{{news}}
<?= $town['news'] ?>
</div>
<div class="whos-online">
{{whosonline}}
<?= $town['whosonline'] ?>
</div>
<div class="babblebox">
{{babblebox}}
<?= $town['babblebox'] ?>
</div>
</div>
HTML;

View File

@ -1,14 +1,10 @@
<?php
$template = <<<HTML
<form action="users.php?do=verify" method="post">
<table width="80%">
<tr><td colspan="2">Thank you for registering a character. Please enter your username, email address, and the verification code
that was emailed to you to unlock your character.</td></tr>
<tr><td width="20%">Username:</td><td><input type="text" name="username" size="30" maxlength="30" /></td></tr>
<tr><td>Email Address:</td><td><input type="text" name="email" size="30" maxlength="100" /></td></tr>
<tr><td>Verification Code:</td><td><input type="text" name="token" /><br><br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit" /> <input type="reset" name="reset" value="Reset" /></td></tr>
</table>
</form>
HTML;
<form action="/verify" method="post">
<table width="80%">
<tr><td colspan="2">Thank you for registering a character. Please enter your username, email address, and the verification code
that was emailed to you to unlock your character.</td></tr>
<tr><td width="20%">Username:</td><td><input type="text" name="username"></td></tr>
<tr><td>Email Address:</td><td><input type="text" name="email"></td></tr>
<tr><td>Verification Code:</td><td><input type="text" name="token"><br><br><br></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"></td></tr>
</table>
</form>