[ Index ]
 

Code source de PHP NUKE 7.9

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

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

   1  <?php
   2  
   3  /************************************************************/
   4  /*                                                          */
   5  /* Updated for PHP-Nuke 5.6 -  18 Jun 2002 NukeScripts      */
   6  /* website http://www.nukescripts.com                       */
   7  /*                                                          */
   8  /* Updated for PHP-Nuke 5.5 - 24/03/2002 Rugeri             */
   9  /* website http://newsportal.homip.net                      */
  10  /*                                                          */
  11  /* (C) 2002                                                 */
  12  /* All rights beyond the GPL are reserved                   */
  13  /*                                                          */
  14  /* Please give a link back to my site somewhere in your own */
  15  /*                                                          */
  16  /************************************************************/
  17  
  18  if ( !defined('BLOCK_FILE') ) {
  19      Header("Location: ../index.php");
  20      die();
  21  }
  22  
  23  $content = "";
  24  
  25  global $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $sitekey, $gfx_chk, $locale;
  26  mt_srand ((double)microtime()*1000000);
  27  $maxran = 1000000;
  28  $random_num = mt_rand(0, $maxran);
  29  $datekey = date("F j");
  30  $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
  31  $code = substr($rcode, 2, 6);
  32  cookiedecode($user);
  33  $sql = "SELECT username FROM ".$user_prefix."_users ORDER BY user_id DESC LIMIT 0,1";
  34  $query = $db->sql_query($sql);
  35  list($lastuser) = $db->sql_fetchrow($query);
  36  $sql2 = "SELECT user_id FROM ".$user_prefix."_users";
  37  $query2 = $db->sql_query($sql2);
  38  $numrows = $db->sql_numrows($query2);
  39  $numrows = intval($numrows);
  40  $sql3 = "SELECT uname, guest FROM ".$prefix."_session WHERE guest='0'";
  41  $result = $db->sql_query($sql3);
  42  $member_online_num = $db->sql_numrows($result);
  43  $who_online_now = "";
  44  $i = 1;
  45  while (list($uname, $guest) = $db->sql_fetchrow($result)) {
  46      if (isset($guest) and $guest == 0) {
  47          if ($i < 10) {
  48              $who_online_now .= "0" .$i." :&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$uname\">$uname</a><br>\n";
  49          } else {
  50              $who_online_now .= $i.":&nbsp;<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$uname\">$uname</a><br>\n";
  51          }
  52          $who_online_now .= ($i != $member_online_num ? "  " : "");
  53          $i++;
  54      }
  55  }
  56  
  57  // Formatting date - Fix by Quake
  58  $month = date('M');
  59  $curDate2 = "%".$month[0].$month[1].$month[2]."%".date('d')."%".date('Y')."%";
  60  $ty = time() - 86400;
  61  $preday = strftime('%d', $ty);
  62  $premonth = strftime('%B', $ty);
  63  $preyear = strftime('%Y', $ty);
  64  $curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
  65  
  66  //Select new today
  67  $sql = "SELECT COUNT(user_id) AS userCount FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDate2'";
  68  $query = $db->sql_query($sql);
  69  list($userCount) = $db->sql_fetchrow($query);
  70  $userCount = intval($userCount);
  71  //end
  72  
  73  //Select new yesterday
  74  $sql = "SELECT COUNT(user_id) AS userCount FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDateP'";
  75  $query = $db->sql_query($sql);
  76  list($userCount2) = $db->sql_fetchrow($query);
  77  $userCount2 = intval($userCount2);
  78  //end
  79  
  80  $guest_online_sql = "SELECT uname FROM ".$prefix."_session WHERE guest='1'";
  81  $guest_online_query = $db->sql_query($guest_online_sql);
  82  $guest_online_row = $db->sql_numrows($guest_online_query);
  83  $guest_online_num = intval($guest_online_row);
  84  
  85  $member_online_sql = "SELECT uname FROM ".$prefix."_session WHERE guest='0'";
  86  $member_online_query = $db->sql_query($member_online_sql);
  87  $member_online_row = $db->sql_numrows($member_online_query);
  88  $member_online_num = intval($member_online_row);
  89  
  90  $who_online_num = $guest_online_num + $member_online_num;
  91  $who_online_num = intval($who_online_num);
  92  $content .= "<form onsubmit=\"this.submit.disabled='true'\" action=\"modules.php?name=Your_Account\" method=\"post\">";
  93  
  94  if (is_user($user)) {
  95      $uname = $cookie[1];
  96      $content .= "<br><img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$uname</b>.<br>\n<hr>\n";
  97      $sql = "SELECT user_id FROM " .$user_prefix."_users WHERE username='$uname'";
  98      $query = $db->sql_query($sql);
  99      list($user_id) = $db->sql_fetchrow($query);
 100      $uid = intval($user_id);
 101      $newpms_query = $db->sql_query("SELECT privmsgs_to_userid FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')");
 102      $oldpms_query = $db->sql_query("SELECT privmsgs_to_userid FROM ".$prefix."_bbprivmsgs WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'");
 103      $newpms = $db->sql_numrows($newpms_query);
 104      $oldpms = $db->sql_numrows($oldpms_query);
 105      $content .= "<img src=\"images/blocks/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
 106      $content .= "<img src=\"images/blocks/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>".intval($newpms)."</b><br>\n";
 107      $content .= "<img src=\"images/blocks/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>".intval($oldpms)."</b><br>\n<hr>\n";
 108  } else {
 109      $content .= "<img src=\"images/blocks/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
 110      $content .= _NICKNAME." <input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
 111      $content .= _PASSWORD." <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
 112  if (extension_loaded('gd') AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
 113      $content .= _SECURITYCODE.": <img src='?gfx=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
 114      $content .= _TYPESECCODE."<br><input type=\"text\" name=\"gfx_check\" size=\"7\" maxlength=\"6\">\n";
 115      $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
 116  } else {
 117      $content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
 118      $content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
 119  }
 120      $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
 121      $content .= "<input type=\"submit\" value=\""._LOGIN."\">\n (<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a>)<hr>";
 122  }
 123  $content .= "<img src=\"images/blocks/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br>\n";
 124  $content .= "<img src=\"images/blocks/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$lastuser\"><b>$lastuser</b></a><br>\n";
 125  $content .= "<img src=\"images/blocks/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": <b>$userCount</b><br>\n";
 126  $content .= "<img src=\"images/blocks/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": <b>$userCount2</b><br>\n";
 127  $content .= "<img src=\"images/blocks/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>$numrows</b><br>\n<hr>\n";
 128  $content .= "<img src=\"images/blocks/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br>\n";
 129  $content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>$guest_online_num</b><br>\n";
 130  $content .= "<img src=\"images/blocks/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>$member_online_num</b><br>\n";
 131  $content .= "<img src=\"images/blocks/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>$who_online_num</b><br>\n";
 132  if ($member_online_num > 0) {
 133      $content .= "<hr>\n<img src=\"images/blocks/group-1.gif\" height=\"14\" width=\"17\"> <b><u>"._BON.":</u></b><br>$who_online_now";
 134  }
 135  $content .= "</form>";
 136  
 137  ?>


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7