Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 63
5 members and 58 guests
banpzdhizdorees, cel8zzgebrityho, dryrserventclea, fenqpcinkx5bgpa, jayaab7deep9tfb
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > NM Staff > Purged Topics

Reply
 
LinkBack Thread Tools Display Modes
Old
  (#11 (permalink))
Moderator
 
dar63's Avatar
 
Status: Offline
Posts: 473
Join Date: Oct 2002
Location: UK
02-20-2003, 05:39 PM

Try this then

Code:
<?php

/********************************************************/
/* Site Info Block for PHP-Nuke 5.5.0 thru 6.0.0        */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright © 2002-2003 by NukeScripts Network         */
/********************************************************/

if (eregi("block-Site_Info.php",$PHP_SELF)) { Header("Location: index.php"); }
$content = "";
global $nukeurl, $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous;

// Total Users
if (is_user($user)) {
    $memname = $cookie[1];
    $content .= ""._BWEL.", $memname.
(<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._BLOGOUT."</a>)\n";
    $content .= "<hr noshade size=\"1\">\n";
    if(is_active("Private_Messages")) {
        $result = sql_query("select uid from $user_prefix"._users." where uname='$memname'", $dbi);
        list($uid) = sql_fetch_row($result, $dbi);
        $result2 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='0'", $dbi);
        $newpms = sql_num_rows($result2, $dbi);
        $result3 = sql_query("select to_userid from $prefix"._priv_msgs." where to_userid='$uid' and read_msg='1'", $dbi);
        $oldpms = sql_num_rows($result3, $dbi);
        $totpms = $newpms + $oldpms;
        $content .= "<a href=\"modules.php?name=Private_Messages\">"._BPM.":</a>
\n";
        $content .= "<big>&middot;</big> "._BUNREAD.": $newpms
\n";
        $content .= "<big>&middot;</big> "._BREAD.": $oldpms
\n";
        $content .= "<big>&middot;</big> "._BTT.": $totpms
\n";
        $content .= "<hr noshade size=\"1\">\n";
    }
} else {
    $content .= ""._BWEL.", $anonymous\n<hr noshade size=\"1\">";
    $content .= "<table border=0 cellpadding=0 cellspacing=0>\n";
    $content .= "<tr><form action=\"modules.php?name=Your_Account\" method=\"post\">\n";
    $content .= "<td>"._BNICK.": <input type=\"text\" name=\"uname\" size=\"10\" maxlength=\"25\">
\n";
    $content .= ""._BPASS.": <input type=\"password\" name=\"pass\" size=\"10\" maxlength=\"20\">
\n";
    $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">\n";
    $content .= "<input type=\"submit\" value=\""._BLOGIN."\"> (<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a>)\n";
    $content .= "</td>\n";
    $content .= "</form></tr>\n";
    $content .= "</table>\n";
    $content .= "<hr noshade size=\"1\">\n";
}
//Formatting Current Date
$c_time = time();
$curDate = date("M d, Y",$c_time);
$result2 = sql_query("SELECT COUNT(UID) AS userCur from $user_prefix"._users." WHERE user_regdate='$curDate'", $dbi);
list($userCur) = sql_fetch_row($result2, $dbi);
$userCur = number_format($userCur, 0);
//Formatting Previous Date
$p_time = $c_time - 86400;
$preDate = date("M d, Y",$p_time);
$result3 = sql_query("SELECT COUNT(UID) AS userPre from $user_prefix"._users." WHERE user_regdate='$preDate'", $dbi);
list($userPre) = sql_fetch_row($result3, $dbi);
$userPre = number_format($userPre, 0);
//Print Membership
$totalmembers = 0;
$result = sql_query("select uname from $user_prefix"._users." order by uid DESC limit 0,1", $dbi);
list($lastuser) = sql_fetch_row($result, $dbi);
$totalmembers = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi);
$totalmem = number_format($totalmembers, 0);
$content .= "<u>"._BMEMP.":</u>
\n";
$content .= "<big>&middot;</big> "._BLATEST.": <A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;uname=$lastuser\">$lastuser</a>
\n";
$content .= "<big>&middot;</big> "._BTD.": $userCur
\n";
$content .= "<big>&middot;</big> "._BYD.": $userPre
\n";
$content .= "<big>&middot;</big> "._BTT.": $totalmem
\n<hr noshade size=\"1\">\n";

/* Daily Membership */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_date."", $dbi);
list($days) = sql_fetch_row($result, $dbi);
if ($days == 0) { $daily = 0; } else { $daily = number_format($totalmembers/$days, 0); }
/* Monthly Membership */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_month."", $dbi);
list($months) = sql_fetch_row($result, $dbi);
if ($months == 0) { $monthly = 0; } else { $monthly = number_format($totalmembers/$months, 0); }
/* Yearly Membership */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_year."", $dbi);
list($years) = sql_fetch_row($result, $dbi);
if ($years == 0) { $yearly = 0; } else { $yearly = number_format($totalmembers/$years, 0); }

$content .= "<u>"._BMEMA.":</u>
";
$content .= "<big>&middot;</big> "._BDAIL.": $daily
</center>";
$content .= "<big>&middot;</big> "._BMONT.": $monthly
\n";
$content .= "<big>&middot;</big> "._BYEAR.": $yearly
\n<hr noshade size=\"1\">\n";

