Log IP Address on Registration

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply

Rating:

Excellent!
112
78%
Very Good
16
11%
Good
8
6%
Fair
3
2%
Poor
4
3%
 
Total votes: 143

User avatar
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Wed Aug 03, 2005 4:21 pm

EasyMOD won't install the MOD, again, 'cause it thinks it's already been installed. To remedy this, you can either clear the phpbb_easymod table, or you can change the MOD Title line to say "Log IP Address on Registration 2" instead of "Log IP Address on Registration"...

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton » Sat Aug 06, 2005 8:49 pm

Mod to the Mod:

Adds an ACP page to display User IP and other user information.

Just install the admin_user_ip.php file in your admin folder and the admin_user_ip.tpl file in your templates/subSilver/admin folder and you're done. There are no files to edit. If you don't like what the mod does, just delete the files. There are no changes made to your database or any other files.

Files can be installed with EasyMOD if you so desire.

Name this file admin_user_ip.php:

Code: Select all

<?php

define('IN_PHPBB', 1);

if( !empty($setmodules) )
{
	$filename = basename(__FILE__);
	$module['User Data']['User IP Addresses'] = $filename;
	return;
}

$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

$lang['UserIP_Title'] = 'User IP Addresses';
$lang['UserIP_Title_Explain'] = 'IP Addresses users were using when they registered.';
$lang['UIP_UserID'] = 'User ID';
$lang['UIP_Username'] = 'Username';
$lang['UIP_IPAddress'] = 'IP Address';
$lang['UIP_Activated'] = 'Activated';
$lang['UIP_LastOn'] = 'Last Visit';
$lang['UIP_Email'] = 'Email';

$template->set_filenames(array('body' => 'admin/admin_user_ip.tpl'));
$template->assign_vars(array(
	'L_USERIP_TITLE' => $lang['UserIP_Title'],
	'L_USERIP_EXPLAIN' => $lang['UserIP_Title_Explain'],
	'L_USERIP_USERID' => $lang['UIP_UserID'],
	'L_USERIP_USERNAME' => $lang['UIP_Username'],
	'L_USERIP_IPADDRESS' => $lang['UIP_IPAddress'],
	'L_USERIP_ACTIVATED' => $lang['UIP_Activated'],
	'L_USERIP_LASTON' => $lang['UIP_LastOn'],
	'L_USERIP_EMAIL' => $lang['UIP_Email'])
);

$sql = "SELECT user_id, username, user_regip, user_active, user_lastvisit, user_email FROM phpbb_users 
		WHERE user_id > 0 
		ORDER BY user_id";

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not obtain user list.', '', __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
	$user_id = '<a href="' . $board_config['script_path'] . 'profile.php?mode=viewprofile&u=' . $row['user_id'] . '" target="_profile">' . $row['user_id'] . '</a>';

	$username = $row['username'];

	$user_regip = decode_ip($row['user_regip']);
	if ( $user_regip != '0.0.0.0' )
	{
		$user_regip = '<a href="http://network-tools.com/default.asp?prog=trace&Netnic=whois.arin.net&host=' . $user_regip . '" target=_"ip">' . $user_regip . '</a>';
	}
	else
	{
		$user_regip = '<span style="color: red;">' . $user_regip . '</span>';
	}

	$user_active = '<span style="color: green;">Yes</span>';
	if ( !$row['user_active'] )
	{
		$user_active = '<span style="color: red;">No</span>';
	}

	$user_laston = '<span style="color: red;">' . $lang['Never'] . '</span>';	
	if ( !empty($row['user_lastvisit']) )
	{
		$user_laston = create_date('M d Y', $row['user_lastvisit'], $board_config['board_timezone']);
	}

	$user_email = '<a href=mailto:' . $row['user_email'] . '>' . $row['user_email'] . '</a>';

	$template->assign_block_vars('userip_row', array(
		'USER_ID' => $user_id,
		'USERNAME' => $username,
		'USER_REGIP' => $user_regip, 
		'USER_ACTIVE' => $user_active, 
		'USER_LASTON' => $user_laston, 
		'USER_EMAIL' => $user_email));
}

$db->sql_freeresult($result);

$template->pparse("body");

include('./page_footer_admin.'.$phpEx);
?>
Name this file admin_user_ip.tpl:

Code: Select all

<h1>{L_USERIP_TITLE}</h1>
<p>{L_USERIP_EXPLAIN}</p>

<table align="center" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr>
	<th>{L_USERIP_USERID}</td>
	<th>{L_USERIP_USERNAME}</td>
	<th>{L_USERIP_IPADDRESS}</td>
	<th>{L_USERIP_ACTIVATED}</td>
	<th>{L_USERIP_LASTON}</td>
	<th>{L_USERIP_EMAIL}</td>
  </tr>
