miner.php allow a custom page section to select all fields with '*' - e.g. to create a STATS section on a custom page
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
diff --git a/miner.php b/miner.php
index 4f240f3..11ae83c 100644
--- a/miner.php
+++ b/miner.php
@@ -1820,14 +1820,29 @@ function processcustompage($pagename, $sections, $sum, $namemap)
foreach ($result as $sec => $row)
{
$secname = preg_replace('/\d/', '', $sec);
- if (secmatch($section, $secname) && isset($row[$field]))
+ if (secmatch($section, $secname))
{
- $showfields[$field] = 1;
- $map = $section.'.'.$field;
- if (isset($namemap[$map]))
- $showhead[$namemap[$map]] = 1;
- else
- $showhead[$field] = 1;
+ if ($field === '*')
+ {
+ foreach ($row as $f => $v)
+ {
+ $showfields[$f] = 1;
+ $map = $section.'.'.$f;
+ if (isset($namemap[$map]))
+ $showhead[$namemap[$map]] = 1;
+ else
+ $showhead[$f] = 1;
+ }
+ }
+ elseif (isset($row[$field]))
+ {
+ $showfields[$field] = 1;
+ $map = $section.'.'.$field;
+ if (isset($namemap[$map]))
+ $showhead[$namemap[$map]] = 1;
+ else
+ $showhead[$field] = 1;
+ }
}
}