vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   NNTP Gateway for Usenet ( Newsgroups ), Mailing Lists (https://vborg.vbsupport.ru/showthread.php?t=92588)

lierduh 11-22-2005 06:25 PM

Quote:

Originally Posted by chrispadfield
This code change (an ugly hack, but i was trying to be quick) fixed it:

Code:

        if ($get_max_postid['postid'] < 1) {
                $get_max_postid['postid'] = 0;
        }
        $db->query("UPDATE " . TABLE_PREFIX . "nntp_settings
                SET value = " . $get_max_postid['postid'] .
                " WHERE varname = 'last_postid'
        ");


The problem happens when you have a completely empty forum. I fixed that in the CVS a while back, but having trouble to find time to release a new version.:(

Krisekocm 11-22-2005 09:03 PM

When i run gateway.php the script is importing only from one group !
but i setup up 2 groups how to make this working to update both ?

oezer 11-24-2005 06:19 PM

Quote:

Originally Posted by lierduh
There is your anwser.

hi lierduh,

i have disabled the posting function on the settings, but the scripts imports only 3 threads and breaks. i got no errors. have you any ideas why the script is not normally finished at the end of the time?

Quote:


Gateway version 2.3.2 1 group(s) gatewayed.

Connecting to server, server says: 200 server ready - posting allowed

Info for adobe.acrobat.macintosh at adobeforums.com: 211 24126 21534 45659 adobe.acrobat.macintosh group selected

Getting message number 45295:
'Re: Calculation Forms' from Anne_Dewey@adobeforums.com. Thread found by References.
Getting message number 45296:
'Re: Slow Performance of Acrobat Form' from Anne_Dewey@adobeforums.com. Thread found by References.
Getting message number 45297:
on the 3rd message the script hangs up :(

scruby 11-29-2005 08:40 PM

Quote:

Originally Posted by lierduh
That is global/user setting, not by Forums. However it will be quite easy to implemented this as a hack through Plugin system. I will include this in the next version.

I got tired of waiting, so I threw together a quickie plugin that does this.
  1. add a plugin, the hook you want is "showthread_start"
  2. product is vbulletin (or you can create a product just for nntp hacks)
  3. PHP Code:

    global $vbulletin;
    $thread verify_id('thread'$threadid11);
    if (
    $thread) {    
        
    $sql "SELECT newsgroupid FROM " 
           
    TABLE_PREFIX 
           
    "nntp_groups WHERE forum = " .
           
    $thread['forumid'];
        if(
    $vbulletin->db->query_first($sql)) {
            unset(
    $threadedmode);
            
    $vbulletin->userinfo['threadedmode'] = 2// 1 - threaded, 2 - hybrid
        
    }



This makes it so that usenet threads are forced into beng threaded or hybrid mode (you pick which)

scruby 11-30-2005 08:46 AM

This has come up before in the threads for the earlier versions of this hack, but I'm bringing it up again since this version of the nntp gatway is still in the alpha phase of development.

In a moderated newsgroup, it's disruptive to post replies to articles that weren't approved by the newsgroup's moderators.

I want to find a good way to deal with moderated newsgroups so that articles and threads don't show up immediately.

Ideally, outgoing messages would be queued for gateway.php in tables outside of vbulletin's thread and post tables, and wouldn't appear in the forums until the message is downloaded from the news server.

dethfire 12-01-2005 05:44 AM

lierduh, thanks for your hard work, any idea when the next version will be released?

moftary 12-03-2005 10:01 PM

Quote:

Originally Posted by frakman
Okay, this is only a quick hack so I could import my MBOX file (extracted from Yahoo Goops) direct. (most because my server is running qmail).
I hope this gets included in standard. (does not require much polish)

First, install mbox.php from PEAR into the includes directory.

I don't think we are to post complete code - if I'm wong on that please tell me - so here are just the changes to pop.php:
Before
PHP Code:

class pop 

PHP Code:

require_once('./includes/mbox.php'); 

After
PHP Code:

    function prepare_connection$user$pass$host "127.0.0.1"$port "110" 

PHP Code:

        if (! (strpos($host'/')===false) ) {    //mbox
            
$this->mbox true;        //mbox
            
$this->_mbox = new Mail_Mbox();    //mbox
        
} else {                    //mbox 

Replace
PHP Code:

        if ($host == '') { 
            return 
0
        }
        
$this->port $port;
        
$this->username $user;
        
$this->password $pass;
        
$this->host $host

With
PHP Code:

            $this->password $pass;
        }                    
//mbox
        
if ($host == '') {         //mbox
            
return 0;             //mbox
        
}                    //mbox
        
$this->host $host;        //mbox 

after
PHP Code:

    function connect()
    { 

Add
PHP Code:

//MBOX-START
        
if ($this->mbox) {
            
$this->pop_connect $this->_mbox->open$this->host );
            if (!
$this->pop_connect) {
                echo 
"ERROR OPENING MBOX FILE\r\n";
                return -
1;
            }


        } else {
//MBOX-END 

After
PHP Code:

        return -2

Add
PHP Code:

    }    //MBOX 

Replace this block
PHP Code:

    function howmany()
    {
        return 
$this->_howmany();
    } 

with
PHP Code:

    function _howmany()
    {
        if (
$this->mbox) {  //MBOX
            
return $this->_mbox->size$this->pop_connect )-1;    //MBOX
        
} else {            //MBOX
        
$this->_write("STAT");
        
$results $this->_gets();
        
$this->log .= $results;
        list (
$results$messages$bytes) = split(' '$results);
        return 
$messages;
        }                
//MBOX
    


Lastly replace
PHP Code:

    function delete_mail $id )
    {
        
$this->_write("DELE $id");
        
$results $this->_gets();
    } 

WITH
PHP Code:

    function delete_mail $id )
    {
        if ( !
$this->mbox ) { //MBOX

        
$this->_write("DELE $id");
        
$results $this->_gets();
        }                 
//MBOX
    


When testing this I imported 10585 messages in 5m20s (not really a benchmark without doing it via POP3 as a comparison however surely the overheads are a lot less with this system)

How does this work? Put a file reference in the host box eg
/usr/local/apache2/www/mbox_locost_oz
where mbox_locost_oz is the MBOX archive. If you are on a Windows server the code would need to be changed (it looks for "/" which will not appear in a host name - would need to be changed to "\")

It will not delete messages from the archive. I do not see this as a bad thing for my purposes (ie dump in starting messages)

I also in my testing dug up a problem when there are no posts at all (I think its a NULL issue) I get this error:
Invalid SQL:
Code:

UPDATE vb_nntp_settings
                SET value =  WHERE varname = 'last_postid';

And this comes (in gateway.php)from
PHP Code:

$get_max_postid $db->query_first("
    SELECT MAX(postid) as postid FROM " 
TABLE_PREFIX "post
"
); 

ALSO somebody was complaining about lack of HTML formatting in Firefox:
in gateway.php change this line:
header("Content-Type: text/plain");
TO
header("Content-Type: text/html");


Or you could simply use /var/qmail/bin/maildir2mbox

moftary 12-03-2005 10:21 PM

Quote:

Originally Posted by donnacha
Oh c'mon, that's just standard contract copperplate, doesn't mean anything other than they'd prefer you not to run your own ISP off any of their accounts. With an account of this kind, downloading miniscule amounts of text-only posts, you are, literally, the least of their worries.

For God's sake, we're talking about $10!!! If, in a sudden fit of insanity, Astraweb decide to mobilise their legal department, go elsewhere.

Nuh hunney :)
I had my giganews account phrozed for that. When your forum get popular, a few of your users will spam newsgroups out of your forum getting your account to be suspended.

moftary 12-03-2005 10:34 PM

Feature Request:

- Ignore messages with no reference 1/0

:)

KeKe 12-27-2005 03:53 PM

I'm trying to install in ASmallOrange hosting server.

When I run gateway.php?debug=1

All I get is:
*****
Gateway version 2.3.2 1 group(s) gatewayed.

Connecting to server, server says: 200 NNTP Service 6.0.3790.206 Version: 6.0.3790.206 Posting Allowed

Info for microsoft.public.windowsxp.general at msnews.microsoft.com: 211 53164 1 1442385 microsoft.public.windowsxp.general
*****

I have tried waiting for 10 minutes, nothing happens.

Should I ask my host to open any port or something?

I have tried in 3.0.7 with 2.3.2 AND 3.5.2 with 3.5. It gets stuck in the same gateway thing.


All times are GMT. The time now is 06:24 PM.

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.01622 seconds
  • Memory Usage 1,808KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (16)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete