-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathcommon.php
119 lines (101 loc) · 5.91 KB
/
common.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
# wizstats - bitcoin pool web statistics - 1StatsQytc7UEZ9sHJ9BGX2csmkj8XZr2
# Copyright (C) 2012 Jason Hughes <wizkid057@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function print_stats_top() {
$localtitleprepend = ""; $localtitleappend = ""; $localheadextras = ""; $localbodytags = "";
if (isset($GLOBALS["titleprepend"])) { $localtitleprepend = $GLOBALS["titleprepend"]; }
if (isset($GLOBALS["titleappend"])) { $localtitleappend = $GLOBALS["titleappend"]; }
if (isset($GLOBALS["headextras"])) { $localheadextras = $GLOBALS["headextras"]; }
if (isset($GLOBALS["bodytags"])) { $localbodytags = $GLOBALS["bodytags"]; }
if (isset($GLOBALS["ldmain"])) { $ldmain = $GLOBALS["ldmain"]; }
include("instant_livedata.php");
$GLOBALS["netdiff"] = $netdiff;
$GLOBALS["phash"] = $phash;
$GLOBALS["sharesperunit"] = $sharesperunit;
$roundduration = format_time($roundduration);
$liveluck = round(($netdiff/$roundshares)*100);
if ($liveluck > 9999) { $liveluck = ">9999%"; }
if (!isset($ldmain)) { $ldmain = ""; }
$rnd = (rand() * rand() + rand());
print("<HTML>
<HEAD>
<TITLE>".$localtitleprepend.$GLOBALS["poolname"]." Pool Statistics".$localtitleappend."</TITLE>
<meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge,chrome=1\">
<!--[if lt IE 9]><script src=\"".$GLOBALS["urlprefix"]."IE9.js\"></script><![endif]-->
<script type=\"text/javascript\" src=\"".$GLOBALS["urlprefix"]."dygraph-combined.js\"></script>
<script type=\"text/javascript\" src=\"".$GLOBALS["urlprefix"]."jquery.js\"></script>
<script type=\"text/javascript\" src=\"".$GLOBALS["urlprefix"]."sortable.js\"></script>
<script type=\"text/javascript\" src=\"".$GLOBALS["urlprefix"]."instantscripts.php/livedata$ldmain.js?rand=$rnd\"></script>
<!--[if IE]><script type=\"text/javascript\" src=\"".$GLOBALS["urlprefix"]."excanvas.js\"></script><![endif]-->
<link rel=\"stylesheet\" type=\"text/css\" href=\"".$GLOBALS["urlprefix"]."stats-style.css\">
".$localheadextras."
</HEAD>
<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\" LINK=\"#0000FF\" VLINK=\"#0000FF\" ALINK=\"#D3643B\" onLoad=\"initShares();\" ".$localbodytags.">
<div id=\"wrapper\">
<div id=\"Eligius-Title\">
<H2><A HREF=\"".$GLOBALS["urlprefix"]."\">".$GLOBALS["poolname"]." Pool Statistics</A></H2><!--[if IE]><BR><![endif]-->
<h4>Donations to help stats development:<BR><B>1Stats</B>Qytc7UEZ9sHJ9BGX2csmkj8XZr2</h4>
</div>
<div id=\"luck\">
<TABLE class=\"lucktable\" width=\"100%\">
<TR>
<TD width=\"30%\" style=\"text-align: left\">Hashrate:</TD><TD width=\"25%\" style=\"text-align: right; border-right:1px dotted #CCCCCC; padding-right: 3px; white-space: nowrap;\" id=\"livehashrate\">$phash</TD>
<TD width=\"25%\" style=\"text-align: left\">Round Time:</TD><TD width=\"20%\" style=\"text-align: right\" id=\"roundtime\">$roundduration</TD>
</TR>
<TR>
<TD width=\"30%\" style=\"text-align: left\">Round Shares:</TD><TD width=\"25%\" style=\"text-align: right; border-right:1px dotted #CCCCCC; padding-right: 3px;\" id=\"sharecounter\">$roundshares</TD>
<TD width=\"25%\" style=\"text-align: left\">Round Luck:</TD><TD width=\"20%\" style=\"text-align: right\" id=\"liveluck\">$liveluck%</TD>
</TR>
</TABLE>
</div>
<br>
<br>
<br>
<br>
<div id=\"line\"></div>
<center>
<ul id=\"menu\">
<li><a href=\"".$GLOBALS["urlprefix"]."\">Home</a></li>
<li><a href=\"".$GLOBALS["urlprefix"]."mystats.php\">My ".$GLOBALS["poolname"]."</a></li>
<li><a href=\"".$GLOBALS["urlprefix"]."blocks.php\">Blocks</a></li>
<li><a href=\"".$GLOBALS["urlprefix"]."topcontributors.php\">Contributors</a></li>
<li><a target=\"_blank\" href=\"https://github.com/wizkid057/wizstats\">GitHub</a></li>
<li><a href=\"/\">".$GLOBALS["poolname"]." Homepage</a></li>
</ul>
</center>
<br>
<br>
<br>
<!--[if IE]><H4>This page works best in <A HREF=\"http://www.google.com/chrome\">Google Chrome</A>. You will not have an optimal experience using Internet Explorer.</H4><![endif]-->
");
if (apc_fetch('cppsrb_ok') == -1) {
print "<TABLE BORDER=1><TR><TD><FONT SIZE=\"+2\" COLOR=\"RED\"><B>AUTO-NOTICE</B>: The CPPSRB reward system appears to be in fail-safe mode.</FONT></TD></TR><TR><TD><FONT COLOR=\"RED\">Some stats are likely not updating as they should right now (128/256 second hash rates, balances, balance graph, payout queue). These items will correct themselves soon when CPPSRB is out of fail safe mode. This can take several hours. <B>No earnings are lost as long as your shares are accepted!</B> Sorry for the inconvenience!</FONT></TD></TR></TABLE><BR>";
}
}
function print_stats_bottom() {
$localafterbodyextras = "";
if (isset($GLOBALS["afterbodyextras"])) { $localafterbodyextras = $GLOBALS["afterbodyextras"]; }
print("<BR><div id=\"line\">");
print("<H3>MUCH MORE TO COME - PLEASE BE PATIENT</H3>
<BR>
Source code/bug submissions/feature requests: <A HREF=\"https://github.com/wizkid057/wizstats\">wizkid057/wizstats on github</A><BR>
I'm working as quickly as I can to get these stats much more useful and presentable, but it is a time consuming process.<BR>
Any donations will help me dedicate more time to development and would be greatly appreciated: <B><I>1Stats</I>Qytc7UEZ9sHJ9BGX2csmkj8XZr2</B><BR><BR>
Thanks for using the new stats!<bR>
<I>-wizkid057</I><BR>");
print("<A HREF=\"".$GLOBALS["urlprefix"]."\"><-- Back to Main Stats Page</A>");
print("</BODY>".$localafterbodyextras."</HTML>");
}