Recent Topics

1 Jan 15, 2005 23:22    

This is a rewrite of a hack originally covered in a different thread. That one added a field to the posts table and incremented a counter each time the post was displayed as a single post page. Spammers or robots not in your conf/_stats file would increment it, and there was no automatic way to decrement it. This version adds a field to the hitlog table for either 0 or the post ID. Spammer hits would show the post ID, but then you delete them so it's cool. Robots not in conf/_stats don't automatically correct. Autopruning stats will cause changes to the heavy hitters list over time. This version does not have a per-post display method. Wouldn't be hard really - I just didn't go there. It's a fairly complicated hack. Alter a table, edit a b2evocore file, edit all your skins, add a new file to your skins/skinname folder(s), edit almost everything in the xmlsrv folder, and your 'noskin' files if you use them.

http://wonderwinds.com/hackblog.php/2005/01/15/a_better_heavy_hitters

Have fun!!!

2 Jan 19, 2005 07:28

If you used this you might want to fix a bug I found. Seems on disp=blah pages the values for $post_id_is and $author_is were not set because I used an if/else inside the posts loop. The corrective action is to set them to 0 before the posts loop and adjust them as need be once inside. Like so:

$post_id_is = $author_is = 0;
if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
$MainList->date_if_changed(); // display post date if it changed
$Item->anchor(); // Anchor for permalinks to refer to
if( $disp == 'single' ) {
	$post_id_is = $Item->get('ID');
	$author_is = $Item->Author->get('ID');
	} ?>


Form is loading...