vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Forgot I Registered Hack (https://vborg.vbsupport.ru/showthread.php?t=95072)

SamirDarji 08-25-2005 07:30 PM

Forgot I Registered Hack
 
We all have numerous forums we've all registered on. But how many do we actually visit? How many have we forgotten about? Not that they weren't good, but we just never had anything to post at the time. Could your forum be forgotten?

How about a hack that emails users that haven't visited in X number of days a default email that could be changed. I've searched for something like this, but mainly all I found was the auto-prune users hacks. I think a lot of those users just forgot they registered.

Andreas 08-25-2005 07:39 PM

I've released a Hack for vBulletin 3.5 that does that (although it was originally meant to prune inactive Users).
But you can use it just as a reminder too if you set the time between notification and deletion very high (eg. won't ever happen).

Thug 08-25-2005 07:41 PM

anything like this for
3.0.7

G0F0RBR0KE 08-26-2005 12:23 AM

Yea, is there a version for 3.0.0 and up

SamirDarji 08-26-2005 06:58 AM

Quote:

Originally Posted by KirbyDE
I've released a Hack for vBulletin 3.5 that does that (although it was originally meant to prune inactive Users).
But you can use it just as a reminder too if you set the time between notification and deletion very high (eg. won't ever happen).

Not a bad system. As others are asking, how hard would it be to port it to vb3? What about just porting the part that does the reminder email rather than the whole pruning thing?

Adrian Schneider 08-26-2005 06:59 AM

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 />";
}



?>


Thug 08-26-2005 09:50 PM

i got this error on that
PHP Code:


Parse error
parse errorunexpected ';' in /home/ohtwadi/public_html/forum/includes/cron/reminder.php on line 18 

what do i add for this
PHP Code:

line 18

$time 
time(); 

also how do i make it email users who have been inactive for 10days and how do i set it to run once a day

Adrian Schneider 08-26-2005 11:25 PM

I fixed the script above.
change the $xdaysago = and $ydaysago = lines to:
PHP Code:

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

to change the days before emailing them, change this line
PHP Code:

$days 30

Call it something like cron_emailinactiveusers.php and place it in ./includes/cron/, then under scheduled tasks add the file.

Fallback 08-27-2005 12:48 PM

Quote:

Originally Posted by SirAdrian
I fixed the script above.
change the $xdaysago = and $ydaysago = lines to:
PHP Code:

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



I actually had to change that to the following... to get it to work...

PHP Code:

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


Thug 08-29-2005 11:56 AM

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


All times are GMT. The time now is 12:45 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.01504 seconds
  • Memory Usage 1,763KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete