PDA

View Full Version : New User Welcome PM [v2]


Pages : [1] 2

rob_daemon
03-31-2004, 10:00 PM
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):

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:

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 (https://vborg.vbsupport.ru/showpost.php?p=514829&postcount=144) post, and then remove the hack in register.php (see below).

Look for:
// ################################################## #################
// # 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 (https://vborg.vbsupport.ru/showpost.php?p=510494&postcount=116) 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
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
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
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
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
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
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
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 :)

* Beermonster clicks install

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
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
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
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
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:

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
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:

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:

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

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
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....

msimplay
04-02-2004, 08:23 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....
there was a little part in the instructions that told you to go to registration options and press save once otherwise you will get sql errors

nemesis01
04-02-2004, 08:33 AM
and if you had read my post properly you will see i did that, even though after running the queries that were supposed to insert those options didn't work.:rolleyes:

msimplay
04-02-2004, 08:40 AM
and if you had read my post properly you will see i did that, even though after running the queries that were supposed to insert those options didn't work.:rolleyes:
have you got any other hacks in register.php
because if u make a tiny mistake it can throw the whole forum off

nemesis01
04-02-2004, 08:41 AM
nope, it is a virgin file.

msimplay
04-02-2004, 08:43 AM
nope, it is a virgin file. try getting a default register php and rehacking it

EDIT just registered at your site and it seems u have private messages turned off for users awaiting email activation try turning it on

nemesis01
04-02-2004, 08:46 AM
might work, however as i said the queries i ran to insert the admincp options are not there so i couldn't even configure it anyway.

msimplay
04-02-2004, 08:48 AM
might work, however as i said the queries i ran to insert the admincp options are not there so i couldn't even configure it anyway.
did you use phpmyadmin or vbulletin querie system ?

nemesis01
04-02-2004, 08:51 AM
i used the vbulletin system, never had a problem with that before, even when it was a hack on vb2.

msimplay
04-02-2004, 08:54 AM
i used the vbulletin system, never had a problem with that before, even when it was a hack on vb2.
back up your database and rerun the queries
it should insert the options check my attachment so u know what it looks like

options>registration options

nemesis01
04-02-2004, 09:02 AM
nope, all i keep getting is:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1062
error desc: Duplicate entry 'regpmfrom' for key 1

msimplay
04-02-2004, 09:10 AM
nope, all i keep getting is:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1062
error desc: Duplicate entry 'regpmfrom' for key 1
are you sure ur host hasnt disabled the querie ?
as i had a similar problem while flushing post tables

nemesis01
04-02-2004, 09:19 AM
yes i am quite sure of that, i just ran the queries on my private .htacess protected test board which is located on the same server and it worked....

Logikos
04-02-2004, 09:24 AM
Very nice, been waiting for this

/me clicks install

rob_daemon
04-02-2004, 03:52 PM
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

Try running this:

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

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....

First, go into phpMyAdmin and run these queries to remove any thing that you had previously added to the database:

DELETE FROM setting WHERE varname = 'regpmfrom';
DELETE FROM setting WHERE varname = 'regpmtext';
DELETE FROM setting WHERE varname = 'regpmtitle';

DELETE FROM phrase WHERE varname = 'setting_regpmtext_title';
DELETE FROM phrase WHERE varname = 'setting_regpmtext_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmtitle_title';
DELETE FROM phrase WHERE varname = 'setting_regpmtitle_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmfrom_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmfrom_title';

It definitely sounds like the option queries weren't executed... make sure you run the quires via phpMyAdmin that are found in the instruction file (I believe that the vB query system only allows 1 query at a time).

Mijae
04-02-2004, 05:17 PM
Try running this:

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



First, go into phpMyAdmin and run these queries to remove any thing that you had previously added to the database:

DELETE FROM setting WHERE varname = 'regpmfrom';
DELETE FROM setting WHERE varname = 'regpmtext';
DELETE FROM setting WHERE varname = 'regpmtitle';

DELETE FROM phrase WHERE varname = 'setting_regpmtext_title';
DELETE FROM phrase WHERE varname = 'setting_regpmtext_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmtitle_title';
DELETE FROM phrase WHERE varname = 'setting_regpmtitle_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmfrom_desc';
DELETE FROM phrase WHERE varname = 'setting_regpmfrom_title';

It definitely sounds like the option queries weren't executed... make sure you run the quires via phpMyAdmin that are found in the instruction file (I believe that the vB query system only allows 1 query at a time).
Won't work for me, no matter how many times I rerun the queries, nothing shows up in the admincp, and I get errors when someone registers.

rob_daemon
04-02-2004, 05:28 PM
Won't work for me, no matter how many times I rerun the queries, nothing shows up in the admincp, and I get errors when someone registers.
What version of vB are you running?

nemesis01
04-02-2004, 06:30 PM
I tried that just now, still no luck. The admincp options simply do not show up, I have even had my host run these queries and he can't explain it either.

nemesis01
04-02-2004, 06:48 PM
I have just noticed actually, the test board I run is still RC4 (forgot to update ghehe) and my normal board is Gold so maybe that is the problem.

Mijae
04-02-2004, 06:52 PM
I have just noticed actually, the test board I run is still RC4 (forgot to update ghehe) and my normal board is Gold so maybe that is the problem.
I have vB3.0.0 GOLD.

Still wont work :(

nemesis01
04-02-2004, 06:55 PM
I have vB3.0.0 GOLD.

Still wont work :(

Yes, that's what I mean, I can't get it to work on Gold either yet it will on RC4.

blubber12
04-02-2004, 09:55 PM
Well i've done everything over..as you recommended to nemesis, and still have the same problems, also running gold and clean reg.php

rob_daemon
04-02-2004, 10:06 PM
I'm running it on Gold (I wrote it on my test board which is running Gold).

I'm not sure why those settings won't show up in the Admin CP... can you run this query in the Admin CP and tell me what you see as the results?

SELECT * FROM setting WHERE varname LIKE 'regpm%';

nemesis01
04-03-2004, 04:19 AM
regpmfrom register 1 1 140 0 0
regpmtext register Hi $username and welcome to $bbtitle! We appreciate you taking the time to register on our site and we hope you enjoy your stay. If you have any questions, you can ask an administrator for assistance. We hope to see you around. Sincerely, The $bbtitle staff 0 textarea 150 0 1
regpmtitle register Welcome to $bbtitle! 0 160 0 0

After running the above query.....

rob_daemon
04-03-2004, 07:02 AM
Hmm... how very odd... that should mean that the settings come up in the Admin CP... are you sure that you don't have the settings at the bottom of the User Registration Options page in the vB Options part of the Admin CP?

Even if the phrases didn't work out, you should at least have blank options at the bottom of that page.

nemesis01
04-03-2004, 07:24 AM
I'm quite sure yes, covered all the bases, cleared temp inet files, cookies, heck I even tried using a different browser but they are simply not there.

Cloudrunner
04-03-2004, 11:11 AM
Just a quick note...

For those of you who are using a table prefix for your VB installation, you'll need to adjust the code provided for your register.php.

instead of:// ################################################## #################
// # 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 user WHERE userid=$pmoptions[regpmfrom]");

// Send the new owner a PM
$DB_site->query(
"INSERT INTO pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
$get_pm_from[userid],
'$get_pm_from[username]',
'$pmoptions[regpmtitle]',
'" . addslashes($pmoptions['regpmtext']) . "',
'" . serialize(array($userid => $username)) . "',
0,
" . TIMENOW . ",
0,
0
)"
);

$pmtextid = $DB_site->insert_id();

$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'
)"
);
// ################################################## #################

