Right Scroll for User Block over 10 Members

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Right Scroll for User Block over 10 Members
Block123
CZ Newbie
Block123 has been a member for over 19 year's 19 Year Member
usa.gif texas.gif
Occupation: Telecom
Age: 53
Gender: Male
Fav. Sports Team: Denver Broncos
Status: Offline
Joined: Jul 07, 2005
0.00 posts per day
Posts: 23
Points: 972
   
I would like my "Members Online" section of my user block to scroll when it goes over 10 or so members online like the one on this site does.

I found the section in the CZ code that tells it >10 auto..etc.. I'm sure it's just a few lines of code I need to add somewhere.

Can you tell me two things.

What exact code do I need to paste into my script to make my user info block do this?

Also

Where exactly in my code do I need to paste it?

Thanks,

<?php
/************************************************************************/
/* USER MENU v1.5 for PHP-Nuke 6.9+ © 2003 by Pitcher@Home              */
/* Based on the code from phpBB2 User Menu by [ Register or login to view links on this board. ]         */
/*                                                                        */
/* Visit Pitcher@Home at http://www.pitcher.no                          */
/* for updates and other PHP-Nuke Tools                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

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

$content = "";

global $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous, $sitekey, $userinfo, $mode, $t, $f, $admin, $stop, $module_name, $redirect, $gfx_chk, $language;
include("language/usermenu/lang-$language.php");
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);
$uname = $cookie[1];

list($lastuser) = sql_fetch_row(sql_query("SELECT username FROM $user_prefix"._users." ORDER BY user_id DESC LIMIT 0,1", $dbi));
list($newid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$lastuser'", $dbi));
$numrows = sql_num_rows(sql_query("SELECT user_id FROM $user_prefix"._users."", $dbi));
$numrows = ($numrows - 1); //removes admin as user
$result = sql_query("SELECT uname, guest FROM $prefix"._session." WHERE guest=0", $dbi);
$member_online_num = sql_num_rows($result, $dbi);
$who_online_now = "";
$i = 1;
while ($session = sql_fetch_array($result, $dbi)) {
   list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$session[uname]'", $dbi));
    if (isset($session["guest"]) and $session["guest"] == 0) {
        if ($i < 10) {
            $who_online_now .= "0$i:&nbsp;<a href=\"modules.php?name=Private_Messages&amp;mode=post&amp;u=$uid\"><img src=\"images/blocks/usermenu/icon_minipost.gif\" border=0 alt=\""._UMSENDPM." $session[uname]\" align=absmiddle></a><A HREF=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$uid\">$session[uname]</a><br>\n";
        } else {
            $who_online_now .= "$i:&nbsp;<a href=\"modules.php?name=Private_Messages&amp;mode=post&amp;u=$uid\"><img src=\"images/blocks/usermenu/icon_minipost.gif\" border=0 alt=\""._UMSENDPM." $session[uname]\" align=absmiddle></a><A HREF=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$uid\">$session[uname]</a><br>\n";
        }
        $who_online_now .= ($i != $member_online_num ? "  " : "");
        $i++;
    }
}
$Today = getdate();
//Formatting Current Date
$month = $Today['month'];
$mday = $Today['mday'];
$year = $Today['year'];
//Formatting Previous Date
$pmonth = $Today['month'];
$pmday = $Today['mday'];
$pmday = $mday-1;
$pyear = $Today['year'];
//Month conversion into numeric mode
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);

//Creating SQL parameter
$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."%";

//Executing SQL Today
list($userCount) = sql_fetch_row(sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'", $dbi));

//end

//Executing SQL Today
list($userCount2) = sql_fetch_row(sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'", $dbi));

//end

$guest_online_num = sql_num_rows(sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=1", $dbi));
$member_online_num = sql_num_rows(sql_query("SELECT uname FROM ".$prefix."_session WHERE guest=0", $dbi));

$who_online_num = $guest_online_num + $member_online_num;
$content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";


if (is_user($user)) {
    list($uid) = sql_fetch_row(sql_query("SELECT user_id FROM $user_prefix"._users." WHERE username='$uname'", $dbi));
    $newpms = sql_num_rows(sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='1' OR privmsgs_type='5')", $dbi));
    $oldpms = sql_num_rows(sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'", $dbi));
   
if ($userinfo[user_avatar]) {
      $content .= "<center>"._UMWELB."<br><img src=\"modules/Forums/images/avatars/$userinfo[user_avatar]\"><br>$uname\n</center><hr>";
   } else {
    $content .= "<center>"._UMWELB."<br><img src=\"images/blocks/usermenu/icon_who.gif\"><br>$uname\n</center><hr>";
}
    $content .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\"><tr><td valign=\"absmiddle\"><img src=\"images/blocks/usermenu/icon_pm.gif\" border=\"0\" valign=\"absmiddle\"></td><td><a href=\"modules.php?name=Private_Messages\"><b>"._UMPM."</b></a></tr></td></table>\n";
    $content .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">";
    $content .= "<tr><td width=\"22\"></td><td><img src=\"images/blocks/usermenu/icon_dot.gif\" height=\"5\" width=\"5\" align=\"absmiddle\"> "._UMNMSG.": </td><td width=\"45%\"><b>$newpms</b><br></td></tr>\n";
    $content .= "<tr><td width=\"22\"></td><td><img src=\"images/blocks/usermenu/icon_dot.gif\" height=\"5\" width=\"5\" align=\"absmiddle\"> "._UMOMSG.": </td><td><b>$oldpms</b>\n</td></tr></table><hr>\n";
} else {
    $content .= "<center>"._UMWEL."<br><img src=\"images/blocks/usermenu/icon_who.gif\"><br>$anonymous\n</center><hr>";
   $content .= "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">";
    $content .= "<tr><td>"._UMNICK."</td><td align=\"right\"><input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\">";
    $content .= "</tr></td><tr><td>"._UMPSW."</td><td align=\"right\"> <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\">";
      
if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
    $content .="</tr></td><tr><td>"._UMSECURITYCODE."</td><td height=\"20\" align=\"right\"><img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='0' alt='"._UMSECURITYCODE."' title='"._UMSECURITYCODE."'>\n";
    $content .="</tr></td><tr><td>"._UMTYPESECCODE."</td><td align=\"right\"><input type=\"text\" NAME=\"gfx_check\" SIZE=\"10\" MAXLENGTH=\"6\">\n";

    $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
    $content .="<input type=\"hidden\" name=\"mode\" value=$mode>\n";
    $content .="<input type=\"hidden\" name=\"f\" value=$f>\n";
    $content .="<input type=\"hidden\" name=\"t\" value=$t>\n";
    $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
    $content .= "</td></tr><td><img src=\"images/blocks/usermenu/icon_dot.gif\" align=\"middle\" height=\"5\" width=\"5\"> <a href=\"modules.php?name=Your_Account&op=new_user\">"._UMREG."</a></td><td align=\"right\"><input type=\"submit\" value=\""._UMLOGIN."\">\n</tr></td></table><hr>";
}
$content .= "<img src=\"images/blocks/usermenu/icon_profile.gif\" height=\"15\" width=\"19\"> <b>"._BMEMP.":</b><br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-moderator.gif\" height=\"15\" width=\"15\"> "._BLATEST.": <A HREF=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$newid\"><b>$lastuser</b></a><br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-author.gif\" height=\"15\" width=\"15\"> "._BTD.": <b>$userCount</b><br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-admin.gif\" height=\"15\" width=\"15\"> "._BYD.": <b>$userCount2</b><br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-guest.gif\" height=\"15\" width=\"15\"> "._BOVER.": <b>$numrows</b><br>\n<hr>\n";
$content .= "<img src=\"images/blocks/usermenu/group-1.gif\" height=\"15\" width=\"15\"> <b>"._UMONLINE."$who_online_num]:</b>\n<br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-anony.gif\" height=\"15\" width=\"15\"> "._BVIS.": <b>$guest_online_num</b><br>\n";
$content .= "<img src=\"images/blocks/usermenu/ur-member.gif\" height=\"15\" width=\"15\"> "._BMEM.": <b>$member_online_num</b>\n";

if (is_user($user)) {
   $content .= "<hr>\n<img src=\"images/blocks/usermenu/group-3.gif\" height=\"15\" width=\"15\"> <b>"._UMON."</b><br>$who_online $who_online_now";
   $content .= "<hr><img src=\"images/blocks/usermenu/icon_logout.gif\" align=\"absmiddle\"><a href=\"modules.php?name=Your_Account&op=logout\"> <b>"._UMBEXIT."</b></a>";
}
$content .= "</form>";
/* Please do not remove this line */
$content .= "<div align=\"right\" class=\"tiny\"><a href=\"http://www.pitcher.no\" target=\"_blank\">&copy; Usermenu</a></div>";

?>



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum