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)
-   -   [Release vb2.0] Send random password instead of activation code (https://vborg.vbsupport.ru/showthread.php?t=15987)

Remi 05-09-2001 12:17 PM

bira

Thank you very very much

It was a dream to have this hack :D

I have RC1 and it is working wounderfull

bira 05-09-2001 12:30 PM

Glad to have helped, Remi :)

RobAC 05-09-2001 09:51 PM

This is an awesome hack as I just tested it out on my forums, but it breaks Tubedogg's automatic welcome message upon registration hack. :(

bira 05-09-2001 10:30 PM

RobAC, if you give me the URL to that hack, I'll check where they collide and how you can use them together.

RobAC 05-09-2001 10:38 PM

Bira,

Here you go. Thanks!

http://www.vbulletin.com/forum/showt...threadid=13857

bira 05-09-2001 10:49 PM

RobRAC,

I checked tubedogg's hack and there's no reason the two hacks should collide, provided you insert the code right.

Here's what you need to make sure:

If you already hacked the file register.php then the end result should be like this.

Find (in the ORIGINAL file):

Code:

  if ($verifyemail) {
    $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
    $activateid=$getjoindate[joindate];

    eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
    eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");

    mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");

  }

And CHANGE that to (my hack's addition is in red, and tubedogg's hack addition is in blue):

Code:

  if ($verifyemail) {
    if ($randpassword=="0") {
        $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
        $activateid=$getjoindate[joindate];
   
        eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
        eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
    } else {
        eval("\$message = \"".gettemplate("email_lostpw",1,0)."\";");
        eval("\$subject = \"".gettemplate("emailsubject_lostpw",1,0)."\";"); 
    }


    mail ($email,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");

  }

  // send a welcome email using email_welcome and emailsubject_welcome templates, but don't
  //  send it now if they need to activate their account
    if ($welcomeuser) {
      eval("\$message = \"".gettemplate("email_welcome",1,0)."\";");
      eval("\$subject = \"".gettemplate("emailsubject_welcome",1,0)."\";");
 
      mail($newuseremail,$subject,$message,"From: \"$bbtitle Mailer\" <$webmasteremail>");
    }
  // end send mail

That's it. The two hacks don't even "meet" at any other point :)


By the way, out of curiosity: if you are using email verification, be it with activation code or with random password, why on earth do you need a separate Welcome E-mail? Simply add your welcome message and whatever text you want to the already existing e-mail templates that are sent to the new users.

RobAC 05-09-2001 10:56 PM

Bira,

I'll double check this....actually, you've made a good point here. Thanks.

RobAC 05-09-2001 11:18 PM

Bira,

Instead of using the email_lostpw template, how can I use a different email template? I want to add in the welcome message to this template, but don't want to make that kind of addition to the lostpw template.

bira 05-09-2001 11:25 PM

Rob, create a new template (eg: email_newpw) and in my hack, wherever it mentions email_lostpw change it to your new template's name.

p.s.

But make sure that the variables from email_lostpw (the variables for the username and password at least!) also appear in your new template.

bira 05-09-2001 11:35 PM

Actually, Rob, there is only one place you need to replace email_lostpw with your new template's name, and that is in register.php.

In my hack instructions it says:

Code:

Find:

      $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
      $activateid=$getjoindate[joindate];

      eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
      eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");

REPLACE it with:

      if ($randpassword=="0") {
          $getjoindate=$DB_site->query_first("SELECT joindate FROM user WHERE userid='$userid'");
          $activateid=$getjoindate[joindate];
   
          eval("\$message = \"".gettemplate("email_activateaccount",1,0)."\";");
          eval("\$subject = \"".gettemplate("emailsubject_activateaccount",1,0)."\";");
      } else {
          eval("\$message = \"".gettemplate("email_lostpw",1,0)."\";");
          eval("\$subject = \"".gettemplate("emailsubject_lostpw",1,0)."\";"); 
      }

This refers to register.php. So, in that bit - and ONLY that bit - you will want to replace email_lostpw with your new template's name, as well as emailsubject_lostpw with a new template's name (for the subject message of your combined Welcome + Password to new user).

So, to sum this up:

1) Create two new template, say email_newpw and emailsubject_newpw. These two templates should resemble in content the lostpw templates, only with your Welcome text.

2) Add my hack EXACTLY like the instructions says, but before you upload the hacked files run a SEARCH/REPLACE in register.php for _lostpw and replace it with _newpw.

That's it.

Am I making any sense? Sorry, I'm tired :)


All times are GMT. The time now is 01:21 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.01044 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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