2012-08-22, 16:48:47
mvlcek Wrote:michaellindahl Wrote:Yes that is true, could you assist me in finding the place where I would need to patch the plugin for my specific use? Thanks.
hitcount.php, function hitcount_init_page (not tested):
Code:function hitcount_init_page() {
global $url;
$post = @$_GET['post'];
if ($url == 'blog' && $post) {
hitcount_init($url.'-'.$post);
} else {
hitcount_init($url);
}
}
Awesome! Thanks, that works perfectly. I have tried to modify the following to retrieve the hits on specific blog pages and from my testing this works:
Code:
function return_hitcount_hits($slugOrFile) {
$post = @$_GET['post'];
if ($slugOrFile == 'blog' && $post) {
$hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile).'-'.preg_replace('/[^A-Za-z0-9\.-]+/','_',$post) . '.txt');
} else {
$hits = @file(GSDATAOTHERPATH . HITCOUNT_DIR . 'hits_' . preg_replace('/[^A-Za-z0-9\.-]+/','_',$slugOrFile) . '.txt');
}
return $hits ? $hits[0] : 0;
}