Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by Gilby Gilby is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 02-19-2002 Last Update: Never Installs: 71
 
No support by the author.

This hack provides a gateway to any NNTP newsgroup such as those from Usenet and other newsgroup servers. Selected newsgroups are imported from your news server and post on the forum are sent out to the newsgroup. This hack was greatly inspired by fastforward's usenet gateway hack. This one is a complete rewrite of that hack written in PHP and works with vB 2.2.2.

Installation:
Installation is pretty simple. No modifications to the vB php files are needed and it simply consists of dropping in the files to your forums directory, running the SQL modifications, and modifying the newsgroup settings for your desired newsgroups. For the complete installation details, read the readme.txt file.

Here are some of the features:
  • Real cool vbcode to text conversion!
  • All posts are inserted, even if parent thread cannot be found for replies
  • Guests posts also get sent to the newsgroup.
  • Importing of attachments from the newsgroup
  • Poll info sent to newsgroup
  • Attachment link sent to newsgroup
  • Supports unlimited newsgroups and servers.
  • email notification of new replies, just like regular forum posts
  • Can import HTML messages and convert to limited vb code.

For control panel integration, please check out GameCrash's Graphical Interface addition.

What's not in it that was in fastforward's usenet gateway hack:
  • No control panel integration at the moment. (Available separately)
  • Does not support separate footers
  • Does not allow custom email address to be used via the users option
  • No spam control or string replacement support.
  • No purging or autoexpire.

There is still lots that I'd like to add to it, but this is competely functional for basic newsgroup gateway support. It is most likely not free of bugs. If you have questions, suggestions or annoyances, please post in this thread.

vb3 support
lierduh modified this to provide support for the beta versions of vb3. When the release candidates of vb3 come out, I plan to add support for vb3 and add other features to this hack. If you have suggestions for new features, let me know.

E-mail gateway support
New in this version, you can now gateway with an email list. This will fetch emails from a POP email account and send via php's mail function to the mailing list's email address. To set up the list, in the newsgroup field, enter in the email address to send outgoing posts to. In the server field, enter in the pop3 server, and in the username and password fields enter in, you guessed it, the username and password to your pop account. Note: the email gateway capabilities has not been fully tested, so it might not work with your POP server. Also, it does not work in combo with a news<->forum gateway in the same forum (you can use either kind though in differnet forums within your forums).

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #332  
Old 04-05-2002, 03:05 AM
Sanjiyan's Avatar
Sanjiyan Sanjiyan is offline
 
Join Date: Jan 2002
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Gilby


And an upgrade to 2.2.5? do you know if it happened with 2.2.4 of vb and 1.9 of the gateway?
didnt use 1.9, I used the version you edited for me.

So 2.2.5 and 1.9 are both new.
Reply With Quote
  #333  
Old 04-05-2002, 03:08 AM
Gilby Gilby is offline
 
Join Date: Oct 2001
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

> didnt use 1.9, I used the version you edited for me.

What version did I edit for you? If I did, it was from a while back and
would not have the email support.

- Gilby
Reply With Quote
  #334  
Old 04-05-2002, 03:11 AM
Sanjiyan's Avatar
Sanjiyan Sanjiyan is offline
 
Join Date: Jan 2002
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nope it didnt have email support, it was the version that you made for me that reported the feedback.. it was a while back ^_^
Reply With Quote
  #335  
Old 04-06-2002, 03:12 PM
jarvis jarvis is offline
 
Join Date: Nov 2001
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone tried the "prune messages" function with this? It seemed like the first time I did this, it reset my 'last msg ID' field to 0?
Reply With Quote
  #336  
Old 04-08-2002, 05:30 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I absolutely *love* this hack and would dearly like to use it on my board. However the long usernames from usenet tend to be cumbersome indeed. Is there a way to hack gateway.php so that let's say only the first 20 characters of the username are uploaded? I am not really worried about chopped off usernames.
Reply With Quote
  #337  
Old 04-09-2002, 04:23 AM
Robert Basil's Avatar
Robert Basil Robert Basil is offline
 
Join Date: Oct 2001
Location: Chandler, Arizona
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by patvdv
I absolutely *love* this hack and would dearly like to use it on my board. However the long usernames from usenet tend to be cumbersome indeed. Is there a way to hack gateway.php so that let's say only the first 20 characters of the username are uploaded? I am not really worried about chopped off usernames.
I agree, this would be a nice addition.

P.S. Gilby this is my #1 favorite hack (and I have over 25 of em installed, and have created about 15 of my own) thanks again!
Reply With Quote
  #338  
Old 04-09-2002, 04:33 AM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I figured it out myself and it seems to work OK. Ideally I would like to see the username length as a parameter in the nntp_settings table

In gateway.php find each instance of:

PHP Code:
from_name($message[from]) 
and replace by

