[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/blocks/ -> block-User_Info.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /************************************************************************/
   7  /* Updated for PHP-Nuke 5.6 -  18 Jun 2002 NukeScripts                  */
   8  /* website http://www.nukescripts.com                                   */
   9  /*                                                                      */
  10  /* Updated for PHP-Nuke 5.5 - 24/03/2002 Rugeri                         */
  11  /* website http://newsportal.homip.net                                  */
  12  /*                                                                      */
  13  /* (C) 2002                                                             */
  14  /* All rights beyond the GPL are reserved                               */
  15  /*                                                                      */
  16  /* Please give a link back to my site somewhere in your own             */
  17  /************************************************************************/
  18  /*         Additional security & Abstraction layer conversion           */
  19  /*                           2003 chatserv                              */
  20  /*      http://www.nukefixes.com -- http://www.nukeresources.com        */
  21  /************************************************************************/
  22  
  23  /*****[CHANGES]**********************************************************
  24  -=[Base]=-
  25        Nuke Patched                             v3.1.0       06/26/2005
  26        NukeSentinel                             v2.5.00      07/11/2006
  27        Caching System                           v1.0.0       10/31/2005
  28  -=[Mod]=-
  29        Avatar Addon                             v1.0.0       07/02/2005
  30        Advanced Security Code Control           v1.0.0       12/17/2005
  31        Advanced Username Color                  v1.0.5       07/05/2005
  32        phpBB User Groups Integration            v1.0.0       08/26/2005
  33        IP Addon                                 v1.0.0       01/17/2006
  34   ************************************************************************/
  35  
  36  if(!defined('NUKE_EVO')) exit;
  37  
  38  global $prefix, $user_prefix, $db, $anonymous, $board_config, $userinfo;
  39  
  40  /*****[BEGIN]******************************************
  41   [ Mod:    Avatar Addon                        v1.0.0 ]
  42   ******************************************************/
  43  $useavatars = 1; //1 to Show Avatars - 0 is off
  44  /*****[END]********************************************
  45   [ Mod:    Avatar Addon                        v1.0.0 ]
  46   ******************************************************/
  47  
  48  /*****[BEGIN]******************************************
  49   [ Mod:    IP Addon                            v1.0.0 ]
  50   ******************************************************/
  51  $showip = 0; //1 to Show your current IP address - 0 is off
  52  /*****[END]********************************************
  53   [ Mod:    IP Addon                            v1.0.0 ]
  54   ******************************************************/
  55  
  56  $content = '';
  57  
  58  list($lastuser) = $db->sql_ufetchrow("SELECT username FROM ".$user_prefix."_users WHERE user_active = 1 AND user_level > 0 ORDER BY user_id DESC LIMIT 1", SQL_NUM);
  59  list($numrows) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_id > 1 AND user_level > 0", SQL_NUM);
  60  $result = $db->sql_query("SELECT uname, guest FROM ".$prefix."_session WHERE guest='0' OR guest='2'");
  61  $member_online_num = $db->sql_numrows($result);
  62  
  63  $who_online_now = "";
  64  $i = 1;
  65  while ($session = $db->sql_fetchrow($result, SQL_ASSOC)) {
  66  /*****[BEGIN]******************************************
  67   [ Mod:    Advanced Username Color             v1.0.5 ]
  68   ******************************************************/
  69      $username2=UsernameColor($session['uname']);
  70      if (isset($session['guest']) and $session['guest'] == 0 && !empty($username2)) {
  71          if ($i < 10) {
  72              $who_online_now .= "0" .$i.".&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$username2</a><br />\n";
  73          } else {
  74              $who_online_now .= $i.".&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$username2</a><br />\n";
  75  /*****[END]********************************************
  76   [ Mod:    Advanced Username Color             v1.0.5 ]
  77   ******************************************************/
  78          }
  79          $who_online_now .= ($i != $member_online_num ? "  " : "");
  80          $i++;
  81      }
  82  }
  83  $db->sql_freeresult($result);
  84  
  85  /*****[BEGIN]******************************************
  86   [ Mod:    IP Addon                            v1.0.0 ]
  87   ******************************************************/
  88  if ($showip == 1) {
  89      $ip = identify::get_ip();
  90      $content .= "<br /><br /><center>"._YOURIP.": ".$ip."</center>";
  91  }
  92  /*****[END]********************************************
  93   [ Mod:    IP Addon                            v1.0.0 ]
  94   ******************************************************/
  95  
  96  /*****[BEGIN]******************************************
  97   [ Mod:    Avatar Addon                        v1.0.0 ]
  98   ******************************************************/
  99  if ($useavatars == 1) {
 100      //Avatars...
 101      if ($userinfo['user_allowavatar']) {
 102      //if ($userinfo['user_avatar_type'] == 1)  {
 103          $content .= "<br /><br /><center><img src=\"".$board_config['avatar_path']."/".$userinfo['user_avatar']."\" alt=\"\" /></center><br />\n";
 104      } elseif ($userinfo['user_avatar_type'] == 2) {
 105          $content .= "<br /><br /><center><img src=\"".$userinfo['user_avatar']."\" alt=\"\" /></center><br />\n";
 106      } elseif (empty($userinfo['user_avatar'])) {
 107          $content .= "<br /><br /><center><img src=\"".$board_config['avatar_gallery_path']."/gallery/blank.gif\" alt=\"\" /></center>\n";
 108      } else {
 109          $content .= "<br /><br /><center><img src=\"".$board_config['avatar_gallery_path']."/".$userinfo['user_avatar']."\" alt=\"\" /></center><br />\n";
 110      }
 111  }
 112  //}
 113  /*****[END]********************************************
 114   [ Mod:    Avatar Addon                        v1.0.0 ]
 115   ******************************************************/
 116  
 117  // Formatting date - Fix
 118  $month = date('M');
 119  $curDate2 = "%".$month[0].$month[1].$month[2]."%".date('d')."%".date('Y')."%";
 120  $ty = time() - 86400;
 121  $preday = strftime('%d', $ty);
 122  $premonth = strftime('%B', $ty);
 123  $preyear = strftime('%Y', $ty);
 124  $curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
 125  
 126  //Select new today
 127  //Select new yesterday
 128  list($userCount) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDate2'", SQL_NUM);
 129  list($userCount2) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDateP'", SQL_NUM);
 130  //end
 131  
 132  list($guest_online_num) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_session WHERE guest='1' OR guest='3'", SQL_NUM);
 133  list($member_online_num) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_session WHERE guest='0' OR guest='2'", SQL_NUM);
 134  
 135  $who_online_num = $guest_online_num + $member_online_num;
 136  $who_online_num = intval($who_online_num);
 137  $content .= "<form onsubmit=\"this.submit.disabled='true'\" action=\"modules.php?name=Your_Account\" method=\"post\">";
 138  
 139  if (is_user()) {
 140  /*****[BEGIN]******************************************
 141   [ Mod:    Advanced Username Color             v1.0.5 ]
 142   ******************************************************/
 143      $uname = $userinfo['username'];
 144      $uname_color = UsernameColor($uname);
 145      $content .= "<br /><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BWEL.", <strong>$uname_color</strong>.<br />\n<hr />\n";
 146  /*****[END]********************************************
 147   [ Mod:    Advanced Username Color             v1.0.5 ]
 148   ******************************************************/
 149      $uid = $userinfo['user_id'];
 150      list($newpms) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')");
 151      list($oldpms) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'");
 152      $content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\" alt=\"\" /> <a href=\"modules.php?name=Private_Messages\"><strong>"._BPM."</strong></a><br />\n";
 153      $content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\" alt=\"\" /> "._BUNREAD.": <strong>".intval($newpms)."</strong><br />\n";
 154      $content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\" alt=\"\" /> "._BREAD.": <strong>".intval($oldpms)."</strong><br />\n<hr noshade='noshade' />\n";
 155  /*****[BEGIN]******************************************
 156   [ Mod:    phpBB User Groups Integration       v1.0.0 ]
 157   ******************************************************/
 158      if (is_user()) {
 159          $content .= "<u><strong>"._GRMEMBERSHIPS.":</strong></u><br />\n";
 160          $result = $db->sql_query("SELECT group_name FROM ".$prefix."_bbgroups LEFT JOIN ".$prefix."_bbuser_group on ".$prefix."_bbuser_group.group_id=".$prefix."_bbgroups.group_id WHERE ".$prefix."_bbuser_group.user_id='$uid' and ".$prefix."_bbgroups.group_description != 'Personal User'");
 161          if ($db->sql_numrows($result) == 0) {
 162             $content .= "<img src=\"images/arrow.gif\" align=\"middle\" alt=\"\" /> "._GRNONE."<br />";
 163          } else {
 164             while(list($gname) = $db->sql_fetchrow($result, SQL_NUM)) {
 165                $gname = GroupColor($gname);
 166                $content .= "<img src=\"images/arrow.gif\" align=\"middle\" alt=\"\" /> $gname<br />";
 167             }
 168          }
 169          $db->sql_freeresult($result);
 170          $content .= "<hr noshade='noshade' />";
 171      }
 172  /*****[END]********************************************
 173   [ Mod:    phpBB User Groups Integration       v1.0.0 ]
 174   ******************************************************/
 175  } else {
 176      $content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BWEL.", <strong>$anonymous</strong>\n<hr />";
 177      $content .= _NICKNAME." <input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\" /><br />";
 178      $content .= _PASSWORD." <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\" /><br />";
 179  /*****[BEGIN]******************************************
 180   [ Mod:     Advanced Security Code Control     v1.0.0 ]
 181   ******************************************************/
 182      $gfxchk = array(2,4,5,7);
 183      $content .= security_code($gfxchk, 'stacked');
 184  /*****[END]********************************************
 185   [ Mod:     Advanced Security Code Control     v1.0.0 ]
 186   ******************************************************/
 187      $content .= "<input type=\"hidden\" name=\"op\" value=\"login\" />";
 188      $content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&amp;op=new_user\" />"._BREG."</a>)<hr />";
 189  }
 190  $content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\" alt=\"\" /> <strong><u>"._BMEMP.":</u></strong><br />\n";
 191  $content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BLATEST.": <a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$lastuser\"><strong>$lastuser</strong></a><br />\n";
 192  $content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BTD.": <strong>$userCount</strong><br />\n";
 193  $content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BYD.": <strong>$userCount2</strong><br />\n";
 194  $content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BOVER.": <strong>$numrows</strong><br />\n<hr />\n";
 195  $content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\" alt=\"\" /> <strong><u>"._BVISIT.":</u></strong>\n<br />\n";
 196  $content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BVIS.": <strong>$guest_online_num</strong><br />\n";
 197  $content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BMEM.": <strong>$member_online_num</strong><br />\n";
 198  $content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\" alt=\"\" /> "._BTT.": <strong>$who_online_num</strong><br />\n";
 199  $content .= "<hr noshade='noshade' />\n<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\" alt=\"\" /> <strong><u>"._BON.":</u></strong><br />$who_online_now";
 200  $content .= "</form>";
 201  
 202  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7