Compare commits
6 Commits
fd5285ba88
...
5307591089
Author | SHA1 | Date |
---|---|---|
Retro_Guy | 5307591089 | |
Retro_Guy | 079ad45764 | |
Retro_Guy | b96ace8584 | |
Retro_Guy | 9dd37b5a45 | |
Retro_Guy | aa8fa270f8 | |
Retro_Guy | 04492ff0d2 |
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
include "config.inc.php";
|
||||
include "../spoolnews/config.inc.php";
|
||||
include "../spoolnews/newsportal.php";
|
||||
$title .= ' - Available Newsgroups';
|
||||
include "head.inc";
|
||||
|
||||
|
@ -7,9 +9,10 @@ $cache_filename = $spooldir . '/grouplist-cache.txt';
|
|||
echo '<center>';
|
||||
echo '<h3>List of Available Newsgroups:</h3>';
|
||||
// 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 '<table border="1">';
|
|||
echo '<tr>';
|
||||
echo '<th>Group</th>';
|
||||
echo '<th>Description</th>';
|
||||
// echo '<th>Messages</th>';
|
||||
echo '<th>Messages</th>';
|
||||
echo '</tr>';
|
||||
|
||||
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
|
@ -42,14 +45,15 @@ foreach ($menulist as $menu) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($groups_array);
|
||||
|
||||
$ns = nntp_open();
|
||||
foreach ($groups_array as $thisgroup) {
|
||||
echo '<tr>';
|
||||
echo '<td>';
|
||||
$group = explode("group=", $thisgroup);
|
||||
if (is_file($spooldir . '/' . $group[1] . '-title')) {
|
||||
$title = file_get_contents($spooldir . '/' . $group[1] . '-title');
|
||||
if (is_file($spooldir . '/' . urldecode($group[1]) . '-title')) {
|
||||
$title = file_get_contents($spooldir . '/' . urldecode($group[1]) . '-title');
|
||||
$title = strrchr($title, "\t");
|
||||
} else {
|
||||
$title = '';
|
||||
|
@ -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 '</td>';
|
||||
echo '<td>' . $title . '</td>';
|
||||
echo '<td>';
|
||||
# Check if group exists. Open it if it does
|
||||
fputs($ns, "group " . urldecode($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>';
|
||||
}
|
||||
|
||||
nntp_close($ns);
|
||||
echo '</table>';
|
||||
echo '<br />';
|
||||
include "../spoolnews/tail.inc";
|
||||
echo '</center>';
|
||||
include "tail.inc";
|
||||
echo '</body></html>';
|
||||
file_put_contents($cache_filename, ob_get_contents());
|
||||
ob_end_flush();
|
|
@ -29,9 +29,6 @@ header("Pragma: cache");
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
include "config.inc.php";
|
||||
include "auth.inc";
|
||||
include "$file_newsportal";
|
||||
|
@ -309,19 +306,41 @@ function expire_overboard($cachefile)
|
|||
|
||||
function display_threads($threads, $oldest)
|
||||
{
|
||||
global $CONFIG, $thissite, $logfile, $config_name, $snippetlength, $maxdisplay, $prune, $this_overboard;
|
||||
global $CONFIG, $OVERRIDES, $thissite, $logfile, $config_name, $snippetlength, $maxdisplay, $prune, $this_overboard;
|
||||
echo '<table cellspacing="0" width="100%" class="np_results_table">';
|
||||
if (! isset($threads)) {
|
||||
$threads = (object) [];
|
||||
} else {
|
||||
krsort($threads);
|
||||
}
|
||||
// Get registered user settings
|
||||
if (isset($_COOKIE['mail_name'])) {
|
||||
if ($userdata = get_user_mail_auth_data($_COOKIE['mail_name'])) {
|
||||
$userfile = $spooldir . '/' . strtolower($_COOKIE['mail_name']) . '-articleviews.dat';
|
||||
$user_config = unserialize(file_get_contents($config_dir . '/userconfig/' . strtolower($_COOKIE['mail_name']) . '.config'));
|
||||
}
|
||||
|
||||
if (! isset($user_config['hide_unsub'])) {
|
||||
if (isset($OVERRIDES['hide_unsub'])) {
|
||||
$user_config['hide_unsub'] = $OVERRIDES['hide_unsub'];
|
||||
} else {
|
||||
$user_config['hide_unsub'] = 'hide';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$results = 0;
|
||||
foreach ($threads as $key => $value) {
|
||||
$target = $this_overboard['msgids'][$value];
|
||||
$checkgroup = $target['newsgroup'];
|
||||
if (! isset($target['msgid'])) {
|
||||
$target = get_data_from_msgid($value);
|
||||
}
|
||||
if (!isset($userdata[$checkgroup])) {
|
||||
if (isset($user_config['hide_unsub']) && $user_config['hide_unsub'] == 'hide') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($target['date'] < $oldest) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -492,8 +492,7 @@ function quoten() {
|
|||
value="<?php echo $text_post["quote"]?>"
|
||||
onclick="quoten(); this.style.visibility= 'hidden';">
|
||||
|
||||
<input type="checkbox" name="abspeichern" value="ja" checked>
|
||||
<?php echo $text_post["remember"];?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<input type="file" name="photo" id="fileSelect" value="fileSelect"
|
||||
|
|
|
@ -11,6 +11,8 @@ if (isset($_POST['command']) && $_POST['command'] == 'Logout') {
|
|||
}
|
||||
$_SESSION = array();
|
||||
session_destroy();
|
||||
unset($_COOKIE['mail_name']);
|
||||
setcookie('mail_name', '', -1, '/');
|
||||
$logmeout = true;
|
||||
} else {
|
||||
$logmeout = false;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
// Where these scripts reside and messages are created: (end with '/')
|
||||
// You must have write access to this directory
|
||||
$workpath = "/home/paris/BBS/nocem/";
|
||||
$workpath = "/home/user/nocem/";
|
||||
|
||||
$domain = "your_domain";
|
||||
$organization = "your_organization";
|
||||
|
@ -43,6 +43,9 @@ $spamgroup = "alt.test,misc.test";
|
|||
$hierarchies = "the alt.* and de.* hierarchies";
|
||||
// $hierarchies = "ALL hierarchies";
|
||||
|
||||
// Add group to Followup-To header. Leave blank for no header
|
||||
$followup_to = "news.admin.net-abuse.usenet";
|
||||
|
||||
// EDIT THE BELOW LINES to reflect your specific needs
|
||||
// NOTE: You may comment out any lines below you do not want
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@ if($count < 2) {
|
|||
}
|
||||
|
||||
fwrite($header_file, "Message-ID: <$thishash@$domain>\n");
|
||||
if(isset($followup_to)) {
|
||||
fwrite($header_file, "Followup-To: $followup_to\n");
|
||||
}
|
||||
fwrite($header_file, "From: $from\n");
|
||||
fwrite($header_file, "Newsgroups: $spamgroup\n");
|
||||
fwrite($header_file, "Subject: @@NCM NoCeM notice $thishash spam/hide ($count $article)\n");
|
||||
|
|
Loading…
Reference in New Issue