TinyPortal

Development => Feedback => Topic started by: Marcel on February 06, 2007, 09:04:03 PM

Title: Mail scripting possible ?
Post by: Marcel on February 06, 2007, 09:04:03 PM
Hi,

Is it possible to generate automatic mail to all members whom are not online for the last 30 days on a forum ?

Thanks,

Marcel

Title: Re: Mail scripting possible ?
Post by: JPDeni on February 06, 2007, 09:20:40 PM
Yes, it would probably be possible, depending on your system. You would have to have something to trigger the sending of the email, either an action by a moderator or a cron job set up to run a separate php script, but it could probably be done. Not that I would want to write the code right now, but maybe someone else would be willing to.
Title: Re: Mail scripting possible ?
Post by: Marcel on February 07, 2007, 05:48:23 PM
OK, thanks and now waiting for someone who can made some scripting

A block could also be nice, with the information, members who's longer then 28 days offline.

Just like the block with users online, but then with users not online since 28 days.

;)

Title: Re: Mail scripting possible ?
Post by: JPDeni on February 07, 2007, 06:12:04 PM
You would have to give a whole lot more information about what you want before someone could write a script.
Title: Re: Mail scripting possible ?
Post by: Marcel on February 07, 2007, 06:16:10 PM
Ok, first step I would preffer is a block in TP with the info of the users not online since 25 days or longer.

eg. user1 last online 25 days ago

I can find this info in the memberlist, but I have no idea how to script that info

:)

Title: Re: Mail scripting possible ?
Post by: knat on February 07, 2007, 07:18:44 PM
why not just send out a news letter to all members every month.. that way you also remind inactive mebers that your forum is still there waiting for them to come back.

Thats how i do it.. and i can see activity increase on my forum after each newsletter..

just an idea..   ;)

the block you want is not really a good thing to have on any board if you ask me  ::)
Title: Re: Mail scripting possible ?
Post by: Marcel on February 07, 2007, 07:47:33 PM
Why is a block not a good idea ? Permission only for admins  ;)

Yes it is possible to use the newsletter for that, but for me is it very important, I have a small private forum (less then 120 members) The reason to remember them to logon to the forum is for IPadres checking for other applications they are using from my servers  ;)
Title: Re: Mail scripting possible ?
Post by: JPDeni on February 07, 2007, 08:04:00 PM
Put this in a php block.

global $db_prefix;

$days = 25; // set the number of days here

$last = time() - ($days * 86400);
$query = db_query(
    "SELECT realName, lastLogin
     FROM {$db_prefix}members
     WHERE lastLogin < $last
     AND lastLogin > 0
     ORDER BY realName", __FILE__, __LINE__);
if(db_affected_rows() != 0)
{
  echo 'Members missing for at least ',$days,' days:<br />';
  while ($row = mysql_fetch_assoc($query))
  {
    echo $row['realName'] , ' last online ';
    echo floor((time() - $row['lastLogin'])/86400);
    echo ' days ago<br />';
  }
}
else
  echo 'All members have been here in the past ',$days,' days.';
Title: Re: Mail scripting possible ?
Post by: Marcel on February 07, 2007, 08:17:39 PM
Wow that's great stuff, it is working fine  :up:

Thanks a lot JPDeni, you're the best  ;D
Title: Re: Mail scripting possible ?
Post by: knat on February 07, 2007, 08:21:42 PM
Quote from: Marcel on February 07, 2007, 07:47:33 PM
Why is a block not a good idea ? Permission only for admins  ;)

Yes it is possible to use the newsletter for that, but for me is it very important, I have a small private forum (less then 120 members) The reason to remember them to logon to the forum is for IPadres checking for other applications they are using from my servers  ;)

ok then it makes perfectly sense to me :D

if i put that block on my forum it would be very loooooong lol

Maybe change the topics title to "Show inactive members block" ? :)