PHP Classes

File: group.php

Recommend this page to a friend!
  Classes of Deanna Earley   networknews   group.php   Download  
File: group.php
Role: Example script
Content type: text/plain
Description: Sample group.php
Class: networknews
nntp browsing and viewing class
Author: By
Last change: Added role, updated html slightly and added email address parsing
Date: 21 years ago
Size: 1,089 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title><?php print $group; ?> - news.earlsoft.co.uk</title>
 </head>
 <body>
<?php
require "common.inc";

$groupinfo = $nntp->getgroupinfo($group);
if (!
$groupinfo) {
  print
"Group not found";
} else {
  print
" <table>";
  print
" <tr><th>Subject</th><th>From</th></tr>";
  for (
$article = $groupinfo['first']; $article <= $groupinfo['last']; $article++) {
   
$head = $nntp->getarticlehead($group, $article);
    if (
$head) {
     
$head = $common->parseheader($head);
     
$email = $common->parseemail($head['from']); $email = $email[0];
      print
" <tr><td><a href=\"article.php?group=".urlencode($group)."&number=".urlencode($article)."\">".htmlspecialchars($head['subject'])."</a></td><td><a href=\"mailto:".urlencode($email['address'])."\">".htmlspecialchars($email['name'])."</a></td></tr>\n";
    }
  }
  print
" </table>";
}

?>
</body>
</html>