Advertisement:

Author Topic: email Inactive Users  (Read 54102 times)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #80 on: November 03, 2014, 07:58:39 PM »
It looks like you're not really running 5.4

Create a test file with phpinfo() on it to know what version you are using.

If the second part works then you are using something below php 5.3.

There is no particular reason as to why I used a closure and thus forcing php 5.3, it makes life easier for me thats all.  I provided the fallback code because it was easy to provide it.
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 dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: email Inactive Users
« Reply #81 on: November 03, 2014, 08:05:58 PM »
Huh....  I'm sorry....  I shoulda thought about doing that before I posted.   phpinfo says that my server is running PHP 5.2.17, NOT 5.4.somethingorother.....  I'm gonna have to talk to my server company about that cause that's just screwed up....  Thank you for helping me figure this one out!

Offline Shkic

  • Semi-Newbie
  • *
  • Posts: 44
Re: email Inactive Users
« Reply #82 on: December 04, 2014, 07:17:44 AM »
Firstly I want to thank you for the mod :)

I'm also have PHP 5.2.17 so I understand, that basically we need PHP 5.3 for this:

Code: [Select]
// We gotta do a nasty thing here, we have to format a "FIND_IN_SET" for each selected group. Thanks to this we need PHP 5.3 or grater...
if (!empty($inGroups))
$additionalgroups = array_map(
function($k) {
return ' OR FIND_IN_SET('. $k .', additional_groups)';
}, $inGroups);

? Then why you include a quoted code for those who don't have 5.3?

   
Code: [Select]
// For those who still want to use this but don't have php 5.3
/* if (!empty($inGroups))
foreach ($inGroups as $k)
$additionalgroups[] = ' OR FIND_IN_SET('. $k .', additional_groups)'; */

I guess mod will fully work if I replace the first code with second one? I'm right? :)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #83 on: December 04, 2014, 08:44:20 AM »
Because it was an easy fix to include.

This particular mod didn't really needed php 5.3 but I made it so because it is easier for me to maintain it.

Yes, the mod will fully work if you uncomment that line and comment the other one.
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: 71,846
    • StoryBB/StoryBB on GitHub
Re: email Inactive Users
« Reply #84 on: December 04, 2014, 11:52:10 AM »
PHP 5.2.x is insecure, please advise your host of this.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline TonyG

  • Semi-Newbie
  • *
  • Posts: 94
Re: email Inactive Users
« Reply #85 on: December 25, 2014, 11:35:14 PM »
Greetings. I just  loaded SMF 2.0.9 and v1.1 of this mod, and I'm looking forward to booting deadbeat members. Thanks! LOL!

I have a number of these in this new installation.

Quote
http://.../index.php?scheduled=task;ts=1419379200
Database error, given array of integer values is empty. (groups)
Function: scheduled_emailInactiveUsers
File: /home/.../forum/Sources/ScheduledTasks.php
Line: 1730

There are only two users registered, my admin user and one test member.
The mod is enabled but no, I have not set any groups. I was thinking that if none were set then the default might have been that the selection applied to all groups. So I'm setting a number of groups and will post back here if this error persists.
I think a code change was made for this back in June but since I just downloaded the package and I get this error, this is half an inquiry as to whether I should do something else, and half an FYI that the issue persists in the current release.

Thanks.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #86 on: December 26, 2014, 10:10:25 AM »
Yes, it is a known issue, a logic one, will see if I have some time today to push a fix for it.
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 Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #87 on: December 26, 2014, 12:37:07 PM »
OK, new version 1.1.1

The green button is a "ready to install" package.

Also updated the download here.


To upgrade just uninstall the old version and install the new one via the package manager.
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 TonyG

  • Semi-Newbie
  • *
  • Posts: 94
Re: email Inactive Users
« Reply #88 on: December 26, 2014, 04:42:03 PM »
Thanks! I'll update, remove the groups to assume "all", and let you know if any more errors are logged.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #89 on: December 26, 2014, 04:54:52 PM »
Well, you need to select the groups you specifically want the mod to be applied to, if you don't select any, then the mod will simply not do anything.

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 TonyG

  • Semi-Newbie
  • *
  • Posts: 94
Re: email Inactive Users
« Reply #90 on: December 26, 2014, 06:29:27 PM »
That's fine, I'm just checking to see if it'll report errors. I have a new board, no live members yet. It'll be a while before we can flag any of them as being inactive.

Offline phpshiva

  • Semi-Newbie
  • *
  • Posts: 70
  • Gender: Female
    • Aquababe
Re: email Inactive Users
« Reply #91 on: January 11, 2015, 06:31:55 AM »
I got errors when code is at bottom from scheludetask as mebers ask for forgotton password
i put it in just a bit up and i see no errors now

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #92 on: January 11, 2015, 10:18:54 AM »
Without knowing which errors you got it is impossible to help you...
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 ben sisko

  • Semi-Newbie
  • *
  • Posts: 65
Re: email Inactive Users
« Reply #93 on: January 15, 2015, 07:41:52 AM »
hello,

i'm getting this error when trying to reinstall the mod after the upgrade from 2.0.8 to 2.0.9:
Code: [Select]
Duplicate entry 'emailInactiveUsers' for key 'task'
File: /home/xxx/public_html/Packages/temp/install.php
Line: 86

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: email Inactive Users
« Reply #94 on: January 15, 2015, 09:19:01 AM »
The scheduled task wasn't removed at uninstall. You need to go to phpmyadmin, SMF database, table smf_scheduled_tasks, then find and remove the row that has the column "task" = emailInactiveUsers
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline petewadey

  • Jr. Member
  • **
  • Posts: 155
Re: email Inactive Users
« Reply #95 on: March 03, 2015, 10:55:03 AM »
Hi Suki,
Thanks for a great mod.
I've just installed and I'm a bit confused as how to select a user group from the ones listed. Am I missing the point somewhere? Is see a drop down list but no way of selecting from it?
Also, Is there a way of choosing old members that have never logged on to be sent the mail?
Thanks,
Pete

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #96 on: March 03, 2015, 01:54:57 PM »
You just need to click on the selected group and save the changes.

As for selecting old members you just need to specify how many days had passed since their last log in, the mod checks the register date too so even if they haven't logged in the mod should catch those users too.
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 petewadey

  • Jr. Member
  • **
  • Posts: 155
Re: email Inactive Users
« Reply #97 on: April 14, 2015, 07:18:32 PM »
Thanks,
I have now mistakenly  marked some users as being safe from deletion. Is there a way of reversing that?
Thanks.
Pete
BTW Great Mod :-)

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,558
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: email Inactive Users
« Reply #98 on: April 15, 2015, 12:56:33 PM »
How many users did you marked?  do you know the IDs of those users?

Are you familiar with php?  if so this is the query that deals with changing the user status, just replace the 4 with 0

Code: [Select]
$request = $smcFunc['db_query']('', '
UPDATE {db_prefix}members
SET to_delete = {int:toDelete}, inactive_mail = 0
WHERE id_member IN ({array_int:users})',
array(
'toDelete' => 4,
'users' => $usersToProtect,
)
);


$usersToProtect is an array of user IDs you want to change.
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 petewadey

  • Jr. Member
  • **
  • Posts: 155
Re: email Inactive Users
« Reply #99 on: April 15, 2015, 01:16:38 PM »
I marked 6 users as safe from deletion and know their usernames. If the only way to unmark them is to change the php, would uninstalling the programe and re installing it work? as I'm not confident enough to  alter php.
Thanks
Pete