Пример #1
0
 /**
  * Fetch valid groups.
  *
  * Returns a list of valid groups (that the client is permitted to select) and associated information.
  *
  * @param string $wildMat (optional) http://tools.ietf.org/html/rfc3977#section-4
  *
  * @return array|object Pear error on failure, array with groups on success.
  * @access public
  */
 public function getGroups($wildMat = null)
 {
     // Enabled header compression if not enabled.
     $this->_enableCompression();
     return parent::getGroups($wildMat);
 }
Пример #2
0
// +----------------------------------------------------------------------+
//
// $Id: index.php,v 1.2.2.1 2005/01/30 15:44:44 heino Exp $
?>
<html>
<head>
    <title>NNTP news.php.net</title>
</head>
<body>
<?php 
require_once "Net/NNTP/Client.php";
$nntp = new Net_NNTP_Client();
$ret = $nntp->connect("news.php.net");
if (PEAR::isError($ret)) {
    echo '<font color="red">No connection to newsserver!</font><br>';
    echo $ret->getMessage();
} else {
    echo "<h1>Avaible groups</h1>";
    $groups = $nntp->getGroups();
    $descriptions = $nntp->getDescriptions();
    foreach ($groups as $group) {
        echo '<a href="group.php?group=' . urlencode($group['group']) . '&writable=' . urlencode($group['posting']) . '">' . $group['group'] . '</a>';
        $msgcount = $group['last'] - $group['first'];
        echo '&nbsp;(' . $msgcount . ' messages)<br>';
        echo $descriptions[$group['group']] . '<br><br>';
    }
    $nntp->quit();
}
?>
</body>
</html>