Modules

XOOP-Stats - No Month Display in "Hit Details"

seventhseal  01-Feb-2005 15:25 5374 Reads   4 Comment(s) 
In the statistics/include directory is a file called statutils.php. Load it in your favorite editor. So we don't get confused on line numbers and different versions of editors, just replace the entire function declaration and code
getMonthlyStats

with
function getMonthlyStats$year )
{
  global 
$xoopsDB$xoopsTpl;

  
$now date("d-m-Y");
  
$dot explode ("-",$now);
  
$nowmonth $dot[1];

  
$l_size getimagesize("images/leftbar.gif");
  
$m_size getimagesize("images/mainbar.gif");
  
$r_size getimagesize("images/rightbar.gif");

  
// get monthly stats and display
  
$resultmonth $xoopsDB->queryF("select sum(hits) as totalhitsmonth from ".$xoopsDB->prefix("stats_month")." where year='$year'");
  list(
$totalhitsmonth) = $xoopsDB->fetchRow($resultmonth);
  
$xoopsDB->freeRecordSet($resultmonth);
  
  
$xoopsTpl->assign('lang_stat_monthlystats'STATS_MONTHLYSTATS." - ".$year );
  
$xoopsTpl->assign('lang_stat_monthhead'STATS_MONTH );
  
  
$resulttotal $xoopsDB->queryF("select hits from ".$xoopsDB->prefix("stats_year")." where year='$year'");
  list(
$hitsforyear) = $xoopsDB->fetchRow($resulttotal);
  
$xoopsDB->freeRecordSet($resulttotal);

  
$monthlist = array();
  
$result $xoopsDB->queryF("select month,hits from ".$xoopsDB->prefix("stats_month")." where year='$year'");
  
$i 0;
  while (list(
$month,$hits) = $xoopsDB->fetchRow($result))
  {
    
$monthlist[$i]['month'] = getMonth$month );
    
$monthlist[$i]['hits'] = $hits;
    if (
$month != $nowmonth)
    {
      
$monthlist[$i]['link'] = "statdetails.php?op=monthlystats&year=$year&month=$month">".$monthlist[$i]['month']."";
    }
    else
    {
      
$monthlist[$i]['link'] = "";
    }
  
    
$midbarsize substr(100 $hits $hitsforyear05);
    
$monthlist[$i]['percent'] = $midbarsize."%";
    
$m_name getMonth($month);
    
$monthlist[$i]['graph'] = "images/leftbar.gif" height="$l_size[1]" width="$l_size[0]" Alt="$m_name $hits">images/mainbar.gif" Alt="$m_name $hits" height="$m_size[1]" width="$midbarsize">images/rightbar.gif" height="$r_size[1]" width="$r_size[0]" Alt="$m_name $hits">";
    
$i++;
  }
  
$xoopsTpl->assign('monthlist'$monthlist );
  
$xoopsDB->freeRecordSet($result);
}


This will fix it! :t-up:

Now, for those detail oriented folks, basically a counter was not getting incremented when creating the month list for details. The wierd thing is, I'm not entirely sure how it was working for December 2004 and January 2005. But, it was, and now it's fixed. This has already been fixed for v0.60 - coming soon!

Thanks for reporting, and thanks for using.
Rating 0/5
Rating: 0/5 (0 votes)
Voting is disabled!


Login

Who's Online

321 user(s) are online (67 user(s) are browsing Publisher)


Members: 0


Guests: 321


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits

Categories