Author |
Message |
Brujo
Regular


Joined: Jun 04, 2004
Posts: 84
Location: Germany
|
Posted:
Fri Mar 13, 2009 4:25 am |
|
Hi I have somme issues with statistics
1. I get no details of the months, not from this year and not from the past years
i think it is wrong that the month is shown as Name like December and not as Count 12. If i call the Url like this:
i get the the datailed stats
2. with shortlinks enabled i get wrong urls, it looks like: Quote: | http://my.domain/stats-2008-.htmlDezember |
thats i belive is happens because the Month is shown as Name in the URL rewrite there ist [0-9] which expect to get the mont not as name
3. just cosmetical, the german Language entry
Quote: | _BACKTOMAIN','Zurück ins Hauptmenü |
Brujo |
|
|
|
 |
Susann
Moderator

Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support
|
Posted:
Fri Mar 13, 2009 5:50 am |
|
Thank you Brujo ! Will add this in our bug tracker.
One reason the month name was changed is to avoid confusion because the date e.g. 12.3.2009 in German doesn´t mean the same in British English also it´s different in American English. |
|
|
|
 |
Brujo

|
Posted:
Fri Mar 13, 2009 2:45 pm |
|
ok I understand and the argument makes sense, however then the code and shortlinks have to be modifyed to work
thanks
Brujo |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Sun Mar 22, 2009 8:24 am |
|
Sorry that this has sat so long and thank you Susann for raising the issue again within our internal bug tracker. I have found the source of the problem and its not ShortLinks, but Statistics code which needs to be corrected. You may fix as follows:
=== OPEN FILE ===
modules/Statistics/index.php
=== FIND CODE ===
Code:
function showMonthStats($nowyear,$nowmonth){
global $prefix,$bgcolor1,$bgcolor2,$db, $ThemeSel, $module_name;
$l_size = getimagesize("themes/$ThemeSel/images/leftbar.gif");
$m_size = getimagesize("themes/$ThemeSel/images/mainbar.gif");
$r_size = getimagesize("themes/$ThemeSel/images/rightbar.gif");
$resultmonth = $db->sql_query("SELECT sum(hits) as TotalHitsMonth from ".$prefix."_stats_month where year='$nowyear'");
list($TotalHitsMonth) = $db->sql_fetchrow($resultmonth);
$result = $db->sql_query("select month,hits from ".$prefix."_stats_month where year='$nowyear'");
echo "<center><b>"._MONTHLYSTATS." $nowyear</b></center><br />";
echo "<table align=\"center\" bgcolor=\"$bgcolor1\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\">";
echo "<tr><td width=\"25%\" bgcolor=\"$bgcolor2\">"._UMONTH."</td><td bgcolor=\"$bgcolor2\">"._SPAGESVIEWS."</td></tr>";
while($row = $db->sql_fetchrow($result)) {
$month = getmonth(intval($row['month']));
$hits = intval($row['hits']);
echo "<tr bgcolor=\"$bgcolor1\"><td>";
if ($month != $nowmonth) {
echo "<a href=\"modules.php?name=$module_name&op=MonthlyStats&year=$nowyear&month=$month\" class=\"hover_orange\">";
echo $month;
echo "</a>";
} else {
echo $month;
}
echo "</td><td>";
$WidthIMG = round(100 * $hits/$TotalHitsMonth,0);
echo "<img src=\"themes/$ThemeSel/images/leftbar.gif\" alt=\"\" width=\"$l_size[0]\" height=\"$l_size[1]\" /><img src=\"themes/$ThemeSel/images/mainbar.gif\" height=\"$m_size[1]\" width=\"",$WidthIMG * 2,"\" alt=\"\" />";
echo "<img src=\"themes/$ThemeSel/images/rightbar.gif\" alt=\"\" width=\"$r_size[0]\" height=\"$r_size[1]\" /> ($hits)";
echo "</td></tr>";
}
echo "</table>";
}
|
=== REPLACE WITH ===
Code:
function showMonthStats($nowyear,$nowmonth){
global $prefix,$bgcolor1,$bgcolor2,$db, $ThemeSel, $module_name;
$l_size = getimagesize("themes/$ThemeSel/images/leftbar.gif");
$m_size = getimagesize("themes/$ThemeSel/images/mainbar.gif");
$r_size = getimagesize("themes/$ThemeSel/images/rightbar.gif");
$resultmonth = $db->sql_query("SELECT sum(hits) as TotalHitsMonth from ".$prefix."_stats_month where year='$nowyear'");
list($TotalHitsMonth) = $db->sql_fetchrow($resultmonth);
$result = $db->sql_query("select month,hits from ".$prefix."_stats_month where year='$nowyear'");
echo "<center><b>"._MONTHLYSTATS." $nowyear</b></center><br />";
echo "<table align=\"center\" bgcolor=\"$bgcolor1\" cellspacing=\"1\" cellpadding=\"3\" border=\"0\">";
echo "<tr><td width=\"25%\" bgcolor=\"$bgcolor2\">"._UMONTH."</td><td bgcolor=\"$bgcolor2\">"._SPAGESVIEWS."</td></tr>";
while($row = $db->sql_fetchrow($result)) {
$monthNumeric = intval($row['month']);
$month = getmonth($monthNumeric);
$hits = intval($row['hits']);
echo "<tr bgcolor=\"$bgcolor1\"><td>";
if ($month != $nowmonth) {
echo "<a href=\"modules.php?name=$module_name&op=MonthlyStats&year=$nowyear&month=$monthNumeric\" class=\"hover_orange\">";
echo $month;
echo "</a>";
} else {
echo $month;
}
echo "</td><td>";
$WidthIMG = round(100 * $hits/$TotalHitsMonth,0);
echo "<img src=\"themes/$ThemeSel/images/leftbar.gif\" alt=\"\" width=\"$l_size[0]\" height=\"$l_size[1]\" /><img src=\"themes/$ThemeSel/images/mainbar.gif\" height=\"$m_size[1]\" width=\"",$WidthIMG * 2,"\" alt=\"\" />";
echo "<img src=\"themes/$ThemeSel/images/rightbar.gif\" alt=\"\" width=\"$r_size[0]\" height=\"$r_size[1]\" /> ($hits)";
echo "</td></tr>";
}
echo "</table>";
}
|
=== END ===
Sorry about this. We should have caught it.
I have fixed this in our code library so it will be available in a future release. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Brujo

|
Posted:
Sun Mar 22, 2009 10:00 am |
|
for me the fix works
thanks
Brujo |
|
|
|
 |
nextgen
Worker


Joined: Sep 28, 2006
Posts: 241
|
Posted:
Thu Apr 16, 2009 7:04 pm |
|
Very nice fix, i missed it as well. |
_________________ alterednuke.com Your source for Ravennuke themes. |
|
|
 |
horrorcode
Involved


Joined: Jan 17, 2009
Posts: 272
Location: Missouri
|
Posted:
Fri Apr 17, 2009 12:56 am |
|
This should be a sticky... Actually explains an error I was getting from google stats. Thanks for the fix. |
|
|
|
 |
montego

|
Posted:
Fri Apr 17, 2009 7:16 am |
|
not sure who made it one, but it is now.  |
|
|
|
 |
|