PHPBB Guest visitors info listing
Posted By: paimpozhil
|
||||||||||
Sometimes, We need to monitor that, Who is visiting our forum without logging in. People who struggled a lot with spammers on their phpbb board should need some monitoring script to trace the guests.

Save the below code as “infolist.php”;
<?php
include "config.php";
mysql_connect($dbhost,$dbuser,$dbpasswd);
mysql_select_db($dbname);
$sql = mysql_query("SELECT * FROM `phpbb_sessions` where
`session_user_id` = '-1' group by `session_ip` order by `session_time`
asc ");
echo ("IP Address - HostName - Start Time - End Time - VisitingPage<br
/> ");
while(($result = mysql_fetch_assoc($sql)))
{
$r = $result;
echo decode_ip($r["session_ip"]) . " - " .
gethostbyaddr(decode_ip($r["session_ip"])) . " - <b>" . date("M d Y
H:i:s",$r["session_start"]) . " - " . date(" H:i:s",$r["session_time"])
. "</b>" ;if ($r["session_page"]!=0){
echo '<a href="/forums/viewforum.php?f=' . $r["session_page"] . '"
target=_blank > Looking into Page </a>';
}
echo "<br />";
}
mysql_close();
function decode_ip($int_ip)
{
$hexipbang = explode('.', chunk_split($int_ip, 2, '.'));
return hexdec($hexipbang[0]). '.' . hexdec($hexipbang[1]) . '.' .
hexdec($hexipbang[2]) . '.' . hexdec($hexipbang[3]);
}
?>
Upload the infolist.php to the phpbb forum root folder.
Code will work fine on any phpbb 2.x.x release.
Hope, It will help someone who fights with blind spammers on their phpbb.
























