AWStats - Fix and Improvement (working)

Discussion in 'Developers' Forum' started by erosbk, Jul 29, 2011.

  1. erosbk

    erosbk New Member

    ** Update: Bug Fix **

    index.php must be changed to keep order of year-month in list. (/usr/local/ispconfig/server/conf/awstats/index.php.awstats)

    In months with two digits (10, 11, 12) order is broken => 1,10,11,12,2,3...9

    Custom key and order by key fixed this bug.

    Main post has been updated with modification. It should work ok now, without bugs...

    All index.php must be updated in stats folder if someone is using this.

    Till, could you update svn please?

    Regards
     
    Last edited: Oct 2, 2011
  2. falko

    falko Super Moderator Howtoforge Staff

    I've added this to our bugtracker. :)
     
  3. erosbk

    erosbk New Member

    Thanks Falko, this bug also gives 404 when selecting stats for current month, I hope this be updated before release xD

    Edit: error with variable names in index.php.awstats. Thread updated.
     
    Last edited: Oct 2, 2011
  4. erosbk

    erosbk New Member

    Main thread updated, code added (new variable to format key for future years and keep sort) in index.php.awstats:

    ...
    $orderkey = substr($file,0,4).substr($file,5,2);
    if (substr($file,5,2) < 10 )
    {
    $orderkey = substr($file,0,4)."0".substr($file,5,2);
    }
    $awprev[$orderkey] = $file;
    ...

    I think that there are no more bugs...
     
  5. zbuzanic

    zbuzanic Member

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I will check that.

    Please be aware that the fixes for 3.0.4 are not developed in trunk (latest), the fixes are in the stable branch and will get merged with trunk only from time to time. The stable branch is:

    svn://svn.ispconfig.org/ispconfig3/branches/ispconfig-3.0.4/

    so if a bug is reported as fixed here, then it is fixed in the stable branch. To update your install to to svn stable branch, you can get the code like this:

    svn export svn://svn.ispconfig.org/ispconfig3/branches/ispconfig-3.0.4

    then go to the install folder and run the update.php script.
     
  7. zbuzanic

    zbuzanic Member

    Yes, I'm aware of branches and I'm using 3.0.4 branch, any ideas what/where should I check?
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    I think I've found the problem. There was a mismatch in the filnename. Please edit the index.php file in the stats directory and replace:

    $aw['aw_renamed_index'] = 'fixedindex.html';

    with:

    $aw['aw_renamed_index'] = 'awsindex.html';

    to see if that solves the problem.
     
    Last edited: Oct 24, 2011
  9. zbuzanic

    zbuzanic Member

    Yes, it works now. I tought it was something like that but didn't want to mess with code atm. Thank you :).
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Thanks for testing it! I've uploaded the fixed files to svn.
     
  11. maumar

    maumar Member

    this enhancement is a must for awstat users ...
    imho, none of us can use awstats without it :)
    Do you plan to include it on a future release?
    should be filed an RFE on bugzilla?
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    This is already included in ispconfig 3.0.4.
     
  13. erosbk

    erosbk New Member

    This is a minor Bugfix for combobox order.

    In index.php, code below must be replaced

    Code:
            $current = $year.$month;
            $awprev[$current] = $year."-".$month;
    
    by this one (just add the four lines of the "if" betweeb both lines to fix order)

    Code:
            $current = $year.$month;
    
            if ( $month < 10 )
            {
                    $current = $year."0".$month;
            }
    
            $awprev[$current] = $year."-".$month;
    
    Main thread has been updated. If latest ispconfig version or svn doesn't have this lines, bug if present there too. Could some one check this on svn? I am working with 3.0.3.3, I didn't updated yet.

    Thanks

    edit: Couln't edit main post =/, Till, could you updated it? thanks!
     
    Last edited: Jan 2, 2012
  14. baskin

    baskin Member

    How can i see the previous month stats?

    I'm getting a dropdown "Jump to previous stats" with 2012-4 value in it but it doesn't do anything.

    I have a full month (2012-4) and today's statistics. The default page shows now this month (May).
     

Share This Page