From: <wis...@us...> - 2012-07-28 09:16:54
|
Revision: 9935 http://xoops.svn.sourceforge.net/xoops/?rev=9935&view=rev Author: wishcraft Date: 2012-07-28 09:16:47 +0000 (Sat, 28 Jul 2012) Log Message: ----------- IP Log 1.01 - Final Release - Moments after mamba Edition - see changelog.txt Modified Paths: -------------- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/admin/dashboard.php XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/class/log.php XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/docs/changelog.txt XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/language/english/admin.php XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/xoops_version.php XoopsModules/iplog/trunk/iplog/admin/dashboard.php XoopsModules/iplog/trunk/iplog/class/log.php XoopsModules/iplog/trunk/iplog/docs/changelog.txt XoopsModules/iplog/trunk/iplog/language/english/admin.php XoopsModules/iplog/trunk/iplog/xoops_version.php Modified: XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/admin/dashboard.php =================================================================== --- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/admin/dashboard.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/admin/dashboard.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -43,47 +43,47 @@ if (count($log_handler->getNumberByCountry())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY); foreach ($log_handler->getNumberByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getNumberByRegion())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_REGION); foreach ($log_handler->getNumberByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getNumberByContinent())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT); foreach ($log_handler->getNumberByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getTotalSecondsByCountry())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY); foreach ($log_handler->getTotalSecondsByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getTotalSecondsByRegion())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_REGION); foreach ($log_handler->getTotalSecondsByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getTotalSecondsByContinent())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT); foreach ($log_handler->getTotalSecondsByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getAdverageSecondsByCountry())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY); foreach ($log_handler->getAdverageSecondsByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getAdverageSecondsByRegion())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_REGION); foreach ($log_handler->getAdverageSecondsByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } if (count($log_handler->getAdverageSecondsByContinent())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT); foreach ($log_handler->getAdverageSecondsByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } echo $indexAdmin->renderIndex(); Modified: XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/class/log.php =================================================================== --- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/class/log.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/class/log.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -343,7 +343,7 @@ } function getNumberByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, count(*) as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, count(*) as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -353,7 +353,7 @@ } function getNumberByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $sql = 'SELECT DISTINCT `b`.`region` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -363,7 +363,7 @@ } function getNumberByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $sql = 'SELECT DISTINCT `b`.`continent` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -373,7 +373,7 @@ } function getTotalSecondsByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, sum(`online`)/60 as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, sum(`online`)/60 as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -383,7 +383,7 @@ } function getTotalSecondsByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`region` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -393,7 +393,7 @@ } function getTotalSecondsByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`continent` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -403,7 +403,7 @@ } function getAdverageSecondsByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, avg(`online`)/60 as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, avg(`online`)/60 as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -413,7 +413,7 @@ } function getAdverageSecondsByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`region` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -423,7 +423,7 @@ } function getAdverageSecondsByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`continent` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { Modified: XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/docs/changelog.txt =================================================================== --- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/docs/changelog.txt 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/docs/changelog.txt 2012-07-28 09:16:47 UTC (rev 9935) @@ -1,8 +1,9 @@ ================================================ -== Version 1.01 Final - 2012/07/28 18:40 AEST == +== Version 1.01 Final - 2012/07/28 19:15 AEST == ================================================ Changed: /admin/about.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/dashboard.php - GNU3 header and shouts added to header (wishcraft) +Changed: /admin/dashboard.php - Search for '-' in array and return Unknown constant (wishcraft) Changed: /admin/footer.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/header.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/log.php - GNU3 header and shouts added to header (wishcraft) @@ -14,12 +15,14 @@ Changed: /class/log.php - GNU3 header and shouts added to header (wishcraft) Changed: /class/log.php - Rename of Field Type 'useragent' to 'agent' as Db (wishcraft) Changed: /class/log.php - xoops_load('cache') is deprecated [changed to standard] (wishcraft) +Changed: /class/log.php - Add Group By to SQL for statistics on dashboard (wishcraft) Changed: /class/countries.php - GNU3 header and shouts added to header (wishcraft) Changed: /include/functions.php - GNU3 header and shouts added to header (wishcraft) Changed: /include/ip2locationlite.class.php - GNU3 header and shouts added to header (wishcraft) Changed: /language/english/help/help.html - GNU3 header and shouts added to header (wishcraft) Changed: /language/english/help/help.html - Content Updated to be revelent & IPInfoDB Instruction added (wishcraft) Changed: /language/english/admin.php - GNU3 header and shouts added to header (wishcraft) +Changed: /language/english/admin.php - Unknown added to language for missing data (wishcraft) Changed: /language/english/admin.php - Rename of Constant Type 'useragent' to 'agent' as Db (wishcraft) Changed: /language/english/admin.php - add two missing language definitions (mamba) Changed: /language/english/admin.php - add three sprintf variable to Delete Query. (wishcraft) Modified: XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/language/english/admin.php =================================================================== --- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/language/english/admin.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/language/english/admin.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -32,6 +32,7 @@ */ define("_AM_IPLOG_SECONDS", "Seconds"); +define("_AM_IPLOG_UNKNOWN", "Unknown"); define("_AM_IPLOG_TH_IP_ID", "IP ID"); define("_AM_IPLOG_TH_UNAME", "Username"); Modified: XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/xoops_version.php =================================================================== --- XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/xoops_version.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/releases/1.01/htdocs/modules/iplog/xoops_version.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -49,9 +49,9 @@ $modversion['icons16'] = 'modules/'.$modversion['dirname'].'/images/icons/16'; $modversion['icons32'] = 'modules/'.$modversion['dirname'].'/images/icons/32'; -$modversion['release_info'] = "Stable 2012/07/27"; +$modversion['release_info'] = "Stable 2012/07/28"; $modversion['release_file'] = XOOPS_URL."/modules/profile/docs/changelog.txt"; -$modversion['release_date'] = "2012/07/27"; +$modversion['release_date'] = "2012/07/28"; $modversion['author_realname'] = "Simon Antony Roberts"; $modversion['author_website_url'] = "http://www.chronolabs.com.au"; Modified: XoopsModules/iplog/trunk/iplog/admin/dashboard.php =================================================================== --- XoopsModules/iplog/trunk/iplog/admin/dashboard.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/trunk/iplog/admin/dashboard.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -38,52 +38,52 @@ $indexAdmin = new ModuleAdmin(); $log_handler = xoops_getmodulehandler('log', 'iplog'); - $indexAdmin = new ModuleAdmin(); - if (count($log_handler->getNumberByCountry())>0) { + $indexAdmin = new ModuleAdmin(); + if (count($log_handler->getNumberByCountry())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY); foreach ($log_handler->getNumberByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getNumberByRegion())>0) { + if (count($log_handler->getNumberByRegion())>1) { $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_REGION); - foreach ($log_handler->getNumberByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + foreach ($log_handler->getNumberByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getNumberByContinent())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT); - foreach ($log_handler->getNumberByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getNumberByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT); + foreach ($log_handler->getNumberByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_COUNTS_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getTotalSecondsByCountry())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY); - foreach ($log_handler->getTotalSecondsByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getTotalSecondsByCountry())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY); + foreach ($log_handler->getTotalSecondsByCountry() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getTotalSecondsByRegion())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_REGION); - foreach ($log_handler->getTotalSecondsByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getTotalSecondsByRegion())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_REGION); + foreach ($log_handler->getTotalSecondsByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getTotalSecondsByContinent())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT); - foreach ($log_handler->getTotalSecondsByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getTotalSecondsByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT); + foreach ($log_handler->getTotalSecondsByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_SUM_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getAdverageSecondsByCountry())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY); - foreach ($log_handler->getAdverageSecondsByCountry() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getAdverageSecondsByCountry())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY); + foreach ($log_handler->getAdverageSecondsByCountry() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_COUNTRY, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getAdverageSecondsByRegion())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_REGION); - foreach ($log_handler->getAdverageSecondsByRegion() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_REGION, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getAdverageSecondsByRegion())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_REGION); + foreach ($log_handler->getAdverageSecondsByRegion() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_REGION, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } - if (count($log_handler->getAdverageSecondsByContinent())>0) { - $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT); - foreach ($log_handler->getAdverageSecondsByContinent() as $id => $value) - $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT, "<label>".$value['node'].": %s</label>", $value['total'], 'Green'); + if (count($log_handler->getAdverageSecondsByContinent())>1) { + $indexAdmin->addInfoBox(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT); + foreach ($log_handler->getAdverageSecondsByContinent() as $id => $value) + $indexAdmin->addInfoBoxLine(_AM_IPLOG_ADMIN_AVG_BY_CONTINENT, "<label>".($value['node']=='-'?_AM_IPLOG_UNKNOWN:$value['node']).": %s</label>", $value['total'], 'Green'); } echo $indexAdmin->renderIndex(); Modified: XoopsModules/iplog/trunk/iplog/class/log.php =================================================================== --- XoopsModules/iplog/trunk/iplog/class/log.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/trunk/iplog/class/log.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -343,7 +343,7 @@ } function getNumberByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, count(*) as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, count(*) as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -353,7 +353,7 @@ } function getNumberByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $sql = 'SELECT DISTINCT `b`.`region` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -363,7 +363,7 @@ } function getNumberByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id'; + $sql = 'SELECT DISTINCT `b`.`continent` as node, count(*) as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -373,7 +373,7 @@ } function getTotalSecondsByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, sum(`online`)/60 as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, sum(`online`)/60 as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -383,7 +383,7 @@ } function getTotalSecondsByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`region` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -393,7 +393,7 @@ } function getTotalSecondsByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`continent` as node, sum(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -403,7 +403,7 @@ } function getAdverageSecondsByCountry() { - $sql = 'SELECT DISTINCT `country-name` as node, avg(`online`)/60 as total FROM `'.$this->table.'`'; + $sql = 'SELECT DISTINCT `country-name` as node, avg(`online`)/60 as total FROM `'.$this->table.'` GROUP BY `country-name`'; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -413,7 +413,7 @@ } function getAdverageSecondsByRegion() { - $sql = 'SELECT DISTINCT `b`.`region` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`region` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`region`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { @@ -423,7 +423,7 @@ } function getAdverageSecondsByContinent() { - $sql = 'SELECT DISTINCT `b`.`continent` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id';; + $sql = 'SELECT DISTINCT `b`.`continent` as node, avg(`online`)/60 as total FROM `'.$this->table.'` a INNER JOIN `'.$GLOBALS['xoopsDB']->prefix('iplog_countries').'` b ON a.country_id = b.country_id GROUP BY `b`.`continent`';; $result = $GLOBALS['xoopsDB']->queryF($sql); $ret = array(); while ($row = $GLOBALS['xoopsDB']->fetchArray($result)) { Modified: XoopsModules/iplog/trunk/iplog/docs/changelog.txt =================================================================== --- XoopsModules/iplog/trunk/iplog/docs/changelog.txt 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/trunk/iplog/docs/changelog.txt 2012-07-28 09:16:47 UTC (rev 9935) @@ -1,8 +1,9 @@ ================================================ -== Version 1.01 Final - 2012/07/28 18:40 AEST == +== Version 1.01 Final - 2012/07/28 19:15 AEST == ================================================ Changed: /admin/about.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/dashboard.php - GNU3 header and shouts added to header (wishcraft) +Changed: /admin/dashboard.php - Search for '-' in array and return Unknown constant (wishcraft) Changed: /admin/footer.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/header.php - GNU3 header and shouts added to header (wishcraft) Changed: /admin/log.php - GNU3 header and shouts added to header (wishcraft) @@ -14,12 +15,14 @@ Changed: /class/log.php - GNU3 header and shouts added to header (wishcraft) Changed: /class/log.php - Rename of Field Type 'useragent' to 'agent' as Db (wishcraft) Changed: /class/log.php - xoops_load('cache') is deprecated [changed to standard] (wishcraft) +Changed: /class/log.php - Add Group By to SQL for statistics on dashboard (wishcraft) Changed: /class/countries.php - GNU3 header and shouts added to header (wishcraft) Changed: /include/functions.php - GNU3 header and shouts added to header (wishcraft) Changed: /include/ip2locationlite.class.php - GNU3 header and shouts added to header (wishcraft) Changed: /language/english/help/help.html - GNU3 header and shouts added to header (wishcraft) Changed: /language/english/help/help.html - Content Updated to be revelent & IPInfoDB Instruction added (wishcraft) Changed: /language/english/admin.php - GNU3 header and shouts added to header (wishcraft) +Changed: /language/english/admin.php - Unknown added to language for missing data (wishcraft) Changed: /language/english/admin.php - Rename of Constant Type 'useragent' to 'agent' as Db (wishcraft) Changed: /language/english/admin.php - add two missing language definitions (mamba) Changed: /language/english/admin.php - add three sprintf variable to Delete Query. (wishcraft) Modified: XoopsModules/iplog/trunk/iplog/language/english/admin.php =================================================================== --- XoopsModules/iplog/trunk/iplog/language/english/admin.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/trunk/iplog/language/english/admin.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -32,6 +32,7 @@ */ define("_AM_IPLOG_SECONDS", "Seconds"); +define("_AM_IPLOG_UNKNOWN", "Unknown"); define("_AM_IPLOG_TH_IP_ID", "IP ID"); define("_AM_IPLOG_TH_UNAME", "Username"); Modified: XoopsModules/iplog/trunk/iplog/xoops_version.php =================================================================== --- XoopsModules/iplog/trunk/iplog/xoops_version.php 2012-07-28 08:52:48 UTC (rev 9934) +++ XoopsModules/iplog/trunk/iplog/xoops_version.php 2012-07-28 09:16:47 UTC (rev 9935) @@ -49,9 +49,9 @@ $modversion['icons16'] = 'modules/'.$modversion['dirname'].'/images/icons/16'; $modversion['icons32'] = 'modules/'.$modversion['dirname'].'/images/icons/32'; -$modversion['release_info'] = "Stable 2012/07/27"; +$modversion['release_info'] = "Stable 2012/07/28"; $modversion['release_file'] = XOOPS_URL."/modules/profile/docs/changelog.txt"; -$modversion['release_date'] = "2012/07/27"; +$modversion['release_date'] = "2012/07/28"; $modversion['author_realname'] = "Simon Antony Roberts"; $modversion['author_website_url'] = "http://www.chronolabs.com.au"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |