News:

Wondering if this will always be free?  See why free is better.

Main Menu

email Inactive Users

Started by Suki, April 19, 2014, 02:00:47 PM

Previous topic - Next topic

Suki

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.

dougiefresh

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!

Shkic

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:

// 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?

   // 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? :)

Suki

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.

Arantor

PHP 5.2.x is insecure, please advise your host of this.

TonyG

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.

Quotehttp://.../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.

Suki

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.

Suki

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.

TonyG

Thanks! I'll update, remove the groups to assume "all", and let you know if any more errors are logged.

Suki

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.

TonyG

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.

phpshiva

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

Suki

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.

ben sisko

hello,

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

margarett

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

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

petewadey

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

Suki

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.

petewadey

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 :-)

Suki

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

$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.

petewadey

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

Advertisement: