The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
NNTP Gateway for Usenet ( Newsgroups ), Mailing Lists Details »» | |||||||||||||||||||||||||||
NNTP Gateway for Usenet ( Newsgroups ), Mailing Lists
Developer Last Online: Nov 2023
The latest version: V3.5.0Alpha 1 (21 Jul 2005)
What is it? This hack provides a gateway from vBulletin forums to the USENET. It allows forum members to read newsgroup messages as well as to send posts to the newsgroups. In a nutshell, it turns vBulletin forums into a basic function news reader. For an added bonus, this package also supports mailing list archive and forum to mailing list gateway. The software retrieves messages from a pop3 account and import them into the forums threaded. It also allows a forums user to send messages to the mailing list by the forum posting interface. Why? The gateway will be appreciated by forum members who do not know how to set up a news reader, or people who do not have port 119 open in their network. A forum interface to read and post news are often considered to be better than a news reader. The gateway adds more contents to your forums and allows the members to interact with wider audience. It is common to see new users signing up to use this feature. History This hack was originally coded by Gilby for vB2. I modified the hack to work with vB3 and have been maintaining and improving the hack. I have now done the modification for this to work with vB3.5. The very original hack by Gilby can be found here: https://vborg.vbsupport.ru/showthrea...7&page=1&pp=15 The vB3 version can be found here: https://vborg.vbsupport.ru/showthread.php?t=65152 Features Some of the features and improvement include:
Future development
What do you need and do not need? You do not need to edit vB php files. No need to manually run SQL. Installation Basically the AdminCP interfaces take care of installation as well as upgrade in the background. Back up your database first. The scripts can modify your database without alerting you! Please follow the instructions in the readme.txt file for more details. It is not a must to click "INSTALL" for this hack if you use it, I do try better answering the questions from people who do. Support Please post your support questions to this thread. Please check the FAQ in the second post within this thread first. It may be surprising, but it is possible your question is answered in the adminCP NNTP settings. Please always provide more details about your problem. Examples and debug messages will certainly help. Well, if you don't even try to have some effort to compose your question, the answer you get may also not include much effort. ================== UPDATES ====================== Jul 21 2005 (release version 3.5.0 Alpha 1) AdminCP xml file is written by Kadence.
Quick installation instruction: 1) Upload files to their correct directory 2) Enter AdminCP, click on NNTP Settings once to install/upgrade. Change settings to your like. 3) Click on NNTP Groups once to install/upgrade. 3a) For new install. Run once http://www.yourdomain.com/setlastmsg.php Delete this file afterwards. If you are upgrading from an older version. There is no need to upload this file. Actually this file should not be there except brand new install. 4) Manually run in debug mode: http://forums.yourdomain.com/gateway.php?debug=1 Show Your Support
|
Comments |
#252
|
|||
|
|||
thats strange - i didnt have that problem at all... luckilly enough it worked "straight out the box" (Tho still have the above mentioned problems with email.... )
|
#253
|
|||
|
|||
Quote:
Also, the problem (mentioned long ago) with the gateway spewing HTML when used with FireFox and the scheduled task manager is caused by this: Code:
if (!headers_sent()) { header("Content-Type: text/plain"); } David |
#254
|
|||
|
|||
Another issue I've run into...
If an NNTP user has not provided a display name (at least in Outlook Express), the "From" field in his posts is "<name@domain.tld>" and the from_name function in functions_nntp.php returns an empty string. My workaround is to add this: Code:
if(!$from_name) $from_name = from_email($from_raw); Code:
return $from_name; https://vborg.vbsupport.ru/showpost....&postcount=209 ... so that only the "name" portion of the e-mail address is displayed. Hopefully, the maintainer of this code can add this to the official version David |
#255
|
|||
|
|||
Quote:
Code:
function logging($text) { global $nntp; if (isset($nntp['debug']) AND $nntp['debug'] == 1) { if (function_exists('log_cron_action')) { print_r($text . "<br>\r\n"); } else { if (!headers_sent()) { header("Content-Type: text/plain"); } echo $text . "\r\n"; flush(); ob_flush(); } } if ($nntp['settings']['do_cron_log']) { $GLOBALS['nntp']['cron_log'] .= $text . "<br />"; } } AFAIK, the scheduler won't allow you do specify the DEBUG parameter, so you'll also have to modify gateway.php and add this: Code:
$nntp['debug'] = 1; |
#256
|
|||
|
|||
I found and fixed a few bugs:
To get the vBulletin user id from the NNTP post e-mail address, locate the following lines in gateway.php: Code:
//Separate name and email address $from_name = from_name($message['from']); $from_email = from_email($message['from']); Code:
//Get user id from email address $from_userid = 0; if ($from_email AND ($nntp_settings['associate_by_email'] == 1)) { $user_data = $db->query_first("SELECT userid FROM " . TABLE_PREFIX . "user WHERE email='" . addslashes($from_email) . "'"); if (!empty($user_data)) $from_userid = $user_data['userid']; } Fix up the SQL statements in the if ($threadid) / else block in gateway.php as follows: Code:
// if the correct thread was found, insert it. if ($threadid) { $lasticonid = 0; $icon_data = $db->query_first("SELECT iconid FROM " . TABLE_PREFIX . "thread WHERE threadid=$threadid"); if (!empty($icon_data)) $lasticonid = $icon_data['iconid']; $postid = insert_post($threadid, $forumid, $foruminfo, $subject, $from_name, $from_email, $from_userid, $date, $lasticonid, $parentid); // update thread $db->query("UPDATE " . TABLE_PREFIX . "thread SET lastpost = '" . $date . "', replycount = replycount + 1, lastposter = '" . addslashes($from_name) . "' WHERE threadid = $threadid "); // update the forum counts $db->query("UPDATE " . TABLE_PREFIX . "forum SET replycount = replycount + 1 WHERE forumid = $forumid"); // update forum last-post data $db->query(" UPDATE " . TABLE_PREFIX . "forum SET lastpost = '" . $date . "', lastposter = '" . addslashes($from_name) . "', lasticonid = $lasticonid, lastthreadid = $threadid, lastthread = '" . addslashes($subject) . "' WHERE forumid IN ({$foruminfo['parentlist']}) AND lastpost < '" . $date . "' "); // send out email notices exec_send_notification($threadid, "0", $postid); } else { //can only be here if no thread is found //Needs to create new thread // Create thread if ($vbulletin->options['similarthreadsearch']) { require_once(MY_DIR . '/includes/functions_search.php'); $similarthreads = fetch_similar_threads($subject); } else { $similarthreads = ''; } $db->query("INSERT INTO " . TABLE_PREFIX . "thread (title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline, iconid, visible, views, similar) VALUES ('" . addslashes($subject) . "', '" . $date . "', $forumid, 1, 0, '" . addslashes($from_name) . "', $from_userid, '" . addslashes($from_name) . "', '" . $date . "', 0, 1, 0, '" . $similarthreads . "') "); $threadid = $db->insert_id(); //insert_post $postid = insert_post($threadid, $forumid, $foruminfo, $subject, $from_name, $from_email, $from_userid, $date); // update the forum counts $db->query("UPDATE " . TABLE_PREFIX . "forum SET replycount = replycount + 1, threadcount = threadcount + 1 WHERE forumid = $forumid"); // update forum last-post data $db->query("UPDATE " . TABLE_PREFIX . "forum SET lastpost = '" . $date . "', lastposter = '" . addslashes($from_name) . "', lasticonid = 0, lastthread = '" . addslashes($subject) . "', lastthreadid = $threadid WHERE forumid IN ({$foruminfo['parentlist']}) AND lastpost < '" . $date . "' "); logging("'$subject' from ". $from_name . ". New thread."); } //new thread or not Code:
//Insert post and follow up function insert_post($threadid, $forumid, $foruminfo, $subject, $from_name, $from_email, $from_userid, $date, $iconid = 0, $parentid = 0) { global $db, $nntp; $message =& $nntp['message']; $db->query("INSERT INTO " . TABLE_PREFIX . "post (postid, threadid, title, username, userid, dateline, pagetext, allowsmilie, showsignature, ipaddress, iconid, visible, isusenetpost, msgid, ref, parentid) VALUES (NULL, $threadid, '". addslashes($subject) . "', '" . addslashes($from_name) . "', $from_userid, '" . $date . "', '" . addslashes($message['text']) . "', 1, 0, '" . addslashes($from_email) . "', $iconid, 1, 1, '" . addslashes($message['message-id']) . "', '" . addslashes($message['references']) . "', " . $parentid . ")"); $postid=$db->insert_id(); //So that thread preview works $db->query(" UPDATE " . TABLE_PREFIX . "thread SET firstpostid = $postid WHERE threadid = $threadid "); // ULTRASOFT HACK if($from_userid != 0) { // update user's post count $db->query("UPDATE " . TABLE_PREFIX . "user SET lastpost = '" . $date . "', lastactivity = '" . $date . "', posts = posts + 1 WHERE userid = $from_userid "); } //save attachments if any if ($message['attachments']) { process_attachments($date, $postid, $threadid, $forumid); } // Index post for searching build_post_index($postid, $foruminfo); return $postid; } Code:
Title: Associate by Email Varname: associate_by_email Value: 1 Description: Use the email address to associate postings with the corresponding vBulletin user. David |
#257
|
|||
|
|||
Here's another mod I've made to this hack.
In wrestling with getting it working, I needed to blow away my vBulletin threads/posts several times, and re-import everything from USENET. Since some of the postings originated in vBulletin, it was skipping them (which was mucking up the threading). Locate the whole if (trim($message['user-agent'])... block of code in gateway.php and tweak it as follows: Code:
$skip_post = 0; if (trim($message['user-agent']) == trim($nntp_settings['useragent']) AND $nntp_settings['organization_check'] == 0) { if ($nntp_settings['full_import_from_usenet'] == 0) { logging("Skip, post was sent from our forum."); $skip_post = 1; } } else if (trim($message['user-agent']) == trim($nntp_settings['useragent']) AND $nntp_settings['organization_check'] == 1 AND trim($message['organization']) == trim($nntp_settings['organization'])) { //added organization so that we don't skip fellow gateway's posts if ($nntp_settings['full_import_from_usenet'] == 0) { logging("Skip, post was sent from our forum."); $skip_post = 1; } } else if (stristr(trim($message['x-no-archive']), 'yes') AND isset($nntp_settings['honor_no-archive']) AND $nntp_settings['honor_no-archive'] != 0) { logging("Skip, X-No-Archive headers is set."); } elseif ($nntp['grouptype'] == 'mail' AND $group['prefix'] AND stristr($message['subject'], $group['prefix']) == false) { logging("Skip, not matching prefix: \"" . $group['prefix'] . "\""); } if(!$skip_post) { $kf = killfile_match(); Code:
Title: Full import from USENET Varname: full_import_from_usenet Value: 0 Description: Override useragent and organization checks to import absolutely everything from USENET.
|
#258
|
|||
|
|||
I found that the NNTP gateway was choking on some articles that had a period on a line by itself.
This seems to be used to indicate the end of the article, but in fact, there was more text to follow. I worked around this by changing function get_article in nntp.php. I replaced this code: Code:
while(!feof($this->fp)) { //$line = trim(fgets($this->fp, 256)); //Took out the length, some lines are longer than that $line = trim(fgets($this->fp)); if ($line == ".") { break; } else { $post .= $line ."\n"; } } Code:
while(!feof($this->fp)) { $line = fgets($this->fp); if ($line == ".\r\n") { break; } else { $post .= rtrim($line, "\r\n") ."\n"; } } David |
#259
|
||||
|
||||
Hey dkendall glad 2 C U be on the Ball with yo add ons. This hack has some po 10 show if it be enhanced and bug free.
I had a problem with it last month! Some groups dont like link backs to userid and forumid. I X-nessed all dat stuff ( signiture, id, links and anything dat might get da boot ) from my ex-posts. Usenet groups be picky when importing from the groups and exporting. All newbies trying diss out be careful when posting to Usenet. Dont put more than one group per forum!!! Mod yo posts. Got a ??? Can U fix it so that can delete posts from a certain Usenet user in VBull??? When I try to delete a user from Usenet in VBull I get message user not found goback. Got posts by user but VBull says cant find user, what the hec. Can U tell me how to fix??? |
#260
|
|||
|
|||
Wow...that took me about 10 reads to fully understand you. Usenet post are not posted as real vbulletin users..they are actually considered guest posts.
|
#261
|
|||
|
|||
Quote:
Quote:
I suppose it would be possible to automatically register unknown email addresses in VB (perhaps using the email address as the username too), but I don't think that's a feature I would want to use. David |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|