@ -3,10 +3,12 @@
global $site_title;
global $site_title;
global $page_title;
global $page_title;
global $page_scripts;
global $page_scripts;
global $page_css;
#
#
$site_title = 'CKPool';
$site_title = 'CKPool';
$page_title = $site_title;
$page_title = $site_title;
$page_scripts = '';
$page_scripts = '';
$page_css = '';
#
#
global $dont_trm;
global $dont_trm;
$dont_trm = false;
$dont_trm = false;
@ -40,6 +42,13 @@ function addScript($script)
}
}
}
}
#
#
function addCSS($css)
{
global $page_css;
$page_css .= $css;
}
#
function addGBase()
function addGBase()
{
{
$g = "function hasCan(){var c0=document.getElementById('can0');c=document.getElementById('can');return !!(c0&&c&&c.getContext&&c.getContext('2d')); }
$g = "function hasCan(){var c0=document.getElementById('can0');c=document.getElementById('can');return !!(c0&&c&&c.getContext&&c.getContext('2d')); }
@ -69,7 +78,7 @@ function gfl(c){c['ctx'].fill()}
function gst(c){c['ctx'].stroke()}
function gst(c){c['ctx'].stroke()}
function gfi(c){gle(c);gst(c)}
function gfi(c){gle(c);gst(c)}
function gbd(c){gbe(c,0,0);gln(c,1,0);gln(c,1,1);gln(c,0,1);gle(c);gfl(c);gst(c)}
function gbd(c){gbe(c,0,0);gln(c,1,0);gln(c,1,1);gln(c,0,1);gle(c);gfl(c);gst(c)}
function ggr(c,xs,ys,yt,xn,x0,x1,y0,y1,ar,nx,vx,vy,av){
function ggr(c,xs,ys,yt,xn,x0,x1,y0,y1,ar,nx,vx,vy,av,w,cols ){
gtso(c,xs,ys);
gtso(c,xs,ys);
gss(c,'black');glw(c,1.5);
gss(c,'black');glw(c,1.5);
gbe(c,0,1);gln(c,0,0);gln(c,1,0);gst(c);
gbe(c,0,1);gln(c,0,0);gln(c,1,0);gst(c);
@ -78,7 +87,6 @@ var hi=c['ctx'].measureText('M').width, wi=c['ctx'].measureText('1').width;
for(var i=0;i< 11 ; i + + ) { var y = i/10.0;gbe(c,-0.01,y);gln(c,1,y);gst(c);var t = '' + ( ( ( y1-y0 ) * i / 10 + y0 ) . toFixed ( 2 ) ) ; gfz ( c , 0 , y , -wi , 0 , t , ' black ' , ' end ' ) }
for(var i=0;i< 11 ; i + + ) { var y = i/10.0;gbe(c,-0.01,y);gln(c,1,y);gst(c);var t = '' + ( ( ( y1-y0 ) * i / 10 + y0 ) . toFixed ( 2 ) ) ; gfz ( c , 0 , y , -wi , 0 , t , ' black ' , ' end ' ) }
gfz(c,gx0(c),0.55,wi,0,yt,'#0080ff','left');
gfz(c,gx0(c),0.55,wi,0,yt,'#0080ff','left');
var m=Math.round(0.5+xn/20.0);
var m=Math.round(0.5+xn/20.0);
var f=1;
for(var i=0;i< xn ; i + + ) { var n = ar[nx+i];var x = ar[vx+i];var xo = (x-x0)/(x1-x0);if(c['skey']&&(i<(xn-1))&&(i%m)==0){gbe(c,xo,0);gln(c,xo,-0.01);gst(c);gfz(c,xo,0,0,-hi*1.5,n,'#00a050','center')}if(c['slines']){gbe(c,xo,0);gln(c,xo,1);gst(c)}}
for(var i=0;i< xn ; i + + ) { var n = ar[nx+i];var x = ar[vx+i];var xo = (x-x0)/(x1-x0);if(c['skey']&&(i<(xn-1))&&(i%m)==0){gbe(c,xo,0);gln(c,xo,-0.01);gst(c);gfz(c,xo,0,0,-hi*1.5,n,'#00a050','center')}if(c['slines']){gbe(c,xo,0);gln(c,xo,1);gst(c)}}
var xhr=3600+x1-(x1%3600);
var xhr=3600+x1-(x1%3600);
gss(c,'brown');
gss(c,'brown');
@ -86,15 +94,15 @@ if(c['tkey']||c['tlines']){var hlv=c['hln'][c['hl']];hrs=c['hrs'][c['hr']]*3600/
var l=0;tpos=2.7;if(c['over']){tpos=1.5}
var l=0;tpos=2.7;if(c['over']){tpos=1.5}
for(var i=xhr;i>=x0;i-=hrs){var n=dfmt(c,i);var xo=(i-x0)/(x1-x0);if(xo< =1&&c['tkey']&&((l%hlv)==0)){gbe(c,xo,0); gln(c,xo,-0.02);gst(c);gfz(c,xo,0,0,-hi*tpos,n,'brown','center')}if(xo< =1&&c['tlines']){gbe(c,xo,0); gln(c,xo,1);gst(c)}l++}}
for(var i=xhr;i>=x0;i-=hrs){var n=dfmt(c,i);var xo=(i-x0)/(x1-x0);if(xo< =1&&c['tkey']&&((l%hlv)==0)){gbe(c,xo,0); gln(c,xo,-0.02);gst(c);gfz(c,xo,0,0,-hi*tpos,n,'brown','center')}if(xo< =1&&c['tlines']){gbe(c,xo,0); gln(c,xo,1);gst(c)}l++}}
glw(c,1);
glw(c,1);
gss(c,'#0000c0');
if(c['smooth']){for(var j=1;j< w.length ; j + + ) { var f = 1;gss(c,cols[j-1]);
if(c['smooth']){var xa=0,ya=0,xb=0,yb=0;
var xa=0,ya=0,xb=0,yb=0;
for(var i=0;i< xn ; i + + ) { var x = ar[vx+i];var y = ar[vy+i];var xo = (x-x0)/(x1-x0);var yo = (y-y0)/(y1-y0);if(f==1){gbe(c,xo,yo);f=0;xb=xo;yb=yo}else{gct(c,(xa+xb)/2,(ya+yb)/2,xb,yb,(xb+xo)/2,(yb+yo)/2)}xa=xb;ya=yb;xb=xo;yb=yo}gct(c,(xa+xb)/2,(ya+yb)/2,xo,yo,xo,yo);gst(c);}
for(var i=0;i< xn ; i + + ) { var x = ar[vx+i];var y = ar[w[j]+vy+i];var xo = (x-x0)/(x1-x0);var yo = (y-y0)/(y1-y0);if(f==1){gbe(c,xo,yo);f=0;xb=xo;yb=yo}else{gct(c,(xa+xb)/2,(ya+yb)/2,xb,yb,(xb+xo)/2,(yb+yo)/2)}xa=xb;ya=yb;xb=xo;yb=yo}gct(c,(xa+xb)/2,(ya+yb)/2,xo,yo,xo,yo);gst(c);}}
else{for(var i=0;i< xn ; i + + ) { var x = ar[vx+i];var y = ar[vy+i];var xo = (x-x0)/(x1-x0);var yo = (y-y0)/(y1-y0);if(f==1){gbe(c,xo,yo);f=0}else{gln(c,xo,yo)}}gst(c);}
else{for(var j=1;j< w.length ; j + + ) { var f = 1;gss(c,cols[j-1]);
for(var i=0;i< xn ; i + + ) { var x = ar[vx+i];var y = ar[w[j]+vy+i];var xo = (x-x0)/(x1-x0);var yo = (y-y0)/(y1-y0);if(f==1){gbe(c,xo,yo);f=0}else{gln(c,xo,yo)}}gst(c);}}
glw(c,1);
glw(c,1);
gss(c,'red');
if(av>0){gss(c,'red');var y=(av-y0)/(y1-y0);
var y=(av-y0)/(y1-y0);
gbe(c,0,y);gln(c,1,y);gst(c);
gbe(c,0,y);gln(c,1,y);gst(c);
var t=''+av.toFixed(2)+'av';gfz(c,1,y,1,0,t,'red','left')
var t=''+av.toFixed(2)+'av';gfz(c,1,y,1,0,t,'red','left')}
if(c['tkey']){var col,hrl=c['hrs'].length;for(var i=0;i< hrl ; i + + ) { if ( c [ ' hr ' ] = = i ) { col = 'red' } else { col = 'black' } gfz ( c , 1 , 0 , c [ ' xo ' ] -c [ ' pxe ' ] , hi * ( i + 1 ) * 2 , ' ' + c [ ' hrs ' ] [ i ] , col , ' end ' ) } for ( var i = 0;i<c['hln'].length;i++){if(c['hl']==i){col='red'}else{col='black'}gfz(c,1,0,c['xo']-c['pxe'],hi*(i+2+hrl)*2,''+c['hrs'][i],col,'end')}}
if(c['tkey']){var col,hrl=c['hrs'].length;for(var i=0;i< hrl ; i + + ) { if ( c [ ' hr ' ] = = i ) { col = 'red' } else { col = 'black' } gfz ( c , 1 , 0 , c [ ' xo ' ] -c [ ' pxe ' ] , hi * ( i + 1 ) * 2 , ' ' + c [ ' hrs ' ] [ i ] , col , ' end ' ) } for ( var i = 0;i<c['hln'].length;i++){if(c['hl']==i){col='red'}else{col='black'}gfz(c,1,0,c['xo']-c['pxe'],hi*(i+2+hrl)*2,''+c['hrs'][i],col,'end')}}
}
}
function sn(i,shi){if(shi.indexOf(' Shift ')< 0 ) { return ' ' + ( i % 10 ) } else { return shi . replace ( / . * ( [ a-z ] ) [ a-z ] * $ / , ' $ 1 ' ) } }
function sn(i,shi){if(shi.indexOf(' Shift ')< 0 ) { return ' ' + ( i % 10 ) } else { return shi . replace ( / . * ( [ a-z ] ) [ a-z ] * $ / , ' $ 1 ' ) } }
@ -108,11 +116,35 @@ function doinit(cbx,xon){for(var i=0;i<cbx.length;i++){var e=document.getElement
addScript($g);
addScript($g);
}
}
#
#
function makeLink($page, $rest = '')
function addTips()
{
$t = "function untip(e){if(e){if(typeof e.tmo!='undefined'){clearTimeout(e.tmo);delete e.tmo}e.style.opacity=0;e.style.visibility='hidden'}}
function tip(i,n){var e=document.getElementById(i);if(e){if(e.style.visibility=='visible'){untip(e)}else{e.style.visibility='visible';e.style.opacity=0.95;e.tmo=setTimeout(function(){untip(e)},n)}}}
";
addScript($t);
$tcss = "span.tip0 {position:absolute;z-index:42;pointer-events:none;font-size:smaller;text-align:left;}
span.notip {position:relative;color:#0077ee;background:#bbffff;border-style:solid;border-color:black;border-width:1px;left:-10px;width:200px;padding:2px;float:left;transition:visibility 0.5s,opacity 0.5s;visibility:hidden;opacity:0}
span.tip {visibility: visibile;}
span.q {position: relative; width: 16px; height: 16px; display: inline-block; background-color: #0077ee; line-height: 16px; color: White; font-size: 13px; font-weight: bold; border-radius: 8px; text-align: center; cursor: pointer; }
ul.tip {margin-top:0;margin-bottom:0;list-style:disc inside none;margin-left:0;padding-left:0.5em;display:block}
li {padding-left:0.5em;}
";
addCSS($tcss);
}
#
#
function makeURL($page)
{
{
if ($page != '')
if ($page == null)
$page = '';
else if ($page != '')
$page = '?k='.$page;
$page = '?k='.$page;
$href = "< a href = 'index.php$page' " ;
return "/index.php$page";
}
function makeLink($page, $rest = '')
{
$href = "< a href = '".makeURL($page)."' " ;
if ($rest != '')
if ($rest != '')
$href .= " $rest";
$href .= " $rest";
$href .= '>';
$href .= '>';
@ -148,7 +180,7 @@ function trm_force($html)
return dotrm($html, false);
return dotrm($html, false);
}
}
#
#
function pghead($script_marker, $name)
function pghead($css_marker, $ script_marker, $name)
{
{
global $page_title;
global $page_title;
@ -187,18 +219,18 @@ span.urg {color:red; font-weight:bold;}
span.err {color:red; font-weight:bold; font-size:120%;}
span.err {color:red; font-weight:bold; font-size:120%;}
span.alert {color:red; font-weight:bold; font-size:250%;}
span.alert {color:red; font-weight:bold; font-size:250%;}
input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; border: 0px;}
input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; border: 0px;}
#n42 {margin:0; position: relative; color:#fff; background:#07e;}
#n42 {margin:0; position: relative; color:#ffffff ; background:#00 77e e;}
#n42 a {color:#fff; text-decoration:none; padding: 6px; display:block;}
#n42 a {color:#fff; text-decoration:none; padding: 6px; display:block;}
#n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;}
#n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;}
#n42 td.navboxr {float: right;}
#n42 td.navboxr {float: right;}
#n42 td.nav {position: relative;}
#n42 td.nav {position: relative;}
#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}";
#n42 td.ts {border-width: 1px; border-color: #00 22e e; border-style: solid none none none;}";
if (!$iCrap)
if (!$iCrap)
{
{
$head .= "
$head .= "
#n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;}
#n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;}
#n42 td.nav:hover {background:#09e;}
#n42 td.nav:hover {background:#00 99e e;}
#n42 td.nav:hover div.sub {background:#07e; visibility: visible;}";
#n42 td.nav:hover div.sub {background:#00 77e e; visibility: visible;}";
}
}
$head .= "
$head .= "
h1 {margin-top: 20px; float:middle; font-size: 20px;}
h1 {margin-top: 20px; float:middle; font-size: 20px;}
@ -220,6 +252,7 @@ h1 {margin-top: 20px; float:middle; font-size: 20px;}
.fthi {color:red; font-size:7px; }
.fthi {color:red; font-size:7px; }
.ftlo {color:green; font-size:7px; }
.ftlo {color:green; font-size:7px; }
.ft {color:blue; font-size:7px; }
.ft {color:blue; font-size:7px; }
$css_marker
< / style > \n";
< / style > \n";
$head .= '< meta name = "robots" content = "noindex" > ';
$head .= '< meta name = "robots" content = "noindex" > ';
@ -592,9 +625,10 @@ function pgfoot($info)
function gopage($info, $data, $pagefun, $page, $menu, $name, $user, $ispage = true, $dotop = true, $douser = true)
function gopage($info, $data, $pagefun, $page, $menu, $name, $user, $ispage = true, $dotop = true, $douser = true)
{
{
global $dbg, $stt;
global $dbg, $stt;
global $page_scripts;
global $page_css, $page_ scripts;
$dbg_marker = '[@dbg@]';
$dbg_marker = '[@dbg@]';
$css_marker = '[@css@]';
$script_marker = '[@scripts@]';
$script_marker = '[@scripts@]';
if ($dbg === true)
if ($dbg === true)
@ -616,13 +650,15 @@ function gopage($info, $data, $pagefun, $page, $menu, $name, $user, $ispage = tr
// if (isset($_SESSION['logkey']))
// if (isset($_SESSION['logkey']))
// unset($_SESSION['logkey']);
// unset($_SESSION['logkey']);
$head = pghead($script_marker, $name);
$head = pghead($css_marker, $ script_marker, $name);
$body = pgbody($info, $page, $menu, $dotop, $user, $douser);
$body = pgbody($info, $page, $menu, $dotop, $user, $douser);
$foot = pgfoot($info);
$foot = pgfoot($info);
if ($dbg === true)
if ($dbg === true)
$pg = str_replace($dbg_marker, cvtdbg(), $pg);
$pg = str_replace($dbg_marker, cvtdbg(), $pg);
$head = str_replace($css_marker, $page_css, $head);
if ($page_scripts != '')
if ($page_scripts != '')
$page_scripts .= "< / script > ";
$page_scripts .= "< / script > ";