| 
     
      
      
      From: <dj...@us...> - 2012-01-23 12:46:51
      
     
   | 
Revision: 8789
          http://xoops.svn.sourceforge.net/xoops/?rev=8789&view=rev
Author:   djculex
Date:     2012-01-23 12:46:42 +0000 (Mon, 23 Jan 2012)
Log Message:
-----------
bugfix: moved incrementation in function
Modified Paths:
--------------
    XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php	2012-01-23 12:44:53 UTC (rev 8788)
+++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php	2012-01-23 12:46:42 UTC (rev 8789)
@@ -161,12 +161,13 @@
 	function topratedusers($direction) {
 	 global $xoopsUser, $xoopsDB,$xoopsTpl;
 	 $array = array();
-	 $i = 1;
+	 
 		 if ($direction == 'up') {
 			$sql = "SELECT owner, count(*) as cnt FROM ".$xoopsDB->prefix('smallworld_vote')." where up='1' GROUP by owner ORDER BY cnt DESC limit 20";
 			$result = $xoopsDB->queryF($sql);
 			$count = $xoopsDB->getRowsNum($result);
-			if ($count != 0) {
+			$i = 1;
+			if ($count >= $i) {
 				while ($row = $xoopsDB->fetchArray($result)) {
 					$array['counter'][$i] = $i;
 					$array['img'][$i] = "<img height='10px' width='10px' style='margin:0px 5px;' src = '../images/like.png'></img>";
@@ -182,6 +183,7 @@
 				$sql = "SELECT owner, count(*) as cnt FROM ".$xoopsDB->prefix('smallworld_vote')." where down='1' GROUP by owner ORDER BY cnt DESC limit 20";		
 				$result = $xoopsDB->queryF($sql);
 				$count = $xoopsDB->getRowsNum($result);
+				$i = 1;
 				if ($count != 0) {
 					while ($row = $xoopsDB->fetchArray($result)) {
 						$array['counter'][$i] = $i;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |