Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
New User Welcome PM [v2] Details »»
New User Welcome PM [v2]
Version: 2.1.0, by rob_daemon rob_daemon is offline
Developer Last Online: Sep 2019 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-31-2004 Last Update: 12-05-2004 Installs: 200
DB Changes
 
No support by the author.

This hack will send any new users a welcome PM. This will work in vB3 Gold and probably RC versions as well. I will give support for this hack (if it's needed) in this thread.

If you upgraded your vB version and you are using a hack version prior to July 8, 2004:
If you have upgraded vB and your hack version is not July 8, 2004 or newer, run this query (there was a problem with the prior instructions):

Code:
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtext', 'register', 'Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff', 'Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff', 'textarea', 150, 0, 0);
This hack was last updated: Sun December 5, 2004 at 23:00 PDT
This update has a new on/off switch.

Update includes: vB 3.0.2/3.0.3 instructions

To install follow the instructions in the attached file.

Installation Information
Files to Edit: 1
Queries to Run: 11

Upgrade Instructions:

Open ./register.php and remove the hack (to find the old hack see below). And re-add the updated hack found in the Installation Instructions file.

To upgrade to the December 5th release, you'll need to run these three queries:

Code:
INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmon', 'register', '1', '1', 'yesno', 135, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmon_title', 'Automatically Send Welcome PM to New Users?', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0',  'setting_regpmon_desc', 'Do you want to automatically send a welcome PM to new users?', '5000');
Uninstall Instructions:

Run the queries in this post, and then remove the hack in register.php (see below).

Look for:
PHP Code:
        // ###################################################################
        // # WELCOME PM HACK BY rob_daemon
        // ###################################################################

 // [. . .] There is code here, but I didn't want to take  up more room

        // ###################################################################
        // # END WELCOME PM HACK
        // ################################################################### 
To configure it after installation, go to: Admin CP --> Options --> vBulletin Options --> User Registration Options

Attached is a screen grab of the PM by default and text instructions. If the file appears corrupt, please see this post.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #102  
Old 04-24-2004, 07:55 AM
rob_daemon's Avatar
rob_daemon rob_daemon is offline
 
Join Date: Sep 2003
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Queries are commands that add to/change the database. You can run queries in phpMyAdmin (which is generally found in your webhost's control panel).
Reply With Quote
  #103  
Old 04-24-2004, 10:56 PM
SnowBot's Avatar
SnowBot SnowBot is offline
 
Join Date: Jul 2003
Location: Manchester UK
Posts: 631
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed with no problems, edited the "0" to "1" works fine Great hack and thanks.
Reply With Quote
  #104  
Old 04-25-2004, 03:20 AM
Kwak Kwak is offline
 
Join Date: Sep 2003
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When it says run the following queries, do you go to phpadmin --> click SQL --> and copy and paste all the queries onto the large white textbox?
Reply With Quote
  #105  
Old 04-25-2004, 08:41 AM
rob_daemon's Avatar
rob_daemon rob_daemon is offline
 
Join Date: Sep 2003
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yup... exactly.
Reply With Quote
  #106  
Old 05-02-2004, 03:27 PM
Fluous Fluous is offline
 
Join Date: Apr 2004
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I'm having a bit of trouble. I open the welcome hack txt, and it doesnt really give instructions. Just has a big glob of php. So erm.... lol.

Also an idea, that would really be nice to take into consideration is. In your admincp, if you can just edit the text there, instead of having to open up the php file to do it. And if you can tell me how to do a "x" username, like the php code that woudl be cool.

This is what I mean by messy, and I can't tell where the seperate queries are. :speechless:

Edit: NVM, my notepad must have been really messy, I'll just work right off of this post. (I had turned on word wrap but meh)

PHP Code:
################################################################### ||
|| # Welcome PM Hack by rob_daemon                                   # ||
|| #     LAST UPDATED: Tue Apr 13 2004 19:34 PST                         # ||
|| # --------------------------------------------------------------- # ||
|| # VARIOUS MODIDIFICATIONS:
|| #     Boofo - Addslashes to username
|| #     Cloudrunner - Table prefix in SQL queries
|| ################################################################### ||
\*=====================================================================*/

INSTRUCTIONS:

------------ 
Open phpMyAdmin and run the following queries:

// ##############################################################################################

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom''register''1''1'''14000);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmfrom_title''User Who Sends Automatic PM Upon Registration''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmfrom_desc''Enter the user ID of the person whose account you\'d like to be used when sending new users a welcome PM upon registering.''5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtext''register''Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff''Hi $username and welcome to $bbtitle!\r\n\r\nWe appreciate you taking the time to register on our site and we hope you enjoy your stay.\r\n\r\nIf you have any questions, you can ask an administrator for assistance.\r\n\r\nWe hope to see you around.\r\n\r\nSincerely,\r\nThe $bbtitle staff''textarea'15001);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmtext_title''Welcome PM Text''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmtext_desc''Set the text of the PM sent to all new users.<br />\r<br />\rNote: You can use the following variables to specify the <b>user\'s</b> information: $username, $userid, $email. And you can use the $bbtitle to specify the board\'s name.''5000');


INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle''register''Welcome to $bbtitle!''Welcome to $bbtitle!'''16000);
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0''setting_regpmtitle_title''Title Of the PM That is Automatically Sent to New Users''5000');
INSERT INTO phrase (phraseidlanguageidvarname, `text`, phrasetypeidVALUES (NULL'0',  'setting_regpmtitle_desc''Set the title of the PM that is sent to all new users automatically. You can use the same variables as the ones that you can use for the PM text (see above).''5000');

// ##############################################################################################

------------ Nextyou MUST goAdmin CP --> Options --> vBulletin Options --> User Registration Options --> Save
    
-------- If you don't do this, you will get SQL errors when a user registers!


------------ Next, open ./register.php and look for:

// ##############################################################################################
        if ($vboptions['
newuseremail'] != '')
        {
            if ($havefields)
            {
                 $DB_site->data_seek(0, $profilefields);
                 while ($profilefield = $DB_site->fetch_array($profilefields))
                 {
                    $varname = "field$profilefield[profilefieldid]";
                    $cfield = $$varname;
                    $customfields .= "$profilefield[title] : $cfield\n";
                 }
            }

            $username = $_POST['
username'];
            $email = $_POST['
email'];
            eval(fetch_email_phrases('
newuser', 0));

            vbmail($vboptions['
newuseremail'], $subject, $message);
        }
// ##############################################################################################

------------ AFTER ADD:

// ##############################################################################################

        // ###################################################################
        // # WELCOME PM HACK BY rob_daemon
        // ###################################################################
        
        $username = $_POST['
username'];
        
        // Process each one of the replacement vars
        $vars = array(
            '
$bbtitle' => $vboptions['bbtitle'], 
            '
$username' => $username, 
            '
$email' => $email, 
            '
$userid' => $userid
        );
        
        $pmoptions['
regpmtext'] = $vboptions['regpmtext'];
        $pmoptions['
regpmtitle'] = $vboptions['regpmtitle'];
        $pmoptions['
regpmfrom'] = $vboptions['regpmfrom'];
        
        // Now that we have the options, we need to process eaach of the 
        // vars we can use
        foreach($vars AS $_key => $_value)
        {
            $pmoptions['
regpmtext'] = str_replace($_key, $_value, $pmoptions['regpmtext']);
            $pmoptions['
regpmtitle'] = str_replace($_key, $_value, $pmoptions['regpmtitle']);
        }

        $get_pm_from = $DB_site->query_first("SELECT username,userid FROM " . TABLE_PREFIX . "user WHERE userid=$pmoptions[regpmfrom]");
        
        // Send the new owner a PM
        $DB_site->query(
            "INSERT INTO " . TABLE_PREFIX . "pmtext
            (
                fromuserid,
                fromusername,
                title,
                message,
                touserarray,
                iconid,
                dateline,
                showsignature,
                allowsmilie
            )
            VALUES
            (
                $get_pm_from[userid],
                '
$get_pm_from[username]',
                '
$pmoptions[regpmtitle]',
                '" . addslashes(
$pmoptions['regpmtext']) . "',
                '" . addslashes(serialize(array(
$userid => $username))) . "',
                0,
                " . TIMENOW . ",
                1,
                1
            )"
        );
        
        $pmtextid = $DB_site->insert_id();
        
        $DB_site->query("UPDATE " . TABLE_PREFIX . "user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
        $DB_site->query(
        "INSERT INTO " . TABLE_PREFIX . "pm 
            (
                pmtextid, 
                userid, 
                folderid, 
                messageread
            ) 
            VALUES 
            (
                '
$pmtextid', 
                '
$userid', 
                '
0', 
                '
0'
            )"
        );
        // ###################################################################
        // # END WELCOME PM HACK
        // ###################################################################

// ##############################################################################################



You are done :)

?> 
k, i got it all, installed perfectly,

[high]* Fluous clicked install.
[/high]

But can you tell me where to find the customize to edit the message? I tried the register.php and searching all the templates.
Reply With Quote
  #107  
Old 05-02-2004, 04:33 PM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wondering how this one related to the version for vB2.x

https://vborg.vbsupport.ru/showthrea...fault+PM+users
Reply With Quote
  #108  
Old 05-02-2004, 04:53 PM
rob_daemon's Avatar
rob_daemon rob_daemon is offline
 
Join Date: Sep 2003
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Fluous
But can you tell me where to find the customize to edit the message? I tried the register.php and searching all the templates.
It is in the vBulletin Options --> User Registration Settings --> Registration PM Text

Also, Notepad doesn't understand UNIX line-breaks well (which is why you were having the problem). Use WordPad or JEdit (or something similar) to edit PHP files.

Quote:
Originally Posted by mtha
wondering how this one related to the version for vB2.x

https://vborg.vbsupport.ru/showthrea...fault+PM+users
It isn't... I wrote this one myself without even knowing the other version existed.
Reply With Quote
  #109  
Old 05-02-2004, 04:59 PM
Fluous Fluous is offline
 
Join Date: Apr 2004
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, after I posted I got my lazy self up to search through the pages and found that screenshot in there. This is a great hack to include so that I can tell my users about the skin options when they register.
Reply With Quote
  #110  
Old 05-06-2004, 08:42 AM
CharlieBrownDE's Avatar
CharlieBrownDE CharlieBrownDE is offline
 
Join Date: Aug 2003
Location: Hamburg
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how safe is the installation in 3.0.1? are there problems with that or can one install this expansion without problems?
Reply With Quote
  #111  
Old 05-07-2004, 04:38 AM
rob_daemon's Avatar
rob_daemon rob_daemon is offline
 
Join Date: Sep 2003
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, as of the most recent there haven't been any reported problems. This hack works with 3.0.0 and greater. I haven't had any problems with this hack, but if you do run into a problem I will try to help you work it out.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:30 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.13024 seconds
  • Memory Usage 2,377KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete