From 1a983e670fea1957549b70433735b6716ca85994 Mon Sep 17 00:00:00 2001 From: Kano Date: Thu, 5 Jul 2012 08:58:22 +1000 Subject: [PATCH] miner.php define custom sum fields as a simple array --- miner.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/miner.php b/miner.php index 24d31451..5e8f80ed 100644 --- a/miner.php +++ b/miner.php @@ -79,9 +79,9 @@ $mobilepage = array( 'DEVS' => array('ID', 'Name', 'GPU', 'Status', 'MHS av', 'Accepted', 'Rejected', 'Utility'), 'POOL' => array('POOL', 'Status', 'Accepted', 'Rejected', 'Last Share Time')); $mobilesum = array( - 'SUMMARY' => array('MHS av' => 1, 'Found Blocks' => 1, 'Accepted' => 1, 'Rejected' => 1, 'Utility' => 1), - 'DEVS' => array('MHS av' => 1, 'Accepted' => 1, 'Rejected' => 1, 'Utility' => 1), - 'POOL' => array('Accepted' => 1, 'Rejected' => 1)); + 'SUMMARY' => array('MHS av', 'Found Blocks', 'Accepted', 'Rejected', 'Utility'), + 'DEVS' => array('MHS av', 'Accepted', 'Rejected', 'Utility'), + 'POOL' => array('Accepted', 'Rejected')); # # customsummarypages is an array of these Custom Summary Pages $customsummarypages = array('Mobile' => array($mobilepage, $mobilesum)); @@ -1358,6 +1358,15 @@ function showcustompage($pagename) if ($sum === null) $sum = array(); + // convert them to searchable via isset() + foreach ($sum as $section => $fields) + { + $newfields = array(); + foreach ($fields as $field) + $newfields[$field] = 1; + $sum[$section] = $newfields; + } + if (count($page) <= 1) { echo "Invalid custom summary page '$pagename' no content ";