Modules

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

seventhseal  01 Feb 2005 3:25 PM 5524 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
le="color: #000000"><?php getMonthlyStats

with
le="color: #000000"><?php 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."&nbsp;-&nbsp;".$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'] = "<a href="statdetails.php?op=monthlystats&year=$year&month=$month">".$monthlist[$i]['month']."</a>"; } else { $monthlist[$i]['link'] = ""; } $midbarsize = substr(100 * $hits / $hitsforyear, 0, 5); $monthlist[$i]['percent'] = $midbarsize."%"; $m_name = getMonth($month); $monthlist[$i]['graph'] = "<img src="images/leftbar.gif" height="$l_size[1]" width="$l_size[0]" Alt="$m_name - $hits"><img src="images/mainbar.gif" Alt="$m_name - $hits" height="$m_size[1]" width="$midbarsize"><img src="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

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits

Categories