<!-- BEGIN userip_row -->
  <tr>
    <td class="row1" align="center">{userip_row.USER_ID}</td>
    <td class="row1">{userip_row.USERNAME}</td>
    <td class="row1">{userip_row.USER_REGIP}</td>
    <td class="row1" align="center">{userip_row.USER_ACTIVE}</td>
    <td class="row1">{userip_row.USER_LASTON}</td>
    <td class="row1">{userip_row.USER_EMAIL}</td>
  </tr>
<!-- END userip_row -->
</table>

<br />
Name this file reg_ip_report_100.txt:

Code: Select all

##############################################################
## MOD Title: Addon to Log IP Address on Registration by TerraFrost
## MOD Author: Lance < Lance at cylan dot net > (Lance Clarke) http://www.cylan.net/ 
## MOD Description: Adds an ACP page to display User IP and other user information.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 1 Minute
##
## Files To Edit: n/a
##
## Included Files: admin_user_ip.php
##		   admin_user_ip.tpl
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##     This is an addon to Log IP Address on Registration by TerraFrost which can be
##     found at: http://www.frostjedi.com/terra/scripts/phpbb/reg_ip.zip
##
##     Log IP Address on Registration by TerraFrost must be installed before installing
##     this addon.
##
############################################################## 
## MOD History: 
## 
##  2005-08-06 - Version 1.0.0
##             - Initial Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ COPY ]-------------------------------------------
#
copy admin_user_ip.php to admin/admin_user_ip.php
copy admin_user_ip.tpl to templates/subSilver/admin/admin_user_ip.tpl

#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
Enjoy...

User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 » Sat Aug 06, 2005 9:36 pm

Throckmorton, cool mode!
But... Imaging if there are more than 5000 users in forum's databes.
I think you have to add how many records to display on each page :)

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton » Sat Aug 06, 2005 10:01 pm

Makc666 wrote: Throckmorton, cool mode!
But... Imaging if there are more than 5000 users in forum's databes.
I think you have to add how many records to display on each page :)


Good point. I threw this together quickly. I'll work on that for an upgrade.

ALLMIGHTYGOD
I've Been Banned!
Posts: 34
Joined: Mon Oct 25, 2004 4:58 pm

error message

Post by ALLMIGHTYGOD » Sun Aug 07, 2005 10:15 am

hi there,

get sum errors here; can u help me fixin' em?!

Code: Select all

Could not insert data into users table

DEBUG MODE

SQL Error : 1054 Unknown column 'user_regip' in 'field list'

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_regip,user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (101, 'zwei-stein', 1123409493, 'e19457c81e62b6bb21e9031a5a187cdf', ' tiscali.de', '5091568a', '', '', 'kein', '', 'keine', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 1, 'd.m.Y, H:i', 'german', 1, 0, 1, 0, '1dc5f578907fc')

Line : 580
File : rums/includes/usercp_register.php
DO NOT MAKE YOUR PROBLEMS TO MINE
OR

I DO NOT SEE THERE A PROBLEM; and if there schould be one- it is DEFENTLEY NOT MINE!

User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 » Sun Aug 07, 2005 10:21 am

Why you didn't read Install notes?
You have to add red line below into your forum's database.

phpBB Knowledge base - How to Install MODs
Find there: 10 ) The "SQL" action :

###############
#
#-----[ SQL ]-------------------------------------------
#
ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0';

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#

ALLMIGHTYGOD
I've Been Banned!
Posts: 34
Joined: Mon Oct 25, 2004 4:58 pm

DID SQL ENTRY

Post by ALLMIGHTYGOD » Sun Aug 07, 2005 10:58 am

I did enter the SQL- ENTRY! of course - but still get the ERROR message! donT get it....

U have another idea why i get the ERROR message?!


greets



Makc666 wrote: Why you didn't read Install notes?
You have to add red line below into your forum's database.

phpBB Knowledge base - How to Install MODs
Find there: 10 ) The "SQL" action :

###############
#
#-----[ SQL ]-------------------------------------------
#
ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0';

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
DO NOT MAKE YOUR PROBLEMS TO MINE
OR

I DO NOT SEE THERE A PROBLEM; and if there schould be one- it is DEFENTLEY NOT MINE!

User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Re: DID SQL ENTRY

Post by Makc666 » Sun Aug 07, 2005 11:03 am

ALLMIGHTYGOD wrote: I did enter the SQL- ENTRY! of course - but still get the ERROR message! donT get it....