use this: // ################################################## #################
// # 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']) . "',
'" . serialize(array($userid => $username)) . "',
0,
" . TIMENOW . ",
0,
0
)"
);

$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
// ################################################## #################


Other than that, Great hack!

* Cloudrunner clicks install

Thank you!

)O( Cloudrunner )O(

poetic
04-03-2004, 01:05 PM
I too have had problems that nemesis has. He's explained them exactly as I've recieved them.

rob_daemon
04-03-2004, 04:14 PM
Unfortunately I can't recreate these problems... I've tried doing various things to try and break it but I just can't do it... if they're there in the database they should be showing up in the Admin CP.

Try going to this link for me: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom

That should edit one of the settings.... if it exists, it will be there.

nemesis01
04-03-2004, 10:40 PM
Unfortunately I can't recreate these problems... I've tried doing various things to try and break it but I just can't do it... if they're there in the database they should be showing up in the Admin CP.

Try going to this link for me: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom

That should edit one of the settings.... if it exists, it will be there.

Did that, the result was interesting.

rob_daemon
04-03-2004, 11:49 PM
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

nemesis01
04-04-2004, 08:01 PM
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):

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:

* nemesis01 clicks install

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:

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

REPLACE it with:

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

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
Works perfectly, swedish.:cool:

* nemesis01 clicks install
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
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: // ################################################## #################
// # 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.

rob_daemon
04-07-2004, 09:56 PM
Wouldn't mind at all; to that same extent: when I release the automatic installer could I include those updates?

Boofo
04-07-2004, 10:18 PM
Wouldn't mind at all; to that same extent: when I release the automatic installer could I include those updates?

Rob, you might want to do a TXT file, too, for those of us who like to know what code we're adding and don't like auto-installers. ;)

AN-net
04-11-2004, 04:49 AM
um, im getting errors when i register on my site now after a registration is done. it says there seems to be a problem with our database. and the option to edit the setting for new user pm does not show up in my user registration setting page.

rob_daemon
04-11-2004, 06:26 AM
um, im getting errors when i register on my site now after a registration is done. it says there seems to be a problem with our database. and the option to edit the setting for new user pm does not show up in my user registration setting page.
Try these instructions: https://vborg.vbsupport.ru/showpost.php?p=495742&postcount=72

joeychgo
04-11-2004, 12:46 PM
Probably a stupid question ---

in the instructions it says to open phpMyAdmin and run queries.....

Is that the same as running queries from EXECUTE SQL QUERY in my admin cp?

rob_daemon
04-11-2004, 04:25 PM
Probably a stupid question ---

in the instructions it says to open phpMyAdmin and run queries.....

Is that the same as running queries from EXECUTE SQL QUERY in my admin cp?
If you want to do the queries via the Admin CP, you need to run them individually as it can't split MySQL queries. And, there is a security limitation in the mysql_query() function that prevents more than one query from being executed at a time.

So, either do each query individually or do them all at once in phpMyAdmin.

AN-net
04-11-2004, 09:49 PM
Try these instructions: https://vborg.vbsupport.ru/showpost.php?p=495742&postcount=72

i have alrdy run the queries in the instructs. what should i do then?

SaN-DeeP
04-12-2004, 06:43 PM
nice mod.

please update UR INSTRUCTIONS in file.

or someone else DO IT. for THE author.

Instructions in THE file do not WORK on Gold VErsion.
and lead users to SQL ERRORS.

although reading the post no. 72 helped.. and works now after 6 hours ;)
* SaN-DeeP clicks INSTALL. ;0

Sandy...

rob_daemon
04-13-2004, 02:30 AM
i have alrdy run the queries in the instructs. what should i do then?

If those instructions do not work, then I'm not sure what the cause of them not showing up would be.

Go to here: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom and tell me what you see.

Instructions in THE file do not WORK on Gold VErsion.

Yes, actually they do (but they do not appear to work on all installations)... I'll be updating the file tonight or tomorrow afternoon.

achtungbaby
04-13-2004, 04:31 AM
If those instructions do not work, then I'm not sure what the cause of them not showing up would be.

Go to here: yourdomain.com/admincp/options.php?do=editsetting&varname=regpmfrom and tell me what you see.



Yes, actually they do (but they do not appear to work on all installations)... I'll be updating the file tonight or tomorrow afternoon.

I wasn't able to install this hack either...although it is a good idea

SaN-DeeP
04-13-2004, 12:24 PM
I wasn't able to install this hack either...although it is a good idea
Hack is PERFECT.
Follow the POST NO. 72 of rob.

Delete all the queries, upload ur ORIGINAl register.php file and then FOLLOW the Queires in post no. 72, then run all phrase manage queries.

after then goto ADMINCP.... and click save.

then edit ur register.php file again.

It is GONNA WORK FOR 100% SURE.

I had probs, too BUT its INSTALLED PERFECT now.

thnx rob.
nice mod.

although, i am still tricket, i have set that new users, should get an email message once when they receive private messages.

This is the PROCEDURE. on my site.
User register -> auth code is send to his mail
User clicks on the link in mail, and comes to board.
Welcome email is send to user.

Even the WELCOME PM appears in USERS, mail box.
But the email is not send about this NEW PM.. in there mail..

Not really wanted, but IT should WORK. technically.

Sandy..

AN-net
04-13-2004, 03:22 PM
when i go to: admincp/options.php?do=editsetting&varname=regpmfrom

it takes me to what it is susposed to be i think. um but for some reason it doesnt show up on the drop down list for settings. im using vb3 gold:)

rob_daemon
04-14-2004, 01:39 AM
when i go to: admincp/options.php?do=editsetting&varname=regpmfrom

it takes me to what it is susposed to be i think. um but for some reason it doesnt show up on the drop down list for settings. im using vb3 gold:)
Does it look like this? https://vborg.vbsupport.ru/attachment.php?attachmentid=17874

If so, what does the 'Setting Group' dropdown menu say for yours?

Updated file to include instructions from post number 27. Also, added Boofo's addslashes() fix and Cloudrunner's table prefix to the code. Upgrade is not mandatory, but recommended to protect against users with a ' or a " in their name.

LilPimp
04-17-2004, 12:06 AM
I dont get tha directions

rob_daemon
04-17-2004, 07:07 AM
I dont get tha directions
What specifically don't you get?

You run the nine queries in phpMyAdmin, go into your Admin CP and save one setting, and then apply the file edit.

Boofo
04-17-2004, 07:30 AM
Rob, in your updated instructions, you have it to show the signature and smilies are set to off. You need to switch the numbers (0 and 1) around. ;)

joeychgo
04-17-2004, 11:00 AM
Question. I installed the other version of this hack, LAST UPDATED: Tue Apr 13 2004 19:34 PST ........

So I need to do another update now? If so, what are the update instructions?

Looks like a great hack...... Very nice job. I can only hope my fist hack will be this good.

rob_daemon
04-17-2004, 03:43 PM
Question. I installed the other version of this hack, LAST UPDATED: Tue Apr 13 2004 19:34 PST ........


So I need to do another update now? If so, what are the update instructions?

Looks like a great hack...... Very nice job. I can only hope my fist hack will be this good.
For upgrading, find the old version of the hack, by searching for:

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

And then look for the end of it:

$DB_site->query(
"INSERT INTO " . TABLE_PREFIX . "pm
(
pmtextid,
userid,
folderid,
messageread
)
VALUES
(
'$pmtextid',
'$userid',
'0',
'0'
)"
);
// ################################################## #################

And replace that and everything in-between with the updated code in the file. There are no new queries to run.

Rob, in your updated instructions, you have it to show the signature and smilies are set to off. You need to switch the numbers (0 and 1) around.

