Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
afc
Worker
Worker


Joined: Aug 16, 2003
Posts: 107
Location: USA

PostPosted: Tue May 02, 2006 11:11 am Reply with quote

can someone update this to new layer it still uses dbi

Code:
<?php


/************************************************************/
/* Userinfo - ScribbyTech                                   */
/* By: Richard Simpson                                      */
/* Only registered users can see links on this board! Get registered or login!                                  */
/* http://www.scribbytech.net                               */
/* Copyright © 2005 by Richard Simpson                      */
/************************************************************/
/* All rights beyond the GPL are reserved                   */
/* http://www.rvhresources.com                              */   
/* email: Only registered users can see links on this board! Get registered or login!                        */
/************************************************************/

$most = "Most Downloaded";
$latest = "Latest Downloads";
$totalfiles = "Total Files";
$totalcategories = "Total Categories";
$totaldownloads = "Files Downloaded";
$hitstext = "Hits";
$uploaded ="Files Uploaded";


if (eregi("block-User_Info2.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   = "100%";    # 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         = "0";      # 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;$l:<A HREF=\"profile-.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=\"profile-.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 .= "&nbsp;$i:&nbsp;".convertIP($session[uname])."\n";
} else {
$gwho_online_now .= "&nbsp;$i:&nbsp;".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/blocks/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%>$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>\n";
$content .= "<div align=\"center\"><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=$TBLWIDTH>\n";
$content .= "<tr><td width=\"100%\"><a href=\"modules.php?name=Your_Account&amp;op=logout\"><center>[ "._LOGOUT." ]</center></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%\"><center><a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a></center></td></tr>\n";
$content .= "<tr><td width=\"100%\" height=\"5\"></td></tr>\n";
$content .= "<tr><td width=\"100%\"><center><a href=\"modules.php?name=Your_Account&amp;op=pass_lost\">"._PASSFOR."</a></center></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='modules.php?name=Your_Account&op=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 5 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." 5 "._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,5", $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=\"profile-.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%\"><b>"._BVIS." ( $guest_online_num )</b></td>\n";
$content .= "</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%\"><b>"._BMEM." ( $member_online_num )</b></td>\n";
$content .= "</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%\"><b>"._BTT." Online ( $who_online_num )</b></td>\n";
$content .= "</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>"._BHITS."</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=\"stats.html?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=\"stats.html?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;"._BTT." 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> "._DOWNST."</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>Categories</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>Downloads</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=\"left\"><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>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=forums.html>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=forums.html>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      */
/************************/

/* 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 "._BTIME."</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;"._BTIME."</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 .= "</form></table></div>\n";
} else {$content .= "</form></div>\n";}

?>
 
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Fri May 05, 2006 1:18 am Reply with quote

I had started to help you with this until I realized it's a ripoff of my userinfo block and all the credits have been removed which is a violation of the GPL. I would ask that you not use this block and that you let the author know that he's a thief!!!
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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 ©