Hacking ShortStat


Published on August 6, 2005 at 7:32 PM EST
In the Tutorials category.

http://www.eatdrinksleepmovabletype.com/upload/2005/10/shortstat-thumb.gif

Earlier this week I installed ShortStat, a great little statistics tool from Shaun Inman. Its results are rather minimalist, but key information gets reported. ShortStat is easily integrated with Movable Type (and just about everything else, too).

I’ve detailed the changes I made below. If you’re already running ShortStat and are feeling brave, you can just grab my modified functions.php and styles.css files. These are for version 0.36b of ShortStat.

Eliminating Horizontal Scrollbars

Every ShortStat installation I’ve seen has horizontal scrollbars at every location. These drive me nuts. I had to eliminate them.

Line 43 of styles.css is width: 256px;. Change it to width: 253px; and those horizontal scroll bars should disappear.

Hits in the Last Week

hitsinthelastweek.gif

Normally, this section displays the total hits from today and the previous 6 days. Today’s results, however, are also shown just above. I don’t need to see them listed in both places, so I made a change to see the previous 7 days.

In functions.php find the SI_getWeeksHits() function at line 510. Go down a little to line 528 and change for ($i=0; $i<7; $i++) { to for ($i=1; $i<8; $i++) {. The two changed numbers are bolded.

More Resources

I wanted to see more than the default 36 Resources list, so I upped that to the top 100.

In functions.php, find the SI_getResources() function at line 381. Change line 395 from LIMIT 0,36"; to LIMIT 0,100";.

Languages Data Table

Every ShortStat install I’ve seen places the Language data table at the very bottom of the page, requiring further scrolling to see a single, lonely table.

Fix this by opening styles.css and going to line 26, which reads height: 606px;. Change to height: 595px;.

That’s it. As I said above, you can just grab my modified functions.php and styles.css files. These are for version 0.36b of ShortStat.