U have another idea why i get the ERROR message?!


greets

Yes, I have.
If SQL says that there is no such entry - it means there is no such entry.
Than you didn't enter SQL-ENTRY right. You made it wrong.
Open you database with phpMyAdmin and look your self - if there is such entry "user_regip" in TABLE "phpbb_users"

4rum
Registered User
Posts: 60
Joined: Sun Jul 04, 2004 3:21 am

Post by 4rum » Sun Aug 07, 2005 12:09 pm

Code: Select all

ALTER TABLE phpbb_users ADD user_regip CHAR(8) NOT NULL DEFAULT '0';
Paste the above line into the Enter SQL: window and use the generated file to update your database.

Read the instructions on the left of the input/output windows
http://www.phpbbhacks.com/forums/db_generator.php

HTH

ALLMIGHTYGOD
I've Been Banned!
Posts: 34
Joined: Mon Oct 25, 2004 4:58 pm

Post by ALLMIGHTYGOD » Sun Aug 07, 2005 12:30 pm

but the programm does the same thing I already did manually in PHP my Admin; so what or why should this help?

it must be s.th else I suppose... :evil:

thx 4 help, tho

maybe u still have an idea..

later
DO NOT MAKE YOUR PROBLEMS TO MINE
OR

I DO NOT SEE THERE A PROBLEM; and if there schould be one- it is DEFENTLEY NOT MINE!

4rum
Registered User
Posts: 60
Joined: Sun Jul 04, 2004 3:21 am

Post by 4rum » Sun Aug 07, 2005 12:51 pm

Code: Select all

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_regip,user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (101, 'zwei-stein', 1123409493, 'e19457c81e62b6bb21e9031a5a187cdf', ' tiscali.de', '5091568a', '', '', 'kein', '', 'keine', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 1, 'd.m.Y, H:i', 'german', 1, 0, 1, 0, '1dc5f578907fc')
You need to edit the above at the point user_regip,
include a space after user_regip,

User avatar
Makc666
Registered User
Posts: 358
Joined: Fri Mar 07, 2003 12:03 pm
Location: MSK-RU
Name: Maxim
Contact:

Post by Makc666 » Sun Aug 07, 2005 1:30 pm

4rum wrote:

Code: Select all

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_regip,user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (101, 'zwei-stein', 1123409493, 'e19457c81e62b6bb21e9031a5a187cdf', ' tiscali.de', '5091568a', '', '', 'kein', '', 'keine', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 1, 'd.m.Y, H:i', 'german', 1, 0, 1, 0, '1dc5f578907fc')
You need to edit the above at the point user_regip,
include a space after user_regip,

Space is a cosmetic thing and nothing else.

4rum
Registered User
Posts: 60
Joined: Sun Jul 04, 2004 3:21 am

Post by 4rum » Sun Aug 07, 2005 1:41 pm

:lol: Quite, but as far as the code is concerned, the omission of that space will cause a problem . :wink:

Throckmorton
Registered User
Posts: 364
Joined: Tue Oct 07, 2003 7:07 pm
Location: Naperville, IL

Post by Throckmorton » Sun Aug 07, 2005 1:43 pm

ALLMIGHTYGOD wrote: but the programm does the same thing I already did manually in PHP my Admin; so what or why should this help?

it must be s.th else I suppose... :evil:

thx 4 help, tho

maybe u still have an idea..

later


Read your error:

Code: Select all

SQL Error : 1054 Unknown column 'user_regip' in 'field list'
You only think you inserted the column manually, but this error says you did not. Regardless, check it again.

ALLMIGHTYGOD
I've Been Banned!
Posts: 34
Joined: Mon Oct 25, 2004 4:58 pm

Post by ALLMIGHTYGOD » Sun Aug 07, 2005 7:12 pm

Code: Select all

Could not insert data into users table

DEBUG MODE

SQL Error : 1054 Unknown column 'user_regip' in 'field list'

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_regip, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (101, 'zwei-stein', 1123441711, 'e19457c81e62b6bb21e9031a5a187cdf', ' @tiscali.de', '5091568a', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 1, 'd.m.Y, H:i', 'german', 1, 0, 1, 0, '2481e6e291b02')

Line : 580
File :  /forums/includes/usercp_register.php




I still get da message; and I checked the database again; the table is set

have absolutely no clue why this message keeps comin' up *damm*
DO NOT MAKE YOUR PROBLEMS TO MINE
OR

I DO NOT SEE THERE A PROBLEM; and if there schould be one- it is DEFENTLEY NOT MINE!

Post Reply

Return to “[2.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 14 guests