[ Index ]
 

Code source de e107 0.7.8

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

title

Body

[fermer]

/e107_plugins/online_extended_menu/ -> online_extended_menu.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_extended_menu/online_extended_menu.php,v $
  14  |     $Revision: 1.18 $
  15  |     $Date: 2006/12/23 18:37:46 $
  16  |     $Author: e107steved $
  17  +----------------------------------------------------------------------------+
  18  */
  19  if (!defined('e107_INIT')) { exit; }
  20  
  21  if(!defined("e_TRACKING_DISABLED") && (isset($pref['track_online']) && $pref['track_online'])) {
  22      $text = ONLINE_EL1.GUESTS_ONLINE.", ";
  23      $text .= ONLINE_EL2.MEMBERS_ONLINE." ...<br />";
  24  
  25      if (MEMBERS_ONLINE) {
  26          global $listuserson, $ADMIN_DIRECTORY;
  27          foreach($listuserson as $uinfo => $pinfo) {
  28  
  29  
  30              list($oid, $oname) = explode(".", $uinfo, 2);
  31              $online_location_page = substr(strrchr($pinfo, "/"), 1);
  32              if ($pinfo == "log.php" || $pinfo == "error.php") {
  33                  $online_location_page = "news.php";
  34                  $pinfo = "news.php";
  35              }
  36              if ($online_location_page == "request.php") {
  37                  $pinfo = "download.php";
  38              }
  39              if (strstr($online_location_page, "forum")) {
  40                  $pinfo = e_PLUGIN."forum/forum.php";
  41                  $online_location_page = "forum.php";
  42              }
  43              if (strstr($online_location_page, "content")) {
  44                  $pinfo = "content.php";
  45                  $online_location_page = "content.php";
  46              }
  47              if (strstr($online_location_page, "comment")) {
  48                  $pinfo = "comment.php";
  49                  $online_location_page = "comment.php";
  50              }
  51              $text .= "<img src='".e_IMAGE."admin_images/users_16.png' alt='' style='vertical-align:middle' /> <a href='".e_BASE."user.php?id.$oid'>$oname</a> ".ONLINE_EL7;
  52              (!strstr($pinfo, $ADMIN_DIRECTORY) ? $text .= " <a href='{$pinfo}'>$online_location_page</a><br />" : $text .= " $online_location_page<br />");
  53          }
  54      }
  55  
  56      if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) {
  57          $menu_pref['most_members_online'] = MEMBERS_ONLINE;
  58          $menu_pref['most_guests_online'] = GUESTS_ONLINE;
  59          $menu_pref['most_online_datestamp'] = time();
  60          $tmp = addslashes(serialize($menu_pref));
  61          $sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
  62      }
  63      global $gen;
  64      if (!is_object($gen)) {
  65          $gen = new convert;
  66      }
  67  
  68      $datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short");
  69  
  70      $text .= "<br />".ONLINE_EL8." ".($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])."<br />(".ONLINE_EL2.$menu_pref['most_members_online'].", ".ONLINE_EL1.$menu_pref['most_guests_online'].") ".ONLINE_EL9." ".$datestamp."<br />";
  71  
  72       $total_members = $sql->db_Count("user","(*)","where user_ban='0'"); // greatly optimizes the query below.
  73      if ($total_members > 1) {
  74  
  75          $newest_member = $sql->db_Select("user", "user_id, user_name", "user_id > ".($total_members-2)." AND user_ban='0' ORDER BY user_join DESC LIMIT 1");
  76  
  77          $row = $sql->db_Fetch();
  78          extract($row);
  79          $text .= "<br />".ONLINE_EL5.": ".$total_members."<br />".ONLINE_EL6.": <a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
  80      }
  81  } elseif(ADMIN) {
  82      global $tp;
  83      $text = $tp->toHtml(ONLINE_TRACKING_MESSAGE,TRUE);
  84  }
  85  
  86  
  87  $ns->tablerender(ONLINE_EL4, $text, 'online_extended');
  88  
  89  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7