模块: XOOP-Stats - "点击详情" 中不显示月份
发布者: seventhseal于 2005/2/1 15:44:34 阅读量:6147由于 artigas 的及时 报告,发现“点击详情”没有显示给定年份的月份。在 1 月 31 日午夜之后,只显示 2005 年 12 月。有点奇怪,但很容易修复。
下载版本将在今天稍后提供,但快速修复方法如下
在统计包括目录中有一个名为 statutils.php 的文件。将其加载到您喜欢的编辑器中。所以我们不会因为行号和对编辑器不同的版本而感到困惑,只需替换整个函数声明和代码
 getMonthlyStats  为
 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 / $hitsforyear, 0, 5); 
    $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/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/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">";
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
现在,对于那些对细节感兴趣的 folks,基本上是计数器在为详细信息创建月份列表时没有增加。奇怪的是,我并不完全清楚 2004 年 12 月和 2005 年 1 月是如何工作的。但现在它已经修复了。这已经在 v0.60 中修复,即将推出!
感谢报告,并感谢使用。




 Re: XOOP-Stats - "点击详情" 中不显示月份
 Re: XOOP-Stats - "点击详情" 中不显示月份


