miner.php - fix/enable autorefresh for custom pages
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
diff --git a/miner.php b/miner.php
index 637c1f8..1c64e5a 100644
--- a/miner.php
+++ b/miner.php
@@ -117,21 +117,24 @@ $showndate = false;
global $rigerror;
$rigerror = array();
#
-function htmlhead($checkapi, $rig)
+function htmlhead($checkapi, $rig, $pg = null)
{
global $miner_font_family, $miner_font_size;
global $error, $readonly, $here;
global $ignorerefresh, $autorefresh;
- $paramrig = '';
+ $extraparams = '';
if ($rig != null && $rig != '')
- $paramrig = "&rig=$rig";
+ $extraparams = "&rig=$rig";
+ else
+ if ($pg != null && $pg != '')
+ $extraparams = "&pg=$pg";
if ($ignorerefresh == true || $autorefresh == 0)
$refreshmeta = '';
else
{
- $url = "$here?ref=$autorefresh$paramrig";
+ $url = "$here?ref=$autorefresh$extraparams";
$refreshmeta = "\n<meta http-equiv='refresh' content='$autorefresh;url=$url'>";
}
@@ -162,7 +165,7 @@ td.lst { color:blue; $miner_font background:#ffffdd }
function pr(a,m){if(m!=null){if(!confirm(m+'?'))return}window.location='$here?ref=$autorefresh'+a}\n";
if ($ignorerefresh == false)
- echo "function prr(a){if(a){v=document.getElementById('refval').value}else{v=0}window.location='$here?ref='+v+'$paramrig'}\n";
+ echo "function prr(a){if(a){v=document.getElementById('refval').value}else{v=0}window.location='$here?ref='+v+'$extraparams'}\n";
if ($readonly === false && $checkapi === true)
{
@@ -1206,7 +1209,7 @@ function showcustompage($pagename)
{
global $customsummarypages;
- htmlhead(false, null);
+ htmlhead(false, null, $pagename);
pagetop(null, $pagename);