Recent Topics

Extended admin stats

Started by on Feb 17, 2004 – Contents updated: Feb 17, 2004

Feb 17, 2004 10:56    

Hi everybody,

Yesterday I was hit by idea to extend current stats for admin part of the blog. What do you think about ability to track visitors time, their IP (resolved to country), requested page and offset by blog? Ability to delete hit is also required (I'm looking suspicious to my hit_log table's rapid grow...)

Someone may already have it implemented. Maybe willing to share it? B)

This could be quick start:

function mg_visits ()
{ 	global $row_stats;

$sql = "SELECT visitID, hit_blog_ID, hit_remote_addr, referingURL, DATE_FORMAT(visitTime, '%Y.%m.%d, %H:%m') AS visitTime, visitURL FROM mg_hitlog ORDER BY visitTime DESC"; 
$result = mysql_query ($sql) or die (mysql_error()); 

//here is the loop that produces the IPs, etc 

while (list($row_stats["visitID"], $blog, $IP, $refer, $time, $url) = mysql_fetch_row($result)) { 
?><a href="b2stats.php?action=delete&hit_ID=<?php echo $row_stats["visitID"]; ?>&show=visits&blog=<?php echo $blog ?>" title="<?php echo T_('Delete this hit!') ?>"><img src="img/xross.gif" width="13" height="13" class="middle" alt="<?php echo /* TRANS: Abbrev. for Delete (stats) */ T_('Del') ?>" /></a>
echo "IP: $IP - Time: $time - Ref: <a href=\"$refer\">$refer</a> - Page: <a href=\"$url\">$url</a><br />"; 


Feb 18, 2004 16:11

I think that'd be super-cool and way useful.

Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.