Add number of messages to grouplist and some tweaks in same.
This commit is contained in:
parent
04492ff0d2
commit
aa8fa270f8
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
include "config.inc.php";
|
include "config.inc.php";
|
||||||
|
include "../spoolnews/config.inc.php";
|
||||||
|
include "../spoolnews/newsportal.php";
|
||||||
$title .= ' - Available Newsgroups';
|
$title .= ' - Available Newsgroups';
|
||||||
include "head.inc";
|
include "head.inc";
|
||||||
|
|
||||||
|
@ -7,9 +9,10 @@ $cache_filename = $spooldir . '/grouplist-cache.txt';
|
||||||
echo '<center>';
|
echo '<center>';
|
||||||
echo '<h3>List of Available Newsgroups:</h3>';
|
echo '<h3>List of Available Newsgroups:</h3>';
|
||||||
// Use cache if new enough
|
// Use cache if new enough
|
||||||
if (filemtime($cache_filename) > (time() - 3600)) {
|
// 14400 = 4 hours
|
||||||
// echo file_get_contents($cache_filename);
|
if (filemtime($cache_filename) > (time() - 14400)) {
|
||||||
// exit();
|
echo file_get_contents($cache_filename);
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -17,7 +20,7 @@ echo '<table border="1">';
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<th>Group</th>';
|
echo '<th>Group</th>';
|
||||||
echo '<th>Description</th>';
|
echo '<th>Description</th>';
|
||||||
// echo '<th>Messages</th>';
|
echo '<th>Messages</th>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
|
|
||||||
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
@ -42,8 +45,9 @@ foreach ($menulist as $menu) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ksort($groups_array);
|
ksort($groups_array);
|
||||||
|
|
||||||
|
$ns = nntp_open();
|
||||||
foreach ($groups_array as $thisgroup) {
|
foreach ($groups_array as $thisgroup) {
|
||||||
echo '<tr>';
|
echo '<tr>';
|
||||||
echo '<td>';
|
echo '<td>';
|
||||||
|
@ -57,12 +61,22 @@ foreach ($groups_array as $thisgroup) {
|
||||||
echo '<font size=5><a href="/' . $thisgroup . '">' . urldecode($group[1]) . "</a></font><br />\r\n";
|
echo '<font size=5><a href="/' . $thisgroup . '">' . urldecode($group[1]) . "</a></font><br />\r\n";
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '<td>' . $title . '</td>';
|
echo '<td>' . $title . '</td>';
|
||||||
|
echo '<td>';
|
||||||
|
# Check if group exists. Open it if it does
|
||||||
|
fputs($ns, "group " . $group[1] . "\r\n");
|
||||||
|
$response = line_read($ns);
|
||||||
|
$messages = explode(' ', $response);
|
||||||
|
if (strcmp(substr($response, 0, 3), "211") == 0) {
|
||||||
|
echo "\n" . $messages[1];
|
||||||
|
}
|
||||||
|
echo '</td>';
|
||||||
echo '</tr>';
|
echo '</tr>';
|
||||||
}
|
}
|
||||||
|
nntp_close($ns);
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
echo '<br />';
|
||||||
|
include "../spoolnews/tail.inc";
|
||||||
echo '</center>';
|
echo '</center>';
|
||||||
include "tail.inc";
|
|
||||||
echo '</body></html>';
|
echo '</body></html>';
|
||||||
file_put_contents($cache_filename, ob_get_contents());
|
file_put_contents($cache_filename, ob_get_contents());
|
||||||
ob_end_flush();
|
ob_end_flush();
|
Loading…
Reference in New Issue