Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
Maclain
Regular
Regular


Joined: Feb 25, 2006
Posts: 60
Location: England

PostPosted: Mon Mar 06, 2006 2:48 pm Reply with quote

I recently downloaded the Data Center block (which is basically a replacement for the user info block) and it's great.

The only issue i have with it is that di displays IP address's, i aint sure where to edit the code to remove this, anyone care to have a look for me?

The data_center_block.php code is as follows:

Code:
<?php 

/************************************************************/
/* (C) 2004                                                 */
/* All rights beyond the GPL are reserved                   */
/* http://www.bpmorgan.com                                  */   
/*for support go to Only registered users can see links on this board! Get registered or login!                       */
/* email:   webmaster@bpmorgan.com                          */
/************************************************************/
$most = "Most Downloaded";
$latest = "Latest Downloads";
$totalfiles = "Total Files";
$totalcategories = "Total Categories";
$totaldownloads = "Files Downloaded";
$hitstext = "Hits";
$uploaded ="Files Uploaded";


if (eregi("block-Data_Center_V2.php",$_SERVER['PHP_SELF'])) {Header("Location: index.php");}

function convertIP ($xip) {
global $admin;
if (is_admin($admin)) return $xip;
$xipx = explode('.',$xip);
for ($i=3;$i<count($xipx);$i++) {
$xipx[$i] = preg_replace ('/(0|1|2|3|4|5|6|7|8|9)/', "X", $xipx[$i]);
}
return implode('.',$xipx);
}

global $user, $cookie, $prefix, $user_prefix, $db, $dbi, $anonymous, $mode, $t, $f, $redirect, $random_num, $userinfo, $gfx_chk, $Version_Num,$bgcolor1;

/***********************************************************************************************************************/
$TBLWIDTH   = "98%";    # WIDTH OFF THE BLOCK CAN BE % OFF OR FIXED SIZE LIKE 150
$GALLERY    = "";       # WHEN YOU DONT SEE AVATARS AS GUEST OR MEMBER TYPE gallery BETWEEN THE 2 QUOTES $GALLERY  = "gallery";
$PM         = "1";      # 1 = PRIVATE MESSAGES BLOCK ON  /  0 = PRIVATE MESSAGES BLOCK OFF
$ST         = "1";      # 1 = SECURITY CODE ON           /  0 = SECURITY CODE OFF
/***********************************************************************************************************************/

$content  = "";
$username = $cookie[1];
$ip = getenv( "REMOTE_ADDR" );
getusrinfo($user);
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
$datekey = date("F j");
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 10);
cookiedecode($user);
$sql = "SELECT username FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$lastuser = $row[username];
$numrows = $db->sql_numrows($db->sql_query("SELECT user_id FROM $user_prefix"._users.""));

$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$l = 1;
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 0) {
if ($l < 10) {
$resultuser_id = sql_query( "SELECT user_id FROM ".$prefix."_users where username='$session[uname]'", $dbi );
list( $user_id ) = sql_fetch_row( $resultuser_id, $dbi );
$who_online_now .= "&nbsp;0$l:<A HREF=\"forum-userprofile-.html$user_id\"><img src=\"images/blocks/userprofil.gif\" align=\"absmiddle\" border=\"0\" ALT=\"Forum profile $session[uname] \"></a><A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a><br>\n";
} else {
$resultuser_id = sql_query( "SELECT user_id FROM ".$prefix."_users where username='$session[uname]'", $dbi );
list( $user_id ) = sql_fetch_row( $resultuser_id, $dbi );
$who_online_now .= "&nbsp;$l:<A HREF=\"forum-userprofile-.html$user_id\"><img src=\"images/blocks/userprofil.gif\" align=\"absmiddle\" border=\"0\" ALT=\"Forum profile $session[uname] \"></a><A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a><br>\n";
}
$who_online_now .= ($l != $member_online_num ? "  " : "");
$l++;
}}

$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=1";
$result = $db->sql_query($sql);
$gmember_online_num = $db->sql_numrows($result);
$gwho_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
if (isset($session["guest"]) and $session["guest"] == 1) {
if ($i < 10) {
$gwho_online_now .= " 0$i: ".convertIP($session[uname])."\n";
} else {
$gwho_online_now .= " $i: ".convertIP($session[uname])."\n";
}
$gwho_online_now .= ($i != $gmember_online_num ? "  " : "");
$i++;
}
}

