Codice:
<?php
/*
# CS_Info 1.0.0 by Giuseppe La Manna #
# Copyright (c) 2005 by Come Sono??? #
# http://www.comesonooo.altervista.org #
# */
// PATCHED 2.9
/*if ( !defined('NUKE_FILE') ) {
Header("Location: index.php");
die();
}*/
// NON PATCHED
if (stristr($_SERVER['PHP_SELF'], "block-CS_Info.php") OR stristr($_SERVER['SCRIPT_NAME'], "block-CS_Info.php")) {
Header("Location: index.php");
die();
}
@require_once('includes/urinfo_func.php');
global $user, $admin, $cookie, $prefix, $user_prefix, $db, $anonymous, $startdate, $gfx_chk, $sentineladmin;
$content = '';
cookiedecode($user);
$uname = $cookie[1];
$uip = urinfo_get_ip();
if ($sentineladmin <= 0) {
$content .= "<div id=\"overDiv\" style=\"position:absolute; visibility:hidden; z-index:9666\"></div>";
$content .= "<script type=\"text/javascript\" src=\"includes/overlib.js\"></script>";
$content .= "<script type=\"text/javascript\" src=\"includes/overlib_hideform.js\"></script>";
}
$tot = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users." WHERE user_id > 1"));
$usersord = $db->sql_fetchrow($db->sql_query("SELECT usersorder FROM $prefix"._urinfo_conf));
$result = $db->sql_query("SELECT uname, guest, host_addr FROM $prefix"._session." WHERE guest = '0' ORDER BY $usersord[usersorder] DESC");
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
if (is_user($user) OR is_admin($admin)) $basepath = 'images/blocks/CS_Info/reg'; else $basepath = 'images/blocks/CS_Info/anon';
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 0) {
if ($session[uname] == $uname) $ip = $uip; else $ip = $session[host_addr];
$godadmin = $db->sql_numrows($db->sql_query("SELECT aid FROM ".$prefix."_authors WHERE aid = '$session[uname]' AND name = 'God'"));
$coadmin = $db->sql_numrows($db->sql_query("SELECT aid FROM ".$prefix."_authors WHERE aid = '$session[uname]' AND name IS NOT 'God' AND radminsuper = '1'"));
if (!is_admin($admin) && $uname != $session[uname]) $ip = SetLastIPByteXXX($ip);
list ($pic, $king) = $db->sql_fetchrow($db->sql_query("SELECT pic, king FROM ".$prefix."_urinfo WHERE view = '$session[uname]'"));
if ($godadmin || $king == '1') $img = "admin.gif"; elseif ($coadmin || $king == '0') $img = "co-admin.gif"; else $img = "msg.gif";
list ($where) = $db->sql_fetchrow($db->sql_query("SELECT module FROM ".$prefix."_urinfo_where WHERE username = '$session[uname]'"));
if (is_admin($admin)) $tit = $ip." - $where<br>"._CLICKFORPROFILE; else $tit = _VIEWPROFILEOF." $session[uname] - $where";
$who_online_now .= "<a href=\"modules.php?name=Private_Messages&mode=post&pm_uname=$session[uname]\">";
$who_online_now .= "<img src=\"$basepath/$img\"/ border=\"0\" ".help(_SENDPMTO." $session[uname]")." vspace=\"1\" align=\"absmiddle\"></a>";
$who_online_now .= " <a ".help($tit)." href=\"modules.php?name=Your_Account&op=userinfo&username=$session[uname]\">$session[uname]</a>";
if (isset($pic) && $pic != '') $who_online_now .= " <img src=\"images/blocks/CS_Info/cat/$pic\" border=\"0\" vspace=\"1\">";
$who_online_now .= "<br>";
}
}
$Today = getdate();
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];
if ($pmonth=="January") { $pmonth=1; } else
if ($pmonth=="February") { $pmonth=2; } else
if ($pmonth=="March") { $pmonth=3; } else
if ($pmonth=="April") { $pmonth=4; } else
if ($pmonth=="May") { $pmonth=5; } else
if ($pmonth=="June") { $pmonth=6; } else
if ($pmonth=="July") { $pmonth=7; } else
if ($pmonth=="August") { $pmonth=8; } else
if ($pmonth=="September") { $pmonth=9; } else
if ($pmonth=="October") { $pmonth=10; } else
if ($pmonth=="November") { $pmonth=11; } else
if ($pmonth=="December") { $pmonth=12; };
$test = mktime (0,0,0,$pmonth,$pmday,$pyear);
$curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
$preday = strftime ("%d",$test);
$premonth = strftime ("%B",$test);
$preyear = strftime ("%Y",$test);
$curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
$row = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'"));
$userCount = $row['userCount'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'"));
$userCount2 = $row2['userCount'];
$guest_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest = '1'"));
$member_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest = '0'"));
$member_online_num = $db->sql_numrows($db->sql_query("SELECT uname FROM ".$prefix."_session WHERE guest='0'"));
$member_att = $db->sql_numrows($db->sql_query("SELECT username FROM ".$prefix."_users_temp"));
$who_online_num = $guest_online_num + $member_online_num;
if (is_user($user)) {
$avatar_default = './modules/Forums/images/avatars/blank.gif';
$row3 = $db->sql_fetchrow($db->sql_query("SELECT user_id, user_avatar, user_avatar_type FROM $user_prefix"._users." WHERE username='$uname'"));
$uid = intval($row3[user_id]);
$avatar = $row3[user_avatar];
$tipo = intval($row3[user_avatar_type]);
list($avatar_path) = $db->sql_fetchrow($db->sql_query("SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='avatar_path'"));
list($avatar_gallery_path) = $db->sql_fetchrow($db->sql_query("SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='avatar_gallery_path'"));
list($avatar_allowupload) = $db->sql_fetchrow($db->sql_query("SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='allow_avatar_upload'"));
list($avatar_allowremote) = $db->sql_fetchrow($db->sql_query("SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='allow_avatar_remote'"));
list($avatar_allowlocal) = $db->sql_fetchrow($db->sql_query("SELECT config_value FROM ".$prefix."_bbconfig WHERE config_name='allow_avatar_local'"));
switch ($tipo) {
case 1 : $avatar = ($avatar_allowupload) ? $avatar_path . '/' . $avatar : $avatar_default; break;
case 2 : $avatar = ($avatar_allowremote && eregi('^http:\/\/.+\.(gif|jpe?g|png|tga|bmp)$', $avatar)) ? $avatar : $avatar_default; break;
case 3 : $avatar = ($avatar_allowlocal) ? $avatar_gallery_path . '/' . $avatar : $avatar_default; break;
default: $avatar = $avatar_default;
}
$content .= "
<center>
"._BWEL." <b>$uname</b>
<br><img border=\"0\" vspace=\"3\" src=\"$avatar\" align=\"absmiddle\"/><br>
"._YOURIP.": <b>$uip</b><br>
<a href=\"modules.php?name=Your_Account&op=logout\"> "._LOGOUT." <img src=\"images/blocks/CS_Info/logout.gif\" border=\"0\" title=\""._LOGOUT."\" align=\"absmiddle\"></a>
<br><hr>
</center>";
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
if ($newpms > 0)
$content .= "<center><a href=\"modules.php?name=Private_Messages\"><img src=\"$basepath/newmsgs.gif\" border=\"0\" vspace=\"2\" align=\"absmiddle\" title=\""._BPM."\"></a><bgsound src=\"$basepath/boink.wav\" loop=\"".$newpms."\" volume=\"100\"></center>";
else
$content .= "<img src=\"$basepath/email-y.gif\" border=\"0\" vspace=\"1\" align=\"absmiddle\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
$content .= "<img src=\"$basepath/email-r.gif\" border=\"0\" vspace=\"1\" align=\"absmiddle\"> "._BUNREAD.": <b>$newpms</b><br>\n";
$content .= "<img src=\"$basepath/email-g.gif\" border=\"0\" vspace=\"1\" align=\"absmiddle\"> "._BREAD.": <b>$oldpms</b><br>\n<hr>\n";
} else {
if (!is_admin($admin)) {
$content .= "<center>"._HELLO." <b>$anonymous</b><br>";
$content .= "<center><a href=\"modules.php?name=Your_Account&op=new_user\"><img border=\"0\" src=\"images/blocks/CS_Info/reg.gif\" title=\""._REGISTERED."\"></a><br>"._YOUAREANON."</center>";
} else $content .= "<center>"._HELLO." <b>"._ADMIN."</b>";
$content .= "
<hr><form action=\"modules.php?name=Your_Account\" method=\"post\" style=\"margin:0,0,0,0\">
<input type=\"hidden\" name=\"op\" value=\"login\" />
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td align=\"right\">"._NICKNAME.":</td>
<td align=\"right\"><input size=\"10\" ".help(_TYPEUSERNAMEHERE)." type=\"text\" name=\"username\" maxlength=\"25\" style=\"width:80\"/></td>
</tr>
<tr>
<td align=\"right\">"._PASSWORD.":</td>
<td align=\"right\"><input size=\"10\" ".help(_TYPEPASSWORDHERE)." type=\"password\" name=\"user_password\" maxlength=\"20\" style=\"width:80\"/></td>
</tr>
";
-> continua sotto