vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Email Activate Code (https://vborg.vbsupport.ru/showthread.php?t=15195)

Kier 04-24-2001 10:00 PM

This tiny hack is in response to a request from Sharg - I would put it into the 2.0 code, but understandably, John doesn't want to make any further modifications to the code unless they are absolutely necessary.

It allows you to use the admin email function to send an email which will remind users in the 'Users awaiting bla bla bla' group of the link for their activation code.

In admin/email.php, find this code:
Code:

  $users=$DB_site->query("SELECT userid,username,password,email FROM user WHERE $condition AND userid>='$startat' AND userid<'$finishat' AND adminemail=1 ORDER BY userid DESC");
  while ($user=$DB_site->fetch_array($users)) {

    $userid=$user[userid];
    $sendmessage=$message;
    $sendmessage=str_replace("\$email",$user[email],$sendmessage);
    $sendmessage=str_replace("\$username",$user[username],$sendmessage);
    $sendmessage=str_replace("\$password",$user[password],$sendmessage);

    mail($user[email],$subject,$sendmessage,"From: $from");

and replace it with this:
Code:

  $users=$DB_site->query("SELECT userid,username,password,email,joindate FROM user WHERE $condition AND userid>='$startat' AND userid<'$finishat' AND adminemail=1 ORDER BY userid DESC");
  while ($user=$DB_site->fetch_array($users)) {

    $userid=$user[userid];
    $sendmessage=$message;
    $sendmessage=str_replace("\$email",$user[email],$sendmessage);
    $sendmessage=str_replace("\$username",$user[username],$sendmessage);
    $sendmessage=str_replace("\$password",$user[password],$sendmessage);
   
        $sendmessage=str_replace("\$userid",$user[userid],$sendmessage);
        $sendmessage=str_replace("\$activateid",$user[joindate],$sendmessage);
        $sendmessage=str_replace("\$bburl",$bburl,$sendmessage);
       


    mail($user[email],$subject,$sendmessage,"From: $from");

The variables $userid and $activateid are now available for you in the mail message, allowing you to construct the link to the activation page like this:

$bburl/register.php?a=act&u=$userid&i=$activateid

Sharg 04-25-2001 10:43 PM

Yeeepiiiii !!!!
Thanks Kier !! Thanks alot !
I got 200 users in the user waiting group i'll send them the activation code now so i'm sure I will have more increased real subscribtion than ever before !!

(So much easier for them just to click on a link to activate their account on a reminder Email) .

Well, I hope this is going to make it in the official next release.

Kier 04-25-2001 11:32 PM

I'll make sure it's in 2.1... or something nicer. ;)

RobAC 04-26-2001 12:03 AM

Kier,

Thanks, this will definitely come in handy.

Joshs 04-28-2001 05:27 PM

What exactly does this do?

SteveK 05-31-2001 04:55 PM

You may also want to add this to remind you of the new variables that are available.

find this:
PHP Code:

  maketextareacode("Message:<p><font size='1'>In the message, you may use \$username, \$password and \$email.</font></p>","message","",10,40); 

and replace with this:
PHP Code:

  maketextareacode("Message:<p><font size='1'>In the message, you may use \$userid, \$activateid, \$username, \$password and \$email.</font></p>","message","",10,40); 

SteveK

Black Tiger 06-02-2001 02:06 PM

I've got a little problem with this one in VB2.0 final.

I made changes to email.php like Kier said.
Now I use the option "email users" in the control panel.

I write the email, then I've got to select who to send to and I select "users awaiting email confirmation" (we've got 82 of them).

After submitting I see:
userid:
done

But no mail is send, even not when I select the option to mail users in this usergroup which post is <1 nothing is send.
In vb1.16 if I selected only a usergroup, an email was send to the entire group.

1.) Am I doing something wrong or forgetting something?
2.) What does the "joindate" added in the first line exactly do?
Please help.

p.s. It seems it only works if I send an email to the usergroup "administrators", then I see the userid's, on any other group I see no id's flying over my screen.

Black Tiger 06-03-2001 11:42 PM

Nobody any idea?

Raptor 06-25-2001 06:53 PM

this works fantastic on vb 2.01

we have over 3970 members on the awaiting confirmation list because our sendmail function corrupted and they've just been sitting there doing nothing

this should sort that out :)

thanks again

Byron 07-24-2001 05:46 PM

Thank you so much Kier.

I have 265 members waiting for confirmation.
Can't imagine doing it one by one.

Thanks a lot.

Hope this feature will be in the next vb version.

Byron 07-24-2001 05:53 PM

Found a something/bug

I use the original template which contains $contactaddress and $bbtitle in my mail to members but the two variable didn't work

"If you are still having problems signing up please contact a member of our support staff at $contactaddress

Thanks very much,
$bbtitle team"

Kier 07-27-2001 10:54 PM

Quote:

Originally posted by Byron
Found a something/bug

I use the original template which contains $contactaddress and $bbtitle in my mail to members but the two variable didn't work

"If you are still having problems signing up please contact a member of our support staff at $contactaddress

Thanks very much,
$bbtitle team"

I'm not sure where you've got $bbtitle and $contactaddress from - the only variables available are $email, $password, $username, $userid,$activateid and $bburl...

In any case, this hack is now included by default in vB 2.0.2 (along with $bbtitle ;))


All times are GMT. The time now is 06:01 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.01061 seconds
  • Memory Usage 1,745KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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