$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=1";
$result = $db->sql_query($sql);
$guest_online_num = $db->sql_numrows($result);
$sql = "SELECT uname FROM ".$prefix."_session WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_num = $guest_online_num + $member_online_num;
$sql = "SELECT total, members, nonmembers FROM ".$prefix."_mostonline";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$total = $row[total];
$members = $row[members];
$nonmembers = $row[nonmembers];
if ($total < $who_online_num) {
$db->sql_query("DELETE FROM ".$prefix."_mostonline WHERE total='$total' LIMIT 1", $dbi);
$db->sql_query("INSERT INTO ".$prefix."_mostonline VALUES ('$who_online_num','$member_online_num','$guest_online_num')", $dbi);
$total = $who_online_num;
$members = $member_online_num;
$nonmembers = $guest_online_num;
} else {
$sql = "SELECT total, members, nonmembers FROM ".$prefix."_mostonline";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$total = $row[total];
$members = $row[members];
$nonmembers = $row[nonmembers];
}

$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,1);
$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."%";
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount = $row[userCount];
$sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$userCount2 = $row[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"));
$pmi=($member_online_num/$who_online_num)*100; $pmi = number_format($pmi, 0);
$pvi=($guest_online_num/$who_online_num)*100; $pvi = number_format($pvi, 0);

// Determine last registered user
$result = sql_query( "select username from $prefix"._users." order by user_id DESC limit 0,1", $dbi );
list( $lastuser ) = sql_fetch_row( $result, $dbi );
// Amount of registered users
$numrows = sql_num_rows( sql_query( "select user_id from $prefix"._users."", $dbi ) );
// Amount of registered users online
$result2 = sql_query( "SELECT uname, guest FROM $prefix"._session." where guest=0", $dbi );
$member_online_num = sql_num_rows( $result2 );
$sql = "SELECT uname, guest FROM $prefix"._session." WHERE guest=0";
$result = $db->sql_query($sql);
$member_online_num = $db->sql_numrows($result);
$who_online_now = "";
$i = 1;
while ($session = $db->sql_fetchrow($result)) {
   $alevel = "";
   $result3 = $db->sql_query("SELECT user_level FROM ".$user_prefix."_users WHERE username='$session[uname]'");
   $result4 = $db->sql_query("SELECT aid FROM ".$prefix."_authors WHERE aid='$session[uname]'");
   $row3 = $db->sql_fetchrow($result3);
   $row4 = $db->sql_fetchrow($result4);
      if($row3[user_level] == 2 || $row4[aid] != ""){
         $alevel = " <br><img src=\"images/User/admin.gif\" border=0>";
      }
    elseif($row3[user_level] == 3){
       $alevel = " <br><img src=\"images/User/mod.gif\" border=0>";
    }
    if (isset($session["guest"]) and $session["guest"] == 0) {
        if ($i < 10) {
            $who_online_now .= "<tr><TD width=100%>0$i:&nbsp;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a>$alevel</td></tr>\n";
        } else {
            $who_online_now .= "<tr><TD  width=100%>$i:&nbsp;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a>$alevel</td></tr>\n";
        }
        $who_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
    }
}

/* Hits Total */
$result = sql_query("SELECT count FROM $prefix"._counter." WHERE type='total' AND var='hits'", $dbi);
$count_holder = sprintf ("%05d", implode(mysql_fetch_row($result), $dbi));
mysql_free_result ($result);
$nbhits .= $count_holder;

/* Hits for Today */
$t_time = time();
$t_year = date("Y", $t_time);
$t_month = date("n", $t_time);
$t_date = date("j", $t_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$t_year' AND month='$t_month' AND date='$t_date'", $dbi);
list($today) = sql_fetch_row($result, $dbi);

/* Hits for Yesterday */
$y_time = $t_time - 86400;
$y_year = date("Y", $y_time);
$y_month = date("n", $y_time);
$y_date = date("j", $y_time);
$result = sql_query("SELECT hits FROM $prefix"._stats_date." WHERE year='$y_year' AND month='$y_month' AND date='$y_date'", $dbi);
list($yesterday) = sql_fetch_row($result, $dbi);

/* Hourly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_hour."", $dbi);
list($hours) = sql_fetch_row($result, $dbi);
$hourly = number_format($count_holder/$hours, 0);

/* Daily Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_date."", $dbi);
list($days) = sql_fetch_row($result, $dbi);
$daily = number_format($count_holder/$days, 0);

/* Monthly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_month."", $dbi);
list($months) = sql_fetch_row($result, $dbi);
$monthly = number_format($count_holder/$months, 0);

/* Yearly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_year."", $dbi);
list($years) = sql_fetch_row($result, $dbi);
$yearly = number_format($count_holder/$years, 0);

/* Server Time */
$Time   = date("d/m/y");
setlocale (LC_TIME, "C");
$Today = (strftime ("%X\n"));
$Offset = date("Z")/3600-1;
if ($Offset >= 0) {
$Offset = "+ ".$Offset;}


$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"account.html\" method=\"post\">";

/* Info for users which is logged in */
if (is_user($user)) {
$sqlp = "SELECT user_posts AS posts FROM $user_prefix"._users." WHERE username = '$uname'";
   $result = $db->sql_query($sqlp);
   $row = $db->sql_fetchrow($result);
   $posts = $row[posts];
   if ($result) {
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH><tr><td width=\"100%\" height=\"10\"></td></tr><tr><td width=\"100%\">\n";
if ($posts>0) $content .= "<br /><center>$posts post(s)</center>\n";}
$content .= "<tr><td width=\"100%\" height=\"10\"></td></tr>\n";
$content .= "<tr><td width=\"100%\"><center><b>"._BWEL." $username</b></center></td></tr></table></div><hr noshade size=1>\n";
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\">&nbsp;<img src=\"images/blocks/ball_r.gif\" align=\"absmiddle\" alt=\"logoff\" border=\"0\">&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUT."</a></td></tr>\n";
$content .= "</table></div><hr noshade size=1>\n";
if ($PM == 1) {
$sql = "SELECT user_id FROM $user_prefix"._users." WHERE username='$username'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$uid = $row[user_id];
$newpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='1' OR privmsgs_type='5')"));
$oldpms = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td colspan=\"2\"><img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"messages.html\"><b>"._BPM."</b></a></td></tr>\n";
$content .= "<tr><td width=\"80%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BUNREAD.":</td>\n";
$content .= "<td width=\"20%\"><p align=\"right\"><b>$newpms</b></td></tr>\n";
$content .= "<tr><td width=\"80%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BREAD.":</td>\n";
$content .= "<td width=\"20%\"><p align=\"right\"><b>$oldpms</b></td>\n";
$content .= "</tr></table></div><hr noshade size=1>\n";
} else {}
} else {
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH><tr><td width=\"100%\" height=\"10\"></td></tr><tr><td width=\"100%\">\n";
$content .= "<center><img src=\"modules/Forums/images/avatars/blank.gif\" alt=\"\"></center></td></tr>\n";
$content .= "<tr><td width=\"100%\" height=\"10\"></td></tr>\n";
$content .= "<tr><td width=\"100%\"><center><b>"._BWEL." $anonymous</b></center></td></tr></table></div><hr noshade size=1>\n";
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\">&nbsp;<img align=\"absmiddle\" src=images/blocks/ball_g.gif>&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a></td></tr>\n";
$content .= "<tr><td width=\"100%\" height=\"5\"></td></tr>\n";
$content .= "<tr><td width=\"100%\">&nbsp;<img align=\"absmiddle\" src=images/blocks/ball_r.gif>&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=pass_lost\">".PASSWORD."</a></td></tr></table></div><hr noshade size=1>";
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH><tr><td width=\"100%\">\n";
$content .= "<center>"._NICKNAME."<br><input type=\"text\" name=\"username\" size=\"13\" maxlength=\"25\"><br>";
$content .= ""._PASSWORD."<br><input type=\"password\" name=\"user_password\" size=\"13\" maxlength=\"20\"><br>";
 if  ($ST ==1 AND extension_loaded("gd") AND ($gfx_chk == 3 OR $gfx_chk == 4 OR $gfx_chk == 6 OR $gfx_chk == 7)) {
    $content .= ""._SECURITYCODE.": <img src='?gfx=gfx&random_num=$random_num'' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
    $content .= ""._TYPESECCODE."<br><input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\">\n";
    $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
} else {
    $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
    $content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
}


$content .="<input type=\"hidden\" name=\"op\" value=\"login\">&nbsp;<input type=\"submit\" value=\"Go\"></center>";
$content .="<input type=\"hidden\" name=\"redirect\" value=$redirect>";
$content .="<input type=\"hidden\" name=\"mode\" value=$mode>";
$content .="<input type=\"hidden\" name=\"f\" value=$f>";
$content .="<input type=\"hidden\" name=\"t\" value=$t>";
$content .="";
$content .= "</tr></table></div><hr noshade size=1>\n";
}

/* GENERAL STATS */
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/group.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <u><b>"._BMEMP."</b></u><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BTD."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$userCount</b></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BYD."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$userCount2</b></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BOVER."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$numrows</b></td></tr>\n";
$content .= "</tr></table></div><hr noshade size=1>\n";

/* TOP 3 MEMBERS */
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\"><img src=\"images/blocks/group.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <b><u>"._BLATEST." 3 "._BMEM."</u></b><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$a = 1;
$result = sql_query("select user_id, username, user_regdate from ".$prefix."_users order by user_id DESC limit 0,3", $dbi);
while(list($lid, $title, $user_regdate) = sql_fetch_row($result, $dbi)) {
$title2 = ereg_replace("_", " ", $title);
$content .= "<tr><td width=\"100%\">&nbsp;0$a:<img src=\"images/blocks/gold.gif\" border=0 align=\"center\" ALT=\"$user_regdate\"><a title=\"$user_regdate\" href=\"forum-userprofile-.html$lid\">$title2</a></td></tr>\n";
$a++;
}
$content .= "</table></div><hr noshade size=1>\n";

/* NOW ONLINE */
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/group.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <b><u>"._BVISIT."</u></b><br><img src=images/blocks/spacer.gif border=0><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"85%\"><p align=\"left\">&nbsp;<img src=\"images/blocks/guest.gif\" width=\"14\" height=\"14\" align=\"absmiddle\"><b>"._BVIS."</b> ($pvi%)</td>\n";
$content .= "<td width=\"15%\"><p align=\"right\"><b>$guest_online_num</b></td></tr>\n";
if ($gmember_online_num > 0) {
$content .= "<tr><td width=\"100%\" colspan=\"2\">$gwho_online_now<br><img src=images/blocks/space.gif border=0></td></tr>\n";
} else {
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=images/blocks/space.gif border=0></td></tr>\n";
}
$content .= "<tr><td width=\"85%\"><p align=\"left\">&nbsp;<img src=\"images/blocks/member.gif\" width=\"14\" height=\"14\" align=\"absmiddle\"><b>"._BMEM."</b> ($pmi%)</td>\n";
$content .= "<td width=\"15%\"><p align=\"right\"><b>$member_online_num</b></td></tr>\n";
if ($member_online_num > 0) {
$content .= "<tr><td width=\"100%\" colspan=\"2\">$who_online_now</td></tr>\n";
} else {
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=images/blocks/space.gif border=0></td></tr>\n";
}
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=images/blocks/space.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<img src=\"images/blocks/admin.gif\" width=\"14\" height=\"14\" align=\"absmiddle\"><b>"._BTT." online</b></td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$who_online_num</b></td></tr>\n";
$content .= "</table></div><hr noshade size=1>\n";

/* MOST EVER ONLINE */
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/group.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <b><u>Most Ever Online</u></b><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BTT."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$total</b></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BMEM."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$members</b></td></tr>\n";
$content .= "<tr><td width=\"90%\"><p align=\"left\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;"._BVIS."</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$nonmembers</b></td></tr>\n";
$content .= "</table></div>\n<hr noshade size=1>";

/* TOTAL HITS */
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/stats.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <b><u>".SITE_HITS."</u></b><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"65%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".TODAY."</td>\n";
$content .= "<td width=\"35%\"><p align=\"right\"><b><a href=\"modules.php?name=Statistics&op=DailyStats&year=$t_year&month=$t_month&date=$t_date\">$today</a></b></td></tr>\n";
$content .= "<tr><td width=\"65%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".YESTERDAY."</td>\n";
$content .= "<td width=\"35%\"><p align=\"right\"><b><a href=\"modules.php?name=Statistics&op=DailyStats&year=$y_year&month=$y_month&date=$y_date\">$yesterday</a></b></td></tr>\n";
$content .= "<tr><td width=\"65%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".TOTAL." Hits</td>\n";
$content .= "<td width=\"35%\"><p align=\"right\"><b><a href=\"stats.html\">$nbhits</a></b></td></tr>\n";
$content .= "</table><hr noshade size=1>\n";
// Total Files
$result = sql_query("select * from ".$prefix."_downloads_downloads", $dbi);
$files = sql_num_rows($result, $dbi);

// Total Categories
$result = sql_query("select * from ".$prefix."_downloads_categories", $dbi);
$cats = sql_num_rows($result, $dbi);

// Total Downloads
$result = sql_query("select lid, title,hits from ".$prefix."_downloads_downloads", $dbi);
while(list($lid, $title, $hits) = sql_fetch_row($result, $dbi)) {
   $title2 = ereg_replace("_", " ", $title);
$a = 1;
$total_hits = $total_hits + $hits;
$a++;
}
$result=sql_query("select * from $prefix"._downloads_downloads."", $dbi);
    $numrows = sql_num_rows($result, $dbi);
    $result=sql_query("select sum(filesize*hits) as serv from $prefix"._downloads_downloads."", $dbi);
    while(list($serv) = sql_fetch_row($result, $dbi)) {
        $served = $serv;
    }
    $gb = 1024*1024*1024;
    $mb = 1024*1024;
    $kb = 1024;
    if ($served >= $gb){
        $mysizes = sprintf ("%01.2f",$served/$gb) . " Gb ";
    } elseif ($served >= $mb) {
        $mysizes = sprintf ("%01.2f",$served/$mb) . " Mb ";
    } elseif ($served >= $kb) {
        $mysizes = sprintf ("%01.2f",$served/$kb) . " Kb ";
    } else{
        $mysizes = $served . " B ";
    }
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/ds.gif\" height=\"17\" width=\"17\" align=\"absmiddle\"> <b><u> ".DOWNLOADS."</u></b><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong>$totalfiles</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$files</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong>$totalcategories</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$cats</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong>$totaldownloads</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$total_hits</b></td></tr>\n";
$content .= "<tr><td width=\"10%\">&nbsp;<strong><big>&middot;</big></strong>Data Sent</td>\n";
$content .= "<td width=\"90%\"><p align=\"right\"><b>$mysizes</b></td></tr>\n";
$content .= "</table></div>\n<hr noshade size=1>";
/************************/
/*      Nuke      */
/************************/
$totauthors     = $db->sql_numrows( $db->sql_query( "select * from $prefix"._authors ) );
$totstories     = $db->sql_numrows( $db->sql_query( "select * from $prefix"._stories ) );
$tottopics      = $db->sql_numrows( $db->sql_query( "select * from $prefix"._topics ) );
$totrev         = $db->sql_numrows( $db->sql_query( "select * from $prefix"._MReviews ) );
$totfaq         = $db->sql_numrows( $db->sql_query( "select * from $prefix"._faqCategories ) );
$totforpost     = $db->sql_numrows( $db->sql_query( "select * from $prefix"._bbposts ) );
$totfortop     = $db->sql_numrows( $db->sql_query( "select * from $prefix"._bbtopics ) );
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .="&nbsp;<img src=\"images/blocks/sitenuke.gif\" border=\"0\"> &nbsp;<b><u>Nuke Info</u></b><br />";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=http://www.phpnuke.org  target=_new>Nuke Version</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$Version_Num</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=modules.php?name=Content&pa=showpage&pid=2>Active Staff</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totauthors</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=topics.html>Active Topics</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$tottopics</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=modules.php?name=News>Active Stories</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totstories</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=faq.html>Total FAQ</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totfaq</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=modules.php?name=MReviews>Total Reveiws</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totrev</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=modules.php?name=Forums>Forum Posts</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totforpost</b></td></tr>\n";
$content .= "<tr><td width=\"90%\">&nbsp;<strong><big>&middot;</big></strong><a href=modules.php?name=Forums>Forum Topics</td>\n";
$content .= "<td width=\"10%\"><p align=\"right\"><b>$totfortop</b></td></tr>\n";
$content .= "</table></div>\n<hr noshade size=1>";
/************************/
/*      Nuke            */
/************************/

/* TOP POSTERS */
$content .= "<img src=\"images/blocks/group.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"><b><u> Top Posters</b></u>";

$number = "10"; //Number of top posters to be displayed

$content .= "<marquee behavior=\"scroll\" align=\"left\" direction=\"up\" height=\"200\" scrollamount=\"2\" scrolldelay=\"70\" onmouseover='this.stop()' onmouseout='this.start()'>\n";
global $prefix, $user_prefix, $user_id, $db;
$result=$db->sql_query("SELECT user_id, username, user_posts, user_avatar FROM ".$user_prefix."_users ORDER BY user_posts DESC LIMIT 0,".$number."");
while(list($user_id, $username, $user_posts, $user_avatar) = $db->sql_fetchrow($result)) {
$content .= "<div align=\"left\"><table class=\"outer\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" cellspacing=\"1\" border=\"0\">";
$content .= "<tr class=\"even\" vAlign=\"middle\">";
$content .= "<td align=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .= "&nbsp;&nbsp;<a href=\"userinfo-.html$username\"><img alt src=\"$user_avatar\" border =\"0\" width=\"32\"></a></td>";
}
else
$content .= "&nbsp;&nbsp;<a href=\"userinfo-.html$username\"><img alt src=\"modules/Forums/images/avatars/$user_avatar\" border =\"0\" width=\"32\"></a></td>";
$content .= "<td align=\"middle\">&nbsp;<a href=\"userinfo-.html$username\"><b>$username</b></a>&nbsp;<br>&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a>";
$content .= "&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a>&nbsp;</td>";
$content .= "</tr>";
$content .= "</table></div><hr>";
}
$content .= "</marquee>\n";

