PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




hw_who

Name

hw_who — Returns information about users currently connected to the Hyperwave server.

Synopsis

array hw_who(hw_link);
resource hw_link: Connection ID to Hyperwave server

Returns

Array containing information on connected users; FALSE on error

Description

hw_who() queries the Hyperwave server for information about all connected users, and returns an array of the data gathered. The indexed array returned contains one array for each connected user, and each of these arrays contains the following elements:

  • self: This is 1 if the user running the query is the same as the user shown by this entry, and 0 otherwise.

  • id: The Hyperwave user ID of the current entry.

  • name: The Hyperwave username for the current entry.

  • system: The user's system status.

  • onSinceDate: The date on which the user connected to the server; in the format YYYY/MM/DD.

  • onSinceTime: The time of day at which the user connected to the server; in the format HH:MM:SS.

  • TotalTime: The total time since the user connected to the server; in the format HH:MM:SS.



Version

PHP 3 since 3.0.3, PHP 4

Example

Example 526. Show information about connected users

if ($user_info = hw_who($hw_link)) {
    reset($user_info);
    echo <<<EOT
    <table border="1">
      <caption>Connected users</caption>
      <thead>
        <tr>
          <th>ID</th>
          <th>Name</th>
          <th>System</th>
          <th>Online since</th>
          <th>Total time online</th>
        </tr>
      </thead>
      <tbody>
EOT;
    foreach ($user_info as $user) {
        echo <<<EOT
        <tr>
          <td>$user[id]</td>
          <td>$user[name]</td>
          <td>$user[system]</td>
          <td>$user[onSinceDate] $user[onSinceTime]</td>
          <td>$user[TotalTime]</td>
        </tr>
EOT;
    }
    echo <<<EOT
      </tbody>
    </table>
EOT;
} else {
    echo "Could not get user information.<br />\n";
}



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.