And I even double-checked this, too :p I'll just turn 'em both on.

Boofo
04-17-2004, 03:47 PM
I don't think I'd turn sigs on, but it is your hack. Just make the last 0 in that column a 1 and the smilies will work. That's how I have mine and the smilies show and the sig does not. ;)

Kwak
04-24-2004, 05:34 AM
What are queries and how do you run them?

rob_daemon
04-24-2004, 07:55 AM
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).

SnowBot
04-24-2004, 10:56 PM
installed with no problems, edited the "0" to "1" works fine :) Great hack and thanks.

Kwak
04-25-2004, 03:20 AM
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?

rob_daemon
04-25-2004, 08:41 AM
Yup... exactly.

Fluous
05-02-2004, 03:27 PM
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)

################################################## ################# ||
|| # 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', '', 140, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_title', 'User Who Sends Automatic PM Upon Registration', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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', 150, 0, 1);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtext_title', 'Welcome PM Text', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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!', '', 160, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtitle_title', 'Title Of the PM That is Automatically Sent to New Users', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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');

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

------------ Next, you MUST go: Admin 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,

* Fluous clicked install.

But can you tell me where to find the customize to edit the message? I tried the register.php and searching all the templates.

mtha
05-02-2004, 04:33 PM
wondering how this one related to the version for vB2.x

https://vborg.vbsupport.ru/showthread.php?t=34498&highlight=Default+PM+users

rob_daemon
05-02-2004, 04:53 PM
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.

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

https://vborg.vbsupport.ru/showthread.php?t=34498&highlight=Default+PM+users

It isn't... I wrote this one myself without even knowing the other version existed.

Fluous
05-02-2004, 04:59 PM
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.

CharlieBrownDE
05-06-2004, 08:42 AM
how safe is the installation in 3.0.1? are there problems with that or can one install this expansion without problems?

rob_daemon
05-07-2004, 04:38 AM
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.

SmartGnome
05-08-2004, 11:00 AM
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.

I run a multiple language board. Any idea how to vbphrase this beauty ?

BTW:
It runs like a charm now :ermm:

sabret00the
05-08-2004, 01:51 PM
is there anyway i can get this to use all the existing settings that were made to the database via this hack?

https://vborg.vbsupport.ru/showthread.php?t=34498

rob_daemon
05-08-2004, 02:12 PM
is there anyway i can get this to use all the existing settings that were made to the database via this hack?

https://vborg.vbsupport.ru/showthread.php?t=34498
No, not at this time. And I don't expect there to be a way in the future.

I run a multiple language board. Any idea how to vbphrase this beauty ?

If you want to run a multi-language board and have the text be different per-language, I'd create a new vB phrase in your system with the text you want. Then, find in the insert code the $vboptions['regpm*'] and replace it with your vB phrase.

Chriss74
05-08-2004, 10:59 PM
@rob_daemon (https://vborg.vbsupport.ru/member.php?u=41139): The attached txt-file seems to be corrupt. Could you please attach it again?

Thanks,
Chriss

Kwak
05-09-2004, 05:37 AM
Installed and clicked Installed.

rob_daemon
05-09-2004, 06:35 AM
@rob_daemon (https://vborg.vbsupport.ru/member.php?u=41139): The attached txt-file seems to be corrupt. Could you please attach it again?

Thanks,
Chriss
The file isn't corrupt... I just checked. Make sure that you aren't using NotePad to edit the file, if you are either open it in WordPad or get another text editor that understands UNIX linebreaks.

Installed and clicked Installed.

Thanks :D

Chriss74
05-09-2004, 06:53 PM
The file isn't corrupt... I just checked. Make sure that you aren't using NotePad to edit the file, if you are either open it in WordPad or get another text editor that understands UNIX linebreaks.
Yes, that was the problem. Thanks for the hint and the hack!

Greetings,
Chriss

Rick Sample
05-09-2004, 09:24 PM
quick question, when it says: ------------ Open phpMyAdmin and run the following queries:

I don't have PHPMYADMIN. So how would I do this? I tried to install phpmyadmin, but was unsuccessful. So I gave up. I forget what I'm using now, its on our server located at another place.

rob_daemon
05-09-2004, 09:51 PM
Then run queries from the vB admin panel (http://www.vbulletin.com/docs/html/main/maintenance_query). You just have to break them up individually.

Rick Sample
05-09-2004, 09:56 PM
Then run queries from the vB admin panel (http://www.vbulletin.com/docs/html/main/maintenance_query). You just have to break them up individually.

Thanks man! In that page it says they cant be undone, so if you done them and your forum returns errors, then what?

Also, should I use the automatic or manual?

Thanks,

rob_daemon
05-10-2004, 04:29 AM
If the queries mess up, they can not be undone in the sense of "Control + Z" but there are queries that you can run to undo their action.

And run it via the manual query; copy and paste each line (full line, not word-wrapped ones) into the box and run the query.

bloodcult
05-11-2004, 10:30 AM
nice hack, thanks!

ranger2kxlt
05-12-2004, 04:47 PM
Not working for me. I installed it and the actual file hack is the problem. I did do the edit user registration options in the admincp and saved it but still have an sql error. When i remove the edit from register.php everything works fine (no pm of coarse, but also no errors). Any idea?

rob_daemon
05-12-2004, 11:31 PM
What's the error?

ranger2kxlt
05-13-2004, 05:17 AM
Doesnt give an exact error, just says sql error.

rob_daemon
05-13-2004, 05:45 AM
Then view the source and you should see the SQL error. Paste that here.

ranger2kxlt
05-14-2004, 01:21 AM
wow never knew that before...

<!--
Database error in vBulletin 3.0.0:

Invalid SQL: INSERT INTO pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
,
'',
'Welcome to ThunderBirdNest.com Forums!',
'Hi test1 and welcome to ThunderBirdNest.com Forums!

We appreciate you taking the time to register on our site and we hope you enjoy your stay.

TBN features some great options for you as a member!
1) A fully functional gallery that allows your to store your images online with us, and share them with the rest of the world without paying for webspace! You are given 512kb of webspace for free to host your images!! However you can upgrade this amount to 10gigs for a very small fee. See below for details.
2) Huge Discounts from our Supporting Sponsors. You can literally save hundreds on top items for your Thunderbird. For example, get a borla exhaust complete setup for ONLY $635! That alone is a savings of over $100 off retail pricing. For information on how to subscribe to our discount forums... please see details below.
3) An online chatroom. Not only can your talk on our forums, but we offer live chat with any members you wish to talk to. Just visit our free chatroom!
4) An events gallery! We keep all our images from all our events. TBN hosts some of the largest club events in the country! Check out our events gallery to experience what its like to have 50-60 Thunderbirds all together!
5) Get your own Email address! For information on how to order your own email address, see details below!
6) So much more! What are you waiting for? Check out our account upgrade options and then head over to the New Members area and tell us about yourself!!

For information on how to order any of our upgrade options, please visit the following link!
http://www.thunderbirdnest.com/forums/subscriptions.php

If you have any questions, you can ask an administrator for assistance.

We hope to see you around.

Sincerely,
The ThunderBirdNest.com Forums staff

Note: Please do not respond to this message. Thank you.',
'a:1:{i:1867;s:5:\&quot;test1\&quot;;}',
0,
1084501190,
1,
1
)
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '
'',
'Welcome to ThunderBirdNest.com Forums!',
'Hi

mysql error number: 1064

Date: Thursday 13th of May 2004 09:19:50 PM
Script: http://www.thunderbirdnest.com/forums/register.php
Referer: http://www.thunderbirdnest.com/forums/register.php
Username: test1
IP Address: 24.155.68.136
-->