/************************/
/*      Nuke            */
/************************/

/* SERVER TIME */
if ($PM == 1) {
$content .= "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\" colspan=\"2\"><img src=\"images/blocks/time.gif\" height=\"16\" width=\"17\" align=\"absmiddle\"> <b><u>Server ".TIME."</u></b><br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "<tr><td width=\"35%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".TIME."</td>\n";
$content .= "<td width=\"65%\"><p align=\"right\">$Today</td></tr>\n";
$content .= "<tr><td width=\"35%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".DATE."</td>\n";
$content .= "<td width=\"65%\"><p align=\"right\">$Time</td></tr>\n";
$content .= "<tr><td width=\"35%\">&nbsp;<strong><big>&middot;</big></strong>&nbsp;".ZONE."</td>\n";
$content .= "<td width=\"65%\"><p align=\"right\">GMT $Offset<br><img src=images/blocks/spacer.gif border=0></td></tr>\n";
$content .= "</form></table></div>\n";
} else {$content .= "</form></div>\n";}

?>



TIA Smile

_________________
Insert funky message here: 
View user's profile Send private message Visit poster's website
dubLeE
Regular
Regular


Joined: Jan 12, 2006
Posts: 60

PostPosted: Mon Mar 06, 2006 3:59 pm Reply with quote

