[DEV] NewsSync (Usenet -> phpBB Sync)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
DeWoert
Registered User
Posts: 26
Joined: Mon Feb 11, 2002 9:43 am
Location: Netherlands
Contact:

Post by DeWoert » Tue Mar 11, 2003 10:51 pm

netclectic wrote: There was an extra parameter added to the add_search_words function in 2.0.4, here's a work around to make it work on earlier versions...

Code: Select all

    switch ($board_config['version'])
    {
        case '.0.0' : 
        case '.0.1' : 
        case '.0.2' : 
        case '.0.3' : 
            add_search_words($post_id, stripslashes($message), stripslashes($subject));
            break;
        
        default :
            add_search_words('', $post_id, stripslashes($message), stripslashes($subject));
            break;
    }


:oops: Where to put that piece of code ??

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Tue Mar 11, 2003 10:58 pm

Look in inc/mod_functions_post.php
find and replace

Code: Select all

add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));
Defend the game:
Image

wineknow
Registered User
Posts: 299
Joined: Tue Mar 04, 2003 5:20 pm
Location: Calgary, Alberta, Canada
Contact:

new build shortly

Post by wineknow » Tue Mar 11, 2003 11:29 pm

thanks for the feedback folks...

I have incorporated the changes with the add_search_words and have implemented a check to make sure that there is something in the subject of posts from phpBB to usenet.

As well as a few other tweeks...
will have a new build tonight or tomorrow for y'all to test.

-kevin

modaco
Registered User
Posts: 120
Joined: Wed Dec 04, 2002 12:21 pm

Post by modaco » Tue Mar 11, 2003 11:48 pm

I've actually tweaked my quick reply and posting.php files to automagically populate the subject line.

Now when I hit 'Post Reply', I get the subject line pre populated with Re: and then the orginal subject, perfect!

After the
//
// User default entry point
//


lines, where the variables are set up for reply mode, I added
$post_topic_id=(isset($HTTP_GET_VARS['t']))? intval( $HTTP_GET_VARS['t']) : 0;
$sql = "SELECT pt.post_subject FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = $topic_id AND pt.post_id = p.post_id LIMIT 0,1";
if( !($result = $db->sql_query($sql) ))
message_die(GENERAL_ERROR, "Couldn't get topic subject information".$sql);
$post_details = $db->sql_fetchrow($result);
$subject="Re: " . $post_details['post_subject'];


As you can probably see, i'm no PHP expert, but it does the trick ;)

P

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 12:02 am

I've been playing with your mod: and it really is quite excellent. However, one small point: can you allow for a footer to be added to all messages going out so that we can put a small "Sent Via" line at the bottom? Also, can you add an option to mangle the e-mail of the poster on sent news? i.e. instead of user@hotmail.com, use user@hotmail.NOSPAM.com or similar?

Thanks for a killer mod!

Legolas

wineknow
Registered User
Posts: 299
Joined: Tue Mar 04, 2003 5:20 pm
Location: Calgary, Alberta, Canada
Contact:

newsSync update - beta 2

Post by wineknow » Wed Mar 12, 2003 12:35 am

ok fixed a bunch of bugs as well as:
- updated the mod_post_functions.php to wrap add_search_words for pre: 4.2.1 compatability
- set a subject if the forum post did not have one
- give no error while expiring posts that were rejected when they were sync-ed to phpBB
- added a memory limit parameter to main code - in case your php was using the default of 8M (like mine)
- rewrote the newstext.txt file format so all newsgroups can be configured if you want to allow replies or not
- added NOSPAM to cleanup email address
- added a global footer string to append to all messages send to usenet

upgrading from B1
- you should not have to upgrade the database just replace all the php files, change the newstext.txt file (use the new format)
- edit the newssync_config.php file and change your news server setting

let me know if you experience any problems.

download at: http://www.wineknow.com/downloads/newssync_b2.tar

-kevin

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 12:43 am

One other thing... Can you make it so that "Announcements" are not synced to the nntp server? that makes it so I can have local info that doesn't get sent to everyone in the world! :)

Thanks!

Legolas

president
Registered User
Posts: 169
Joined: Thu Apr 04, 2002 11:31 pm

Re: newsSync update - beta 2

Post by president » Wed Mar 12, 2003 3:31 am

wineknow wrote: ok fixed a bunch of bugs as well as:
- updated the mod_post_functions.php to wrap add_search_words for pre: 4.2.1 compatability
- set a subject if the forum post did not have one
- give no error while expiring posts that were rejected when they were sync-ed to phpBB
- added a memory limit parameter to main code - in case your php was using the default of 8M (like mine)
- rewrote the newstext.txt file format so all newsgroups can be configured if you want to allow replies or not
- added NOSPAM to cleanup email address
- added a global footer string to append to all messages send to usenet

upgrading from B1
- you should not have to upgrade the database just replace all the php files, change the newstext.txt file (use the new format)
- edit the newssync_config.php file and change your news server setting

let me know if you experience any problems.

download at: http://www.wineknow.com/downloads/newssync_b2.tar

-kevin


Upgraded perfectly. I like the NOSPAM thing, maybe even anonymise the entire e-mail address? Maybe have the forum homepage as the email address?

I forgot about the reply subject thing i had made a workaround for that myself :roll:

really like the new newstext.txt file format

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 7:45 am

One other thing.. Any chance you can add a check to make sure that two copies don't run at the same time? If I set my cron to run it in 15-30 min intervals, I don't want to have two run at the same time.. Or, is it safe to do so?

Legolas

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 7:49 am

Strange bug I think... I have alt.test setup to sync, and the phpBB board shows that there are 24 pages of posts.. But, when I go beyond page 4 or so, it tells me there are no more posts.. So, it's not updating the number of posts, or the post_id's correctly somewhere.. Sorry, I'll try to track it down better shortly...

modaco
Registered User
Posts: 120
Joined: Wed Dec 04, 2002 12:21 pm

Post by modaco » Wed Mar 12, 2003 9:18 am

Blatant feature request:

It would be cool to be able to set a sig that goes on all outgoing posts to the NG, e.g.

'Posted from www.mywebsite.com'

Obviously this wouldn't show at the phpBB end...

P

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 9:29 am

One other issue: quotes/bbcode should be stripped/replaced with something useful.. quotes should be replaced with ">" and ">" in messages should be translated into bbcode for the board...

Legolas

Legolas-ga
Registered User
Posts: 115
Joined: Tue Jan 07, 2003 8:39 am
Location: Costa Mesa, CA - but, moving to Corona, CA
Contact:

Post by Legolas-ga » Wed Mar 12, 2003 9:34 am

modaco wrote: Blatant feature request:

It would be cool to be able to set a sig that goes on all outgoing posts to the NG, e.g.

'Posted from www.mywebsite.com'

Obviously this wouldn't show at the phpBB end...

P


That's done in Beta 3

modaco
Registered User
Posts: 120
Joined: Wed Dec 04, 2002 12:21 pm

Post by modaco » Wed Mar 12, 2003 11:17 am

There's a beta 3? Is that available already?

Also, if a user is posting on NGs with a different e-mail address to the one they use on the forum, can I manually create a mapping between the two?

Thanks,

Paul

president
Registered User
Posts: 169
Joined: Thu Apr 04, 2002 11:31 pm

Post by president » Wed Mar 12, 2003 1:20 pm

modaco wrote: There's a beta 3? Is that available already?

Also, if a user is posting on NGs with a different e-mail address to the one they use on the forum, can I manually create a mapping between the two?

Thanks,

Paul


I'm sure he meant b2. And it is there. :wink:

Post Reply

Return to “[2.0.x] MODs in Development”