I was very happy with this so I'll share my solution.
Download the tablesort.js script from http://www.frequency-decoder.com/2006/09/16/unobtrusive-table-sort-script-revisited
(script is not mine BTW)
open your awstats.pl file (make backup first!) and on line 657 (I used version 6.5) where it reads:
Then scroll down to EXTRASECTIONS where the table headers are defined. (line 10360)
add class=\sortable\" to every <th> definition
so the line
will look like this:
print "<th class=\sortable\">".$ExtraFirstColumnTitle[$extranum]."</th>";
do this also on lines 10361 until 10364.
Now you can click all the table headers in your extrasections to sort the tables really fast. Nice little arrows will be displayed in very tableheader to show sort order.
Ofcourse you can also add sortable columns the same way to all sections of the awstats report, just give the <th> headers class=sortable.
You can look further into the options (like autosorting columns when page loads) on the mentioned URL.
I've tried this every way that I can think of. It works on the first page but I can't get it to work on the second-level pages. (Meaning: It works for the extra sections on the first page but not for the pages you get to when clicking "full list")
Anyone know where those <th>'s are defined/printed? I've tried most of the ones I see but none seem to affect the "full list" pages.
i made a typo, where it reads
it should ofcourse be
If somebody is looking for the patch, here it goes.
Log in to post a comment.