Advertisement:

Author Topic: email Inactive Users  (Read 49663 times)

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #40 on: May 30, 2014, 12:55:47 PM »
Yeah, it is somehow complicated, I know I did changed the behavior a couple of times but since I haven't checked the code recently I have no idea whats the current state and behavior.

In theory it should be like this:

the mod checks your database everyday looking for new inactive users, this is done by getting the current day minus the days you specified for the users to be inactive, in your case is 365 so:

$inactiveFor = 86400 * (!empty($modSettings['eiu_inactiveFor']) ? $modSettings['eiu_inactiveFor'] : 15);

There is also a "grace period"

$sinceMail = 86400 * (!empty($modSettings['eiu_sinceMail']) ? $modSettings['eiu_sinceMail'] : 15);

The list does indeed show only the users who already passed the first checks and the grace period and are still inactive,  the list doesn't show the potential inactive users but  the users who are ready to be confirmed for deletion by the admin, meaning the users who were marked as inactive AND also their grace period has expired.

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline zarachrome

  • Semi-Newbie
  • *
  • Posts: 11
Re: email Inactive Users
« Reply #41 on: May 30, 2014, 01:40:10 PM »
That's right!
Thank you for explain it  :)

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #42 on: June 10, 2014, 03:10:44 PM »
i Just gave it a try.. is it standard, that "generel settings" and "user list" do show the same settings page "Email Inactive Users"?

i don´t see anything different on "user list"


p.s.
in the description text, there is a typo.. you wrote "not after the main was sent".. i think this should be "mail" not "main"..

p.p.s. error log says (german):
Code: [Select]
http://board.url/index.php?action=admin;area=eiu
Filter hinzufügen: Nur Fehlermeldungen mit der gleichen Nachricht anzeigen
2: in_array() expects parameter 2 to be array, boolean given
Filter hinzufügen: Nur Fehler von dieser Datei zeigen
Datei: /boardfolder/Themes/default/languages/emailInactiveUsers.english.php (show_settings sub template - eval?)
Zeile: 903


OK, I uploaded the correct package.

The "in_array() expects parameter 2 to be array, boolean given" error is an SMF bug when using a multiple select box, it only happens the first time you install the mod, by default SMF sets an non existent setting as a boolean false but the code to show the multiple select HTML code needs an array, in this case, an empty array.  I vaguely remember I fixed that on 2.1 but I don't know if I ever pushed the fix or not, will take a look at it when I get back.

Anyway, heres the correct branch, if you enable the "Disable the deletion of users feature" option then the user list will always remain empty since the change I introduced will reset the user status back to normal instead of mark the user for deletion.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline mikk

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
Re: email Inactive Users
« Reply #43 on: June 13, 2014, 11:01:15 AM »
OK, I uploaded the correct package.

Hi!

Thanks for this mod,  I'm testing this.

Problems:
- With non-UTF8 language forum, non-ASCII2 chars is lost in subject and in the mail body. But with UTF8 forum all character is OK.
- html code doesn't work in mail body,  example:<b>
- after mod uninstall, "inactive_mail", "sent_mail", and "to_delete" is remain in the database
- after mod uninstall, this mod scheduled task didn't delete.

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #44 on: June 13, 2014, 11:20:08 AM »
Quote
- With non-UTF8 language forum, non-ASCII2 chars is lost in subject and in the mail body. But with UTF8 forum all character is OK.

Could you give me an example. not so sure if theres something I can actually do about it.

Quote
- html code doesn't work in mail body,  example:<b>
This is intentional. sendmail does have a setting for allowing HTML on the body, if you want to use HTML change it on the mod's code:

Code: [Select]
// Send the mail away!
foreach($messages as $m)
sendmail($m['mail'], $m['subject'], $m['message'], null, null, false);

Quote
- after mod uninstall, "inactive_mail", "sent_mail", and "to_delete" is remain in the database
- after mod uninstall, this mod scheduled task didn't delete.

If you want to remove those settings you need to check the "Remove all data associated with this modification"  checkbox when uninstalling.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,424
    • Arantor on GitHub
Re: email Inactive Users
« Reply #45 on: June 13, 2014, 11:25:36 AM »
The scheduled task remover probably should be put into a <code> block rather than a <database> block in the uninstaller so it will always be run regardless.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline mikk

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
Re: email Inactive Users
« Reply #46 on: June 13, 2014, 11:48:07 AM »
Hi!

Quote
- With non-UTF8 language forum, non-ASCII2 chars is lost in subject and in the mail body. But with UTF8 forum all character is OK.

Could you give me an example. not so sure if theres something I can actually do about it.
 

Example for message body:
Code: [Select]
Szia kedves {display_name}! öüóőúéáí ÖÜÓŰŐÚÉÁÍ
Quote
- html code doesn't work in mail body,  example:<b>

This is intentional. sendmail does have a setting for allowing HTML on the body, if you want to use HTML change it on the mod's code:

Code: [Select]
// Send the mail away!
foreach($messages as $m)
sendmail($m['mail'], $m['subject'], $m['message'], null, null, false);

Okay, but what is the new code? This is the original code.

Quote
- after mod uninstall, "inactive_mail", "sent_mail", and "to_delete" is remain in the database
- after mod uninstall, this mod scheduled task didn't delete.

If you want to remove those settings you need to check the "Remove all data associated with this modification"  checkbox when uninstalling.

I don't remember to this settings, but now I can't install again the mod, because I get error messages:
Code: [Select]
"Database error"
Duplicate entry 'emailInactiveUsers' for key 'task'
"File": /var/www/vhosts/xxx.xxx.hu/httpdocs/test/forum-iso/Packages/temp/install.php
"line": 86

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #47 on: June 13, 2014, 11:54:34 AM »
Quote
Example for message body:
Code: [Select]
Szia kedves {display_name}! öüóőúéáí ÖÜÓŰŐÚÉÁÍ

Yeah, to be honest, I'm not sure theres something I can do and even if I can, I have way too many things on my head right now, best advice I can give you is use utf8 or just use html entities directly on the subject.

I believe is the last param on sendmail($m['mail'], $m['subject'], $m['message'], null, null, false);  dunno, can't check right now.

Quote
I don't remember to this settings, but now I can't install again the mod, because I get error messages:

Yeah, thats something I need to change, just don't know when.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline mikk

  • Semi-Newbie
  • *
  • Posts: 34
  • Gender: Male
Re: email Inactive Users
« Reply #48 on: June 13, 2014, 12:46:16 PM »
Yeah, to be honest, I'm not sure theres something I can do and even if I can, I have way too many things on my head right now, best advice I can give you is use utf8 or just use html entities directly on the subject.
I believe is the last param on sendmail($m['mail'], $m['subject'], $m['message'], null, null, false);  dunno, can't check right now.

I think you search this: http://support.simplemachines.org/function_db/index.php?action=view_function;id=314

Anyway, thanks for answers, this mod is very good idea.

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #49 on: June 13, 2014, 02:07:55 PM »
huh ???  thats what I'm using already I just couldn't remember where was the param to allow html on the body, didn't bother to search for it either since 1) I have other priorities right now and 2) when I was creating this mod I played with that setting and in 99% of all the cases it didn't work because the mail client/receiver/whatever usually strips out any html so it really is redundant to allow html on the body but like I said, if you want to allow html just change that param to true, I'm not gonna do it by default since it will only cause headaches and will not gonna work anyway.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline senyor35

  • Semi-Newbie
  • *
  • Posts: 67
Re: email Inactive Users
« Reply #50 on: July 06, 2014, 07:42:30 AM »
When I install this mod the Scheduled Task file is gives error this line;

