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)

rob_daemon 03-31-2004 10:00 PM

New User Welcome PM [v2]
 
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.

Boofo 04-01-2004 05:04 AM

Can we get a screenshot of what the pm would look like? ;)

And could you please put the code in a text file for anyone that wants that? ;)

rob_daemon 04-01-2004 05:13 AM

Quote:

Originally Posted by Boofo
Can we get a screenshot of what the pm would look like? ;)

And could you please put the code in a text file for anyone that wants that? ;)

Yes and yes. Both are now attached to the original post. :)

Boofo 04-01-2004 05:22 AM

Thank you, sir. ;)

I was going to do a hack like this myself, but had to stop and remember that I'm an idiot and wouldn't have known where to add this. ;)

Clicks install!

rob_daemon 04-01-2004 05:29 AM

Quote:

Originally Posted by Boofo
Thank you, sir. ;)

I was going to do a hack like this myself, but had to stop and remember that I'm an idiot and wouldn't have known where to add this. ;)

Clicks install!

Hehe :D

It's been on my list of things to do over spring break since the end of my winter holiday; and I'm now finally getting around to it.

*feels happy about releasing first hack to public*

Charlie Argueta 04-01-2004 05:52 AM

Really nice hack and very friendly to the new users that doesn't know what to do after.

This is your hack, but is it possible to change the welcome text and also translate it to another language, Spanish in my case :D

See Ya

rob_daemon 04-01-2004 06:08 AM

Quote:

Originally Posted by Charlie Argueta
Really nice hack and very friendly to the new users that doesn't know what to do after.

This is your hack, but is it possible to change the welcome text and also translate it to another language, Spanish in my case :D

See Ya

Of course... see the long line of ////'s that say CUSTOMIZE HERE?

Just translate the variable $pmtext and it will change.

If you want to use the user's username, you can use $username, and if you want their user ID, use $userid.

When you edit the message, make sure you leave it outdented like it is in the default state otherwise your PM will look very strange :eek:

I do plan to make these things in the phrase system (or admin cp) in a later version, but I'll need to do some exploration of how do it.

Charlie Argueta 04-01-2004 06:16 AM

Quote:

Originally Posted by rob_daemon
Of course... see the long line of ////'s that say CUSTOMIZE HERE?

Just translate the variable $pmtext and it will change.

If you want to use the user's username, you can use $username, and if you want their user ID, use $userid.

When you edit the message, make sure you leave it outdented like it is in the default state otherwise your PM will look very strange :eek:

I do plan to make these things in the phrase system (or admin cp) in a later version, but I'll need to do some exploration of how do it.

Thanks again:devious: and with the phrase I believe would be perfect :up:

rob_daemon 04-01-2004 06:18 AM

Quote:

Originally Posted by Charlie Argueta
Thanks again:devious: and with the phrase I believe would be perfect :up:

Indeed, but the problem lies in the variables; but I'll see what I can do.

Boofo 04-01-2004 06:31 AM

Is there a way to set this up to test it without a new registration?

rob_daemon 04-01-2004 06:34 AM

Quote:

Originally Posted by Boofo
Is there a way to set this up to test it without a new registration?

Not really (for it is in register.php); you can do it on your test board or you can simply create an account and then delete in the Admin CP.

Boofo 04-01-2004 06:36 AM

That's ok, I just realized that I can check my sent message folder after the next new registration. See? I warned you I was an idiot. ;)

rob_daemon 04-01-2004 06:38 AM

Quote:

Originally Posted by Boofo
That's ok, I just realized that I can check my sent message folder after the next new registration. See? I warned you I was an idiot. ;)

It actually won't appear in the sent messages folder (I designed it that way for sites that get a lot of traffic because then your PM limit would go through the roof). And, it would be another SQL query :D

Boofo 04-01-2004 06:41 AM

Well, I'll just have to hope the next new user saves the message. ;)

Congratulations on your first hack! An excellent job! ;)

sabret00the 04-01-2004 07:07 AM

this would be even better if we could set the txt via the acp :)

???`S?LV?R???` 04-01-2004 08:51 AM

:) seems useful

SpeedysWorld 04-01-2004 12:02 PM

/me Loves this hack! I wille be clicking install when I get home, just getting a list together of the hacks I am going to be installing tonight.

- SpeedysWorld

PS: I also think that it should be intergrated into the admincp, it would be better, the vB2 version had that, maybe you should look at the code for that to get some ideas on how to do it, but ovisouly write your own code for it. Great hack for your first release.

Fi_InCogNiTo 04-01-2004 02:22 PM

Works great on my forum. I logged off and created a new acct and it sent the PM just fine ;)

rob_daemon 04-01-2004 04:13 PM

I'm glad you all enjoy it... I'm looking into the Admin CP integration as we speak.. I hope I can get an update out very shortly :)

Beermonster 04-01-2004 04:32 PM

Nice touch :)

