Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 09-09-2005, 08:34 PM
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Posts: 645
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian
Samir, do you just want it to email users after being inactive for X ammount of days?

I wrote this up pretty quickly, so let me know how it works.
Add it to your scheduled tasks, and only have it run once a day.
PHP Code:
<?php

// #############################################################################
// Email Inactive Users
// #############################################################################

error_reporting(E_ALL & ~E_NOTICE);

// Ensure Connection
if (!is_object($DB_site))
{
    exit;
}

$days 30;
$time time();
$xdaysago $time - ((86400 * ($days 1));
$ydaysago $time - (86400 $days);  

$users $DB_site->query("
    SELECT userid, username, lastactivity, email
    FROM " 
TABLE_PREFIX "user
    WHERE lastactivity < " 
$xdaysago " AND lastactivity > " $ydaysago "
"
);

while (
$user $DB_site->fetch_array($users))
{
    
$message 'Hello ' $user['username'] . ', ';
    
$message .= "We have noticed that you havn't visited our board in over " $days " days.\n";
    
$message .= "You may ignore this email, consider it a friendly reminder that you have ";
    
$message .= "registered at our board.\n";
    
$message .= "Thank you,\n";
    
$message .= $vboptions['bbtitle'] . "\n";
    
$message .= $vboptions['homeurl'];
    
    
vbmail($user['email'], 'Inactivity Notice'$messagetrue);
    echo 
"Inactivity email successfully sent to  " $user['username'] . ".<br />";
}



?>
Wow, I didn't expect so quick a reply! Too bad I'm in the middle of changing hosts, and it's a nightmare. My site's down because I have to keep it closed to keep email stuff straight. You might as well release this as a hack. I'm sure others will want to use it.
Reply With Quote
  #12  
Old 09-09-2005, 10:46 PM
o0Hubba0o's Avatar
o0Hubba0o o0Hubba0o is offline
 
Join Date: Mar 2005
Location: Minnesota
Posts: 263
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Thug
i did this i ran it worked fine but only emailed abt 8ppl and the ppl it mailed r active anway
how do i get it to email all those who havent been active for 1day since there last post
Who haven't been active for 1 day! Man what a pushy admin! Heh j/k with you, but it is an extremely short time lol.


Thanks for asking for this hack though, this will come in very handy, and thanks for making one up for him too.


Also scroll back up to "Fallens" post, there's still that extra "(" in the script.
Reply With Quote
  #13  
Old 09-22-2005, 11:24 PM
Thug Thug is offline
 
Join Date: Feb 2004
Location: Sheffield : uk
Posts: 783
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

mine neva shows in task log,how do i no if its working
Reply With Quote
  #14  
Old 11-20-2005, 05:36 PM
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Posts: 645
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be ported to 3.5 or is there already one available? I'm looking to add newer hacks to 3.5 since they'd all be plug-ins, but I'm still waiting for all my currently used hacks to go to 3.5.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03651 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete