• Welcome to Simple Machines Community Forum. Please login or sign up.
November 27, 2021, 03:04:57 AM

News:

SMF 2.0.18 has been released! Please update. Read more.


email Inactive Users

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

Previous topic - Next topic

Suki

The log you sent is telling theres a duplicated function in the ScheduledTasks.php file but there isn't in the file you attached.

You need to attach the real file you are using or at least tell me if you did something else since you attached it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

petewadey

I realize there is a duplicate file, and I'm trying with the help of my host to remove all traces and install a fresh copy. If this fails, I will probably give up, as it's beyond my capability to sort this. Shame because I would really like to run this mod.
Anyway, I'll try one more time from scratch.
I will let you know how I get on.
Pete

aegersz

Hi, i'm still experiencing inconsistencies with this mod - it worked fine ages when my member base was smaller but now it's producing less emails.

what do you suggest is best to debug it without producing emails etc. ?

i don't really want to commit to queuing up real emails to send, i don't know if it is possible to just echo the candidate members name out somewhere, a temp table maybe ?

thoughts on getting it to do a "dry" run before the real one ?

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Suki

You can copy all the logic inside the scheduled task into a separate file, include all the files the scheduled task calls and replace the actual query to delete members with a var_dump() of the array that holds the ids or do a query with those ids to the memebrs table to get their names
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

aegersz

excellent. i didn't know where to start but have used var_dump() to debug in the past.

it's on my "to do" list.

thanks Suki !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

@rjen

I am considering to use this MOD.

There is one thing I cannot figure out though: I want to sent the reminders to all 'Regular members' , ie the ones that are NOT part of any membergroup.
Can that be done? And if so, how?

Thanks in advance...
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

Suki

June 10, 2018, 03:40:18 PM #226 Last Edit: June 10, 2018, 04:20:01 PM by Suki
No, you need to specifically select the user groups you want to target, the mod was designed like that from the beginning.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

@rjen

June 10, 2018, 03:51:53 PM #227 Last Edit: June 10, 2018, 04:23:22 PM by @rjen
That's too bad : I specifically want to to target the users NOT in a usergroup...

well actually in the group 'Regular Members'  which is not in the picklist of the mod...
Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

aegersz

September 08, 2018, 11:50:00 AM #228 Last Edit: September 08, 2018, 12:06:40 PM by aegersz
FYI, I wrote a (suitable for VPS users) quick-and-dirty batch version of the emailer as it may handy and/or of interest to somebody:

<?php
$servername 
"localhost";
$username "?";
$password "?";
$dbname "?;
$tbpref = "?_";

// SET THESE TOO !
$days_not_logged_in = 365;
$do_email = 0;
// ---------

$connect = new mysqli($servername$username$password$dbname);
if (
$connect->connect_error) {
        die("
Connection failed" . $connect->connect_error);
}

$sql = "SELECT FROM" . " " . $tbpref . "members ORDER BY last_login";

$result = $connect->query($sql);

if (
$result->num_rows > 0) {
        while(
$row = $result->fetch_assoc()) {
                if (!empty(
$row["last_login"])) {
                        
$dateSin =  $row["last_login"];
                        
$current_date = date("U") /* to have it in microseconds */;
                        
$your_month = date("m", $dateSin);
                        
$your_day =  date("d", $dateSin);
                        
$your_year =  date("Y", $dateSin);
                        
$selected_date_stamp = mktime(0,0,0,$your_month,$your_day,$your_year);
                        
$selected_date = date("U",$selected_date_stamp);
                        
$difference = round (($current_date - $selected_date)/(3600*24));
                        if (
$difference >= $days_not_logged_in) {
                                echo 
$row["member_name"] . " " . $row["email_address"] . " " . "posts=" . $row["posts"] . " ";
                                echo "
Last logged in" . " " . $difference . " " . "days ago" . PHP_EOL;
                                
$to_member =  $row["member_name"];
                                
$from_name = "SMF Administrator";
                                
$from_email = "smfadmin@site-name";
                                
$headers = "From$from_name <$from_email>";
                                
$body = "Dear $to_member, \n
We miss you 
as you have not logged in to https://site-name for over $difference days. \n
Your membership is safe however you may be deleted from the forum some time in the future if you remain inactive.
Of course you will be given ample warning should that be the case. \n
Come 
and visit us if you are bored :-) \n
Regards
, \n
Server Admin
";
                                
$subject = "Regarding your last login to site_name";
                                
$to_email = $row["email_address"];
                                if (
$do_email) {
                                        if (mail(
$to_email$subject$body$headers)) {
                                                echo "
(email sent)" . " ";
                                        } else {
                                                echo "
(email failed)" . " ";
                                        }
                                }
                        }
                }
        }
} else {
        echo "
0 results";
}

$connect->close();
?>

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

aegersz

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Sir Osis of Liver

Getting this error on messy forum -


http://www.forum.com/index.php?action=admin;area=eiu;sa=general2
2: in_array() expects parameter 2 to be array, boolean given
File: /home/forum/public_html/Themes/default/Admin.template.php
Line: 909

"The best laid schemes o' mice an' men / Gang aft a-gley." - Robert Burns

Suki

What SMF version are you using? I recall there was a bug with adding a select option, upgrade to the latest available SMF version or just set an option and save.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

SMiFFER


3 years later, how about now?  :laugh:

Quote from: SMiFFER on October 13, 2016, 04:26:27 PM
Nice mod.

Question:
Could you include a function to remind/auto-purge members that have not posted since x days ?
At least these 16 (getting more???)steps must be completed for SMF2.1 Final.
Last Full Version: 2.0 Final released more than 10 years ago on 20110604

QUOTE OF Aleksi "Lex" Kilpinen: "That version is old enough to go to school itself."
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Suki

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

Making tough decisions, so you don't have to.

acmirapt

I've downloaded this plugin in Monday, and i've been planning to run it to clean a User Database with lots of users since 2005  :-X

But i have a question. This will delete only users or users and his posts and content? Or it will put the users replys and topics as Visitor state?

Thanks!  8)

Suki

Hi, welcome to SMF.

This mod follows SMF's deletion process (as of SMF 2.0.15), meaning their posts won't be deleted but marked as "guest post" or visitor state as you call it.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

acmirapt

I've all the settings done, the emails are sent yesterday at 1AM.

Now, in the plugin Users List i dont have any List. It only says
"There aren't any users marked for potential deletion"

Why this happen? I've checked the DB and smf_members table and there are some users with 1 in user deletion column.

Can you help? Its possible to do List and delete in another Way?? I dont want to send another email to users, because some of them Will report that as spam and other mais are returned (maybe there's no email account anymore)

Thanks for your help.

Suki

The mod does the deletion in two steps, first it sends an email to those users that hasn't been logged since X days, then some more time passes, the "grace period" where users can indeed log in and they will no longer be counted for deletion.

Only those users who who received the mail and still hasn't logged in will be counted towards deletion.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Making tough decisions, so you don't have to.

acmirapt

Thanks for your help Suki. So after the grace period that i've selected in the settings the users to listed for deletion / inactive will appear in the list.

Thanks again!  8)

Chas Large

Hi Suki,

Hope you are well.

I have 210 members who have never posted since they signed up over a year ago and I want to try and either encourage them back into using the forum or delete them.

Have just installed this mod and like others before, am having a few issues.

Running SMF 2.0.18. Installed OK, set the settings to:

How many days since their last log in to receive the email. = 365
How many days since the user was marked for deletion = 15
Minimum posts made = 0

Run the mod and get the "There aren't any users that match the criteria" message in the list.

Created the test PHP file you give here: https://www.simplemachines.org/community/index.php?topic=521464.msg3808007#msg3808007

with the same result.

Change the How many days since their last log in to receive the email. to 300 and I get 13 results with the test file.

Reducing this number again gives more results.

I'm wondering if I have misunderstood the "How many days since their last log in to receive the email" setting? An Admin search uses the date of the last login to give my list based on zero posts, does your mod do the same or has it got a limit in the number of days you can enter here?

I can get the most numbers in the test by entering 0 days but this only results in 47 members potentially being targeted.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Advertisement: