From: <dj...@us...> - 2012-01-23 12:44:59
|
Revision: 8788 http://xoops.svn.sourceforge.net/xoops/?rev=8788&view=rev Author: djculex Date: 2012-01-23 12:44:53 +0000 (Mon, 23 Jan 2012) Log Message: ----------- bugfix: wrong count array Modified Paths: -------------- XoopsModules/smallworld/trunk/smallworld/admin/index.php Modified: XoopsModules/smallworld/trunk/smallworld/admin/index.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-01-23 11:17:24 UTC (rev 8787) +++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-01-23 12:44:53 UTC (rev 8788) @@ -93,13 +93,14 @@ // FInd list of best rated users overall $topusers = $admin->topratedusers('up'); +$count = count($topusers['cnt']); $top_cnt = 0; - if (count($topusers) != 0) { + if ($count != 0) { $top_cnt = 1; $top = "<table class='smallworldadmin'><tr>"; $top .= "<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($topusers)-1) { + while ($i <= $count) { $top .= vsprintf('<tr><td>%s</td>',array($topusers['counter'][$i])); $top .= vsprintf('<td>%s</td>',array($topusers['img'][$i])); $top .= vsprintf('<td>%s</td>',array($topusers['cnt'][$i])); @@ -114,12 +115,13 @@ // FInd list of worst rated users overall $lowusers = $admin->topratedusers('down'); $low_cnt = 0; - if (count($lowusers) != 0) { +$count = count($lowusers['cnt']); + if ($count != 0) { $low_cnt = 1; $low = "<table class='smallworldadmin'><tr>"; $low .= "<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(array($lowusers))) { + while ($i <= $count) { $low .= vsprintf('<tr><td>%s</td>',array($lowusers['counter'][$i])); $low .= vsprintf('<td>%s</td>',array($lowusers['img'][$i])); $low .= vsprintf('<td>%s</td>',array($lowusers['cnt'][$i])); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |