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)
-   -   New User Welcome PM [v2] (https://vborg.vbsupport.ru/showthread.php?t=63269)

nemesis01 04-04-2004 08:01 PM

Quote:

Originally Posted by rob_daemon
There's your problem... they're stuck in the Version Info and Other Untouchables (for a reason which I can not comprehend).

Pull down the "Setting Group" option and put it in User Registration Options.

Try doing the same for:
yourdomain.com/admincp/options.php?do=editsetting&varname=regpmtext
yourdomain.com/admincp/options.php?do=editsetting&varname=regpmtitle

Ok, done that, didn't really work:

rob_daemon 04-05-2004 04:01 AM

Unfortunately... I have no idea why this isn't working... I've tried it multiple times, but I can't seem to re-create it.

Run these in the order given (this time it specifies which field to enter each value into.. if this doesn't work, I'm not sure what will):

Code:

DELETE FROM setting WHERE varname = 'regpmfrom';

DELETE FROM setting WHERE varname = 'regpmtext';

DELETE FROM setting WHERE varname = 'regpmtitle';

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);

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, 1);

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle', 'register', 'Welcome to $bbtitle!', 'Welcome to $bbtitle!', '', 160, 0, 0);


nemesis01 04-05-2004 07:00 AM

Huzzah, success at long last, now to try out the file edit and other testing, if it works i'll post back. Thanks for your patience.:)

nemesis01 04-05-2004 07:09 AM

Works perfectly, swedish.:cool:

[high]* nemesis01 clicks install[/high]

Boofo 04-05-2004 09:50 AM

Rob, have you updated the code with the addslashes fix yet? ;)

blubber12 04-05-2004 12:20 PM

Great news..I'll give it a shot later and let you know :)

Boofo 04-05-2004 12:28 PM

For those of you that get a db error when someone registers with an apostrophe or quotes in their name, here is the fix for that. Serialize string should ALWAYS have the addslashes in them. ;)

Find:

PHP Code:

                '" . serialize(array($userid => $username)) . "',
                
0,
                
" . TIMENOW . ",
                
0,
                


REPLACE it with:

PHP Code:

                '" . addslashes(serialize(array($userid => $username))) . "',
                
0,
                
" . TIMENOW . ",
                
0,
                


The 1 will allow smilies in the message, also, that is why the 4 line code change. ;)

rob_daemon 04-06-2004 03:55 AM

Quote:

Originally Posted by nemesis01
Works perfectly, swedish.:cool:

[high]* nemesis01 clicks install[/high]

Yes! Finally :D (I'm not sure why it didn't work before but I'll be writing an automatic installer soon).

And Boofo, I haven't yet; my spring break just ended and my ever-so-kind teachers decided to load me up with coursework. I'll see if I can't release it shortly :) (along with an auto-installer to prevent "SQL troubles")

Tradjick 04-07-2004 12:47 AM

Thanks, rob. Installed and working on Gold.

And thank you Cloudrunner for the prefix mod. I really appreciate that info, beeing a newbish. :ninja:

ManagerJosh 04-07-2004 06:15 PM

Quote:

Originally Posted by rob_daemon
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.

This hack was last updated: Thu Apil. 1, 2004 at 11:22 AM PST


To install follow the instructions in the attached file.

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

Upgrade Instructions:

Download the installation instructions, run the queries, and then open ./register.php and remove the hack (to find the old hack see below).

Look for:
PHP Code:

// ###################################################################
        // # WELCOME PM HACK BY rob_daemon
        // ###################################################################

[...] // This means that there is code here, but I didn't want to take  up more room

$DB_site->query("UPDATE user SET pmtotal=pmtotal+1, pmunread=pmunread+1, pmpopup=2 WHERE userid=$userid");
        
$DB_site->query(
        
"INSERT INTO pm 
            (
                pmtextid, 
                userid, 
                folderid, 
                messageread
            ) 
            VALUES 
            (
                '
$pmtextid', 
                '
$userid', 
                '0', 
                '0'
            )"
        
);
        
// ################################################################### 

And re-add the updated hack found in the Installation Instructions file.

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.

Hey Rob... would you object too much if I uploaded a modified version of your hack? There were a few bugs in the SQL Queries that messed up the AdminCP area.


All times are GMT. The time now is 08:11 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.02215 seconds
  • Memory Usage 1,763KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (3)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