function($k) {

What solve please?

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #51 on: July 07, 2014, 10:30:57 AM »
You shouldn't use this if you're not using PHP 5.3, theres even a check for that when installing, anyway, upload your Sources/ScheduledTask.php file
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Impsat-1

  • Jr. Member
  • **
  • Posts: 321
Re: email Inactive Users
« Reply #52 on: July 12, 2014, 11:53:47 PM »
Ufff!!!... hey Suki, I´m sorry but when uninstalling and re-install the MOD, say this

Code: [Select]
Duplicate entry 'emailInactiveUsers' for key 'task'
Archivo: /home/**********/public_html/foro/Packages/temp/install.php
Línea: 86

Please help me or say me what I have to delete for install de New Version Updated for you....

I hope for solution...

Sorry for my english but I from Argentine and..... here only Spanish :)

Thanks & Regards.-
Vive Cáda Momento De Tu Vida Como Si Fueras a Irte Mañana, Más Planificala Cómo Si Jamás Fueras a Irte ;).-

Offline Impsat-1

  • Jr. Member
  • **
  • Posts: 321
Re: email Inactive Users
« Reply #53 on: July 13, 2014, 12:32:31 AM »
Ufff!!!... Ok Suki, Solved... from db, I delete all tables ;)


Thanks & Regards 8).-
Vive Cáda Momento De Tu Vida Como Si Fueras a Irte Mañana, Más Planificala Cómo Si Jamás Fueras a Irte ;).-

Offline Impsat-1

  • Jr. Member
  • **
  • Posts: 321
Re: email Inactive Users
« Reply #54 on: July 13, 2014, 12:55:06 AM »
Mmm... for any user in future, Uninstall like in pic :)




Thanks & Regards, have a great time 8).-
Vive Cáda Momento De Tu Vida Como Si Fueras a Irte Mañana, Más Planificala Cómo Si Jamás Fueras a Irte ;).-

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #55 on: July 14, 2014, 12:34:19 PM »
OK, version 1.1 was uploaded:

Adds some small improvements and fixes some other not so small bugs...

- Adds a new setting for not removing users, rather just keep annoying them with emails.
- Add Spanish translation or fix the current, dunno/don't really care.
- Move the removal of scheduled task to its own file so it can be executed eerytime the user uninstalls the mod, prevents errors when trying to install again.
To update just uninstall the mod and make sure you check the "Remove all data associated with this modification" checkbox  this is important otherwise you will have an error when trying to install the new version.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Impsat-1

  • Jr. Member
  • **
  • Posts: 321
Re: email Inactive Users
« Reply #56 on: July 14, 2014, 10:46:34 PM »
Wow!!!... Great Job Suki and so, so important detail :)

- Adds a new setting for not removing users, rather just keep annoying them with emails.

I'will try now!!!

Thanks Again... ;)

Have a Great Time
Thanks & Regards 8).-
Vive Cáda Momento De Tu Vida Como Si Fueras a Irte Mañana, Más Planificala Cómo Si Jamás Fueras a Irte ;).-

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,141
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: email Inactive Users
« Reply #57 on: July 15, 2014, 08:12:31 AM »
Nice mod and thanks for the update, good new feature :)
Unless
dunno/don't really care.
this is not really cool to say IMHO ;)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE

Offline Suki

  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,259
  • Kaizoku Jotei
Re: email Inactive Users
« Reply #58 on: July 15, 2014, 08:23:50 AM »
Why?  it is the true, I couldn't remember if the was already a translation or not. Didn't bother to look for it either.

If you're not aware already, I made my own translations, evey single of my 30-ish mods I ever made or kept updated from other authors. So yes, I am entitle to dismiss my own work if I want it to.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,141
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: email Inactive Users
« Reply #59 on: July 15, 2014, 08:32:05 AM »
Sure you do and sure you can (and sure I know) but, like I said, IMHO if you support a work of yours in public and you yourself claim "don't really care" then you are not very much "encouraging" it :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.
♥ Jess ♥

STOP EDITING MY PROFILE