View Single Post
  #123  
Old 12-21-2004, 01:25 PM
sv1cec sv1cec is offline
 
Join Date: May 2004
Location: Athens, Greece
Posts: 2,091
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by qhoa
but it is not clearn the member has none active after 10 days from reg date
you have any idea
i tried to run manual (by click run now button)
and i got this message
Manage Activation

Done

that's all
i check my member list they still there
sorry guy i really don't know what wrong with it
Here is my slightly modified version of the manageactivation.php file. The difference is that at the end, the script sends you a consolidated report, on its actions. To whom it send a message, and for which period (3-days, 5-days, 8 days, or who were deleted).

Maybe you find it useful.

Rgds

PHP Code:
<?php
// version 2.3a updated instructions urghh


// ## Error Reporting ( we use error reporting in php so we can control the display of error messages
// ## we will use this because all vBulletin files follow the same error reporting rules) ##
error_reporting(E_ALL & ~E_NOTICE);

// ## this action here cache's the templates so that everytime their needed a querry wont be needed to run
// ## the names in there are just the template names :), there must be a comma after everyone but the last ##

//$globaltemplates = array(
//    'ActivationEmail_v2_Subject',
//    'ActivationEmail_v2_Message3',
//    'ActivationEmail_v2_Message5',
//    'ActivationEmail_v2_Message8',
//);
//

// ## Grabs global.php this grabs vbulletins global.php so we can use the most basic of vBulletins functions ##
require_once('./global.php');

    
// Get all users who have not activated their accounts.
    
$userArray=$DB_site->query("
        SELECT username,user.userid,email,joindate,activationid 
        FROM user
        LEFT JOIN useractivation ON (user.userid=useractivation.userid)
        WHERE user.usergroupid=3 AND user.posts = 0 
    "
);

    while (
$user=$DB_site->fetch_array($userArray))
    {
        
// make random number
            
if (empty($user['activationid']))
            { 
//none exists so create one
                    
$user['activationid'] = vbrand(0100000000);
                    
$DB_site->query("
                            INSERT INTO " 
TABLE_PREFIX "useractivation
                            VALUES
                            (NULL , 
$user[userid], " TIMENOW ", $user[activationid], 0, 2)
                    "
);
                    echo (
"ActivationID created for "$user[username]."<br>");
            }

        
// Calculate days since joining
        
$currentday time();
        
$day intval(($currentday $user[joindate])/(60*60*24));
        
$username $user[username];
        
$activateid  $user[activationid];
        
$userid $user[userid];
        
$email $user[email];
       
        
// Email users who have not activated after 3 days.
        
if ($day>AND $day<4)
        {
            eval(
"\$subject = \"".fetch_template("ActivationEmail_v2_Subject")."\";");
            eval(
"\$message = \"".fetch_template("ActivationEmail_v2_Message3")."\";");
            
mail ($email,$subject,$message,"From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            
$threedayemail['$userid'] = "$username (UID: $userid), e-mail address: $email, Activation Code: $activateid";
        }
        
// Email users who have not activated after 5 days.
        
elseif ($day>AND $day<6)
        {
            eval(
"\$subject = \"".fetch_template("ActivationEmail_v2_Subject")."\";");
            eval(
"\$message = \"".fetch_template("ActivationEmail_v2_Message5")."\";");
            
mail ($email,$subject,$message,"From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            
$fivedayemail['$userid'] = "$username (UID: $userid), e-mail address: $email, Activation Code: $activateid";

        }
        
// Email users who have not activated after 8 days.
        
elseif ($day>AND $day<9)
        {
            eval(
"\$subject = \"".fetch_template("ActivationEmail_v2_Subject")."\";");
            eval(
"\$message = \"".fetch_template("ActivationEmail_v2_Message8")."\";");
            
mail ($email,$subject,$message,"From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            
$eightdayemail['$userid'] = "$username (UID: $userid), e-mail address: $email, Activation Code: $activateid";
        }
        
// Delete users.
        
elseif ($day>10)
        {
            
$DB_site->query("UPDATE post SET username='".addslashes($username)."',userid=0 WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM user WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM userfield WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM usertextfield WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM access WHERE userid='$userid'");
//            $DB_site->query("DELETE FROM calendar_events WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM customavatar WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM moderator WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM pm WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM subscribeforum WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM subscribethread WHERE userid='$userid'");
            
$DB_site->query("DELETE FROM session WHERE userid='$userid'");
            eval(
"\$subject = \"".fetch_template("ActivationEmail_v2_DeletedSubject")."\";");
            eval(
"\$message = \"".fetch_template("ActivationEmail_v2_DeletedMessage")."\";");
            
mail ($email,$subject,$message,"From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");
            
$deletedusers['$userid'] = "$username (UID: $userid), e-mail address: $email, Activation Code: $activateid";
        }
}
if (
$threedayemail!='')
{
$threeday implode("\n "$threedayemail);
}
if (
$fivedayemail!='')
{
$fiveday implode("\n "$fivedayemail);
}
if (
$eightdayemail!='')
{
$eightday implode("\n "$eightdayemail);
}
if (
$deletedusers!='')
{
$deleted implode("\n "$deletedusers);
}

if (!
$threeday)
    {
        
$threeday "None";
    }

    if (!
$fiveday)
    {
        
$fiveday "None";
    }

    if (!
$eightday)
    {
        
$eightday "None";
    }            

    if (!
$deleted)
    {
        
$deleted "No one was deleted";
    }

$date vbdate $vboptions['dateformat'], TIMENOW ) ;
$time vbdate $vboptions['timeformat'], TIMENOW ) ;
    
$logmessage "Activation Reminder Script run on $date at $time. \n \n 3 Day Reminder Sent To: \n $threeday \n \n 5 Day Reminder Sent To: \n $fiveday \n \n 8 Day Reminder Sent To: \n $eightday \n \n Deleted Users: \n $deleted";

mail ($vboptions[webmasteremail],"Activation Reminder Report (Activation Notification)",$logmessage,"From: \"$vboptions[bbtitle] Mailer\" <$vboptions[webmasteremail]>");

log_cron_action($logmessage$nextitem);
    
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01271 seconds
  • Memory Usage 1,888KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete