Page 5 of 71

Posted: Wed Aug 03, 2005 4:21 pm
by TerraFrost
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"...

Posted: Sat Aug 06, 2005 8:49 pm
by Throckmorton
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...

Posted: Sat Aug 06, 2005 9:36 pm
by Makc666
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 :)

Posted: Sat Aug 06, 2005 10:01 pm
by Throckmorton
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.

error message

Posted: Sun Aug 07, 2005 10:15 am
by ALLMIGHTYGOD
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

Posted: Sun Aug 07, 2005 10:21 am
by Makc666
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
#

DID SQL ENTRY

Posted: Sun Aug 07, 2005 10:58 am
by ALLMIGHTYGOD
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
#

Re: DID SQL ENTRY

Posted: Sun Aug 07, 2005 11:03 am
by Makc666
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"

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

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

Posted: Sun Aug 07, 2005 12:30 pm
by ALLMIGHTYGOD
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

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

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,

Posted: Sun Aug 07, 2005 1:30 pm
by Makc666
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.

Posted: Sun Aug 07, 2005 1:41 pm
by 4rum
:lol: Quite, but as far as the code is concerned, the omission of that space will cause a problem . :wink:

Posted: Sun Aug 07, 2005 1:43 pm
by Throckmorton
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.

Posted: Sun Aug 07, 2005 7:12 pm
by ALLMIGHTYGOD

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*