[3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Hervé
Registered User
Posts: 156
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by Hervé »

Hi,
I have been looking for an inactive accounts manager for a while :D
I have 2 questions :
  1. I would like to give a "bonus" to the members that have posted a lot of messages, increasing the delay for sending emails depending on the total number of posted messages.
    For instance send email if number of days since last post divided by total number of posts > 10.
    Is it possible ?
  2. Auto delete User :
    Users will be autodeleted after a given amount of days if they do not return after the 3 reminders.
    what is the delay between reminders ?
Thanks in advance for your reply.
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

Hi Hervé,

Well now the query does not take in the account the amount of posts of the user other than to see if the user has posted or not.
If you give me some straight forward examples of how the calculation would/should be perhaps I could find a way. Not promising though! ;)

The delay between the messages is the amount of days (interval) that is set in the configuration page.
If you set it for instance to 30, then the users that have not logged in for the past 30 days a message will be sent.
Then another message will be sent after 30 days if the user has not logged in. After another 30 days a last message will be sent.
And then if you have set the auto delete option the account will be deleted after the amount of days that you have configured.

All the best!
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
User avatar
Hervé
Registered User
Posts: 156
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by Hervé »

Hi Andrea,
Thank you for your reply.

To take into account the number of posts I suggest the rule I'm manually using now i.e.
the message is sent if the number of days since last post divided by the number of post is greater than 10
that value (10) could be a parameter.

For instance (based on my forum www.leforumrecifal.com)
Fredm has posted 10 messages, last visit on october 25 (146 days ago) : 146 / 10 = 14,6 => well message
kauderni has posted 17 messages, last visit on october 16 (155 days ago) : 155 / 17 = 9,1 => no message : even if his last visit is older than Fredm he has a bonus because he has posted more messages.

About the delay between messages, I understand the rule.
For my fourum I would like to set the delay to 6 month thus message if the user has not posted for 180 days.
He would thus receive the second message after a year, the third after a year and an half, ... it's too long !

I suggest an additionnal distinct parameter for the delay between messages
so I could set for instance the first message after 6 month and then an additionnal message every 30 days.

Thanks a lot for your attention
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

I see,

well I guess it could be done but I see a minor problem...
Let's say that a user has not logged in for 30 days and has 1500 posts this will result to a
30/1500 = 0.02 No message... but this bonus will be for a really long time! >15000 days to be exact :)
Of course you say that the "quotient" factor could be variable so that could save somehow the situation.

In any case I'll have to sit on it for a while to see how it can be done the best/easiest way.


Yes I know when I was writing the ext I was not aware that someone could set such a high number of days (even though it's allowed).
It is scheduled to implement 2 extra parameters (for that case), 1 for the 2nd message and 1 for the 3rd message on future releases.
So each reminder will/could be set independently.
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
User avatar
Hervé
Registered User
Posts: 156
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by Hervé »

Thanks,
If a user has posted 1500 messages but has not visited the forum for 30 days perhaps he is in holidays :mrgreen:
andreask wrote:
Thu Mar 19, 2020 12:31 pm
It is scheduled to implement 2 extra parameters (for that case), 1 for the 2nd message and 1 for the 3rd message on future releases.
What about the 4th message ? and for the 5th ?
I think one additional delay would suffice, valid for all not first messages.
Last edited by Hervé on Fri Mar 20, 2020 9:23 am, edited 1 time in total.
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

There is no 4th or 5th or any #th.

The extension sends 3 messages.
And then it stops sending messages to the same user. Unless you specifically send another message or you reset the counter for that user. In the last case again 3 messages and stop.

Well in any case I'll see how it might be best implemented. Perhaps one is enough as you say.
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
dimassamid
Registered User
Posts: 26
Joined: Sat Aug 25, 2007 4:55 pm

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by dimassamid »

Hello Andreas!

Thank you for this great extension!

Please tell, is it possible to change 3 reminders to 2?
Also, it would be great if this setting can be changed on the config page.

I would like to set up reminders as follows:
90 days inactivity - first reminder message
180 days inactivity - second reminder message

I would not like to flood user mailboxes with a large count of emails. Many people don’t like these messages, especially if they come often.

And the second question.
Is it possible to include the "self delete link" to the first reminder too?

Thank you again for your great work!
User avatar
Hervé
Registered User
Posts: 156
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by Hervé »

Hi,
By the way, if you add a field to specify the number of reminders
it would be nice to be able to set this number to zero which means : no limit.
Thanks again
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

Hello,

First of all, thank you for the kind words.

Now to your questions.
dimassamid wrote:
Sat Apr 04, 2020 5:06 am
Please tell, is it possible to change 3 reminders to 2?
Also, it would be great if this setting can be changed on the config page.
dimassamid wrote:
Sat Apr 04, 2020 5:06 am
And the second question.
Is it possible to include the "self delete link" to the first reminder too?

Thank you again for your great work!
Yes both can be done, but I do not have direct access to the code now, in order to modify and test it to give you a definitive answer with how to proceed on changing the files. So please give me some time.
I will get back to you asap.
Hervé wrote:
Sat Apr 04, 2020 7:12 am
Hi,
By the way, if you add a field to specify the number of reminders
it would be nice to be able to set this number to zero which means : no limit.
Thanks again
For now I do not work actively on the extension so i have not really thought about it. When I'll get back to it I will take your advice under consideration. Thank you for your input and ideas.

All the best,

Andreas
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
User avatar
Hervé
Registered User
Posts: 156
Joined: Tue Jun 04, 2019 7:51 am
Location: Belgium
Name: Rudy
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by Hervé »

It's cosmetic, thanks to you Image
User avatar
nhseacoast
Registered User
Posts: 609
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by nhseacoast »

Upgraded to Stable version on phpbb v3.2.1. Configuration sets fine, but when clicking "Inactive users list" or "Ignore/Delete Approval List" I get the following:

Code: Select all

General Error
SQL ERROR [ mysql4 ]

Unknown column 'ium_remind_counter' in 'field list' [1054]

SQL

SELECT user_id, username, user_regdate, user_posts, user_lastvisit, user_inactive_time, user_inactive_reason, ium_remind_counter, ium_previous_sent_date, ium_reminder_sent_date, ium_dont_send, ium_request_date, ium_random, ium_type, ium_request_type FROM phpbb_users WHERE user_id not in (SELECT ban_userid FROM phpbb_banlist) AND user_type NOT IN (3, 2) AND user_id <> 2 AND user_inactive_reason <> 3 AND user_id > 1 AND user_regdate < 1583668763 AND user_lastvisit < 1583668763 ORDER BY user_regdate LIMIT 20

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysql.php
LINE: 191
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/mysql_base.php
LINE: 45
CALL: phpbb\db\driver\mysql->sql_query()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 270
CALL: phpbb\db\driver\mysql_base->_sql_query_limit()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 321
CALL: phpbb\db\driver\driver->sql_query_limit()

FILE: [ROOT]/ext/andreask/ium/acp/main_module.php
LINE: 728
CALL: phpbb\db\driver\factory->sql_query_limit()

FILE: [ROOT]/ext/andreask/ium/acp/main_module.php
LINE: 568
CALL: andreask\ium\acp\main_module->inactive_users()

FILE: [ROOT]/ext/andreask/ium/acp/main_module.php
LINE: 238
CALL: andreask\ium\acp\main_module->get_inactive_users()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: andreask\ium\acp\main_module->main()

FILE: [ROOT]/adm/index.php
LINE: 82
CALL: p_master->load_active()
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.1
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

Is this after an update? Or a fresh install?
First try refreshing cache of phpbb
If this does not work uninstall extension, delete completely the extension and reinstall.
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
User avatar
nhseacoast
Registered User
Posts: 609
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by nhseacoast »

It was an update. Ill try a fresh install later today. Thanks.

Edit:
Deleting old version and data, purging the cache did the trick! Thank you.
:D
Last edited by nhseacoast on Wed Apr 08, 2020 9:35 pm, edited 3 times in total.
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.1
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

Try first refreshing the cache before reinstalling!

Good luck!
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
andreask
Registered User
Posts: 636
Joined: Fri Feb 27, 2009 6:13 pm
Name: Andreas

Re: [3.3][RC] [3.1][3.2][RC] PhpBB IUM (Inactive User Manager/reminder)

Post by andreask »

dimassamid wrote:
Sat Apr 04, 2020 5:06 am
Hello Andreas!

Thank you for this great extension!

Please tell, is it possible to change 3 reminders to 2?
Also, it would be great if this setting can be changed on the config page.

I would like to set up reminders as follows:
90 days inactivity - first reminder message
180 days inactivity - second reminder message

I would not like to flood user mailboxes with a large count of emails. Many people don’t like these messages, especially if they come often.

And the second question.
Is it possible to include the "self delete link" to the first reminder too?

Thank you again for your great work!
So here is how you can do it now. Later I will probably implement some sort of option or something, we will see...

Open file : andreask/ium/classes/reminder.php
Find:

Code: Select all

	private function update_user($user)
	{
		// Update user ium info for the reminder

		$update_arr = array('ium_reminder_sent_date' => time());
		$counter = ($user['ium_remind_counter'] + 1);

		if ( $user['ium_remind_counter'] == 0 )
		{
			$merge = array('ium_remind_counter' => $counter);
			$update_arr = array_merge($update_arr, $merge);
		}
		else if ( $user['ium_remind_counter'] == 1 )
		{
			$random_md5	= md5(uniqid($user['user_email'], true));
			$merge = array('ium_previous_sent_date'	=>	$user['ium_reminder_sent_date'],
				'ium_remind_counter'	=>	$counter,
				'ium_random'			=>	$random_md5,
				);
			$update_arr = array_merge($update_arr, $merge);
		}
		else if ( $user['ium_remind_counter'] >= 2 )
		{
			$merge = array('ium_previous_sent_date' =>	$user['ium_reminder_sent_date'],
				'ium_remind_counter'	=>	$counter,
				'ium_request_date'		=>	time(),
				'ium_type'				=>	'auto',
				'ium_dont_send'			=>	1,
				);
			$update_arr = array_merge($update_arr, $merge);
		}

		$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $update_arr) . '
						WHERE user_id = ' . (int) $user['user_id'];

		$this->db->sql_query($sql);
	}
