FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » Matching Authors with Users During NNTP Import
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Matching Authors with Users During NNTP Import [message #166169] Wed, 05 October 2011 16:28 Go to next message
jm2morri is currently offline  jm2morri   
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
Hello,

I have a situation where I get a bunch of nntp messages that all have the same email address but actually come from different people, as indicated in the name field. (These are created by another web/nntp interface that will not expose the user's email address as per their privacy concerns--mostly because they generally hide the fact that it's an nntp gateway).

Anyways, on my site, all of the posts get attributed to the same user. Is there a way to get fudforum to use the name field to lookup the user instead? The difficulty is that if no user exists we don't know the real email address to use to create the account.

What I'm trying to avoid is all of these posts looking like they come from one account, because they don't. I'm open to any possible solution.

James.
Re: Matching Authors with Users During NNTP Import [message #166170 is a reply to message #166169] Thu, 06 October 2011 06:42 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
FUDforum will use the 'From:' name if there is no E-mail address.
However, if it finds an E-mail address, it will not look at the 'From:' portion.
You can change it in scripts_common.inc.
Re: Matching Authors with Users During NNTP Import [message #166173 is a reply to message #166170] Thu, 06 October 2011 09:40 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
naudefj wrote on Thu, 06 October 2011 02:42
FUDforum will use the 'From:' name if there is no E-mail address.
However, if it finds an E-mail address, it will not look at the 'From:' portion.
You can change it in scripts_common.inc.


Thanks for the pointer Frank.

So if I comment out the line


$user_id = q_singleval('SELECT id FROM '. sql_p .'users WHERE email='. _esc($from_email));

in scripts_common.inc

then it will always try to matchup the name in the From: to a login name? That is actually what I think I want. It might make a bunch of new users to start with but it should clean itself up I think. Any side effects I haven't considered?

James.
Re: Matching Authors with Users During NNTP Import [message #166174 is a reply to message #166173] Thu, 06 October 2011 09:46 Go to previous messageGo to next message
jm2morri is currently offline  jm2morri   
Messages: 225
Registered: January 2009
Location: Stratford, Ontario, Canad...
Karma: 0
Senior Member
Or even better in my case, how would I change the code to only do the email matching when the email address doesn't contain "abc.com"? In that case, I want it to fall through and check by name, not by email. That way everyone else in the world still works fine but this one case of users acts differently.

If someone could help me with the syntax that would be great.

Right now the code is

        /* Try to identify user by email. */
        $user_id = q_singleval('SELECT id FROM '. sql_p .'users WHERE email='. _esc($from_email));


So how would I put this into an if statement that only did this if the email didn't contain "abc.com". In that case, I want it to then perform what's in the next if statement

        /* If user was not found via email, try to look the user up by login. */
        if (empty($user_id) && !empty($from_name)) {                if ($GLOBALS['FUD_OPT_2'] & 128) {
                        $user_id = q_singleval('SELECT id FROM '. sql_p .'users WHERE alias='. _esc(make_alias($from_name)));
                } else {
                        $user_id = q_singleval('SELECT id FROM '. sql_p .'users WHERE login='. _esc($from_name));
                }
        }


James.
Re: Matching Authors with Users During NNTP Import [message #166180 is a reply to message #166174] Fri, 07 October 2011 08:02 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
If you need someone to implement it for you, mail me for a quote.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Call to undefined function fud_use() 3.0.3RC2 (resolved)
Next Topic: 3.0.3 NNTP Import Limit
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 01 02:24:41 GMT 2024

Total time taken to generate the page: 0.02425 seconds