vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   NNTP Gateway (Usenet/Newsgroups) (https://vborg.vbsupport.ru/showthread.php?t=35247)

PhoenixBB 08-23-2003 06:39 PM

Is anyone using this with V3, and if so does the threading feature work properly? Not only for incoming posts but when posting out it puts the posts on the correct thread in the NG ?

The threading feature is about the only reason I would think of getting VB3. At the moment I'm loathe to switch on posting because from what I could gather it tends to post to the first post and newsgroups can get quite snotty about that. Especially the one I use! There are already hostile camps and if my guys don't post in the correct order, all hell would break loose. VB3 would solve that if the threading feature does what it ought.

lierduh 08-24-2003 10:52 AM

Quote:

08-19-03 at 03:39 AM saab340 said this in Post #600
I receive this error from cron e-mail... and its killing the server after it gets in the loop.... it used to work fine, what is going on, and how could I fix this....

One thing to watch out. Don't put the cron job in place until you import all the messages. The last message counter only gets updated after all the messages are received. If by then the cron job starts another message retrieving, the server can be brought down after a few processes trying to add the same messages to the forum database.

NuclioN 08-24-2003 11:45 AM

Looks like a great hack. However...tried a few newsgroups but there is no connection possible. Maybe i'm doing something wrong or the server is giving problems.

1 group(s) gatewayed.
Could not connect to NNTP-serverLogging in to alt.binaries.nl, group alt.binaries.nl
Not connectedNot connected

Is it true that IMAP must be installed on the server?

PhoenixBB 09-03-2003 12:01 PM

Okay I've finally switched on the posting feature, but it's making a hell of a mess of the newsgroup. Aside from the top posting issue, it keeps posting with an extra 'Re:'. So some replies are like 'Re: Re: Re: Re: blah blah'.

This not only looks hideous in the newsgroup but it makes a mess of my forum because they end up on separate threads. I can't merge with the originals else any replies will go to the wrong part of the thread.

It's actually not giving a good impression of our forum because anyone who posts from my board will by necessity be 'top posting' which annoys everyone, and have the multiple 'Re' in the subject lines, which enrages them further.

Does anyone know how to fix this? The hack would be fine without this issue, but as it's such a major flaw I can't see how I can allow posting if it isn't sorted.

I was considering Fastfowards hack, because his seemed to thread correctly on the NG, but my host isn't keen on a perl script. As I'm on a shared server and have no problems with this hack (apart from this issue) then Gilby's it is.

I did notice that Fasforward had optional code for the New Thread and New Reply which ensured the correct threading. This was basically inserting 'nntp dateline' in one of the DB>insert sections. Does Gilby's hack use the nntp dateline? Had a read thru both files and can't see it. Does it use a different name? Usenet dateline or something? In other words could I adapt that bit of code ala Fastforwards version so that posts will go to the correct part of the thread (and hopefully not have the multiple 'Re:')

Any suggestions or solutions? Anyone?

Muchos Gracias.

lierduh 09-06-2003 02:55 AM

I have a hack for this hack a few posts back regarding the thread sorting problem. Usenet readers sort them by References and Message-IDs in the header. Not by date/time.

PhoenixBB 09-06-2003 01:12 PM

Do you mean this one: https://vborg.vbsupport.ru/showthrea...996#post420996

I thought that was just for sorting out problems with incoming threading. For the most part VB threads ok, and any 'strays' I merge. I do sometimes get a 're: re: re:' which ends up on a different thread, but I can live with that. What I want to ensure is that when replying to a post in the middle of a thread it will actually go to the correct part of the thread on Usenet, and not 'top post'. And hopefully, not end up adding an extra 're:' to each reply. Are you saying that the above hack will fix those problems? <keeps all fingers and toes crossed>

Phoenix

SRozhon 09-06-2003 01:31 PM

Can someone tell me what query I need to run to delete the duplicate posts from my newsgroup threads? For example,

Palatines from Germany to England 1709 Now Online joe 0 0 09-05-2003 11:11 AM
by joe

Palatines from Germany to England 1709 Now Online joe 0 0 09-05-2003 11:11 AM
by joe

Palatines from Germany to England 1709 Now Online joe 0 0 09-05-2003 11:11 AM
by joe

I want to keep one of these by not the other two. If I got rid of all of them I could just query

DELETE FROM post WHERE username='name of bad seed'

like Gilby said around page 28. But I want to keep one of them. Any suggestions or advise on this?

lierduh 09-08-2003 08:27 PM

Quote:

09-07-03 at 01:12 AM PhoenixBB said this in Post #606
Do you mean this one: https://vborg.vbsupport.ru/showthrea...996#post420996

I thought that was just for sorting out problems with incoming threading. For the most part VB threads ok, and any 'strays' I merge. <keeps all fingers and toes crossed>

Phoenix

The hack is for posts generated from the forums. The originally hack (a very good one by the way) did not implement the References in the header properly.

Not sure what do you mean by "top post", I know "top reply".

MaDCaT75 09-08-2003 09:28 PM

If only I was smart enough to install this..... :(

csimo 09-11-2003 02:20 PM

I'm running VB3. Has anyone tried this on vB3? Will it work, should I try?

Sounds like great work so far!

Gardener 09-11-2003 06:14 PM

Quote:

Originally Posted by csimo
I'm running VB3. Has anyone tried this on vB3? Will it work, should I try?

Sounds like great work so far!

Been there, tried that, it doesn't work. :ermm:

petertdavis 09-11-2003 06:49 PM

Does anyone have a forum with this hack working? I'd like to see it in action.

allan grossman 09-11-2003 07:41 PM

Quote:

Originally Posted by petertdavis
Does anyone have a forum with this hack working? I'd like to see it in action.

I do.

http://pointbeing.com

allan grossman 09-11-2003 10:58 PM

Got it threading properly thanks to lierduh's fix.

One small thing, though - look at his code. There are about four instances of

"allowsmili e,showsignature"

and the extra spaces will throw SQL errors if you don't catch them all. I missed two of them and had to go back and edit stuff again but once I got that fixed I replied to a couple posts and checked the threads with Agent - and they showed up in the right spots.

Thanks again, lierduh - I've always liked this hack and you just made it better.

There's only one other problem I've seen and I mentioned it before but the non-RFC-compliant signature separator causes problems for some newsreaders - some of them won't strip the signature out of quoted text because the signature separator isn't quite legal.

If someone is interested in fixing that small issue for their own Usenet gateway, an RFC-compliant signature separator is <linefeed><dash><dash><space><linefeed>

Here's the fix if anyone's interested:

In gateway.php, find both instances of

$signature = "\n--\n";

(line 542 and line 554), and replace with

$signature = "\n-- \n";

Now that I've got those two things fixed the hack's gone from great to awesome. Thanks, gents!

petertdavis 09-12-2003 01:10 AM

Quote:

Originally Posted by allan grossman

Very nice, the usenet posts look like every other post in your forum. Now, how to get it working in version 3. :)

lierduh 09-12-2003 01:43 PM

Quote:

Originally Posted by allan grossman
Got it threading properly thanks to lierduh's fix.

One small thing, though - look at his code. There are about four instances of

"allowsmili e,showsignature"

and the extra spaces will throw SQL errors if you don't catch them all. I missed

Looks like the forum has added the extra spaces. When I tried to edit my post and remove the space, they are not there. :ermm:

allan grossman 09-12-2003 01:53 PM

Weird.

I didn't think maybe it could be the forum. Sorry about blaming your code, lierduh.

BTW - thanks for fixing things. This hack is a lot better now that it threads properly :)

megarry 09-13-2003 12:17 PM

I thried this hack sometime ago and I decided against using it because it setup a new user account for each post received from the NNTP gateway. Does this hack still do that?

If so, is there a way to not setup accounts for each post? I would much rather have the messages come in without user accounts, makes maintaining my user database a bit of a nightmare with thousands of unused accounts.

Dennis

allan grossman 09-13-2003 12:37 PM

Quote:

Originally Posted by megarry
I thried this hack sometime ago and I decided against using it because it setup a new user account for each post received from the NNTP gateway. Does this hack still do that?

If so, is there a way to not setup accounts for each post? I would much rather have the messages come in without user accounts, makes maintaining my user database a bit of a nightmare with thousands of unused accounts.

Dennis

It doesn't do that now, Dennis. Usenet posts come in under a guest account.

SRozhon 09-14-2003 08:09 PM

I can't find the answer to this...
Quote:

Originally Posted by Dmitriy
I wonder how I can I exclude the posts in the usenet forusm from being included in the detnew and getdaily searches.

This script downloads a lot of posts from usenet and it confuses many of my members when they want to see new posts since last visit or new posts in the past 24 hours.

Can someone suggest how to hack the search.php to exclude certain forums from being counted towards the latest posts?

Found it! Thank you patvdv on page 23 of this thread

