PHPBB Guest visitors info listing

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.

PHPBB Logo

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.




3 Comments so far »

  1. Testttyq said,

    Wrote on June 15, 2008 @ 8:42 pm

    Hi all!

    Bye

  2. Testttyq said,

    Wrote on June 17, 2008 @ 1:33 pm

    Hello

    G’night

  3. Timmy said,

    Wrote on June 27, 2008 @ 6:41 am

    Lucky to find you, keep on the good workk guys! Best of luck.

Comment RSS · TrackBack URI

Leave a Comment

You must be logged in to post a comment.

Google