took this from v1 forums incase ppl dont look there works perfect on v2.05
create a new file ircstats.php copy the code below and upload to root web directory
now open the remotes window in mIRC with ctrl+r
go to file new
and paste this into the window
also change localhost for your site url
create a new file ircstats.php copy the code below and upload to root web directory
<?
// IRC Stats v1.2 by TorrentialStorm
// DO NOT remove the credits.
// If you want to change the output, fine. Just don't come to me if you can't read my code.
require "backend/functions.php";
dbconn(false);
$search = sqlesc(trim($_GET['search']));
$b = chr(2);
$c = chr(3);
$res = @mysql_query("SELECT users.id, users.class, users.downloaded, users.uploaded, users.username, count(distinct torrents.id) as 'torrents', count(distinct comments.id) as comments, count(distinct forum_posts.id) as forumposts, count(distinct peers.id) as transfers FROM users LEFT JOIN torrents ON users.id = torrents.owner LEFT JOIN comments ON users.id = comments.user LEFT JOIN forum_posts ON users.id = forum_posts.userid LEFT JOIN peers ON users.id = peers.userid WHERE users.username = $search AND users.status = 'confirmed' GROUP by users.id") or die("Database error");
$num = @mysql_num_rows($res);
if($num < 1) {
echo $search." - No such user, please try again.";
die;
}
$arr = @mysql_fetch_assoc($res);
$seeders = get_row_count("peers", "WHERE userid={$arr['id']} AND seeder='yes'");
$leechers = get_row_count("peers", "WHERE userid={$arr['id']} AND seeder='no'");
if($arr[uploaded] == 0 && $arr[downloaded] == 0)
$ratio = "N/A";
elseif ($arr[downloaded] > 0)
$ratio = $arr[uploaded]/$arr[downloaded];
else
$ratio = 0.00;
if (is_numeric($ratio)) $ratio = number_format($ratio, 2);
$arr['downloaded'] = mksize($arr['downloaded']);
$arr['uploaded'] = mksize($arr['uploaded']);
$arr['class'] = get_user_class_name($arr['class']);
$out .= "$b{$c}09$arr[username]$b{$c}10 - {$c}13Downloaded: {$c}10({$c}04$arr[downloaded]{$c}10) - {$c}13Uploaded: {$c}10({$c}04$arr[uploaded]{$c}10)";
$out .= " - {$c}13Ratio: {$c}10({$c}04$ratio{$c}10) - {$c}13Class: {$c}04($arr[class]{$c}10)";
$out .= " - {$c}13Torrents Posted: {$c}10({$c}04$arr[torrents]{$c}10) - {$c}13Comments: {$c}10({$c}04$arr[comments]{$c}10)";
$out .= " - {$c}13Forum Posts: {$c}10({$c}04$arr[forumposts]{$c}10) - {$c}13Active Transfers: {$c}10({$c}04$arr[transfers]{$c}10)";
$out .= " - {$c}13Seeding: {$c}10({$c}04$seeders{$c}10) - {$c}13Leeching: {$c}10({$c}04$leechers{$c}10)";
print $out;
?>mIRC Script now open the remotes window in mIRC with ctrl+r
go to file new
and paste this into the window
also change localhost for your site url
on !*:join:#your.channel.here:$hello(#,$nick)
on $*:text:/^!stats\s(\S+)$/iS:#your.channel.here:$hello(#,$regml(1))
alias -l hello {
if (!$sock(hello)) {
sockopen hello localhost 80
sockmark hello msg $1 $+(/ircstats.php?search=,$2)
}
}
on *:sockopen:hello:{
sockwrite -n $sockname GET $gettok($sock(hello).mark,3,32) HTTP/1.1
sockwrite -n $sockname Host: $+($sock(hello).addr,$str($crlf,2))
}
on *:sockread:hello:{
var %hello | sockread %hello
if ($regex(%hello,/(.+ $+ $gettok($sock(hello).mark,2,61) $+ .+)/)) {
$gettok($sock(hello).mark,1-2,32) $regml(1)
sockclose hello
}
}