Net_NNTP
[ class tree: Net_NNTP ] [ index: Net_NNTP ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.0 of the PHP license,       |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Alexander Merz <alexmerz@php.net>                           |
  17. // |          Heino H. Gehlsen <heino@gehlsen.dk>                         |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: index.php,v 1.2.6.2 2005/11/27 21:49:10 heino Exp $
  21.  
  22. $host 'news.php.net';
  23. $debug = false;
  24.  
  25. ?>
  26. <html>
  27.  
  28. <head>
  29.     <title>NNTP <?php echo $host?></title>
  30. </head>
  31.  
  32. <body>
  33. <?php
  34.  
  35. require_once "Net/NNTP/Client.php";
  36.  
  37. $nntp = new Net_NNTP_Client();
  38. $nntp->setDebug($debug);
  39.  
  40. $posting $nntp->connect($host);
  41. if (PEAR::isError($posting)) {
  42.     echo '<font color="red">No connection to newsserver!</font><br>';
  43.     die($posting->getMessage());
  44. }
  45.  
  46. $groups $nntp->getGroups();
  47. if (PEAR::isError($groups)) {
  48.     die('<font color="red">' $groups->getMessage('</font><br>');
  49. }
  50.  
  51.  
  52. $descriptions $nntp->getDescriptions();
  53. if (PEAR::isError($descriptions)) {
  54.     echo '<font color="red">' $descriptions->getMessage('</font><br>';
  55. }
  56.  
  57. echo "<h1>Avaible groups</h1>";
  58.  
  59. foreach($groups as $group{
  60.     echo '<a href="group.php?group='urlencode($group['group'])'&writable='urlencode($group['posting'])'">'$group['group']'</a> ';
  61.     echo '('($group['last'$group['first'])' messages)<br>';
  62.     echo $descriptions[$group['group']]'<br><br>';
  63. }
  64.  
  65. $nntp->quit();
  66.  
  67. ?>
  68. </body>
  69.  
  70. </html>

Documentation generated on Mon, 11 Mar 2019 14:05:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.