Holidazed 09-20-2003 03:07 AM

allan grossman, what news server are you using? Is it a free one or do you pay?

I have a pay server I am using. I modified the database to make reference to the server name, username and password but it seems to be ignoring the password.

When running gateway.php, I keep getting the error

Logging in to news-west.newscene.com, group alt.games.adnd
Posting Message from DK: 500 Huh?
Posting Message from DK: 500 Huh?

Ideas?

PhoenixBB 09-20-2003 04:50 AM

Quote:

Originally Posted by lierduh
The hack is for posts generated from the forums. The originally hack (a very good one by the way) did not implement the References in the header properly.

Not sure what do you mean by "top post", I know "top reply".

Weird, my notifications for this thread seem to have stopped.

I think top reply would be the same thing. Like if someone replies to a post in the middle of the thread on our forum, because it's linear it goes on the end. No problem. But because Usenet is threaded, it really needs to go to the correct part of the thread there and not 'top reply/post' as the NGers get really ++++y. Does your hack send the post to the correct part of the thread?

It looked quite complicated at first but I'm gonna give it a try anyway because all of a sudden long names eg"Re: bla blah (was blah blah blah)" are for some reason not threading at all and I'm ending up with a full page of those that I have to merge!

PhoenixBB 09-20-2003 06:57 AM

I'm sorry lierduh but I can't make head nor tail of your instructions.

Quote:


1) Add two columns to post table.

ref (type: Text)
pre_postid (type: int, length:10)
How exactly do I do this? If I click the post> "insert" I get a lot of 'field' 'type' 'null 'value' etc. There is no 'pre-postid' just postid. At the bottom it indicates this would add a new row. As a row isn't a column, where is the bit to add columns??

Quote:

2)hack newreply.php

diff newreply_old.php newreply.php

26a27,30
> if (isset($pre_postid)) {
> $pre_postid=(int)$pre_postid;
> }
>
Again confused here: are we to edit the code currently at lines 26,27, and 30 so it reads as above or add this to replace it? If '}' is to go at line 30 then the code currently there will now be on 31?

Quote:

< include("class.POP3.php3");
---
> //require_once("class.POP3.php3");
We change to 'require_once' , then comment it out?

Thanx

allan grossman 09-20-2003 10:49 AM

Quote:

Originally Posted by bitg
allan grossman, what news server are you using? Is it a free one or do you pay?

I have a pay server I am using. I modified the database to make reference to the server name, username and password but it seems to be ignoring the password.

When running gateway.php, I keep getting the error

Logging in to news-west.newscene.com, group alt.games.adnd
Posting Message from DK: 500 Huh?
Posting Message from DK: 500 Huh?

Ideas?

I use Giganews - it's a pay service.

Your 500 error means "Command not recognized". I used GameCrash's graphical in terface to the NNTP gateway - it stores the server name, username and password in a template. Here's the thread -

https://vborg.vbsupport.ru/showthread.php?t=36475

allan grossman 09-20-2003 11:07 AM

How exactly do I do this? If I click the post> "insert" I get a lot of 'field' 'type' 'null 'value' etc. There is no 'pre-postid' just postid. At the bottom it indicates this would add a new row. As a row isn't a column, where is the bit to add columns??

You do it with a MySQL query -

ALTER TABLE post ADD COLUMN ref TEXT;

ALTER TABLE post ADD COLUMN pre_postid INT;

Then I just set the column width for pre_postid in phpMyAdmin because I didn't know how to do it with a query - but it worked.

Again confused here: are we to edit the code currently at lines 26,27, and 30 so it reads as above or add this to replace it? If '}' is to go at line 30 then the code currently there will now be on 31?

You put it directly *under* line 26. It should look like this -

if (isset($postid)) {
if (isset($pre_postid)) {
$pre_postid=(int)$pre_postid;
}

We change to 'require_once' , then comment it out?

Yup.

good luck!

Holidazed 09-22-2003 12:27 AM

Quote:

Originally Posted by allan grossman
I use Giganews - it's a pay service.

Your 500 error means "Command not recognized". I used GameCrash's graphical in terface to the NNTP gateway - it stores the server name, username and password in a template. Here's the thread -

https://vborg.vbsupport.ru/showthread.php?t=36475

I use Newscene which is also a pay service. I am also using the graphical interface for this hack. I put in the servername, the newsgroup, my username and password. I use this same information in my news reader so I know it is right.

I still get the same error.

Another thing to note. When I edit the newsgroup forum in the graphical interface, the password field is blank. Yet when I look at the database, the correct password is in there. Could it be that the password is not being sent when trying to connect to the news server?

allan grossman 09-22-2003 01:17 AM

Quote:

Originally Posted by bitg
...When I edit the newsgroup forum in the graphical interface, the password field is blank. Yet when I look at the database, the correct password is in there. Could it be that the password is not being sent when trying to connect to the news server?

I dunno - I think you'd be getting authentication errrors, not "WTF is this command" errors.

Gilby wrote one version of nntp.php that does extensive logging - I've attached it here. You'll need to rename it to nntp.php after you back up the one you have now. Maybe it'll help -

good luck!

PhoenixBB 09-22-2003 04:26 AM

Thanks allan!

I'm just stuck on this bit

Quote:

125a126,132
> if ($message[references]){
> $elements=imap_mime_header_decode($message[references]);
> $message[references] = '';
> for($i=0;$i<count($elements);$i++) {
> $message[references] .= $elements[$i]->text;
> }
> }
Now I read that as put this in at lines 125, and 126, and 132. A similar code to that starts at line 119. So do I put this at the end of that (finishes with 2 '}' or in place of it. Most of the other code was straight replacement, I got that, but I can't work out if this is an addition or replacement, and if it's an addition does it go at line 125 inbetween the close brackets?? <scratches head>

ETA: actually I'm getting stuck further.

Quote:

258c265
< $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,at tachmentid,pagetext,allowsmilie,showsignature,ipad dress,iconid,visible,isusenetpost,msgid) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($ message[subject]))."','".addslashes(from_name($message[from]))."','0','".$date."','$attachmentid','".addslashe s($message[text])."','1','0','".addslashes(from_email($message[from]))."','0','1','1','".addslashes($message[msgid])."')");
So okay, I change that for the one given but that goes from line 258>259. What's with the 265? Should I delete the rest up to that line (that's the 'logging' and 'indexing' bit)?

Thanx!

PhoenixBB 09-22-2003 08:13 AM

Okay I bit the bullet and just went for it, even though the instructions were not at all clear to me. I fear I've got it wrong though. <sobs>

It half works for me:

As it's so early in the morning I've not got a lot of incoming so it's hard to tell if it'll thread correctly in my forums. I had two posts with identical 'Re:' subjects that should have been on the same thread. Checked with my newsreader and they were on the right thread in the NG, so not 'strays'. I'll know if it's really worked later today I guess, but I can live with it as it's no worse than at the moment, just takes a bit of effort merging them all if there are a lot of posts.

More interesting was the threading in the newsgroup when I posted from the forum. Yay, it sent the posts to the correct part of the thread, but only if one used the Quote button to reply. If one uses Add Reply then it 'top replies'. :(

Is it supposed to still do this? Have I misinterpreted the instructions and if I get it right it'll stop top posting if the Add Reply is used?

So it's sorta half working at the moment and I'm mightily pleased. Thanks lierduh!

Can I get it fully working or am I gonna have to put notices up forbidding people to use the Add Reply button in that forum? :)

Thanx

ETA: Actually, I guess it's kind of impossible to stop it top posting with the Add Reply, 'cause how would it know which post to reply to. Hmmm. So I guess it did work properly after all and I never buggered it up. Phew

Now if only I could think of a way to remove the add reply button from that forum. ;)

allan grossman 09-22-2003 08:22 AM

Hi, PhoenixBB :)

Might be a good idea to read the man page for "diff" - it might make things a little clearer.

125a126,132: This means that on the hacked file lines 126-132 were added (that's what the 'a' means) - they don't exist in the original file. I copied a few lines above and below so you'd know what the thing was supposed to look like here -

PHP Code:

            // Decode the subject and from headers
            
if (function_exists('imap_mime_header_decode')){
                if (
$message[subject]){
                    
$elements=imap_mime_header_decode($message[subject]);
                    
$message[subject] = '';
                    for(
$i=0;$i<count($elements);$i++) {
                        
$message[subject] .= $elements[$i]->text;
                    }
                }
                               if (
$message[references]){ 
                                       
$elements=imap_mime_header_decode($message[references]); 
                                       
$message[references] = ''
                                       for(
$i=0;$i<count($elements);$i++) { 
                                           
$message[references] .= $elements[$i]->text
                                       } 
                               } 
                if (
$message[from]){
                    
$elements=imap_mime_header_decode($message[from]);
                    
$message[from] = '';
                    for(
$i=0;$i<count($elements);$i++) {
                        
$message[from] .= $elements[$i]->text;
                    }
                }
            } 

The 258c265 is a straight replacement (that's what the 'c' means). Remember you added lines just now? The line number was 258 in the original file - it's now line 265.

You're getting there :)

allan

edit: If your "add reply" button doesn't work there's something bollixed up in newreply.php - best to start over with a fresh copy of that file and make sure the hack is applied correctly. The button does work, honest :)

I gotta go to work now - good luck!

PhoenixBB 09-22-2003 11:31 AM

Quote:

Might be a good idea to read the man page for "diff" - it might make things a little clearer.
What? What? I just hotfooted it over to the main page and can't find anything. Not that I think it'll make any difference because it still doesn't make sense.

Have I mentioned how much I hate this new layout and these scrolly code boxes? <g> Thank god I got most of my hacks done, because I'm having a very hard time wrapping my head around this. I like the old ways better, least I could understand the instructions.

As the original code started on line 119, then I'm guessing that the first number mentioned is where the replacement code finishes? In this case, very handily at 125? <g> But...but...that still doesn't indicate where one would insert. And 126 and 132 do have code in the original - just different ones. Brackets in this case. Now the original code has been pushed down to 126 and 132 has still got a bracket!

I have a bewildered look on my face at the moment, because I'm just not getting it. Even from your instructions there is no way I would have gotten that the code would have ended up in the middle without seeing it. I actually replaced completely the 'message [from]' section. Whoops.

Quote:

The 258c265 is a straight replacement (that's what the 'c' means). Remember you added lines just now? The line number was 258 in the original file - it's now line 265.
Now this bit I get! <runs round in excited circles> Thank God! I was fearing early senility for a moment.

But I have a blank line on 258 - the code doesn't start till 260! After inputting the changes it's still the same. 265 is the end of another similar code. Actually it's the same! No mention of this in the instructions, but 264-265 is the same code 260-262 as above. So does that mean I have to do it twice? Ok. Ain't no way I'm getting this from the 'coded' instructions tho. :(

Hang about....... I'm going thru this again and I might be seeing the light.....I've just been getting cross at this 214,216c221,223 because I don't have the same code at 214. It is now at 221. A-ha! But...... it doesn't end at 223, that's an empty line! It ends at 221! <clutches head>

If this 608,613c615,617 is supposed to mean the original was on 608, nope it's 613 on mine and ends on 618. I just replaced that code with the new one and it now starts at 619 and ends at 624. Sigh.

Well hell, I appear to have made things worse!! I just ran the gateway and a load of code come up, it didn't even try to connect. Was basically the stuff in the gateway file.

I wonder if it was the duplicating of the 258 code for both the 'insert thread' and 'insert post'? Okay I've put the previous file which seemed to work back, and just changed it so I have put the code you showed above for the message reference. Only thing different is I now have the 'message[from]' code back.

Ah, it's working again!

I'm never gonna get this. If all the instructions will be done like this from now on then my days of adding hacks are at an end. Trying to figure out those instructions was a hundred times harder than putting the original hack in.

The Add Reply button does work Allan, it just 'top posts/replies' which is a big no-no in newsgroups. But of course it must do that and there is no way round it. People will just have to get used to using the Quote button in that forum. Unfortunately that doesn't always strip the VB code, so will mean people doing it manually. They won't of course. :(

And it's still 'top replying' even using the Quote Button! Seems it does that when one replies to a post that originates from the board and not the newsgroup, and it ends up going to the wrong part of the thread in the NG. <whimpers> This is defeating me. :(

Thanks for showing me where the code goes Allan, ain't no way I'd have figured it out otherwise. I wouldn't have this gateway hack up at all if the instructions had been in this new 'code'. :(

I need to lie down! :)

Holidazed 09-22-2003 12:27 PM

Quote:

Originally Posted by allan grossman
I dunno - I think you'd be getting authentication errrors, not "WTF is this command" errors.

Gilby wrote one version of nntp.php that does extensive logging - I've attached it here. You'll need to rename it to nntp.php after you back up the one you have now. Maybe it'll help -

good luck!

Allan, I used the file you gave me and got the following message when synchronizing the newsgroups.
__________________
1 group(s) gatewayed.
200 NewsRave v1.01 (posting ok) 381 More authentication needed 480 Authentication required for command Logging in to news-west.newscene.com, group rec.games.frp.dnd
__________________

Now, I have the username in the username field and the database shows the password in the password field (even tho the admin interface for this hack does not show the password), but it does not seem to be sending this information.

Question, in your admin interface for this hack, does the password show there or does it remain an empty field like mine does?

allan grossman 09-22-2003 12:45 PM

Quote:

Originally Posted by PhoenixBB
What? What? I just hotfooted it over to the main page and can't find anything. Not that I think it'll make any difference because it still doesn't make sense.

man page, not main page :)

From a terminal window type "man diff" (no quotes) and smack the enter key. Use the spacebar to scroll down and the "q" key to quit. Lotsa good stuff there. "diff --help" will give you the short version.

Read this - maybe it'll help you understand things a little better -

http://linux.oreillynet.com/pub/a/linux/lpt/28_01.html

Quote:

Originally Posted by PhoenixBB
...Thanks for showing me where the code goes Allan, ain't no way I'd have figured it out otherwise. I wouldn't have this gateway hack up at all if the instructions had been in this new 'code'. :(

I need to lie down! :)

You're gonna do fine, PhoenixBB. Don't get caught up quite so much in line numbers - as you add and replace text in the file the line numbers are gonna change. My advice would be to use the search function in your favorite text editor and if you're within a few lines of where you oughtta be (and there are no other instances of that particular string in the file) then apply the change.

Remember the output from diff can be a (append), c (change), or d (delete). If it's okay with lierduh maybe I can come up with a set of instructions that are a little easier to follow.

Hang in there - make sure the changes you're contemplating make sense and don't worry too much about line numbers as long as you're close to the target - as the line numbers change as you edit the file :)

cheers -

allan

allan grossman 09-22-2003 12:47 PM

Quote:

Originally Posted by bitg
...Question, in your admin interface for this hack, does the password show there or does it remain an empty field like mine does?

The password shows up in my admin interface. Sounds like you're almost there :)

allan grossman 09-22-2003 03:53 PM

I worked on the instructions a little - maybe they'll be easier now. If lierduh or anybody else objects to my changing the instructions I'll be happy to delete them. I didn't write this hack, have no input on it and can only report on what worked for me - so here goes:

edit: I had the same problem lierduh did. There are a couple places here where the forum software thows a couple of spaces in "allowsmilie" in the text below. If you just paste this stuff in it'll cause database errors so once you're finished editing newreply.php and gateway.php, replace all instances of "allowsmili e" with "allowsmilie". This appears to be a bug in vB3 -

1) Add two columns to post table. Run these queries against your forum database either from a command line or phpMyAdmin or whatever else you have :)

ALTER TABLE post ADD COLUMN ref TEXT;

ALTER TABLE post ADD COLUMN pre_postid INT(10);

please note that all line numbers were taken from the original files - since we're adding a couple of lines here and there the numbers will be off just a little :)



2)open forumhome/newreply.php

find (around line 27):

PHP Code:

if (isset($postid)) { 

add under it:

PHP Code:

 if (isset($pre_postid)) { 
   
$pre_postid=(int)$pre_postid
 } 

find (around line 305):

PHP Code:

       $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible')"); 

replace it with:

PHP Code:

       $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,pre_postid) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','$visible','$pre_postid')"); 



save newreply.php



3) Modify template: newreply

find:

PHP Code:

<input type="hidden" name="threadid" value="$threadid"

add under it:

PHP Code:

<input type="hidden" name="pre_postid" value="$postid"



4) Modify gateway.php

find (around line 19):

PHP Code:

header("Content-Type: text/plain");
include(
"global.php");

// Load NNTP classes
include("nntp.php");
// POP3 class
include("class.POP3.php3");
// Load Mime message parser
include("mime.php"); 

replace it with

PHP Code:

header("Content-Type: text/plain");
require_once(
"global.php");

// Load NNTP classes
require_once("nntp.php");
// POP3 class
//require_once("class.POP3.php3");
// Load Mime message parser
require_once("mime.php"); 



find (around line 66):

PHP Code:

       $get_newthreads=$DB_site->query("SELECT post.postid,post.username,post.userid,post.dateline,post.attachmentid,post.pagetext,post.showsignature,post.ipaddress,thread.pollid,thread.title,post.threadid,thread.forumid FROM thread,post WHERE post.isusenetpost=0 AND thread.threadid=post.threadid AND post.dateline=thread.dateline AND post.userid=thread.postuserid AND (thread.forumid="implode(" OR thread.forumid="$group[forum]) . ")"); 

replace it with:

PHP Code:

       $get_newthreads=$DB_site->query("SELECT post.postid,post.username,post.userid,post.dateline,post.attachmentid,post.pagetext,post.showsignature,post.ipaddress,thread.pollid,thread.title,post.threadid,thread.forumid,post.pre_postid FROM thread,post WHERE post.isusenetpost=0 AND thread.threadid=post.threadid AND post.dateline=thread.dateline AND post.userid=thread.postuserid AND (thread.forumid="implode(" OR thread.forumid="$group[forum]) . ")"); 



find (around line 74):

PHP Code:

       $get_newposts=$DB_site->query("SELECT post.postid,post.username,post.userid,post.dateline,post.attachmentid,post.pagetext,post.showsignature,post.ipaddress,thread.title,post.threadid,thread.forumid,thread.msgid,thread.prefix FROM thread,post WHERE post.isusenetpost=0 AND thread.threadid=post.threadid AND (thread.forumid="implode(" OR thread.forumid="$group[forum]) . ")"); 

replace it with:

PHP Code:

        $get_newposts=$DB_site->query("SELECT post.postid,post.username,post.userid,post.dateline,post.attachmentid,post.pagetext,post.showsignature,post.ipaddress,thread.title,post.threadid,thread.forumid,thread.msgid,thread.prefix,post.pre_postid FROM thread,post WHERE post.isusenetpost=0 AND thread.threadid=post.threadid AND (thread.forumid="implode(" OR thread.forumid="$group[forum]) . ")"); 



find (around line 119):

PHP Code:

                if ($message[from]){
                    
$elements=imap_mime_header_decode($message[from]);
                    
$message[from] = '';
                    for(
$i=0;$i<count($elements);$i++) {
                        
$message[from] .= $elements[$i]->text;
                    }
                }
            } 

add under it:

PHP Code:

                               if ($message[references]){ 
                                       
$elements=imap_mime_header_decode($message[references]); 
                                       
$message[references] = ''
                                       for(
$i=0;$i<count($elements);$i++) { 
                                           
$message[references] .= $elements[$i]->text
                                       } 
                               } 


find (around line 214):

PHP Code:

                                       
                                       
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,isusenetpost,msgid) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($message[subject]))."','".addslashes(htmlspecialchars(from_name($message[from])))."','0','".$date."','$attachmentid','".addslashes($message[text])."','1','0','".addslashes(htmlspecialchars(from_email($message[from])))."','0','1','1','".addslashes($message[msgid])."')"); 
                                       
$postid=$DB_site->insert_id(); 

replace it with:

PHP Code:

                                       
                                         
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible,isusenetpost,msgid,ref) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($message[subject]))."','".addslashes(htmlspecialchars(from_name($message[from])))."','0','".$date."','$attachmentid','".addslashes($message[text])."','1','0','".addslashes(htmlspecialchars(from_email($message[from])))."','0','1','1','".addslashes($message[msgid])."','".addslashes($message[references])."')"); 
                                         
$postid=$DB_site->insert_id(); 

find (around line 258):

PHP Code:

                                       $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmili  e,showsignature,ipaddress,iconid,visible,isusenetpost,msgid) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($message[subject]))."','".addslashes(from_name($message[from]))."','0','".$date."','$attachmentid','".addslashes($message[text])."','1','0','".addslashes(from_email($message[from]))."','0','1','1','".addslashes($message[msgid])."')"); 

replace it with:

PHP Code:

                                       $DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmili e,showsignature,ipaddress,iconid,visible,isusenetpost,msgid,ref) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($message[subject]))."','".addslashes(from_name($message[from]))."','0','".$date."','$attachmentid','".addslashes($message[text])."','1','0','".addslashes(from_email($message[from]))."','0','1','1','".addslashes($message[msgid])."','".addslashes($message[references])."')"); 


find (around line 608):

PHP Code:

                       $get_attachinfo=$DB_site->query("SELECT msgid FROM post WHERE threadid=$newthread[threadid]"); 
                       
$ref ''
                       while (
$thisref=$DB_site->fetch_array($get_attachinfo)){ 
                               if (
$thisref[msgid] and strlen($ref) < 600){ $ref .= "$thisref[msgid] "; } 
                       } 
                       
$ref "\r\nReferences: ".wordwrap($ref210"\r\n        "); 

replace it with:


PHP Code:

                       $get_references=$DB_site->query_first("SELECT msgid,ref FROM post WHERE postid=$newthread[pre_postid]"); 
                       
$references $get_references[ref] . " " $get_references[msgid]; 
                       
$ref "\r\nReferences: ".wordwrap(stripslashes($references), 210"\r\n        "); 


find (around line 629):

PHP Code:

                       $DB_site->query("UPDATE post SET isusenetpost = -1, msgid = '<".addslashes($msgid).">' WHERE postid=$newthread[postid]"); 

replace it with:

PHP Code:

                       $DB_site->query("UPDATE post SET isusenetpost =1, msgid ='<".addslashes($msgid).">' , ref = '".$references."' WHERE postid=$newthread[postid]"); 


Holidazed 09-22-2003 04:15 PM

Quote:

Originally Posted by allan grossman
The password shows up in my admin interface. Sounds like you're almost there :)

OK, as I stated earlier, my password is not in the password field in my CP, however, it is there in the database. How do I get it to stay in the CP area?

allan grossman 09-22-2003 05:29 PM

Quote:

Originally Posted by bitg
OK, as I stated earlier, my password is not in the password field in my CP, however, it is there in the database. How do I get it to stay in the CP area?

I guess I'd be looking at the graphical interface hack, bitg - I'm at the office and can't look at mine but I had no problem with the password staying in the CP. My first guess would be a small glitch in the way the CP hack was applied but I could be way off-base here :)

Holidazed 09-22-2003 08:49 PM

Quote:

Originally Posted by allan grossman
I guess I'd be looking at the graphical interface hack, bitg - I'm at the office and can't look at mine but I had no problem with the password staying in the CP. My first guess would be a small glitch in the way the CP hack was applied but I could be way off-base here :)


I just completely uninstalled the graphical interface hack as well as the nntp hack. Then I installed just the nntp hack (no graphical interface). I then configured all the fields in the database.

When I go to http://www.dungeonkeepersdomain.com/mb-test/gateway.php I get the following error:

___________________
1 group(s) gatewayed.
200 NewsRave v1.01 (posting ok)
381 More authentication needed
480 Authentication required for command
Logging in to news-west.newscene.com, group rec.games.frp.dnd
480 Authentication required for command
500 Huh?
Posting Message from DK:
500 Huh?
500 Huh?
500 Huh?
Posting Message from DK:
500 Huh?
___________________

Again, I know that the username, password, server and newsgroup are correct. There is no graphical interface installed. The username and password are showing up just fine in the database.

This happens when I place a message in the newsgroup forum and then run gateway.php. When I have no posts pending in the newsgroup forum, I get no errors, however, I get no incoming posts either. I deliberately did not run setlastmsg.php so that I would get plenty of message.

The wierd part is as follows. If I use a news server that is free and does not require a username and password (often posting rights are removed), I get tons of new messages but cannot post (for obvious reasons). The problem has to be that the username and/or password is not being sent.

ideas?

allan grossman 09-22-2003 09:14 PM

I might have an idea.

I was just thinking that the fact that the password field didn't show up in the graphical interface *and* it isn't being passed to the news server but shows up in phpMyAdmin (I guess) would lead me to believe maybe the password field is either misspelled, the wrong type or in the wrong location.

The table type for nntp_groups should be ISAM, not MyISAM. It won't work if the table type is wrong (I don't know why, but I tried it the other way and the script fails).

If the table type is incorrect you can fix it by running this query against the database -

ALTER TABLE nntp_groups TYPE = ISAM;

Inside the nntp_groups table the password field is spelled "password" and is case-sensitive.

If it's not a spelling error, a typo or a misconfigured table I'm stumped, bitg - but I think the fact that the password isn't being sent and *also* isn't showing up in the graphical interface is significant.

Holidazed 09-22-2003 09:37 PM

Well, I don't know which suggestion is was, but it is working now.

The password field was named PASSWORD, I changed it to password.


All times are GMT. The time now is 09:12 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.02463 seconds
  • Memory Usage 2,064KB
  • 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
  • (23)bbcode_php_printable
  • (26)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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