From: <dj...@us...> - 2012-01-23 13:31:50
|
Revision: 8791 http://xoops.svn.sourceforge.net/xoops/?rev=8791&view=rev Author: djculex Date: 2012-01-23 13:31:43 +0000 (Mon, 23 Jan 2012) Log Message: ----------- Bugfix: return empty array for function mostactiveusers_allround istead of string Bugfix: removed redundant containers in function doCheckUpdate() 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-23 13:15:30 UTC (rev 8790) +++ XoopsModules/smallworld/trunk/smallworld/admin/index.php 2012-01-23 13:31:43 UTC (rev 8791) @@ -59,8 +59,14 @@ $sumallusers = $admin->TotalUsers (); // Find list of most active users (total) $maAllround = $admin->mostactiveusers_allround(); -$ma_cnt = 0; - if (count($maAllround) != 0) { + $ma_cnt = 0; + if (!empty($maAllround)) { + $count = count($maAllround['cnt']); + } else { + $count=0; + } + $mat_cnt = 0; + if ($count != 0) { $ma_cnt = 1; $ma = "<table class='smallworldadmin'><tr>"; $ma .= "<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>"; @@ -79,8 +85,13 @@ // Find list of most active users (24 hours) $maToday = $admin->mostactiveusers_today(); -$mat_cnt = 0; - if (count($maToday) != 0) { + if (!empty($maToday)) { + $count = count($maToday['cnt']); + } else { + $count=0; + } + $mat_cnt = 0; + if ($count != 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>"; @@ -99,12 +110,12 @@ // FInd list of best rated users overall $topusers = $admin->topratedusers('up'); -if (!empty($topusers)){ -$count = count($topusers['cnt']); -} else { -$count = 0; -} -$top_cnt = 0; + if (!empty($topusers)){ + $count = count($topusers['cnt']); + } else { + $count = 0; + } + $top_cnt = 0; if ($count != 0) { $top_cnt = 1; $top = "<table class='smallworldadmin'><tr>"; @@ -124,12 +135,12 @@ // FInd list of worst rated users overall $lowusers = $admin->topratedusers('down'); -$low_cnt = 0; -if (!empty($lowusers)) { -$count = count($lowusers['cnt']); -} else { -$count=0; -} + $low_cnt = 0; + if (!empty($lowusers)) { + $count = count($lowusers['cnt']); + } else { + $count=0; + } if ($count != 0) { $low_cnt = 1; $low = "<table class='smallworldadmin'><tr>"; Modified: XoopsModules/smallworld/trunk/smallworld/class/adminclass.php =================================================================== --- XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-23 13:15:30 UTC (rev 8790) +++ XoopsModules/smallworld/trunk/smallworld/class/adminclass.php 2012-01-23 13:31:43 UTC (rev 8791) @@ -107,8 +107,7 @@ $counter = $xoopsDB->getRowsNum($result); if ($counter < 1) { - $msg['cnt'][1] = _AM_SMALLWORLD_THEREARE; - $msg['uid_fk'][1] = _AM_SMALLWORLD_NO; + $msg = array(); //$xoopsTpl->append('topuser', $msg); } else { $msg = array(); @@ -249,13 +248,13 @@ $upd_img = '../images/upd_normal.png'; } if ($critical) { - $rt = "<div class='smallworld_update'><img src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_CRITICAL_UPD."</div></p>"; + $rt = "<div class='smallworld_update'><img src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_CRITICAL_UPD."</div>"; $rt .="<textarea class='xim_update_changelog'>".$read[1]."</textarea><br /><br />"; - $rt .=_AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a></div>"; + $rt .=_AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a>"; } else if ($update) { - $rt = "<div class='smallworld_update'><img src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_NORMAL_UPD."</div></p>"; + $rt = "<div class='smallworld_update'><img src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_NORMAL_UPD."</div>"; $rt .= "<textarea class='smallworld_update_changelog'>".$read[1]."</textarea><br /><br />"; - $rt .="<p>". _AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a>"; + $rt .= _AM_SMALLWORLD_UPDATE_SERVER_FILE."<br /><a href='".$read[3]."'>".$read[3]."</a>"; } else { $rt = "<div class='smallworld_update'><br/><img src='".$upd_img."' />"._AM_SMALLWORLD_UPDATE_YOUHAVENEWESTVERSION."</div>"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |