diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php index db90c8b..66e64a9 100644 --- a/Rocksolid_Light/rocksolid/overboard.php +++ b/Rocksolid_Light/rocksolid/overboard.php @@ -259,7 +259,7 @@ function expire_overboard($cachefile) function display_threads($threads, $oldest) { - global $CONFIG, $OVERRIDES, $thissite, $logfile, $config_name, $config_dir, $snippetlength, $maxdisplay, $this_overboard, $article_age; + global $CONFIG, $OVERRIDES, $thissite, $logfile, $config_name, $spooldir, $config_dir, $snippetlength, $maxdisplay, $this_overboard, $article_age; $expireme = time() - ($article_age * 86400); $display = '
';
}
$display .= ' '; $display .= '' . headerDecode($target_head['subject']) . ' '; $display .= '' . $target_head['newsgroup'] . ''; if ($result_count > 1 && isset($target_head['date'])) { $poster = get_poster_name(mb_decode_mimeheader($target_head['name'])); - $display .= 'Posted: ' . get_date_interval(date("D, j M Y H:i T", $target_head['date'])) . ' by: ' . create_name_link($poster['name'], $poster['from']) . ' '; - if ($CONFIG['article_database'] == '1') { - $article = get_db_data_from_msgid($target_head['msgid'], $target_head['newsgroup'], 1); - $display .= wordwrap(substr($article['search_snippet'], 0, $snippetlength), ($snippetlength / 2), "\n", true); + $block = false; + foreach ($blocked_user_config as $key => $value) { + $blockme = '/' . addslashes($key) . '/'; + if (preg_match($blockme, $target_head['name'])) { + $block = true; + break; + } + } + if ($block) { + $display .= ' '; + $display .= ' '; + $display .= '(message #' . $target_head['number'] . ' hidden by your blocklist)'; + } else { + $display .= ' Posted: ' . get_date_interval(date("D, j M Y H:i T", $target_head['date'])) . ' by: ' . create_name_link($poster['name'], $poster['from']) . ' '; + if ($CONFIG['article_database'] == '1') { + $article = get_db_data_from_msgid($target_head['msgid'], $target_head['newsgroup'], 1); + $display .= wordwrap(substr($article['search_snippet'], 0, $snippetlength), ($snippetlength / 2), "\n", true); + } } $skip = $target_head['number']; } @@ -350,26 +380,40 @@ function display_threads($threads, $oldest) } if ($skip != $target['number']) { $poster = get_poster_name(mb_decode_mimeheader($target['name'])); - $groupurl = $thissite . "/thread.php?group=" . _rawurlencode($target['newsgroup']); - $url = $thissite . "/article-flat.php?id=" . $target['number'] . "&group=" . _rawurlencode($target['newsgroup']) . "#" . $target['number']; - $display .= ' '; - $display .= ' '; - $display .= '' . headerDecode($target['subject']) . ''; - - $display .= ' '; - $display .= ''; - $display .= 'by: ' . create_name_link($poster['name'], $poster['from']) . ''; - - $display .= ' '; - $display .= 'Posted: ' . get_date_interval(date("D, j M Y H:i T", $target['date'])) . ' in: ' . $target['newsgroup'] . ' '; - if ($CONFIG['article_database'] == '1') { - $article = get_db_data_from_msgid($target['msgid'], $target['newsgroup'], 1); - $display .= htmlentities(substr($article['search_snippet'], 0, $snippetlength)); + $block = false; + foreach ($blocked_user_config as $key => $value) { + $blockme = '/' . addslashes($key) . '/'; + if (preg_match($blockme, $target['name'])) { + $block = true; + break; + } } - if ($target['date'] < $expireme) { - unset($this_overboard['threads'][$target['date']]); - unset($this_overboard['threadlink'][$new]); - file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Pruning: " . $target['newsgroup'] . ":" . $target['number'], FILE_APPEND); + if ($block) { + $display .= ''; + $display .= ' ';
+ $display .= '(message #' . $target['number'] . ' hidden by your blocklist)';
+ } else {
+ $groupurl = $thissite . "/thread.php?group=" . _rawurlencode($target['newsgroup']);
+ $url = $thissite . "/article-flat.php?id=" . $target['number'] . "&group=" . _rawurlencode($target['newsgroup']) . "#" . $target['number'];
+ $display .= ' '; + $display .= '' . headerDecode($target['subject']) . ''; + + $display .= ' '; + $display .= ''; + $display .= 'by: ' . create_name_link($poster['name'], $poster['from']) . ''; + + $display .= ' '; + $display .= 'Posted: ' . get_date_interval(date("D, j M Y H:i T", $target['date'])) . ' in: ' . $target['newsgroup'] . ' '; + if ($CONFIG['article_database'] == '1') { + $article = get_db_data_from_msgid($target['msgid'], $target['newsgroup'], 1); + $display .= htmlentities(substr($article['search_snippet'], 0, $snippetlength)); + } + if ($target['date'] < $expireme) { + unset($this_overboard['threads'][$target['date']]); + unset($this_overboard['threadlink'][$new]); + file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Pruning: " . $target['newsgroup'] . ":" . $target['number'], FILE_APPEND); + } } } } @@ -383,7 +427,7 @@ function display_threads($threads, $oldest) function display_flat($threads, $oldest) { - global $CONFIG, $OVERRIDES, $thissite, $logfile, $config_name, $config_dir, $snippetlength, $maxdisplay, $this_overboard, $article_age; + global $CONFIG, $OVERRIDES, $thissite, $logfile, $spooldir, $config_name, $config_dir, $snippetlength, $maxdisplay, $this_overboard, $article_age; $expireme = time() - ($article_age * 86400); $display = '
|