PHP Code:
substr(from_name($message[from]),0,15
to get a 15 character delimited username.
Reply With Quote
  #339  
Old 04-09-2002, 04:38 AM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by jarvis
Has anyone tried the "prune messages" function with this? It seemed like the first time I did this, it reset my 'last msg ID' field to 0?
Yes that happens to me to. I guess you can run setlastmsg.php again as a workaround but it would be nice if the last msg ID was preserved automatically.

Better even would be if the NNTP gateway had its own pruning mechanism for those forums in which you import the usenet posts. For e.g. if you schedule the gateway job every hour, it would be *perfect* if it could also check for posts older than x days and remove them from the board

Gilby, would you consider such an addition?
Reply With Quote
  #340  
Old 04-10-2002, 02:27 PM
Gilby Gilby is offline
 
Join Date: Oct 2001
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by jarvis
Has anyone tried the "prune messages" function with this? It seemed like the first time I did this, it reset my 'last msg ID' field to 0?
Are you using the prune messages function that is in the vb control panel? I can't see how or why that would even touch the nntp table in the database.
Reply With Quote
  #341  
Old 04-10-2002, 04:28 PM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Gilby


Are you using the prune messages function that is in the vb control panel? I can't see how or why that would even touch the nntp table in the database.
Gilby, yes I am (also) using 'Mass Prune' from the AdminCP and the behaviour is consistently the same. Deleting all posts from a forum resets the msgid field. Btw, I am using vb 2.2.4

Superb hack though I hope you will continue developing it.

Regards,

Pat.
Reply With Quote
  #342  
Old 04-10-2002, 04:53 PM
Gilby Gilby is offline
 
Join Date: Oct 2001
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by patvdv
Gilby, yes I am (also) using 'Mass Prune' from the AdminCP and the behaviour is consistently the same. Deleting all posts from a forum resets the msgid field. Btw, I am using vb 2.2.4
Hmmm... I just tried using the mass prune (the one built into vb), and it didn't change my lastmsg field in the database. I'm confused on why this would even happen though. vB doesn't even know the nntp tables exist when it executes that. unless you are using some other prune script.

Is this mass prune in the nntp graphical interface? If so, then that'll explain it. I don't have that hack installed. In the admin control panel, the 'mass prune' found under the 'Threads & Posts' heading did not change the lastmsg field for me.
Reply With Quote
  #343  
Old 04-10-2002, 08:16 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working smoothly with 2.2.5, if anyone was wondering.
Reply With Quote
  #344  
Old 04-12-2002, 04:32 AM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Gilby


Hmmm... I just tried using the mass prune (the one built into vb), and it didn't change my lastmsg field in the database. I'm confused on why this would even happen though. vB doesn't even know the nntp tables exist when it executes that. unless you are using some other prune script.

Is this mass prune in the nntp graphical interface? If so, then that'll explain it. I don't have that hack installed. In the admin control panel, the 'mass prune' found under the 'Threads & Posts' heading did not change the lastmsg field for me.
Gilby, it seems weird to me too but yes I am using the standard vbulletin 'Mass Prune' option to delete all posts. I don't have the graphical NNTP admin panel installed. But I did some more tests and apparently the problem does not appear when I only prune the full contents on 1 single forum. Previously I had selected the parent forum including subforums. I will run some more tests if I get the chance
Reply With Quote
  #345  
Old 04-12-2002, 06:58 AM
v0nreagan's Avatar
v0nreagan v0nreagan is offline
 
Join Date: Nov 2001
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #346  
Old 04-12-2002, 07:39 AM
patvdv's Avatar
patvdv patvdv is offline
 
Join Date: Oct 2001
Location: Belgium
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had the same idea but implemented it differently, without the added table field:

Open search.php and find:

PHP Code:
// ###################### Start get new #######################
if ($action=="getnew") {
  
// generate query
  // do it!
  
if ($bbuserinfo[userid]!=or $bbuserinfo[lastvisit]!=0) {
    
$forumsql=getallforumsql(); 
After that, add:

PHP Code:
// HACK: search for normal or usenet posts
            
if ($usenet=="true") {
                  
$forums=$DB_site->query("SELECT forum FROM nntp_groups");
                  
$forumsql.=" AND forumid IN (0";
                  while (
$forum=$DB_site->fetch_array($forums)) {
                      
$forumsql.=",$forum[forum]";
              }
            
$forumsql.=")";
            } else {
                 
$forums=$DB_site->query("SELECT forum FROM nntp_groups");
                  
$forumsql.=" AND forumid NOT IN (0";
                  while (
$forum=$DB_site->fetch_array($forums)) {
                      
$forumsql.=",$forum[forum]";
                  }
                  
$forumsql.=")";
        }
// HACK: search for normal or usenet posts 
Then update your forumhome_newposts template to include 2 links rather than one:

To look for normal posts:
<a href="search.php?s=$session[sessionhash]&action=getnew&usenet=false">

To look for usenet posts:
<a href="search.php?s=$session[sessionhash]&action=getnew&usenet=true">

Not being a PHP wizard I am not 100% sure that this would cover all angles but it seems to work for me fine so far
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:59 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08882 seconds
  • Memory Usage 2,395KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete