|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/yaleb/examples/ |
Upload File : |
<html>
<head>
<base href="<output name="http_referer">">
<title>Soupermail Vote results</title>
<link rel="stylesheet" type="text/css" href="examples.css">
<script language="javascript">
var v1 = <output name="counter_1" alt="0">;
var v2 = <output name="counter_2" alt="0">;
var v3 = <output name="counter_3" alt="0">;
var total = v1 + v2 + v3;
var v1p = 0;
var v2p = 0;
var v3p = 0;
if (total != 0) {
v1p = Math.floor(v1 / total * 10000) / 100;
v2p = Math.floor(v2 / total * 10000) / 100;
v3p = Math.floor(v3 / total * 10000) / 100;
}
var v1str = "";
var v2str = "";
var v3str = "";
var i = 0;
while (i < v1p) { v1str += "+"; i++; }
i = 0;
while (i < v2p) { v2str += "+"; i++; }
i = 0;
while (i < v3p) { v3str += "+"; i++; }
</script>
</head>
<body bgcolor="white" text="black">
<h1>Vote Results</h1>
<p>This page shows the results of our simple vote. There's some Javascript
in here doing stuff, so it may not work on all browsers, but look at the
source to get an idea of what I'm doing. As an exercise for the adventurous,
why don't you alter this so that when you vote, you get a cookie, that stops
you from voting later on. I reckon it can be done in one config file :)
</p>
<b>I think counters are:</b>
<table border="0" width="80%">
<tr valign="top">
<td width="20%">
<script language="javascript">
<!--
document.write("<nobr>Great (" + v1p + "%)</nobr><br><nobr>OK (" + v2p + "%)</nobr><br><nobr>Bloat (" + v3p + "%)</nobr>");
//-->
</script>
</td>
<td width="80%"><font color="red">
<script language="javascript">
<!--
document.write(v1str + "<br>" + v2str + "<br>" + v3str + "");
//-->
</script>
</font>
</td>
</tr>
</table>
<p>There have been <b><output name="counter_4"></b> votes.</p>
<p>Return <a href="index.htm">to the examples page</a>.</p>
<hr>
<p>The Soupermail configuration file that made this page looks like this:</p>
<table width="90%" border="1">
<tr valign="top">
<td class="egcon">
<pre class="egcon">
<!--#include virtual="vote.con"-->
</pre>
</td>
</tr>
</table>
<p>The template that made this page is
<a href="voteresult.txt">voteresult.txt</a>.</p>
</body>
</html>