From 7ce4eeadca043a77ab0735de1ec296c4be073cce Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Thu, 9 Jul 2015 00:51:23 +0200 Subject: [PATCH] on mobile devices, default to a single column - add symlink for ua library --- include/classes/rrdstat.php-class | 12 ++++++------ testbed/rrd/useragent.php-class | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 00ac8fb..7532f00 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -966,15 +966,15 @@ class rrdstat { if (isset($pconf['stats_url_add'])) { $sURL_add = $pconf['stats_url_add']; } else { $sURL_add = '&sub=%s'; } - $default_num_rows = $GLOBALS['ua']->isMobile()?1:2; - $num_rows = is_numeric($pconf['num_rows'])?$pconf['num_rows']:$default_num_rows; - $num_cols = ceil(count($stats)/$num_rows); + $default_num_cols = $GLOBALS['ua']->isMobile()?1:2; + $num_cols = is_numeric($pconf['num_rows'])?$pconf['num_rows']:$default_num_cols; + $num_rows = ceil(count($stats)/$num_cols); $out .= ''."\n"; - for ($col = 0; $col < $num_cols; $col++) { + for ($row = 0; $row < $num_rows; $row++) { $out .= ''."\n"; - for ($row = 0; $row < $num_rows; $row++) { - $idx = $col * $num_rows + $row; + for ($col = 0; $col < $num_cols; $col++) { + $idx = $row * $num_cols + $col; $out .= '
'."\n"; if ($idx < count($stats)) { @list($sname, $s_psub) = explode('|', $stats[$idx]['name'], 2); diff --git a/testbed/rrd/useragent.php-class b/testbed/rrd/useragent.php-class index 1e64b0d..a0d2f69 120000 --- a/testbed/rrd/useragent.php-class +++ b/testbed/rrd/useragent.php-class @@ -1 +1 @@ -/home/robert/git/kairo/include/classes/useragent.php-class \ No newline at end of file +../../include/classes/useragent.php-class \ No newline at end of file -- 2.43.0