Re: Problems converting modified WWWboard to FUD [message #162115 is a reply to message #162114] |
Fri, 19 March 2010 21:12 |
parocks
Messages: 5 Registered: March 2010
Karma:
|
Junior Member |
|
|
naudefj wrote on Fri, 19 March 2010 15:59Here is another version for you to try. This time untested. It's not pretty, but it will try to assign dummy E-Mail addresses to anonymous WWWboard posters.
sourceforge.net/apps/trac/fudforum/changeset/4927
That fix didn't work.
Here's the error message I got.
***************
Create new user Name=[Mumpheous Orb], EMail=[Mumpheous_Orb(at)oldforum(dot)com]
Fatal error: Call to undefined method stdClass::add_user() in wwwboard.php on line 247
********************
Mumpheous_Orb is the user name.
I looked at the php script, and the actual writing of php scripts is beyond me, I can sometimes look at them and modifty them.
There's a section of the php script that says this
************************
// Link is not an E-mail id.
} elseif (($p = strpos($data, 'Posted by <a href="')) !== false) {
$tmp = substr($data, $p, (stripos($data, ":<p>", $p) - $p));
$x = preg_match('!Posted by \<a href="([^"]+)"\>(.*)</a> [\(\[](.+)[\)\]] on (.*)!', $tmp, $res);
$msg['email'] = '';
$msg['user'] = $res[2];
$msg['time'] = normalize_date($res[4]);
// No E-Mail or link.
} elseif (($p = strpos($data, 'Posted by ')) !== false) {
$tmp = substr($data, $p, (stripos($data, ':<p>', $p) - $p));
$x = preg_match('!Posted by (.*) [\(\[](.+)[\)\]] on (.*)!i', $tmp, $res);
if ( $x == 0 ) {
preg_match('!Posted by (.*) on (.*)!i', $tmp, $res);
$res[3] = $res[2];
$res[2] = '0.0.0.0';
}
$msg['email'] = '';
$msg['user'] = $res[1];
$msg['ipaddr'] = gethostbyname($res[2]);
$msg['time'] = normalize_date($res[3]);
} else { /* We still need date of post and 'anon' user. */
print_msg('ERROR: Unknown message format.');
exit;
}
*****************************
It seems that what is happening is the first thing the script is doing is putting in a blank email at that section, and then later is attempting to put something in that email section.
Maybe, in that section which is putting nothing in the email, something could be put in the email. I like the choice you made for what the email name should be - username(at)oldforum(dot)com
Maybe, instead of
$msg['email'] = '';
it could be something like $msg['email'] = NEWTHINGHERE;
I made a small change which "worked"
I changed
$msg['email'] = '';
to
$msg['email'] = $res[2];
in the sections I identified.
What that did was simply put the user name in the email section
when the email section was blank. It would probably be a little
better to have it say $res[2] (and then @oldforum.com)
but I don't know the right way to say that without giving errors.
I made the changes to the earlier version - the first one from today.
I haven't seen what happens with consistency checker or anything, but it did put the names in right.
|
|
|