[ABD] - About Delete Inactive User Timer MOD

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
User avatar
robra
Registered User
Posts: 147
Joined: Thu Dec 09, 2010 2:09 am
Location: Brazil

[ABD] - About Delete Inactive User Timer MOD

Post by robra »

The author page of this MOD in http://www.phpbb.com/community/viewtopi ... 1&start=15 is locked because the download link is broken and because the author not reply to the messages since 30 Jan 2011.
Well, this MOD really is a code addition in the end of the root/common.php file. It's very simple to do that.
Follow the steps below:
1- Make backup of the root/common.php file to restore it if you have some problem.
2- Open the common.php file and in the end, before of the code ?>, include this code:

Code: Select all

// Append at the end of common.php in the root directory of your phpBB installation.

// Don't mess with these variables.
// Use these as referances to how long this site should keep a newly registered user that is inactive.
$timespan_minute = 60;				// 1 minute
$timespan_hour = 60 * $timespan_minute;		// 1 hour
$timespan_day = 24 * $timespan_hour;		// 1 day
$timespan_week = 7 * $timespan_day;		// 1 week
$timespan_month = 30 * $timespan_day;		// 1 month
$timespan_year = 365 * $timespan_day;		// 1 year

// Change this variable to anything you want!
// A value under 5 minutes is not recomended.
// Use above variables as referance.
$delete_user_time = 24 * $timespan_hour;	// 24 hours is default!

$usercheck_time = time();
$sql_usercheck = "SELECT * FROM " . USERS_TABLE . " WHERE user_inactive_reason='1' ";
$result_usercheck = $db->sql_query($sql_usercheck);
while($row_usercheck = $db->sql_fetchrow($result_usercheck))
{
	$user_id = $row_usercheck['user_id'];
	$user_inactive_time = $row_usercheck['user_inactive_time'];
	$user_regdate = $row_usercheck['user_regdate'];
	
	if($user_inactive_time == $user_regdate and $usercheck_time > $user_inactive_time + $delete_user_time)
	{
		$sql_usercheck_remove = "DELETE FROM " . USERS_TABLE . " WHERE user_inactive_time='$user_inactive_time' ";
		$result_usercheck_remove = $db->sql_query($sql_usercheck_remove);
	}
}
3- Salve it and do the uplod of it.

P.S.:
- This MOD is to automatically exclude only the users that created a register in Forum but they never activated the register.
- This MOD is indicate to the Fórum that is configurated with the option "User" in the GENERAL tab>>User registation settings
- The "default time" to auto exclude the inactive user is 24 hours after create your register in Forum. Is not indicate to use a time under of 5 minutes.
If you want to change the "default time", then, change the hours in the line:

Code: Select all

$delete_user_time = 24 * $timespan_hour;	// 24 hours is default!
Exemple:
Suppose that you want to exclude auto the inactive user that created a register in the Forum but not activated the register in 3 days. Then, you can do it this way:

Code: Select all

$delete_user_time = 72 * $timespan_hour;	// 24 hours is default!
Or this way:

Code: Select all

$delete_user_time = 3 * $timespan_day;  // 24 hours is default!
I hope to have helped.
Last edited by robra on Tue Jul 26, 2011 7:20 pm, edited 2 times in total.
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: About Delete Inactive User Timer MOD

Post by RMcGirr83 »

Hello,

Please edit your topic title with a prefix as outlined in Modifications Development Forum Rules, section 3a. This will allow people to see the development status of your modification at a glance.

Thank you,
The phpBB Modifications Team
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
robra
Registered User
Posts: 147
Joined: Thu Dec 09, 2010 2:09 am
Location: Brazil

Re: [ABD] - About Delete Inactive User Timer MOD

Post by robra »

Sorry.
Is done.

Thanks.
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 28654
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: [ABD] - About Delete Inactive User Timer MOD

Post by Paul »

Locked as topic has been marked as ABD by the author.

If you want to have it reopened, please ask someone on the MOD team.
Locked

Return to “[3.0.x] Abandoned MODs”