// Total Hits
/* 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);
$today = number_format($today, 0);
/* 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);
$yesterday = number_format($yesterday, 0);
/* Hits in Total */
$totalhits = 0;
$result = sql_query("SELECT hits FROM $prefix"._stats_year."", $dbi);
while(list($hits) = sql_fetch_row($result, $dbi)) {
    $totalhits = $totalhits + $hits;
}
$totalhit = number_format($totalhits, 0);
$content .= "<u>"._BHITS.":</u>
";
$content .= "<big>&middot;</big> "._BTD.": <a href=\"modules.php?name=Statistics&op=DailyStats&year=$t_year&month=$t_month&date=$t_date\">$today</a>
";
$content .= "<big>&middot;</big> "._BYD.": <a href=\"modules.php?name=Statistics&op=DailyStats&year=$y_year&month=$y_month&date=$y_date\">$yesterday</a>
</center>";
$content .= "<big>&middot;</big> "._BTT.": <a href=\"modules.php?name=Statistics\">$totalhit</a>
\n<hr noshade size=\"1\">\n";

/* Hourly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_hour."", $dbi);
list($hours) = sql_fetch_row($result, $dbi);
if ($hours == 0) { $hours = 0; } else { $hourly = number_format($totalhits/$hours, 0); }
/* Daily Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_date."", $dbi);
list($days) = sql_fetch_row($result, $dbi);
if ($days == 0) { $days = 0; } else { $daily = number_format($totalhits/$days, 0); }
/* Monthly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_month."", $dbi);
list($months) = sql_fetch_row($result, $dbi);
if ($months == 0) { $months = 0; } else { $monthly = number_format($totalhits/$months, 0); }
/* Yearly Hits */
$result = sql_query("SELECT count(*) FROM $prefix"._stats_year."", $dbi);
list($years) = sql_fetch_row($result, $dbi);
if ($years == 0) { $years = 0; } else { $yearly = number_format($totalhits/$years, 0); }

$content .= "<u>"._BHITA.":</u>
";
$content .= "<big>&middot;</big> "._BHOUR.": $hourly
";
$content .= "<big>&middot;</big> "._BDAIL.": $daily
</center>";
$content .= "<big>&middot;</big> "._BMONT.": $monthly
\n";
$content .= "<big>&middot;</big> "._BYEAR.": $yearly
\n<hr noshade size=\"1\">\n";

//Total Online
online();
$result2 = sql_query("SELECT uname,guest FROM $prefix"._session." where guest=0", $dbi);
$member_online_num = sql_num_rows($result2, $dbi);
$member_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result2, $dbi)) {
    if (isset($session["guest"]) and $session["guest"] == 0) {
            $member_online_now .= "<big>&middot;</big> <A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;uname=$session[username]\">$session[username]</a>
\n";
        $member_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
    }
}
$result3 = sql_query("SELECT uname,guest FROM $prefix"._session." where guest=1", $dbi);
$guest_online_num = sql_num_rows($result3, $dbi);
$guest_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result3, $dbi)) {
    if (isset($session["guest"]) and $session["guest"] == 1) {
            $guest_online_now .= "<big>&middot;</big> "._BGUES." $i
\n";
        $guest_online_now .= ($i != $guest_online_num ? "  " : "");
        $i++;
    }
}
$who_online_num = $guest_online_num + $member_online_num;
$content .= "<u>"._BON.":</u>\n
\n";
$content .= "<big>&middot;</big> "._BVIS.": $guest_online_num
\n";
$content .= "<big>&middot;</big> "._BMEM.": $member_online_num
\n";
$content .= "<big>&middot;</big> "._BTT.":$who_online_num\n<hr noshade size=\"1\">\n";
if ($member_online_num > 0) {
    $content .= "<u>"._BONM.":</u>
$member_online_now\n<hr noshade size=\"1\">\n";
}
if ($guest_online_num > 0) {
    $content .= "<u>"._BONG.":</u>
$guest_online_now\n<hr noshade size=\"1\">\n";
}

// Server Stats
$Today = date("d M Y");
$Time = date("H:i:s");
$Offset = date("O");
$content .= "<u>"._BSERV.":</u>
\n";
$content .= "<big>&middot;</big> "._BDT.": $Today
\n";
$content .= "<big>&middot;</big> "._BTM.": $Time
\n";
$content .= "<big>&middot;</big> "._GMT.": $Offset\n";

?>
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#12 (permalink))
Junior Member
 
Status: Offline
Posts: 71
Join Date: Jan 2003
Location: England
02-20-2003, 05:52 PM

This Is really wierd...

The block is on the site and seems to be working great except I'm still getting those lines that I posted previous coming up.

On line 253 I have: $rows=mysql_num_rows($res);

On line 357 I have: $row = mysql_fetch_array($res);

This help you understand what might be wrong?

BTW, the block is set to adminviewing only atm, because of it being messed up
 Send a message via ICQ to TuNa  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Icons vanished from the site usser info block killerbee Open topics 1 01-17-2005 09:57 AM
User Info Block Groove Nuke 7.x - Blocks 3 07-27-2004 03:53 PM
Site Info Block w/avatar 6.5 BMWTechNet Nuke 6.5 to 6.9 - Blocks 3 04-16-2003 02:50 PM
site info block for 6.5 chuck Nuke 6.5 to 6.9 - Blocks 9 04-06-2003 06:03 AM
User Info Block + Modules Block = Where can I get it! nasrules Purged Topics 3 03-15-2003 11:16 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31