diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php
index 8c7bf3b..67af4e5 100644
--- a/Rocksolid_Light/rocksolid/newsportal.php
+++ b/Rocksolid_Light/rocksolid/newsportal.php
@@ -42,16 +42,12 @@ $CONFIG = include($config_file);
*/
function nntp_open($nserver=0,$nport=0) {
global $text_error,$CONFIG;
- global $server,$port,$synchro_user,$synchro_pass;
+ global $server,$port;
// echo "
NNTP OPEN
";
if(!isset($CONFIG['enable_nntp']) || $CONFIG['enable_nntp'] != true) {
$CONFIG['server_auth_user'] = $CONFIG['remote_auth_user'];
$CONFIG['server_auth_pass'] = $CONFIG['remote_auth_pass'];
}
- if(isset($synchro_user)) {
- $CONFIG['server_auth_user'] = $synchro_user;
- $CONFIG['server_auth_pass'] = $synchro_pass;
- }
$authorize=((isset($CONFIG['server_auth_user'])) && (isset($CONFIG['server_auth_pass'])) &&
($CONFIG['server_auth_user'] != ""));
if ($nserver==0) $nserver=$server;
@@ -87,8 +83,6 @@ function nntp_open($nserver=0,$nport=0) {
}
}
if ($ns==false) echo "
".$text_error["connection_failed"]."
"; - unset($synchro_user); - unset($synchro_pass); return $ns; } @@ -1203,4 +1197,22 @@ function get_date_interval($value) { } return $variance; } + +function rslight_db_open($database, $table) { + try { + $dbh = new PDO('sqlite:'.$database); + } catch (PDOExeption $e) { + echo 'Connection failed: '.$e->getMessage(); + exit; + } + $dbh->exec("CREATE TABLE IF NOT EXISTS $table( + id INTEGER PRIMARY KEY, + newsgroup TEXT, + number TEXT, + msgid TEXT, + date TEXT, + name TEXT, + subject TEXT)"); + return($dbh); +} ?> diff --git a/Rocksolid_Light/rocksolid/overboard.php b/Rocksolid_Light/rocksolid/overboard.php index bbce4df..760612b 100755 --- a/Rocksolid_Light/rocksolid/overboard.php +++ b/Rocksolid_Light/rocksolid/overboard.php @@ -93,9 +93,13 @@ if(is_file($cachefile)) { ob_start(); # Iterate through groups +$database = $spooldir.'/'.$config_name.'-overview.db3'; +$table = 'overview'; +$dbh = rslight_db_open($database, $table); +$query = $dbh->prepare('SELECT * FROM overview WHERE newsgroup=:findgroup ORDER BY date DESC LIMIT '.$maxdisplay); $articles = array(); foreach($grouplist as $findgroup) { - $groups = explode(" ", $findgroup); + $groups = preg_split("/(\ |\t)/", $findgroup, 2); $findgroup = $groups[0]; $none=0; @@ -115,16 +119,21 @@ foreach($grouplist as $findgroup) { } $stats = stat($spoolpath.$thisgroup); if($stats[9] > $oldest) { - $newarticles = scandir($spoolpath.$thisgroup); - foreach($newarticles as $newarticle) { -$newarticle = $spoolpath.$thisgroup."/".$newarticle; - $stats = stat($newarticle); - if($stats[9] > $oldest && $stats[7] > 0) { - $articles[] = $newarticle; - } + if($dbh) { + $query->execute(['findgroup' => $findgroup]); + while (($overviewline = $query->fetch()) !== false) { + if($overviewline['date'] < $oldest) { + continue 2; + } + if(stripos($overviewline['newsgroup'], $findgroup) !== false) { + $articles[] = $spoolpath.$thisgroup.'/'.$overviewline['number']; + } + } + } } } +$dbh = null; if (isset($_GET['thisgroup'])) { echo 'Posted: '.$date_interval.' by: '.create_name_link($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 ")) diff --git a/Rocksolid_Light/rocksolid/result.php b/Rocksolid_Light/rocksolid/result.php deleted file mode 100755 index 68dc436..0000000 --- a/Rocksolid_Light/rocksolid/result.php +++ /dev/null @@ -1,213 +0,0 @@ - - - - - -'.$grouplist[0].' (latest)'; - echo ''; - echo ''; - echo ' | '; -// Newsgroups button (hidden) - echo ''; - echo ''; - echo ' | '; - echo '
'; - echo ''; - echo ' | '; - echo '
'; - } else { - echo ' |
';
- }
- echo ' '; - echo ''.mb_decode_mimeheader($article[1])."\r\n"; - echo ' '; - echo ''.$findgroup.''; - echo ' '; - echo 'Posted: '.$article[3].' by: '.mb_decode_mimeheader($fromoutput[0]).' '; - echo ' |
".$results." matching articles found.
\r\n"; -#echo "