diff --git a/miner.php b/miner.php index e151d605..842da861 100644 --- a/miner.php +++ b/miner.php @@ -5,6 +5,8 @@ global $miner, $port, $readonly, $notify, $rigs, $socktimeoutsec; global $checklastshare, $hidefields; global $ignorerefresh, $changerefresh, $autorefresh; global $allowcustompages, $customsummarypages; +global $miner_font_family, $miner_font_size; +global $colouroverride, $placebuttons; # # Don't touch these 2 - see $rigs below $miner = null; @@ -96,11 +98,17 @@ $warnfont = ''; $warnoff = ''; $dfmt = 'H:i:s j-M-Y \U\T\CP'; # -global $miner_font_family, $miner_font_size; -# $miner_font_family = 'verdana,arial,sans'; $miner_font_size = '13pt'; # +# Edit this or redefine it in myminer.php to change the colour scheme +# See $colourtable below for the list of names +$colouroverride = array(); +# +# Where to place the buttons: 'top' 'bot' 'both' +# anything else means don't show them - case sensitive +$placebuttons = 'top'; +# # This below allows you to put your own settings into a seperate file # so you don't need to update miner.php with your preferred settings # every time a new version is released @@ -109,6 +117,32 @@ $miner_font_size = '13pt'; if (file_exists('myminer.php')) include_once('myminer.php'); # +# This is the system default that must always contain all necessary +# colours so it must be a constant +# You can override these values with $colouroverride +# The only one missing is in $warnfont +# - which you can override directly anyway +global $colourtable; +$colourtable = array( + 'body bgcolor' => '#ecffff', + 'td color' => 'blue', + 'td.h color' => 'blue', + 'td.h background' => '#c4ffff', + 'td.err color' => 'black', + 'td.err background' => '#ff3050', + 'td.warn color' => 'black', + 'td.warn background' => '#ffb050', + 'td.sta color' => 'green', + 'td.tot color' => 'blue', + 'td.tot background' => '#fff8f2', + 'td.lst color' => 'blue', + 'td.lst background' => '#ffffdd', + 'td.hi color' => 'blue', + 'td.hi background' => '#f6ffff', + 'td.lo color' => 'blue', + 'td.lo background' => '#deffff' +); +# # Ensure it is only ever shown once global $showndate; $showndate = false; @@ -117,6 +151,28 @@ $showndate = false; global $rigerror; $rigerror = array(); # +function getcss($cssname, $dom = false) +{ + global $colourtable, $colouroverride; + + $css = ''; + foreach ($colourtable as $cssdata => $colour) + { + $cssobj = split(' ', $cssdata, 2); + if ($cssobj[0] == $cssname) + { + if (isset($colouroverride[$cssdata])) + $color = $colouroverride[$cssdata]; + + if ($dom == true) + $css .= ' '.$cssobj[1].'='.$colour; + else + $css .= $cssobj[1].':'.$colour.'; '; + } + } + return $css; +} +# function htmlhead($checkapi, $rig, $pg = null) { global $miner_font_family, $miner_font_size; @@ -152,17 +208,17 @@ function htmlhead($checkapi, $rig, $pg = null) echo "
$refreshmeta