try removing line 41
Code:
$ip = getenv( "REMOTE_ADDR" );

_________________
[Personal] Only registered users can see links on this board! Get registered or login!
[Hosting] Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Maclain
PostPosted: Mon Mar 06, 2006 4:33 pm Reply with quote

nope still shows IP address's
 
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Mon Mar 06, 2006 6:58 pm Reply with quote

Unfortunately that code seems to grab directly from the session table's "uname" field.
Somewhere the guest checking doesn't seem to be working

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
dubLeE
PostPosted: Mon Mar 06, 2006 9:29 pm Reply with quote

Code:
$gwho_online_now .= " 0$i: ".convertIP($session[uname])."\n";

} else {
$gwho_online_now .= " $i: ".convertIP($session[uname])."\n";


see if it works if you change it to this

Code:
$gwho_online_now;

} else {
$gwho_online_now;


that might or might not work, im not well versed enough with PHP to know that much but i was tackling this, this is how i would go about it, just basically taking things out and seeing what would happen...

where did you download this from? ill install on my test site and see if i can figure it out...
 
Maclain
PostPosted: Tue Mar 07, 2006 1:32 am Reply with quote

Only registered users can see links on this board! Get registered or login! is the download,

i'm gonna play with it tonight, gotta work for 8 hours first Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©