Replace with:

Code: Select all

	private function update_user($user)
	{
		// Update user ium info for the reminder

		$update_arr = array('ium_reminder_sent_date' => time());
		$counter = ($user['ium_remind_counter'] + 1);

		if ( $user['ium_remind_counter'] == 0 )
		{
			$merge = array('ium_remind_counter' => $counter,
				'ium_random'	=>	md5(uniqid($user['user_email'], true))
				);
			$update_arr = array_merge($update_arr, $merge);
		}
		else if ( $user['ium_remind_counter'] >= 1 )
		{
			$merge = array('ium_previous_sent_date' =>	$user['ium_reminder_sent_date'],
				'ium_remind_counter'	=>	$counter,
				'ium_request_date'		=>	time(),
				'ium_type'				=>	'auto',
				'ium_dont_send'			=>	1,
				);
			$update_arr = array_merge($update_arr, $merge);
		}

		$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $update_arr) . '
						WHERE user_id = ' . (int) $user['user_id'];

		$this->db->sql_query($sql);
	}
On my test runs it worked fine. Let me know if you get any problems!

All the best!
Here is what I am working on right now...
Inactive User Manager for phpBB
Give it a try...
If you would like to buy me a bier ;) for my work I will drink it on a hot summer day and thank you!!!
Post Reply

Return to “Extensions in Development”