Latinus wrote: Hey guys,
Why not share our data ?
Here a mysql extract from my board where the bots, the user-agent and the IP are shown (only the active bots).
http://forum.lokanova.net/bots_data.php
If you need the code, I can post it (it's quite simple).
It is not integrated in the forum and there is no style of color or other thing like that.
It's simply the raw data.
c u
Code: Select all
<?php
# Mysql settings :: Here the only 5 variables to be defined.
$host_db = "localhost"; // in most hosts it's "localhost"... change if needed.
$database = "";
$user_db = "";
$pass_db = "";
$table_pfx = "phpbb_"; // the default phpBB installation sets "phpbb_" as table prefix.
//
$bots_table = $table_pfx."bots";
//
# Mysql connexion
$cnx = mysql_connect($host_db, $user_db, $pass_db);
$select_db = mysql_select_db($database);
// Mysql SELECT
if(!($cnx)) { die("Mysql connexion failed"); }
else
{
if(!($select_db)) { die("database error, is '$database' correctly defined ?"); }
if(!($result = mysql_query("
SELECT bot_name, bot_agent, bot_ip
FROM $bots_table
WHERE bot_visits != 0
ORDER BY bot_id ASC
",
$cnx ))) { die("bad mysql request"); }
}
// Data retrieving
$listing = "<table width=\"90%\" border=\"1\">\n";
$new_line = "\t<tr>\n\t\t<td>";
while($row = mysql_fetch_assoc($result))
{
$listing .= "$new_line$row[bot_name]</td>\n\t\t<td>$row[bot_agent]</td>\n\t\t<td>$row[bot_ip]</td>\n\t</tr>\n";
}
$listing .= "</table>";
// Destroy Mysql data from memory
mysql_free_result($result);
mysql_close($cnx);
//
# HTML output
print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n\t<title>blabla</title>\n</head>\n<body>\n$listing\n</html>";
unset($listing);
?>
GroovePlugs wrote: I've got CH 2.04. Everything works except the bot's don't show up in the who's online box. Do they show up for your forum?
Code: Select all
#-----[ OPEN ]------------------------------------------------------
viewonline.php
#-----[ INLINE FIND ]------------------------------------------------
s.session_page, s.session_ip
#-----[ INLINE AFTER, ADD ]------------------------------------------
, s.is_robot
#-----[ FIND ]-------------------------------------------------------
$username = $lang['Guest'];
#-----[ REPLACE WITH ]-----------------------------------------------
if($row['is_robot'])
{
$username = $row['is_robot'] . ' ( Bots )';
} else {
$username = $lang['Guest'];
}
#-----[ OPEN ]------------------------------------------------------
includes/page_header.php
#-----[ INLINE FIND ]------------------------------------------------
s.session_logged_in, s.session_ip
#-----[ INLINE AFTER, ADD ]------------------------------------------
, s.is_robot
#-----[ FIND ]-------------------------------------------------------
$guests_online++;
#-----[ AFTER, ADD ]-----------------------------------------------
if( $row['is_robot'] )
{
$online_userlist = $row['is_robot'] . (($online_userlist!='') ? ', ' : '') . $online_userlist;
}