Include this code at the top of your site pages that you want monitored for search engine bot activity at the very top line of the code.
- Code: Select all
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/botmonitor/bm.php'); ?>
If you change the location of the bm.php file then you must also change the above code.
open the bm-settings.php file and modify the database info email addresses, names and site url at the top.
Use the install.sql file to create a database for storing your bot monitor records and your all done.
you can use the following code to display the last 100 bot visits in a webpage for what ever use you need assuming you have chosen to activate the database features of the script to log bot visits in your mysql database.
Place this within ur php code where you wish the info to be displayed, make sure the first line of your code is the bot monitor include listed above so that database settings will work and that you have set the database settings in the bm-settings.php file and chosen Y for the use of database.
- Code: Select all
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/botmonitor/bm-settings.php'); ?>
<table width="100%" border="0"align="center">
<tr><td width="150"><div align="center">IP Address</div></td><td width="150"><div align="center">Bot ID</div></td><td width="200"><div align="center">Date/Time</div></td><td width="200"><div align="center">Page Visited</div></td></tr>
<?php
dbinit();
// Fetch rows from AuthUser table and display ALL users
$result = mysql_query("SELECT * FROM bwwd_bm WHERE id <= 100 ORDER BY id DESC");
$row = mysql_fetch_array($result);
while ($row) {
print "<tr>";
print " <td width=\"150\">";
print " <div align=\"center\">";
print $row['ip'];
print " </div>";
print " </td>";
print " <td width=\"150\">";
print " <div align=\"center\">";
print $row['bot'];
print " </div>";
print " </td>";
print " <td width=\"200\">";
print " <div align=\"center\">";
print $row['visit'];
print " </div>";
print " </td>";
print " <td width=\"200\">";
print " <div align=\"center\">";
print " <a href=\"http://".$row['page']."\">";
print $row['page'];
print " </a>";
print " </div>";
print " </td>";
print "</tr>";
$row = mysql_fetch_array($result);
}
?>
</table>
Edit the settings file with your database info and other site/email info and chose the settings you wish to use to record the bot visits, either email database or both.
