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

SamirDarji 09-09-2005 08:34 PM

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.

o0Hubba0o 09-09-2005 10:46 PM

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.

Thug 09-22-2005 11:24 PM

mine neva shows in task log,how do i no if its working

SamirDarji 11-20-2005 05:36 PM

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. :(


All times are GMT. The time now is 09:35 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.01306 seconds
  • Memory Usage 1,786KB
  • 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
  • (8)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete