Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues
Author Message
Brujo
Regular
Regular



Joined: Jun 04, 2004
Posts: 84
Location: Germany

PostPosted: Fri Mar 13, 2009 4:25 am Reply with quote

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

Quote:

http://my.domain/modules.php?name=Statistics&op=MonthlyStats&year=2008&month=Dezember


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:

Quote:

http://my.domain/modules.php?name=Statistics&op=MonthlyStats&year=2008&month=12


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
 
View user's profile Send private message
Susann
Moderator



Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Fri Mar 13, 2009 5:50 am Reply with quote

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.
 
View user's profile Send private message
Brujo







PostPosted: Fri Mar 13, 2009 2:45 pm Reply with quote

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

PostPosted: Sun Mar 22, 2009 8:24 am Reply with quote

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&amp;op=MonthlyStats&amp;year=$nowyear&amp;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&amp;op=MonthlyStats&amp;year=$nowyear&amp;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! 
View user's profile Send private message Visit poster's website
Brujo







PostPosted: Sun Mar 22, 2009 10:00 am Reply with quote

for me the fix works

thanks
Brujo
 
nextgen
Worker
Worker



Joined: Sep 28, 2006
Posts: 241

PostPosted: Thu Apr 16, 2009 7:04 pm Reply with quote

Very nice fix, i missed it as well.

_________________
alterednuke.com Your source for Ravennuke themes. 
View user's profile Send private message Send e-mail
horrorcode
Involved
Involved



Joined: Jan 17, 2009
Posts: 272
Location: Missouri

PostPosted: Fri Apr 17, 2009 12:56 am Reply with quote

This should be a sticky... Actually explains an error I was getting from google stats. Thanks for the fix.
 
View user's profile Send private message
montego







PostPosted: Fri Apr 17, 2009 7:16 am Reply with quote

not sure who made it one, but it is now. Cool
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.30.01 RN All Other Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©