List of Available Newsgroups:';
// Use cache if new enough
if (filemtime($cache_filename) > (time() - 3600)) {
// echo file_get_contents($cache_filename);
// exit();
}
ob_start();
echo '
';
echo '';
echo 'Group | ';
echo 'Description | ';
// echo 'Messages | ';
echo '
';
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$groups_array = array();
foreach ($menulist as $menu) {
if (($menu[0] == '#') || trim($menu) == "") {
continue;
}
$menuitem = explode(':', $menu);
if ($menuitem[0] == 'spoolnews') {
continue;
}
if ($menuitem[2] == '1') {
$in_gl = file($config_dir . $menuitem[0] . "/groups.txt");
foreach ($in_gl as $ok_group) {
if (($ok_group[0] == ':') || (trim($ok_group) == "")) {
continue;
}
$ok_group = preg_split("/[ \t]/", trim($ok_group), 2);
$groups_array[$ok_group[0]] = $menuitem[0] . '/thread.php?group=' . urlencode($ok_group[0]);
}
}
}
ksort($groups_array);
foreach ($groups_array as $thisgroup) {
echo '';
echo '';
$group = explode("group=", $thisgroup);
if (is_file($spooldir . '/' . $group[1] . '-title')) {
$title = file_get_contents($spooldir . '/' . $group[1] . '-title');
$title = strrchr($title, "\t");
} else {
$title = '';
}
echo '' . urldecode($group[1]) . " \r\n";
echo ' | ';
echo '' . $title . ' | ';
echo '
';
}
echo '
';
// echo ob_get_contents();
file_put_contents($cache_filename, ob_get_contents());
ob_end_flush();
echo '