1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 14:58:01 +00:00

miner.php allow a custom page section to select all fields with '*' - e.g. to create a STATS section on a custom page

This commit is contained in:
Kano 2012-08-10 22:33:34 +10:00
parent 556cc7bd3a
commit d04005aef9

View File

@ -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;
}
}
}