PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Brujo
Regular
Regular


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

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

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:
Only registered users can see links on this board!
Get registered or login to the forums!


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:
Only registered users can see links on this board!
Get registered or login to the forums!


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: 3143
Location: Germany:Moderator German NukeSentinel Support

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

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 Visit poster's website
Brujo
Regular
Regular


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

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

ok I understand and the argument makes sense, however then the code and shortlinks have to be modifyed to work

thanks
Brujo
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

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

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


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

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

for me the fix works

thanks
Brujo
View user's profile Send private message
nextgen
Worker
Worker


Joined: Sep 28, 2006
Posts: 135
Location: Maryland

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

Very nice fix, i missed it as well.
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
horrorcode
Involved
Involved


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

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

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 Visit poster's website MSN Messenger
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

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

not sure who made it one, but it is now. Cool
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum