From d59b8ef5638a0bf904ce8bea3a45873def95fd76 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 5 Aug 2013 09:18:52 +0200 Subject: [PATCH] Make block count on stats page configurable Fixes #549 --- public/include/config/global.inc.dist.php | 3 +++ public/include/pages/statistics/blocks.inc.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/public/include/config/global.inc.dist.php b/public/include/config/global.inc.dist.php index 359f74da..265dfc7a 100644 --- a/public/include/config/global.inc.dist.php +++ b/public/include/config/global.inc.dist.php @@ -109,6 +109,7 @@ $config['ap_threshold']['max'] = 250; * mobile : Enable/Disable mobile theme support * mobile_theme : Theme used for mobile browsers * api disabled : Disable the sites API functions + * blocks count : # of blocks to display on block statistics page * * Defaults: * title = `The Pool - Mining Evolved` @@ -119,6 +120,7 @@ $config['ap_threshold']['max'] = 250; * mobile = true * mobile_theme = `mobile` * api disbabled = false + * blocks count = 20 **/ $config['website']['title'] = 'The Pool - Mining Evolved'; $config['website']['name'] = 'The Pool'; @@ -128,6 +130,7 @@ $config['website']['theme'] = 'mmcFE'; $config['website']['mobile'] = true; $config['website']['mobile_theme'] = 'mobile'; $config['website']['api']['disabled'] = false; +$config['website']['blocks']['count'] = 20; /** * Account specific settings diff --git a/public/include/pages/statistics/blocks.inc.php b/public/include/pages/statistics/blocks.inc.php index 3218a9f4..494e6be3 100644 --- a/public/include/pages/statistics/blocks.inc.php +++ b/public/include/pages/statistics/blocks.inc.php @@ -7,7 +7,7 @@ if (!defined('SECURITY')) die('Hacking attempt'); if (!$smarty->isCached('master.tpl', $smarty_cache_key)) { $debug->append('No cached version available, fetching from backend', 3); // Grab the last blocks found - $iLimit = 20; + !empty($config['website']['blocks']['count']) ? $iLimit = $config['website']['blocks']['count'] : $iLimit = 20; $aBlocksFoundData = $statistics->getBlocksFound($iLimit); // Propagate content our template