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 2005/01/08 20:03:30 heino Exp $
  21. ?>
  22. <html>
  23. <head>
  24.     <title>NNTP news.php.net</title>
  25. </head>
  26. <body>
  27. <?php
  28. require_once "Net/NNTP/Client.php";
  29.  
  30. $nntp = new Net_NNTP_Client();
  31.  
  32. $ret $nntp->connect("news.php.net");
  33. ifPEAR::isError($ret)) {
  34.  echo '<font color="red">No connection to newsserver!</font><br>' ;
  35.  echo $ret->getMessage();
  36. else {
  37.     echo "<h1>Avaible groups</h1>";    
  38.     $groups $nntp->getGroups();
  39.     $descriptions $nntp->getDescriptions();
  40.     foreach($groups as $group{
  41.         echo '<a href="group.php?group='.urlencode($group['group']).
  42.             '&writable='.urlencode($group['posting_allowed']).'">'.
  43.             $group['group'].'</a>' ;
  44.         $msgcount $group['last']-$group['first']
  45.         echo '&nbsp;('.$msgcount.' messages)<br>';
  46.         echo $descriptions[$group['group']].'<br><br>';
  47.     }
  48.     $nntp->quit();
  49. }    
  50. ?>
  51. </body>
  52. </html>

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