TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,055
  • Total Topics: 21,337
  • Online today: 194
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 173
  • Total: 173

Mail scripting possible ?

Started by Marcel, February 06, 2007, 09:04:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marcel

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


JPDeni

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.

Marcel

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.

;)


JPDeni

You would have to give a whole lot more information about what you want before someone could write a script.

Marcel

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

:)


knat

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

Marcel

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

JPDeni

#7
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.';

Marcel

Wow that's great stuff, it is working fine  :up:

Thanks a lot JPDeni, you're the best  ;D

knat

#9
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" ? :)

This website is proudly hosted on Crocweb Cloud Website Hosting.