Source for file status.php

Documentation is available at status.php

  1. <?php //-*-php-*-
  2. /* ******************************************************************** **
  3. ** Copyright notice **
  4. ** **
  5. ** (c) 1995-2003 PHPOpenChat Development Team **
  6. ** http://phpopenchat.sourceforge.net/ **
  7. ** **
  8. ** All rights reserved **
  9. ** **
  10. ** This script is part of the PHPOpenChat project. The PHPOpenChat **
  11. ** project is free software; you can redistribute it and/or modify **
  12. ** it under the terms of the GNU General Public License as published by **
  13. ** the Free Software Foundation; either version 2 of the License, or **
  14. ** (at your option) any later version. **
  15. ** **
  16. ** The GNU General Public License can be found at **
  17. ** http://www.gnu.org/copyleft/gpl.html. **
  18. ** A copy is found in the textfile GPL and important notices to the **
  19. ** license from the team is found in the textfile LICENSE distributed **
  20. ** with these scripts. **
  21. ** **
  22. ** This script is distributed in the hope that it will be useful, **
  23. ** but WITHOUT ANY WARRANTY; without even the implied warranty of **
  24. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
  25. ** GNU General Public License for more details. **
  26. ** **
  27. ** This copyright notice MUST APPEAR in all copies of the script! **
  28. ** ******************************************************************** */
  29.  
  30. /*
  31. $Author: letreo $
  32. $Date: 2003/10/10 16:45:14 $
  33. $Source: /cvsroot/phpopenchat/chat3/status.php,v $
  34. $Revision: 1.5 $
  35. */
  36.  
  37. //Include this script to output statisics about current online chatters of your chat.
  38. //Get default values
  39.  
  40. require_once('config.inc.php');
  41.  
  42. require_once(POC_INCLUDE_PATH.'/adodb/adodb.inc.php');
  43. require_once(POC_INCLUDE_PATH.'/class.Chat.inc');
  44. require_once(POC_INCLUDE_PATH.'/class.Translator.inc');
  45.  
  46. $_chat = &new Chat(CHAT_NAME,$supported_languages);
  47. if(!isset($_SESSION['translator'])) {
  48. if(function_exists('session_register')) {
  49. session_register('translator');
  50. }
  51. $translator = &new Translator( $_chat->get_language() );
  52. $_SESSION['translator'] = $translator;
  53. }
  54. $_chat->connect();
  55. $online_chatters = $_chat->get_chatters('%');
  56. $_chat->disconnect();
  57. $chatter_count = count($online_chatters);
  58. print '<table cellpadding="2" cellspacing="0" border="0">
  59. <thead>
  60. <tr>
  61. <td colspan="2" style="background-color:#0a0;color:#ff0;font-family: arial,sans-serif;font-size: 10px;font-weight: bold">
  62. Online: '.$chatter_count.'
  63. </td>
  64. </tr>
  65. </thead>
  66. <tbody>';
  67. if($chatter_count > 0)
  68. {
  69. reset($online_chatters);
  70. do{
  71. print '<tr>';
  72. print ' <td style="background-color:#ffce00;color:#000;font-family: arial,sans-serif;font-size: 10px">'.preg_replace( "/\#{3}([^#]*)\#{3}/e", "htmlentities(\$_SESSION['translator']->out('\\1'))", current($online_chatters) ).'</td>';
  73. if(next($online_chatters))
  74. print '<td style="background-color:#ffce00;color:#000;font-family: arial,sans-serif;font-size: 10px">'.preg_replace( "/\#{3}([^#]*)\#{3}/e", "htmlentities(\$_SESSION['translator']->out('\\1'))", current($online_chatters) ).'</td>';
  75. else
  76. {
  77. print '<td style="background-color:#ffce00;color:#000;font-family: arial,sans-serif;font-size: 10px">&nbsp;</td>';
  78. print'</tr>';
  79. break;
  80. }
  81. print '</tr>';
  82. }while(next($online_chatters));
  83. } else print '<tr><td colspan="2">&nbsp;</td></tr>';
  84. print ' </tbody>
  85. </table>
  86. ';
  87. unset($_chat);
  88. unset($chatter_count);
  89. unset($online_chatters);
  90. ?>

Documentation generated on Tue, 29 Jun 2004 14:42:45 +0200 by phpDocumentor 1.3.0RC3