diff --git a/Rocksolid_Light/common/grouplist.php b/Rocksolid_Light/common/grouplist.php index 3220aa9..e0cf812 100644 --- a/Rocksolid_Light/common/grouplist.php +++ b/Rocksolid_Light/common/grouplist.php @@ -1,5 +1,7 @@ '; echo '

List of Available Newsgroups:

'; // Use cache if new enough -if (filemtime($cache_filename) > (time() - 3600)) { - // echo file_get_contents($cache_filename); - // exit(); +// 14400 = 4 hours +if (filemtime($cache_filename) > (time() - 14400)) { + echo file_get_contents($cache_filename); + exit(); } ob_start(); @@ -17,7 +20,7 @@ echo ''; echo ''; echo ''; echo ''; -// echo ''; +echo ''; echo ''; $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); + +$ns = nntp_open(); foreach ($groups_array as $thisgroup) { echo ''; echo ''; echo ''; + echo ''; echo ''; } - +nntp_close($ns); echo '
GroupDescriptionMessagesMessages
'; @@ -57,12 +61,22 @@ foreach ($groups_array as $thisgroup) { echo '' . urldecode($group[1]) . "
\r\n"; echo '
' . $title . ''; + # 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 '
'; +echo '
'; +include "../spoolnews/tail.inc"; echo ''; -include "tail.inc"; echo ''; file_put_contents($cache_filename, ob_get_contents()); ob_end_flush(); \ No newline at end of file