Quote:
Originally posted by rawnet
Hello,
How do we stop Usenet postings from appearing when someone clicks on the "New Threads Since Last Visit" link in the forums?
|
Using older stuff from Usenet hack - you need a new field in thread table.
ALTER TABLE thread ADD isusenetpost TINYINT(2) DEFAULT 0 not null;
then open your gateway.php and find:
// Create thread
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach,msgid,prefix) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."' ,'".$date."','$forumid','1','0','".addslashes(from _name($message[from]))."','0','".addslashes(from_name($message[from]))."','".$date."','0','1','$attachcount','".addsla shes($message[msgid])."','".addslashes($theprefix)."')");
replace it with (changes enbolded)
// Create thread modded
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,p ostusername,postuserid,lastposter,dateline,iconid, visible,attach,msgid,
isusenetpost,prefix) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."' ,'".$date."','$forumid','1','0','".addslashes(from _name($message[from]))."','0','".addslashes(from_name($message[from]))."','".$date."','0','1','$attachcount','".addsla shes($message[msgid])."'
,'1','".addslashes($theprefix)."')");
From now on each thread created by gateway.php will be flagged as originating from usenet (isusenetpost=1)...
Open search.php and find
two lines:
$wheresql.=" AND thread.open<>10";
in my case around line 551 and 601...
Directly below each of them add:
// NNTP Gateway mod
if (!$includeusenetpostsingetnew) { $wheresql.=" AND thread.isusenetpost=0"; };
// End of mod
Having isusenetpost in thread table also allows you to separate threrad counts or create separate links for "View new Usenet posts" ( see example
here...