ranger2kxlt
05-14-2004, 01:28 AM
could it be that extra comma that is in the text?? right below VALUES??

Im not sure where that is coming from however because it is not in our sourcecode like this.

ranger2kxlt
05-14-2004, 01:35 AM
found the problem! My stupid fault... i had the wrong userid in the spot for the person in the from section of the pm. Thanks for your help.

rob_daemon
05-14-2004, 04:18 AM
found the problem! My stupid fault... i had the wrong userid in the spot for the person in the from section of the pm. Thanks for your help.
I'm glad to hear that.. but if you hadn't figured it out I'd have been clueless :p

MaxScript
05-18-2004, 03:13 AM
how you make to NOT make a popup ?

rob_daemon
05-19-2004, 12:32 AM
As of now, there isn't a way; you'd have to disable the JavaScript popup in the Default Registration Options.

armani1072
05-20-2004, 09:41 PM
[INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_title', 'User Who Sends Automatic PM Upon Registration', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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');


I added a prefix of 'vB3' to all the tables in my database when i uploaded it. so if i were to run this query where would i make the changes? any help would be great. thanks

rob_daemon
05-20-2004, 11:46 PM
Here:

INSERT INTO `PREFIX_setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);
INSERT INTO PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_title', 'User Who Sends Automatic PM Upon Registration', '5000');
INSERT INTO PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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 `PREFIX_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 PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtext_title', 'Welcome PM Text', '5000');
INSERT INTO PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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 `PREFIX_setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle', 'register', 'Welcome to $bbtitle!', 'Welcome to $bbtitle!', '', 160, 0, 0);
INSERT INTO PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtitle_title', 'Title Of the PM That is Automatically Sent to New Users', '5000');
INSERT INTO PREFIX_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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');

Just replace all instances of 'PREFIX' with your database prefix.

armani1072
05-20-2004, 11:50 PM
thanks i will give it a try :)

Rick Sample
05-20-2004, 11:51 PM
I'm just affraid to install this hack, yet I really need it to encourage members to post. I just don't like how it says SQL querys can't be undone. I know I would have to run the querys via the admin cp, but it just gives me creaps because I have no experience in restoring a database or anything.

Any suggestions?

armani1072
05-21-2004, 12:01 AM
worked great thanks alot rod :)



**clicks install**

armani1072
05-21-2004, 12:02 AM
I'm just affraid to install this hack, yet I really need it to encourage members to post. I just don't like how it says SQL querys can't be undone. I know I would have to run the querys via the admin cp, but it just gives me creaps because I have no experience in restoring a database or anything.

Any suggestions?


if you need to delete a query rob shows how to do it in post #72 of this thread.

rob_daemon
05-21-2004, 12:03 AM
I'm just affraid to install this hack, yet I really need it to encourage members to post. I just don't like how it says SQL querys can't be undone. I know I would have to run the querys via the admin cp, but it just gives me creaps because I have no experience in restoring a database or anything.

Any suggestions?
All of the queries have counter queries if you need to undo it. It is virtually impossible for this to screw up anything because you are merely inserting rows into the database, not overwriting anything or changing the structure of the database.

Rick Sample
05-21-2004, 12:10 AM
All of the queries have counter queries if you need to undo it. It is virtually impossible for this to screw up anything because you are merely inserting rows into the database, not overwriting anything or changing the structure of the database.

virtually impossible, hmm.....well you don't know me LOL...I'm like tim taylor on tool time LOL.

To test it to make sure users can still register, should I try to register after I do this hack, just to see if its all working?

If so, I'll prob give this a try later tonight, to see if I can get it going or not! It looks easy though, just sounds disasterouse!

Rick Sample
05-21-2004, 12:29 AM
quick question,
1. lets say after I open admin cp and run each query individually, how can I test to see if it worked? I mean will I see side effects if it doesn't?

2. I forget should I run it manually or automatic in the admin cp

3. I created the board, but it says I don't have permissions to exicute an SQL query. I know when I transfered my PHP board, it transfered my admin account, then created another admin account. I deleted that without thinking. So how do I make myself a super admin again???


Thanks for all of your help :)

rob_daemon
05-21-2004, 12:59 AM
To test it to make sure users can still register, should I try to register after I do this hack, just to see if its all working?

Yup... and then delete the user in the Admin CP when you are done.

lets say after I open admin cp and run each query individually, how can I test to see if it worked? I mean will I see side effects if it doesn't?

To see if it worked, go into the Admin CP --> vBulletion Options --> User Registration Options

And there should be three new options: Registration PM From, Text, and Title.

I forget should I run it manually or automatic in the admin cp

You do them manually by pasting them into the query box.

I created the board, but it says I don't have permissions to exicute an SQL query. I know when I transfered my PHP board, it transfered my admin account, then created another admin account. I deleted that without thinking. So how do I make myself a super admin again???

http://www.vbulletin.com/docs/html/main/maintenance_query

josh929
05-21-2004, 07:03 AM
i would like to install this hack. however, i know absolutely NOTHING about mysql.

i would be able to run the queries just fine, but i need to know now to uninstall the hack for future upgrades and whatnot. if anyone could provide an exact undo of every change to the database (putting it back just like it was before the hack was installed), that would be fantabulous. i could then install the hack without worrying about foreign things in my vbulletin database that i have no idea how to get rid of. :)

if this is alot of work, then nevermind. :)

rob_daemon
05-22-2004, 02:04 AM
The following two queries will undo any database changes:

DELETE FROM `setting` WHERE `varname` IN ('regpmfrom', 'regpmtext', 'regpmtitle');

DELETE FROM `phrase` WHERE `varname` IN ('setting_regpmfrom_title', 'setting_regpmfrom_desc', 'setting_regpmtext_title', 'setting_regpmtext_desc', 'setting_regpmtitle_title', 'setting_regpmtitle_desc');

josh929
05-22-2004, 11:28 PM
thanks :)

MediaHound
06-03-2004, 07:14 AM
Thanks a lot for this hack!

Onkel_Tom
06-03-2004, 09:30 AM
Thanks for this hack !
click install ;)

contramontanum
06-03-2004, 01:24 PM
Ran all queries, clicked "save" in ACP User registration options and did the file edit. When I registered a test user I got an error message that there was a problem with the database. This is the error msg that was emailed to me.

Database error in vBulletin 3.0.0:

Invalid SQL: INSERT INTO pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
,
'',
'Welcome to Loudmouth Discussion Forums!',
'Hi testuser and welcome to Loudmouth Discussion Forums!

We appreciate you taking the time to register on our site and we hope you enjoy your stay.

If you have any questions, you can ask an administrator for assistance.

We hope to see you around.

Sincerely,
The Loudmouth Discussion Forums staff',
'a:1:{i:89;s:8:\"testuser\";}',
0,
1086272221,
1,
1
)
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '
'',
'Welcome to Loudmouth Disc

mysql error number: 1064

Bryan Ex
06-03-2004, 03:26 PM
Looks like exactly what I was after. Just so I'm clear on this... do PM's need to be enabled for users awaiting email confirmation or will the welcome PM just wait until the account is activated?

rob_daemon
06-03-2004, 05:08 PM
Ran all queries, clicked "save" in ACP User registration options and did the file edit. When I registered a test user I got an error message that there was a problem with the database. This is the error msg that was emailed to me.

It appears that you don't have a user set for the registration PM to be from. Go into the Admin CP and make sure that 'User Who Sends Automatic PM Upon Registration' has the proper value.

Looks like exactly what I was after. Just so I'm clear on this... do PM's need to be enabled for users awaiting email confirmation or will the welcome PM just wait until the account is activated?

The PM will be sent upon the user hitting the final button in the registration system... since there is no "PM Que" in vB, the user will get the welcome PM notice right after they register (even if they haven't activated yet). And the hack simply puts the PM in the user's inbox without any regards for permissions.

contramontanum
06-03-2004, 08:01 PM
Thanks Rob, that did the trick. Very useful hack indeed! Is there a way to format the text in the welcome mail to put in links (to other pages on the forum)? I noticed HTML doesn't work.

rob_daemon
06-03-2004, 08:52 PM
Glad that did the trick :)

Standard vB code will work.

r6xual
06-04-2004, 12:30 AM
**install**

Flawless install for me.

MediaHound
06-04-2004, 03:16 AM
First off, thanks for a great hack. It's exactly what I was after.



The PM will be sent upon the user hitting the final button in the registration system... since there is no "PM Que" in vB, the user will get the welcome PM notice right after they register (even if they haven't activated yet).


That being said,
I just installed it, and ran the first test of a new user registration.
I was alarmed to see the PM before I clicked the link in the email that I was supposed to click before becoming a member. I was even more alarmed to be taken to my inbox with no problem after clicking 'ok' to accept the PM.


And the hack simply puts the PM in the user's inbox without any regards for permissions.


If I were a slow or stupid end user on my board, and as soon as I registered and was taken to my inbox, I would think I'm all good to go. I might not realize that there was still a link to click in my email before I was given permissions.

The defalut PM your out of the box hack should include, should tell the user that they still need to check their email and click a link, (if the board requires it).

Had I seen that as the PM I wouldnt have been so alarmed, as the webmaster.
That scared the ** out of me because I thought my users now didnt need to click the link in the email to get their permissions.

Just could have been a little less harsh with that surprise.

Off to my sites!
Thanks again,

MH

rob_daemon
06-04-2004, 03:32 AM
Hmm... it really let you go into the inbox before you activated your account? That shouldn't happen (I think)... I'll do some testing tomorrow (or later tonight) to see if I can figure out why you were able to view your inbox prior to activation as vBulletin should prevent that from happening.

Another alternative would to hide the popup box when inserting the PM into the database, but new users who are not familiar with a forums system may not notice the "You have 1 new PM" in the upper right corner. I wonder if there is a way to suppress email messages about PMs, though....

MediaHound
06-04-2004, 04:40 AM
Hmm... it really let you go into the inbox before you activated your account? That shouldn't happen (I think)... I'll do some testing tomorrow (or later tonight) to see if I can figure out why you were able to view your inbox prior to activation as vBulletin should prevent that from happening.

After a user registers, they are told they need to check their email. That message:

"Thank you for registering, testuser6. An email has been dispatched to testuser6@edit.com with details on how to activate your account. Click here to return to where you were previously.

You will receive an email in your inbox. You MUST follow the link in that email before you can post on these forums. Until you do that, you will be told that you do not have permission to post."

If they click 'here' to return to where they were previously, bang, the popup (as well as the page I was previously on). The popup then takes me to the inbox, and I'm in.

I see how this could be confusing to inexperienced users.

MediaHound
06-04-2004, 04:48 AM
Just for the record, I'm also able to reply to the message. Not cool.

Also,
I set up "Welcome Message Ghost" as the user who 'sends' this PM, so I as the admin dont get bombarded with newbie pms.

And the subtitle on this new user tells them:
"Please do not reply to me. I'm just a robot. Use the 'contact us' link for assistance."

This will help cut back the time I spend chatting 1 on 1 with new members unnecessarily.

But, back to it - I think it's not so cool that they can read and write from the inbox if they aren't 'opted in' by clicking the link they were sent.

Your hack is excellent in 99% of its regards, except that the uses can kind of 'get in the side entrance' per say.

rob_daemon
06-04-2004, 04:55 AM
What are your permissions on the "Users Awaiting Email Confirmation" usergroup?

MediaHound
06-04-2004, 05:48 AM
What are your permissions on the "Users Awaiting Email Confirmation" usergroup?


It's a lot of variables.
Everything is set to 'NO', except for the following, which are yes:

Usergroup Options:
Allow Users to have Member Groups (Sets whether or not permissions from the user's member (secondary) user group memberships are inherited or not)

General Permissions:
Can View Member Info
Can Edit Own Profile
Can Set Self to Invisible Mode
Show edited by note on edited messages?
Can Use Signatures

Forum Viewing Permissions
Can View Forum
Can View Others' Threads
Can Search Forums

Who's Online Permissions
Can View Who's Online

If I left it out, its because it is set to 'NO', or it's a file size variable that wont matter here.

Many thanks,

MH

SnowBot
06-06-2004, 09:28 AM
I have had this being reported afew times now and was hoping someone can advise me on what to do. ?


Hi Snowy

I'm getting the flashing Private Messages indicator in the NAVbar and within my UserCP is states I have 1 unread PM, but I don't have any.

Any ideas?

Cheers

Its happening all the time and i have to go in and delete it in the database :( not good, any ideas ?

Thanks

rob_daemon
06-06-2004, 10:43 PM
When it happens, go into the database and make sure that there is something in both the pmtext and pm table.

If there isn't, try rehacking the file; if there is, could you please paste the values of those two rows (and also their appropriate fields)?

MediaHound
06-10-2004, 01:01 AM
What are your permissions on the "Users Awaiting Email Confirmation" usergroup?

Did you see my reply?

rob_daemon
06-10-2004, 02:29 AM
Yup... and I can not recreate this on my test forum at all with this hack installed. I'll keep trying various permission combinations.

Kwak
06-14-2004, 05:14 PM
Does anyone know if this mini-mod interfere with the v3 Articles hack (https://vborg.vbsupport.ru/showthread.php?t=65934)?

RapCheck
06-14-2004, 09:02 PM
whats the difference between this and the welcome pm thats in vb3???

Bryan Ex
06-15-2004, 12:03 AM
The welcome message built into VB3 is sent via email... this is by PM when they first login.

RapCheck
06-15-2004, 01:38 AM
ummmm, its already in vb3... the last option in the vboptions...

Noiz Pollution
06-18-2004, 01:35 PM
ummmm, its already in vb3... the last option in the vboptions...
I don't have that.

RapCheck
06-18-2004, 08:10 PM
lol

well thats weird, its not a hack

I have 3.0.0 gold, been there since vb3 beta versions

Boofo
06-19-2004, 03:20 AM
lol

well thats weird, its not a hack

I have 3.0.0 gold, been there since vb3 beta versionsThe built-in one for for e-mail. This one is for pm. So, yes, it is a hack and no, it is not into vB3 by default. ;)

RapCheck
06-19-2004, 08:25 PM
ummmmm hello!! look at the screen shot lol

https://vborg.vbsupport.ru/external/2004/06/1.php?attachmentid=19189


'default PM'

'send default PM to new users?'

I get replies to this PM all the time on my board... lol

Onkel_Tom
06-20-2004, 03:28 PM
Hi all,
there is a problem when the username has a ' in the name like "Tom's"
I get a MySQL Error while inserting the PM in the database because the PM receivername will be closed after Tom instead of Tom's.

any idea to fix that ?

Noiz Pollution
06-21-2004, 07:59 AM
ummmmm hello!! look at the screen shot lol

https://vborg.vbsupport.ru/attachment.php?attachmentid=19189


'default PM'

'send default PM to new users?'

I get replies to this PM all the time on my board... lol
Heh, did you have the hack installed on vB2 by any chance?

rob_daemon
06-21-2004, 08:07 AM
Does anyone know if this mini-mod interfere with the v3 Articles hack?

Sorry, I haven't tested that.

ummmmm hello!! look at the screen shot lol

https://vborg.vbsupport.ru/atta...achmentid=19189


'default PM'

'send default PM to new users?'

I get replies to this PM all the time on my board... lol

Whatever that is, it's not standard in vB3.

Hi all,
there is a problem when the username has a ' in the name like "Tom's"
I get a MySQL Error while inserting the PM in the database because the PM receivername will be closed after Tom instead of Tom's.

any idea to fix that ?

I just updated the hack to make sure that all strings are protected against quote problems. Follow the upgrade instructions in the first post.

Onkel_Tom
06-21-2004, 10:59 AM
thanks for your fast reply and fix of the code rob_daemon ;)

RapCheck
06-21-2004, 05:31 PM
Heh, did you have the hack installed on vB2 by any chance?
I checked and yeah apparently I did


I dont see how its still in the options and works fully with vb3 but anyways I guess I'm lucky, or something.

Noiz Pollution
06-22-2004, 08:49 AM
I checked and yeah apparently I did


I dont see how its still in the options and works fully with vb3 but anyways I guess I'm lucky, or something.
Looks like you have been, I had an old portal hack which stayed in my options, didn't do anything but it was there.

b4ne
06-26-2004, 01:04 PM
My new users dont get a PM but get the message via email .... any idea how to fix this ?

rob_daemon
06-26-2004, 08:25 PM
My new users dont get a PM but get the message via email .... any idea how to fix this ?
What do you mean? Do they get the new PM email and not the PM?

SnowBot
06-30-2004, 02:14 AM
Hi Snowy

I'm getting the flashing Private Messages indicator in the NAVbar and within my UserCP is states I have 1 unread PM, but I don't have any.

Any ideas?

Cheers

This is still happening even withthe updates. I notice its when the user first registers and the popup comes if the press CANCEL it comes up with this. I mean if they dont read the PM right away we get this error.

rob_daemon
06-30-2004, 05:59 AM
Hmm... I'm not sure why that would be happening. I'll see if I can recreate this tomorrow and if I am able to, I'll see if I can't come up with a fix.

SnowBot
06-30-2004, 08:24 AM
Cool that will be great :) Thanks for the fast responce :)

Osterling
07-05-2004, 05:56 AM
the attachement seems to be messed up.. can some one send me the instructions?

Onkel_Tom
07-06-2004, 09:11 PM
Small update to find the correct place to put the code in register.php for vB3.0.2 or 3.0.3:

find:

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

$newemails = explode(' ', $vboptions['newuseremail']);
foreach ($newemails AS $toemail)
{
if (trim($toemail))
{
vbmail($toemail, $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],
'" . addslashes($get_pm_from['username']) . "',
'" . addslashes($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
// ################################################## #################
// ################################################## ############################################


@ rob_daemon
Please update the installation instruction ;)

Kwak
07-07-2004, 12:03 AM
[QUOTE=Onkel_Tom]Small update to find the correct place to put the code in register.php for vB3.0.2 or 3.0.3:

find:

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

$newemails = explode(' ', $vboptions['newuseremail']);
foreach ($newemails AS $toemail)
{
if (trim($toemail))
{
vbmail($toemail, $subject, $message);
}
}
}




On the register.php file for 3.0.3, I can't find $username = $_POST['username'];

This is the part I think you are talking about:
$email = $_POST['email'];
eval(fetch_email_phrases('newuser', 0));

$newemails = explode(' ', $vboptions['newuseremail']);
foreach ($newemails AS $toemail)
{
if (trim($toemail))
{
vbmail($toemail, $subject, $message);
}
}
}


On top of that code is:

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";
}
}


Any idea?

Onkel_Tom
07-07-2004, 12:55 AM
In the original file register.php it's line 743 with
$username = $_POST['username'];

rob_daemon
07-08-2004, 06:30 PM
the attachement seems to be messed up.. can some one send me the instructions?

What are you using to view the file? See here (https://vborg.vbsupport.ru/showpost.php?p=510494&postcount=116).

The file has been updated with the new instructions.

Kwak
07-08-2004, 07:40 PM
Error

SQL-query :

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

MySQL said:
#1062 - Duplicate entry 'regpmfrom' for key 1

[Documentation] ? [Back]

Getting that error message when I query the provided codes on phpmyadmin.
vB 3.0.3.

rob_daemon
07-08-2004, 10:02 PM
You don't need to redo the queries if you have already installed the mod.

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.

Onkel_Tom
07-08-2004, 10:07 PM
Error

SQL-query :

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

MySQL said:
#1062 - Duplicate entry 'regpmfrom' for key 1

[Documentation] ? [Back]

Getting that error message when I query the provided codes on phpmyadmin.
vB 3.0.3.
that means that you have already the needed setting for regpmfrom in your database !
You can't add a setting twice with the same name.
If you have installed the hack before all is fine and you can proceed with the other instructions. If not you have to check which hack also uses a varname called regpmfrom in the settings table.

Kwak
07-09-2004, 12:33 AM
Oh okay. So I applied the hack on the new register.php file (3.0.3) and then tested it out.

I got a new popup so that is a good start. There was no text on the PM so I went to the admin setting.
Under Options, User Registion Options, on the bottom, I only see
"User Who Sends Automatic PM Upon Registration" (which I set to admin) and
"Title Of the PM That is Automatically Sent to New Users."

But I don't see where I could put the Welcome PM text in. ANy idea?

rob_daemon
07-09-2004, 02:17 AM
Hmm... I see the problem. Run this query:

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

Kwak
07-09-2004, 02:33 AM
Hmm... I see the problem. Run this query:

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


Bingo! :cool: Thanks a lot rob_daemon. Have a great weekend!

rob_daemon
07-09-2004, 04:21 AM
No problem; and have a great weekend yourself :)

kira
07-15-2004, 07:45 PM
One of my favorite hacks, ported over wonderfully to vb3. If I hadn't screwed up a query by repeating it accidentally (my fault entirely), this would've been a perfect install!

Great work. Thanks very much!

Bro_Joey_Gowdy
07-20-2004, 03:16 PM
clicks install

paulyy
07-23-2004, 06:35 AM
This didn't work properly for me either. I followed the instructions like a religious man and one of the queries wouldn't work, also I couldn't find where to "customise" the welcome PM, nor would the title of the PM show.

rob_daemon
07-23-2004, 11:02 PM
Hmm... that's very odd. Which query did not work? What version of vB are you running and what is the last updated date on the hack?

paulyy
07-24-2004, 03:27 PM
vB Version: 3.0.3

What do you mean by 'Last updated date'?

rob_daemon
07-24-2004, 05:35 PM
In the hack file, there's a line that says "Last Updated" and there's a date next to it. What is that date?

Datenpapst
07-26-2004, 12:57 PM
In the hack file, there's a line that says "Last Updated" and there's a date next to it. What is that date?
If I dont have 3.0.3 it also works or not?

rob_daemon
07-27-2004, 06:24 AM
It should work on any version from 3.0.0 to 3.0.3.

Datenpapst
07-27-2004, 07:41 AM
It should work on any version from 3.0.0 to 3.0.3.
Thats great :) Makes the board more personal :)

nogerorob
08-01-2004, 07:17 AM
First:

This is a great Mod. I've installed this with no problems, and clicked install. Thank you.


Thanks Rob, that did the trick. Very useful hack indeed! Is there a way to format the text in the welcome mail to put in links (to other pages on the forum)? I noticed HTML doesn't work.

I'm trying to create a link in the private message that takes the user to our Introductions and Greetings area. I had a shot at doing this in register.php as follows:

$username = $_POST['username'];
$intro_forum = '<a href="http://www.weeklydavespeak.com/forums/forumdisplay.php?f=13">Greetings and Introductions</a>';
// Process each one of the replacement vars
$vars = array(
'$bbtitle' => $vboptions['bbtitle'],
'$username' => $username,
'$email' => $email,
'$userid' => $userid,
'$intro_forum' => $intro_forum
);


But it ends up displaying the html code in the private message, rather than interpret it as a URL. Any ideas on how to create a link in the private message?

nogerorob
08-01-2004, 07:28 AM
aha!

I just figured out the answer to my question. No further modification of register.php is needed.

Simply use the vBcodes to create the link in adminCP -> vb options -> user registration -> welcome pm text . In my case:


Please take a moment to introduce yourself on the Greetings and Introductions Forum (http://www.weeklydavespeak.com/forums/forumdisplay.php?f=13)

rob

NietzscheKid
08-02-2004, 12:15 AM
Hi.

This is really a beautiful hack. But I cannot get it to work. I have tried several times. Deleted the mysql queries, re-installed them and this process I have repeated over and over. :(

The thing is that the welcome message appears in my admin cp. But, when I test it and register a test account, I get an error message (after hitting the complete registration button). I get a database error message. Please hit refresh etc.

Then it tells me that I am already registered when hitting refresh.

There is no automatic welcome message sent either.

And there is something very strange happening.

When I upload the new register.php file (with your code it is around 45 KB). The original register.php is around 38 KB). However, when I upload and replace the old php file with the new one, I get a 41 KB page on my ftp. So, it seems like for whatever reason, regardless of how many times I try to upload it, the register.php file reduces the 45 KB to 41 automatically.

Any help would be greatly appeciated. I really love this hack and would like to use it.

Thanks :)

NietzscheKid
08-02-2004, 01:22 AM
Hi.

This is really a beautiful hack. But I cannot get it to work. I have tried several times. Deleted the mysql queries, re-installed them and this process I have repeated over and over. :(

The thing is that the welcome message appears in my admin cp. But, when I test it and register a test account, I get an error message (after hitting the complete registration button). I get a database error message. Please hit refresh etc.

Then it tells me that I am already registered when hitting refresh.

There is no automatic welcome message sent either.

And there is something very strange happening.

When I upload the new register.php file (with your code it is around 45 KB). The original register.php is around 38 KB). However, when I upload and replace the old php file with the new one, I get a 41 KB page on my ftp. So, it seems like for whatever reason, regardless of how many times I try to upload it, the register.php file reduces the 45 KB to 41 automatically.

Any help would be greatly appeciated. I really love this hack and would like to use it.

Thanks :)
Actually, you've already answered my question a few pages back. I should read a whole thread before asking questions.

Thanks again.

"clicks install"

rob_daemon
08-02-2004, 04:39 AM
aha!

I just figured out the answer to my question. No further modification of register.php is needed.

Simply use the vBcodes to create the link in adminCP -> vb options -> user registration -> welcome pm text .

Glad you were able to solve your issue :)

Actually, you've already answered my question a few pages back. I should read a whole thread before asking questions.

Thanks again.

"clicks install"

Haha... glad you got it fixed yourself :)

nogerorob
08-02-2004, 07:16 AM
Glad you were able to solve your issue :)



Haha... glad you got it fixed yourself :)

Looks like this hack's on autopilot now. :)

I installed this hack thanks to the scubaboard's admin article here. (http://www.moderninsider.com/article54.html)

Nice work on this hack, I'm watching to see how it affects threads and posts.

Thanks again.

rob

fiber1
08-07-2004, 03:53 AM
Rob,

The text file you have is stretches horizontal in a few lines and very hard to follow.
Would it be to much to ask to align it left with the proper page breaks so it is easier to folllow?

Fiber

rob_daemon
08-07-2004, 04:07 AM
Rob,

The text file you have is stretches horizontal in a few lines and very hard to follow.
Would it be to much to ask to align it left with the proper page breaks so it is easier to folllow?

Fiber

Take a look at this (https://vborg.vbsupport.ru/showpost.php?p=510494&postcount=116) post and see if it helps.

fiber1
08-07-2004, 05:49 AM
Thanks, that issue happens from time to time.

Fiber

fiber1
08-07-2004, 11:49 PM
Very nice hack!

Thank you,

Fiber

nelto
09-13-2004, 07:09 AM
Hi
Great hack you have seted up here.
But Im having a little prb.
I installed it, everythitng was smoth as silk but.....
I tested it by registering myself with a different username, and I didnt got any pm on my pm box.
Any ideas?

rob_daemon
09-14-2004, 04:51 AM
Hmm... have you double checked that you specified all of the right variables in the Admin CP? After you check to make sure they're there, hit the save button, just to make sure the cache is rebuilt.

KW802
09-17-2004, 02:36 AM
* KW802 clicks "install" so he remembers to install this over the weekend. ;)

shadesvn
09-20-2004, 05:19 PM
I'm so tired to read all of your msgs for every cases ... could you guys please give a fresh instruction for VB 3.03 .. !

Thanks so much !

KW802
09-20-2004, 05:26 PM
I'm so tired to read all of your msgs for every cases ... could you guys please give a fresh instruction for VB 3.03 .. !

Thanks so much !:confused: I'm running 3.0.3 and used the instructions in the first post; took about 5 minutes.

ManagerJosh
09-21-2004, 05:53 AM
:confused: I'm running 3.0.3 and used the instructions in the first post; took about 5 minutes.
Rob, you might need to revise the hack a bit:

Invalid SQL: INSERT INTO pmtext
(
fromuserid,
fromusername,
title,
message,
touserarray,
iconid,
dateline,
showsignature,
allowsmilie
)
VALUES
(
1,
'ManagerJosh',
'Welcome to WorldSims Forums!',
'',
'a:1:{i:8387;s:13:"Sims2Kid'sMom";}',
0,
1095699710,
0,
0
)
mysql error: You have an error in your SQL syntax near 'sMom";}',
0,
1095699710,
0,
0
)' at line 19

mysql error number: 1064

shadesvn
09-21-2004, 10:46 AM
Rob, you might need to revise the hack a bit:
Just like KW802 said above ... and I got no problems 222 .. thanks for your confirmation mate .. !

Actually, don't change the original queries, MJosh .. you can change the PM's content in ACP later.

tbroush
09-25-2004, 04:51 PM
Awesome hack and very easy to install.

Carlos

joergh
10-03-2004, 12:00 AM
Very nice hack :nervous: :ninja:

joergh

mtha
10-14-2004, 05:18 AM
what about turning it on and off ?
Seem like the function wasnt implemented, so I gave it a shot.
If you already install the hack, do the followings

run this querry to add another option (turn on/off) to your "vB Registration Options

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmactive', 'register', '1', '1', '', 139, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmactive_title', 'Send default PM to new users?', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmactive_desc', '', '5000');


In registration.php

Look for

$pmoptions['regpmtext'] = $vboptions['regpmtext'];

add above:

$pmoptions['regpmactive'] = $vboptions['regpmactive'];


Look for:

// Send the new owner a PM
$DB_site->query(

Add above:

if ($pmoptions['regpmactive']) {


LOOK FOR

// ################################################## #################
// # END WELCOME PM HACK
// ################################################## #################

ADD ABOVE:

}

taffy056
10-14-2004, 10:02 AM
Hi,

I would like to add this on, but I am having a problem with phpMyAdmin, the problem is I have no real idea how to work it, can someone tell me in English how to to do these queries etc for this hack, I simply have no idea.

Thanks

taffy

rob_daemon
10-14-2004, 01:41 PM
The easiest way to run queries is through the Admin CP. You can find the documentation about it here (http://www.vbulletin.com/docs/html/main/maintenance_query)

zendiver
10-14-2004, 04:17 PM
One small thing to add for the more inexperienced members trying to install this hack. If you are following the updated version of the hack "Weclome PM Hack [Oct 14 2004]" and you open up phpMyAdmin to run the queries and you get the following error:
Error

SQL-query :

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

'regpmactive', 'register', '1', '1', '', 139, 0, 0
)

MySQL said:


Table 'database_name.setting' doesn't exist


it is because you have a prefix on your tables in your database.

To fix this problem, go back into the instructions and everwhere it says:
INSERT INTO `setting`
and
INSERT INTO phrase

make sure you add the prefix for your tables:

Example: My tables have vb3_ as the prefix so I added it to look like the following:
INSERT INTO `vb3_setting`
and
INSERT INTO vb3_phrase


Hope this helps
-Robert

mtha
10-14-2004, 05:51 PM
One small thing to add for the more inexperienced members trying to install this hack. If you are following the updated version of the hack "Weclome PM Hack [Oct 14 2004]" and you open up phpMyAdmin to run the queries and you get the following error:
Error

SQL-query :

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

'regpmactive', 'register', '1', '1', '', 139, 0, 0
)

MySQL said:


Table 'database_name.setting' doesn't exist


it is because you have a prefix on your tables in your database.

To fix this problem, go back into the instructions and everwhere it says:
INSERT INTO `setting`
and
INSERT INTO phrase

make sure you add the prefix for your tables:

Example: My tables have vb3_ as the prefix so I added it to look like the following:
INSERT INTO `vb3_setting`
and
INSERT INTO vb3_phrase


Hope this helps
-Robert

:) yeah, I just copy the original one over.

anyway, there's a fun way to do this:turn on debug mod, and add directly from ACP/vB Options :) but ... you have to know what you are doing, or you will distroy your board.

ManagerJosh
10-17-2004, 07:18 AM
Just like KW802 said above ... and I got no problems 222 .. thanks for your confirmation mate .. !

Actually, don't change the original queries, MJosh .. you can change the PM's content in ACP later.
Shades, if you read the SQL error in more detail, the error was about the hacking being unable to support apostrophes within the usernames, causing the insert in the PM text to break down.

Yes I know i can edit it manually, however it is just frustrating sometimes and well, annoying.

alwafi
10-19-2004, 12:23 AM
nice thanks

FleaBag
10-21-2004, 01:33 PM
I finally got around to installing this - used to use it on vB2. Thanks a lot. :)

Kwak
10-22-2004, 04:55 AM
I just love this hack. :cool: Props to the hacker.

Wifey
10-24-2004, 11:18 PM
* Wifey clicks install

GREAT hack! It works out really well with another hack I have installed in order to let people know how to check what usergroup they were sorted into. It also keeps another group of special members that I have who welcome new members to their clique with work :)

Thank you so much!

NightWalk8r
11-22-2004, 06:31 AM
I got this error when i try to run the queries:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text

Please help

rob_daemon
11-22-2004, 09:06 PM
I got this error when i try to run the queries:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text

Please help
Can you please paste the whole query here so I can try to trouble shoot it?

NightWalk8r
11-25-2004, 12:07 AM
I used this because my DB uses the vb3_ prefix.


INSERT INTO `vb3_setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmfrom', 'register', '1', '1', '', 140, 0, 0);
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmfrom_title', 'User Who Sends Automatic PM Upon Registration', '5000');
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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 `vb3_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);
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtext_title', 'Welcome PM Text', '5000');
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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 `vb3_setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmtitle', 'register', 'Welcome to $bbtitle!', 'Welcome to $bbtitle!', '', 160, 0, 0);
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmtitle_title', 'Title Of the PM That is Automatically Sent to New Users', '5000');
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (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')


This is the error i keep getting =/

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
INSERT INTO vb3_phrase (phraseid, languageid, varname, `text

rob_daemon
11-25-2004, 03:22 AM
I just ran all of those queries without problem. Try running each one individually to see where the problem occurs.

NightWalk8r
11-25-2004, 03:33 PM
wow!!! it works!!!! hmm.........i wonder why? -_-
Thank you soooo much =)

rob_daemon
11-25-2004, 11:53 PM
Very odd. Where were you running the queries? Command line, phpMyAdmin, vB Admin CP?

mtha
11-29-2004, 09:13 PM
Seem like the function wasnt implemented, so I gave it a shot.
If you already install the hack, do the followings

run this querry to add another option (turn on/off) to your "vB Registration Options

INSERT INTO `setting` (`varname`, `grouptitle`, `value`, `defaultvalue`, `optioncode`, `displayorder`, `advanced`, `volatile`) VALUES ('regpmactive', 'register', '1', '1', '', 139, 0, 0);
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmactive_title', 'Send default PM to new users?', '5000');
INSERT INTO phrase (phraseid, languageid, varname, `text`, phrasetypeid) VALUES (NULL, '0', 'setting_regpmactive_desc', '', '5000');


In registration.php

Look for

$pmoptions['regpmtext'] = $vboptions['regpmtext'];

add above:

$pmoptions['regpmactive'] = $vboptions['regpmactive'];


Look for:

// Send the new owner a PM
$DB_site->query(

Add above:

if ($pmoptions['regpmactive']) {


LOOK FOR

// ################################################## #################
// # END WELCOME PM HACK
// ################################################## #################

ADD ABOVE:

}


Rob, do you want to add this option to turn ON/OFF the welcome PM into your hack?

I think I'd be very handy for users

rob_daemon
11-30-2004, 03:45 AM
Rob, do you want to add this option to turn ON/OFF the welcome PM into your hack?

I think I'd be very handy for users
It's in the version in CVS, I've just been busy writing my term papers and other things to clean it up and update all the instructions. I'm hoping to get new versions of my three hacks out next weekend.

rob_daemon
12-06-2004, 05:06 AM
Okay. New version is done. It now has an on/off switch. Sorry for such a delay! I was trying to replicate Manager Josh's problem (page 15) but I was not able to with any form of magic quotes or any quote character as it is all escaped. Manager Josh: if you still have this problem please let me know :).

ManagerJosh
12-06-2004, 05:29 AM
still having it...I think :-/

Haven't officially rechecked recently. I'll do a test in a couple of hrs...meanwhile will upgrade to the latest changes to see if that bug still exists.

trackpads
12-07-2004, 12:14 AM
Great work and thanks for the update!!

Viks
12-10-2004, 11:07 PM
the hack text file is all so .. mish..mashed!!
cud you kindly upload a formated text file, it just easy to follow......especially for forum admins who are not techies.

:)

thanks

rob_daemon
12-11-2004, 12:13 AM
the hack text file is all so .. mish..mashed!!
cud you kindly upload a formated text file, it just easy to follow......especially for forum admins who are not techies.

:)

thanks
This could be caused by your editor, did you read this (https://vborg.vbsupport.ru/showpost.php?p=510494&postcount=116) post?

Viks
12-11-2004, 12:56 AM
thanks!!!!!!!!!

Delphiprogrammi
12-14-2004, 06:20 AM
i get SQL errors


MySQL retourneerde:


#1062 - Duplicate entry 'regpmon' for key 1


while running this query


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


the uninstallation instructions do not help ....

now how can i get rid of it :nervous:

Delphiprogrammi
12-14-2004, 07:04 AM
hi,

never mind that SQL error all installed and working fine thanks for another great one ;) *clicking install*

4number8
12-19-2004, 01:16 PM
Thanks alot, works like a charm....clicks Install ;)

tormodg
12-28-2004, 07:43 PM
This worked fine for me! Thanks. Installed!