[high]* Beermonster clicks install[/high]

gmarik 04-01-2004 04:40 PM

Nice one.

rob_daemon 04-01-2004 05:25 PM

I have updated the hack, and it now has three admin CP options:

PM From, PM Text, and PM Title, all of these are found in the User Registration Options in the Admin CP.

sabret00the 04-01-2004 05:57 PM

you should rename it as version two.

AlexanderT 04-01-2004 06:10 PM

Great, will definitely add this one :)

msimplay 04-01-2004 09:55 PM

what about turning it on and off ?

rob_daemon 04-01-2004 10:00 PM

Quote:

Originally Posted by msimplay
what about turning it on and off ?

I can add that, too. But in its current state, you'd have to comment out the code.

*puts it on to-do list*

msimplay 04-01-2004 10:16 PM

Quote:

Originally Posted by rob_daemon
I can add that, too. But in its current state, you'd have to comment out the code.

*puts it on to-do list*

lol yeh i don't want to turn it off but just incase we need to is all
especially since we are going into admin cp changes
i thought might aswell make it complete

rob_daemon 04-01-2004 10:55 PM

Quote:

Originally Posted by msimplay
lol yeh i don't want to turn it off but just incase we need to is all
especially since we are going into admin cp changes
i thought might aswell make it complete

Yeah... I've almost got it working (there's a small problem), but I won't be able to release it for a couple of days because my webhost is causing major problems :(

So, I'm switching hosts; I hope that all goes well :eek:

Leapfrog 04-01-2004 11:17 PM

Nice Work Robert!

/me feels special as I asked for this mod. Co-owns site with Rob! :P

Vivi Ornitier 04-01-2004 11:36 PM

i get this when runnin the first query.

SQL-query :

INSERT INTO `setting`
VALUES (

'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:

#1136 - Column count doesn't match value count at row 1

SpeedysWorld 04-02-2004 12:19 AM

/me clicks install, great update! works great!

- SpeedysWorld

rob_daemon 04-02-2004 12:24 AM

Quote:

Originally Posted by Vivi Ornitier
i get this when runnin the first query.

SQL-query :

INSERT INTO `setting`
VALUES (

'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:


#1136 - Column count doesn't match value count at row 1

Hmm... try running this:

Code:

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

blubber12 04-02-2004 12:35 AM

I"m using the updated hack..and have no admcp options in user reg? What have I done wrong?

Vivi Ornitier 04-02-2004 01:08 AM

I'm using that query u gave me rob and i get

INSERT INTO `setting` ( `varname` , `groupttitle` , `value` , `defaultvalue` , `optioncode` , `displayorder` , `advanced` , `volatile` )
VALUES (

'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:

#1054 - Unknown column 'groupttitle' in 'field list'

rob_daemon 04-02-2004 01:17 AM

Quote:

Originally Posted by blubber12
I"m using the updated hack..and have no admcp options in user reg? What have I done wrong?

Did you run the queries that were specified in the file?

Vivi Ornitier: My bad.. an extra `t` slipped in:

Code:

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);
You may also need updated queries for the others if that works:

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

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

Boofo 04-02-2004 01:24 AM

You might want to let them know how to turn smilies on for the pms (changing the 0 to 1). ;)

Also, can this be set up to only send the pm on activation? I don't allow pms until they are activated. ;)

Hobbes 04-02-2004 04:50 AM

Quote:

Originally Posted by Vivi Ornitier
I'm using that query u gave me rob and i get

INSERT INTO `setting` ( `varname` , `groupttitle` , `value` , `defaultvalue` , `optioncode` , `displayorder` , `advanced` , `volatile` )
VALUES (

'regpmfrom', 'register', '1', '1', '', 140, 0, 0
)

MySQL said:


#1054 - Unknown column 'groupttitle' in 'field list'

I think these errors might have t odo with left over vb2 tables from the hacks on that site. dunno though

Vivi Ornitier 04-02-2004 04:54 AM

Those all worked rob, yet when i run the 4th query from the install file it gives me

SQL-query :

INSERT INTO `setting`
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
)

MySQL said:

#1136 - Column count doesn't match value count at row 1

nemesis01 04-02-2004 05:21 AM

i ran all the queries, have no settings in the ACP under 'User Registration Options'.

nemesis01 04-02-2004 05:34 AM

and now, after saving the settings even though the new ones were not there we have this when trying to register:

Database error in vBulletin 3.0.0:

Invalid SQL: SELECT username,userid FROM user WHERE userid=register
mysql error: Unknown column 'register' in 'where clause'

mysql error number: 1054

Date: Friday 02nd of April 2004 02:54:23 AM
Script: http://www.gamers-gateway.com/vb/register.php
Referer: http://www.gamers-gateway.com/vb/register.php

i have had to shut my board because of this, i trust somebody will be kind enough to help....


All times are GMT. The time now is 01:37 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.01548 seconds
  • Memory Usage 1,841KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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