Page 3 of 71

Posted: Fri May 20, 2005 5:10 am
by TerraFrost
Not that I know of. I can implement that feature, but atm, it isn't uber high on my priority list (I have other MODs needing attention before this one)...

Posted: Wed May 25, 2005 6:07 am
by happypappy
i get this error when trying to install....and im a newb and have never done any sql alterations....please help...thank

Code: Select all

An error was encountered while processing the SQL commands. Further SQL processing has been halted. You may choose to complete the MOD installation anyway and perform the SQL commands manually yourself. However, at this point EM cannot guarantee the MOD will work correctly so you are best off seeking support from the Author before continuing further.

The failed line was:
ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0'

SQL Error: 1060
Duplicate column name 'user_regip' 
  

Posted: Wed May 25, 2005 6:24 am
by happypappy
figured it out :wink:

Posted: Wed May 25, 2005 3:38 pm
by Justas
I slapped up a piece of code that will find the IP most often posted from for each user and, if you disable the debug mode, it also adds the values to your forum database (provided that you have the user_regip column all set up with this mod ;)).

I will not be responsible for any possible harm caused by this code and encourage you to look it over yourself before using, as it's mainly meant for more advanced users. But TerraFrost is free to use it to create an add-on in the next version of this mod, if he so wishes ;)

Do note that you will need to either create a mysql_connect.php or change the filename in the include command to suit your environment, as described below. Also, you might want to run it in debug mode first to see if the results look normal.

Code: Select all

<?php

if (!file_exists('mysql_connect.php')) {
 echo "File mysql_connect.php not found. Please check the source first";
 exit;
}

//Here should be a file that connects to the server and selects the forum database
include('mysql_connect.php');

$debug = 1; // Change this to 0 if you want the file to make the modifications in your database.

if ($debug) echo "This file is in debug mode, please check the source first<p>";

$query = "SELECT poster_ip, poster_id FROM phpbb_posts";
$result = mysql_query($query);

while ($array = mysql_fetch_assoc($result)) {
 $ip = $array['poster_ip'];
 $id = $array['poster_id'];
 $ipcount[$id][$ip]++;
}

ksort($ipcount);

foreach ($ipcount as $user=>$ips) {
 arsort($ipcount[$user]);
 if ($user != -1) $user_ips[$user] = key($ipcount[$user]);
}

if (!$debug) {
 foreach ($user_ips as $user=>$ip) {
  if (mysql_query("UPDATE phpbb_users SET user_regip = '$ip' WHERE user_id = '$user'"))
   echo "Changed user #$user's registration IP to $ip<br>";
  else echo "<font color=red>Couldn't change registration IP for user #$user</font><br>";
 }
}
else { echo "Showing gathered data ([User ID] => IP):<p><pre>"; print_r($user_ips); }

?>

Posted: Wed May 25, 2005 8:15 pm
by TerraFrost
Looks like a useful script, Justas - thanks! :)

Posted: Sun Jun 26, 2005 10:23 pm
by CyberMartyr
I needed this, thanx! I run a forum for a band and we get these dead spammer accounts.

Posted: Mon Jul 18, 2005 5:38 pm
by unwillingsong
I installed this mod--fine...no problems. But now I can't delete users. Any suggestions?

Posted: Mon Jul 18, 2005 6:35 pm
by TerraFrost
On a virgin phpBB, there's only one place users can be deleted - the ACP User Administration interface. The portion of that file responsible for deleting users is as follows:

Code: Select all

			$sql = "DELETE FROM " . USERS_TABLE . "
				WHERE user_id = $user_id";
			if( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $sql);
			}
Since this MOD doesn't modify that, I can only surmise that you either have a heavily modified phpBB and this MOD is incompatable with another, or that this MOD wasn't installed correctly.

As such, assuming that you're trying to delete users via the ACP User Administration interface and that the error you recieved said 'Could not delete user', then posting admin_users.php might prove helpful.

I say might because, for heavily modified boards, there's a fair chance I won't be able to test it out, myself (ie. I'd need to have made the appropriate DB changes / changes to included files, etc)

Posted: Mon Jul 18, 2005 6:39 pm
by unwillingsong
I need to be a little clearer.

I'm *trying* to delete a user...but when I go into the user's profile and click "Delete", it tells me no such user exists.

Thanks for your help, btw.

Posted: Mon Jul 18, 2005 6:48 pm
by TerraFrost
Instead of paraphrasing the error, could you tell me the actual error? Once I have the actual error, I can see where it occurs and what the reason for it might be.

Also, how, exactly, are you going into the user's profile? Do you go through the ACP or not?

Posted: Mon Jul 18, 2005 6:50 pm
by unwillingsong
TerraFrost wrote: Instead of paraphrasing the error, could you tell me the actual error? Once I have the actual error, I can see where it occurs and what the reason for it might be.

Also, how, exactly, are you going into the user's profile? Do you go through the ACP or not?


The actual error is the screen that comes up when I click on DELETE USER: Sorry, but that user does not exist.

I am using the ACP to get into the user's profile.

Posted: Mon Jul 18, 2005 7:12 pm
by TerraFrost
In a virgin admin_users.php, the string "$lang['No_user_id_specified']" should occur three times. Could you maybe post the five or lines that come before and after the line containing the above string?

Also, what other MODs have you installed?

Alternatively, you could, via PM, provide me with a temp. FTP account that I might use to diagnose / fix your problem.

Posted: Mon Jul 18, 2005 7:19 pm
by unwillingsong

Posted: Mon Jul 18, 2005 8:01 pm
by TerraFrost
Admin Add User is the problem.

Find, in admin_user.php, the following:

Code: Select all

// Start replacement - Admin add user MOD
Then replace it with this:

Code: Select all

// Start replacement - Admin add user MOD
$user_id = ($new_user) ? $user_id : intval($HTTP_POST_VARS['id']);
// End replacement - Admin add user MOD
Hopefully this'll fix the problem for you (it did for me). If it doesn't, I'd recommend contacting the orig. author of the Admin add user MOD with follow up questions.

Anyway, the above problem is due to this line in the Admin Add Users install file:

Code: Select all

# 
#-----[ FIND ]------------------------------------------------ 
#
if ( (
{
$user_id = intval($HTTP_POST_VARS['id']);

# 
#-----[ IN-LINE FIND ]------------------------------------------------ 
#
$user_id = intval($HTTP_POST_VARS['id']);

# 
#-----[ IN-LINE REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Admin add user MOD
$user_id = ($new_user) ? $user_id : intval($HTTP_POST_VARS['id']);
// End replacement - Admin add user MOD
IN-LINE actions aren't appropriate here and EasyMOD will only do an IN-LINE REPLACE WITH with the first line.

Posted: Mon Jul 18, 2005 8:12 pm
by unwillingsong
Thank you! I'll give it a try! I appreciate your help!