(time() - 60)) { echo file_get_contents($cachefile); exit(0); } } ob_start(); # Iterate through groups $database = $spooldir.'/articles-overview.db3'; $table = 'overview'; $dbh = rslight_db_open($database, $table); $query = $dbh->prepare('SELECT * FROM '.$table.' WHERE newsgroup=:findgroup AND date >= '.$oldest.' ORDER BY date DESC LIMIT '.$maxdisplay); $articles = array(); $db_articles = array(); foreach($grouplist as $findgroup) { $groups = preg_split("/(\ |\t)/", $findgroup, 2); $findgroup = $groups[0]; $overboard_noshow = explode(' ', $CONFIG['overboard_noshow']); foreach($overboard_noshow as $noshow) { if ((strpos($findgroup, $noshow) !== false) && !isset($_GET['thisgroup'])) { continue 2; } } $thisgroup = preg_replace('/\./', '/', $findgroup); if($dbh) { $query->execute(['findgroup' => $findgroup]); while (($overviewline = $query->fetch()) !== false) { $articles[] = $spoolpath.$thisgroup.'/'.$overviewline['number']; $db_articles[] = $findgroup.':'.$overviewline['number'].':'.$overviewline['date']; } } } $dbh = null; if (isset($_GET['thisgroup'])) { echo '
'; echo ''; echo ' | '; // Article List button echo ''; echo ''; echo ' | '; // Newsgroups button (hidden) if(isset($frames_on) && $frames_on === true) { echo ''; echo ''; echo ' | '; } echo '
'; echo ''; echo ' | '; // Newsgroups button (hidden) if(isset($frames_on) && $frames_on === true) { echo ''; echo ''; echo ' | '; } echo '
'; } else { echo ' |
';
}
echo ' '; echo ''.mb_decode_mimeheader($output[1])."\r\n"; echo ' '; echo ''.$groupname.''; echo ' '; if((isset($CONFIG['hide_email']) && $CONFIG['hide_email'] == true) && (strpos($fromoutput[0], '@') !== false)) { $poster_name = truncate_email($fromoutput[0]); } else { $poster_name = $fromoutput[0]; } $poster_name = trim($poster_name, "\""); echo 'Posted: '.$date_interval.' by: '.create_name_link(mb_decode_mimeheader($poster_name)).' '; // echo 'Posted: '.$date_interval.' by: '.mb_decode_mimeheader($fromoutput[0]).' '; # Try to display useful snippet if($stop=strpos($body, "begin 644 ")) $body=substr($body, 0, $stop); $body = quoted_printable_decode($body); $mysnippet = recode_charset($body, $content_type[1], "utf8"); if($bodyend=strrpos($mysnippet, "\n---\n")) { $mysnippet = substr($mysnippet, 0, $bodyend); } else { if($bodyend=strrpos($mysnippet, "\n-- ")) { $mysnippet = substr($mysnippet, 0, $bodyend); } else { if($bodyend=strrpos($mysnippet, "\n.")) { $mysnippet = substr($mysnippet, 0, $bodyend); } } } $mysnippet = preg_replace('/\n.{0,5}>(.*)/', '', $mysnippet); $snipstart = strpos($mysnippet, ":\n"); if(substr_count(trim(substr($mysnippet, 0, $snipstart)), "\n") < 2) { $mysnippet = substr($mysnippet, $snipstart + 1, $snippetlength); } else { $mysnippet = substr($mysnippet, 0, $snippetlength); } echo "".$mysnippet." \r\n"; echo ' |
".$results." recent articles found.
\r\n"; #echo "cached copy: ".date("D M j G:i:s T Y", time())."
\r\n"; include "tail.inc"; $thispage = ob_get_contents(); ob_end_clean(); echo $thispage; if(count($articles) > 0) { $cacheFileHandle = fopen($cachefile, "w+"); fwrite($cacheFileHandle, $thispage); fwrite($cacheFileHandle, $iscached); fclose($cacheFileHandle); } ?>