vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Un-Activated User Management (https://vborg.vbsupport.ru/showthread.php?t=65845)

sabret00the 12-21-2004 12:59 PM

tbh you've just lost me, what does it say in your scheduled tasks log?

sv1cec 12-21-2004 01:25 PM

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


qhoa 12-21-2004 02:15 PM

thanks sv1cec
i'll try it and hope it solve my problem
again thanks

qhoa 12-21-2004 02:16 PM

Quote:

Originally Posted by sabret00the
tbh you've just lost me, what does it say in your scheduled tasks log?

it said

manageActivation Complete; 3 Day Reminder Sent To: None. 5 Day Reminder Sent To: None. 8 Day Reminder Sent To: None. Users Deleted: No one was deleted.

nubian 12-25-2004 10:26 PM

what is the significant difference between 2.3b and 2.4?
is it only the manageActivation.php?

sabret00the 12-26-2004 07:23 AM

Quote:

Originally Posted by nubian
what is the significant difference between 2.3b and 2.4?
is it only the manageActivation.php?

yup that's the only thing that'll change.

T3MEDIA 12-26-2004 11:54 AM

Quote:

Originally Posted by sabret00the
depends on what your board is trying to do with them users, but it's mostly taking up space it don't need to be.

i saw a post by someone the other day that said they had 200 members unconfirmed, to think something like this could've seduced em into completing their registration.

1200 unconfirmed users on my site. 12,000 total. site been up 2 months. so I think this is a good idea.

T3MEDIA 12-26-2004 07:59 PM

Shy about 2,000 users and I got this error.

Quote:

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT postid, thread.title, post.dateline , IF(thread.views=0, thread.replycount+1, thread.views) as views, thread.replycount, thread.votenum, thread.votetotal

FROM myvb3_post AS post
INNER JOIN myvb3_thread AS thread ON(thread.threadid = post.threadid)
LEFT JOIN myvb3_deletionlog AS delthread ON(delthread.primaryid = post.threadid AND delthread.type = 'thread')
LEFT JOIN myvb3_deletionlog AS delpost ON(delpost.primaryid = post.postid AND delpost.type = 'post')
WHERE (postid IN(151, 152, 167, 177, 182, 191, 196, 202, 206, 207, 208, 215, 216, 217, 218, 226, 229, 234, 239, 240, 242, 340, 342, 403, 472, 473, 477, 1488, 1490, 1908, 1910, 1917, 2200, 3048, 3140) OR postid IN()) AND post.dateline > 1104093229 AND thread.replycount >= 1
AND delthread.primaryid IS NULL
AND delpost.primaryid IS NULL
AND post.visible = 1


mysql error: You have an error in your SQL syntax near ')) AND post.dateline > 1104093229 AND thread.replycount >= 1
AND delthread.pr' at line 8

mysql error number: 1064
and I got this in email.

Quote:

Activation Reminder Script run on 12-26-2004 at 04:26 PM.

3 Day Reminder Sent To:
None

5 Day Reminder Sent To:
None

8 Day Reminder Sent To:
None

Deleted Users:
No one was deleted
I used the php version that was in the fourm here that had a more detailed output.

Please and thank you.

sabret00the 12-26-2004 08:09 PM

Quote:

Originally Posted by T3MEDIA
Shy about 2,000 users and I got this error.



and I got this in email.



I used the php version that was in the fourm here that had a more detailed output.

Please and thank you.

i can't see that query in neither sv1vec's nor my version, i suggest downloading the stock version and checking the instructions.

also that should delete atleast around 1800 of your 2000 unconfirmed members (just a guess but i'm guessing their more than 10 days old.)

T3MEDIA 12-26-2004 08:21 PM

so this error from what you see here deleted something or what? I have no idea if you ask me. Somebody got delted. can you upload your version as an attachment? thanks.


All times are GMT. The time now is 10:02 AM.

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.01354 seconds
  • Memory Usage 1,837KB
  • 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
  • (1)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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