From: <dj...@us...> - 2012-01-20 18:51:16
|
Revision: 8767 http://xoops.svn.sourceforge.net/xoops/?rev=8767&view=rev Author: djculex Date: 2012-01-20 18:51:05 +0000 (Fri, 20 Jan 2012) Log Message: ----------- error in arraycount in both adminclass.php and index.php Modified Paths: -------------- XoopsModules/smallworld/trunk/smallworld/admin/index.php XoopsModules/smallworld/trunk/smallworld/class/adminclass.php Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-01-20 18:21:33 UTC (rev 8766) +++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-01-20 18:51:05 UTC (rev 8767) @@ -74,12 +74,12 @@ // Find list of most active users (24 hours) $maToday = $admin->mostactiveusers_today(); $mat_cnt = 0; - if (count($maToday) != 0) { + if (count(array($maToday)) > 0) { $mat_cnt = 1; $mat = "<table class='smallworldadmin'><tr>"; $mat .= "<td><b>"._AM_SMALLWORLD_STATS_POS."</b></td><td><b>"._AM_SMALLWORLD_STATS_IMG."</b></td><td><b>"._AM_SMALLWORLD_STATS_AMOUNT."</b></td><td><b>"._AM_SMALLWORLD_STATS_NAME."</b></td></tr>"; $i = 1; - while ($i < count($maToday)-1) { + while ($i <= count(array($maToday))) { $mat .= vsprintf('<tr><td>%s</td>',array($maToday['counter'][$i])); $mat .= vsprintf('<td>%s</td>',array($maToday['img'][$i])); $mat .= vsprintf('<td>%s</td>',array($maToday['cnt'][$i])); Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-20 18:21:33 UTC (rev 8766) +++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-20 18:51:05 UTC (rev 8767) @@ -139,9 +139,9 @@ $sql .= "GROUP BY uid_fk "; $sql .= "ORDER BY count( * ) DESC limit 20"; $result = $xoopsDB->queryF($sql); - if ($xoopsDB->getRowsNum($result) > 0) { $msgtoday = array(); - $i = 1; + if ($xoopsDB->getRowsNum($result) != 0) { + $i = 1; while ($row = $xoopsDB->fetchArray($result)) { $msgtoday["counter"][$i] = $i; $msgtoday["img"][$i] = "<img style='margin:0px 5px;' src = '../images/".$i.".png'></img>"; @@ -151,8 +151,7 @@ $i++; } } else { - $msgtoday['cnt'][1] = _AM_SMALLWORLD_THEREARE; - $msgtoday['from'][1] = _AM_SMALLWORLD_NO; + $msgtoday = array(); } return $msgtoday; } @@ -176,10 +175,7 @@ $i++; } } else { - $array['counter'][$i] = ''; - $array['img'][$i] = ""; - $array['cnt'][$i] = _AM_SMALLWORLD_NO; - $array['user'][$i] = _AM_SMALLWORLD_THEREARE; + $array = array(); } } else { $sql = "SELECT owner, count(*) as cnt FROM ".$xoopsDB->prefix('smallworld_vote')." where down='1' GROUP by owner ORDER BY cnt DESC limit 20"; @@ -195,10 +191,7 @@ $i++; } } else { - $array['counter'][$i] = ''; - $array['img'][$i] = ""; - $array['cnt'][$i] = _AM_SMALLWORLD_NO; - $array['user'][$i] = _AM_SMALLWORLD_THEREARE; + $array = array(); } } return $array; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |