$template->param(COINCREATIONTIME => localtime($coininfo[0])."");
if ( $coininfosize == 1 && $requestedaction eq "" ) {
- $template->param(NOTYETFLIPPED => 1);
+ $template->param(STATUS_NOTYETFLIPPED => 1);
}
elsif ( $coininfosize == 1 && $requestedaction eq "flip" ) {
$result = int(rand(2));
$coins_db{$requestedcoinid} = $coins_db{$requestedcoinid} .
"," . time .
"," . $result;
- $template->param(COINSTATUS => "Just flipped");
+ $template->param(STATUS_JUSTFLIPPED => 1);
$template->param(COINRESULT => translateresult($result));
}
elsif ( $coininfosize == 3 ) {
- $template->param(COINSTATUS => "Flipped @ " . localtime($coininfo[1]));
+ $template->param(STATUS_FLIPPED => 1);
+ $template->param(COINFLIPPEDTIME => localtime($coininfo[1])."");
$template->param(COINRESULT => translateresult($coininfo[2]));
}
}
<br>
- <!-- TMPL_IF NAME=NOTYETFLIPPED -->
+ <!-- TMPL_IF NAME=STATUS_NOTYETFLIPPED -->
<pre>
<b>Creation time:</b> <!-- TMPL_VAR NAME=COINCREATIONTIME -->
<b>Status:</b> Not yet flipped <a href=/<!-- TMPL_VAR NAME=REQUESTEDCOINID -->?action=flip><font color=blue>[flip it]</font></a>
</pre>
- <!-- TMPL_ELSE -->
+ <!-- /TMPL_IF -->
+
+ <!-- TMPL_IF NAME=STATUS_JUSTFLIPPED -->
<pre>
<b>Creation time:</b> <!-- TMPL_VAR NAME=COINCREATIONTIME -->
-<b>Status:</b> <!-- TMPL_VAR NAME=COINSTATUS -->
+<b>Status:</b> Just flipped
<b>Result:</b> <!-- TMPL_VAR NAME=COINRESULT -->
</pre>
<!-- /TMPL_IF -->
+ <!-- TMPL_IF NAME=STATUS_FLIPPED -->
+ <pre>
+<b>Creation time:</b> <!-- TMPL_VAR NAME=COINCREATIONTIME -->
+<b>Status:</b> Flipped @ <!-- TMPL_VAR NAME=COINFLIPPEDTIME -->
+<b>Result:</b> <!-- TMPL_VAR NAME=COINRESULT -->
+ </pre>
+ <!-- /TMPL_IF -->
</body>
</html>