View Full Version : Send default PM to all new users - templated
Overgrow
03-02-2002, 10:00 PM
Disclaimer:
-No support is offered for this hack. If you PM or email for support, it will be joyfully ignored. When I have time, I will answer questions in this thread.
Default PM to New Users - Templated
This is largely the work of Sparkz, in this thread:
https://vborg.vbsupport.ru/showthread.php?threadid=34498
I wanted to use this hack but felt it was a bit cumbersome since it used text files instead of the vB templates. This is a re-write and should be quicker and easier to install.
It also sends the PM after writing the user, not after activiation-- so it won't matter if you have email activation turned on or not. Also there is optional code to make the pmpopup work if you like.
Steps for installation:
-add two templates 'newpm_message' and 'newpm_title'
-edit one file 'register.php'
Overgrow
03-03-2002, 06:55 AM
<font size="1">Note: If you already have Sparkz version installed, you'll need to replace the code in register.php and add the new templates.</font>
Jadelit
03-03-2002, 07:31 AM
Thanks!
ForKmaN
03-03-2002, 07:47 AM
Very nice work!
thanks!
Floris
03-03-2002, 08:14 AM
Cool! Thank you :) Looks like you are a good hacker, nice to have you onboard. Your style and mine are alike.
nafae
03-03-2002, 01:59 PM
THANK YOU this is exactly what I was waiting on!!! I shall install asap
nafae
03-03-2002, 02:17 PM
Ok i installed it, tested it, and it works great. Now, when someone registers on my site, they get a pm from "The Welcome Wagon" :)
NYI Fan
03-03-2002, 08:38 PM
easy, simple, not hard, and did i mention EASY? Thanks! This is a great addition!
Goldfinger
03-03-2002, 09:48 PM
great hack.. veryyy nice.
Stylez
03-04-2002, 01:47 AM
ooh cool, it worked.
Lesane
03-04-2002, 03:12 PM
Neat hack, well done.
aldamon
03-04-2002, 06:03 PM
Overgrow, though I can't thank you enough for implementing the pmpopup function, it MUST happen after activation. When you register, there is a link to return to the Main BB view. This is the first thing newbs see, NOT the activation E-mail. When the newbs click this link, the pmpopup occurs, even if they are not activated. On my board, this pm hack is an incentive to actually read the PM box. What good is the popup if they can't actually get to the message? It's just confusing for them and I'd appreciate it if you could force the pmpopup after activation. That way they can actually click the link in the popup.
Thanks!
aldamon
03-05-2002, 12:58 PM
OK, I figured out what was going on. In my board, Users Awaiting E-Mail Confirmation cannot use the PM system. So when they get the popup, things go wrong because they cannot read the PM until they are activated.
I'd really like to see an alternate version of this updated hack where the PM is sent after activation, just like the original hack. I'd use the old hack, but there is no pmpopup functionality.
So either I use the old hack and get no pmpopup or I use the new hack and the PM is sent immediately instead of after activation. Hmmmm, what a pickel.
Supernature
03-05-2002, 07:58 PM
Thank you very much for this great Hack.
Just a simple Thing: The Image for "new Posts" doesn't show up, the Message seems to be "old" - is there a way to fix this?
NYI Fan
03-05-2002, 10:08 PM
aldamon
i use Firefly's "flash the pm bar on new message" hack
that works wonders!
aldamon
03-06-2002, 10:47 AM
I noticed that too. Without pmpopup on the message is not "new", it's old.
Vivi Ornitier
03-25-2002, 02:54 AM
Very Nice hack
it works perfectly once again thank you :)
Dontom
05-15-2002, 08:39 AM
easy to install, workin perfect!
Thank you very much!! i had 2 moderators do this manually every day - they are even more thankfull :)
Tom
trainer
05-15-2002, 03:20 PM
not sure what the problem is but i am getting this as the PM title
<!-- BEGIN TEMPLATE: newpm_title --> Welcome to ********! <!-- END TEMPLATE: newpm_title -->
instead of the "Welcome to ********!"
the rest is working fine. any ideas?
dreamhost
06-28-2002, 09:56 PM
Has anyone come up with the code change for popup only after registered? If so where can I find it? thanks
Cloughie
07-06-2002, 11:34 PM
Originally posted by Dontom
easy to install, workin perfect!
Thank you very much!! i had 2 moderators do this manually every day - they are even more thankfull :)
Tom
I get this too..
Does anyone know why?
Cloughie
07-08-2002, 10:06 AM
help me please.
I LOVE this hack and at the moment cannot use it :(
Cloughie
07-08-2002, 09:13 PM
please ;)
Cloughie
07-09-2002, 04:49 AM
I am hoping if I keep bumping this someone might help lol
Cloughie
07-10-2002, 01:09 PM
help :(
Thunderpuck
08-06-2002, 12:00 AM
Originally posted by Overgrow
Disclaimer:
-No support is offered for this hack. If you PM or email for support, it will be joyfully ignored. When I have time, I will answer questions in this thread.
It appears that Overgrow had little intention of supporting this hack even when he wrote it. Too bad, it's a great start to what could have been a very good hack.
:rolleyes:
Cloughie
08-06-2002, 09:24 AM
I forgot to say i turned of commenting in my admin panel and it sorted this out.
Sparkz
08-06-2002, 10:28 AM
Originally posted by Thunderpuck
It appears that Overgrow had little intention of supporting this hack even when he wrote it. Too bad, it's a great start to what could have been a very good hack.
:rolleyes:
[shameless plug]You could always try the original ;) https://vborg.vbsupport.ru/showthread.php?s=&threadid=34498[/shameless plug]
My hack has been heavily updated since Overgrow decided to write this templated version of it.
sreedchi
01-29-2003, 12:06 AM
Would be great to know if there was a way to make this default message show as "new." Otherwise, this hack is great and easy to install! Thanks.
Overgrow
01-29-2003, 05:15 PM
In the Insert query find:
.time().
and change it to
.(time()+60).
Should do it as it will make the message newer than their last activity. Have not tested this.
As far as supporting the hacks.. Yes I am a selfish hacker. I hack for myself and my site. No bones about it.. I release some code here if i I think it will help people but I do not have time to make modifications that people request. Since I never use email activation, my hacks won't take this into account. Sorry!
Bison
01-29-2003, 10:17 PM
I respect you opinon and agree with you about email activation ... gives you a little more time to review the person's form request before letting them in....
sreedchi
01-31-2003, 04:47 PM
Originally posted by Overgrow
In the Insert query find:
.time().
and change it to
.(time()+60).
That did it! Thanks - no need to apologize. We'll take whatever we can get from you. :)
sreedchi
01-31-2003, 04:56 PM
Although, now the 'New' flag doesn't seem to want to turn off. :(
I tried changing it to .(time()+1), but same issue. Oh well.
amykhar
02-04-2003, 12:20 PM
OK gang, here is what you need to do to a) send the PM after the member activates their account and b) make sure the message is new.
In actuality, doing a seems to ensure b. So this is easy.
INSTEAD OF doing this step in Overgrow's hack:
find
$DB_site->query("UPDATE session SET userid=$userid WHERE sessionhash='".addslashes($session['dbsessionhash'])."'");
directly after this, add
// send default PM to new user
eval("\$newpmtitle.= \"".gettemplate("newpm_title")."\";");
eval("\$newpmmessage.= \"".gettemplate("newpm_message")."\";");
$originating_user = 1;
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,messageread,folderid) VALUES (NULL,$userid,$userid,$originating_user,'".addslashes(htmlspecialchars($newpmtitle))."','".addslashes($newpmmessage)."',".time().",0,0)");
// send default PM to new user
DO THIS:
Find:
} else {
// activate account
if ($userinfo['customtitle']==0) {
$usergroup=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid=2");
if ($usergroup[usertitle]=="") {
$gettitle=$DB_site->query_first("SELECT title FROM usertitle WHERE minposts<=$userinfo[posts] ORDER BY minposts DESC
LIMIT 1");
$usertitle=$gettitle[title];
} else {
$usertitle=$usergroup[usertitle];
}
$dotitle=", usertitle='".addslashes($usertitle)."'";
} else {
$dotitle = '';
}
$DB_site->query("UPDATE user SET usergroupid=2 $dotitle WHERE userid='$u'");
$username=$userinfo[username];
Add AFTER:
// send default PM to new user
eval("\$newpmtitle.= \"".gettemplate("newpm_title")."\";");
eval("\$newpmmessage.= \"".gettemplate("newpm_message")."\";");
$originating_user = 22;
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,messageread,folderid) VALUES
(NULL,$u,$u,$originating_user,'".addslashes(htmlspecialchars($newpmtitle))."','".addslashes($newpmmessage)."',".time().",0,0)");
// send default PM to new user
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=2 WHERE userid=$u");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=2 WHERE userid=$u";
}
If you have done it correctly, the next line you see in the code is:
eval("standarderror(\"".gettemplate("error_activatedthanks")."\");");
Amy
amykhar
02-04-2003, 12:21 PM
Note, you don't need to tinker with time or anything else. This PM will be new and it does popup the first time the member logs in after activation.
Grunt
02-06-2003, 10:33 AM
works great amykhar..thanks to you and Overgrow for this hack...a small change to your code however amy..
instead of
$originating_user = 22;
it should be 1 (if you want the pm to be from #1 that is)
Also, if using amy's hack to the hack, you can ignore this in the original instructions:
OPTIONAL: If you want the PM alert box to pop up, add this part as well:
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=2 WHERE userid=$userid");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=2 WHERE userid=$userid";
}
sreedchi
02-06-2003, 12:20 PM
Thanks Overgrow, Amy, and Gruntie. Good teamwork!
Alien
04-27-2003, 05:07 AM
I just installed this one instead on vB 2.3.0 with amykhar's awesome modification and it's so much better!
Thanks you guys!
-Jason
cYbercOsmOnauT
06-19-2003, 06:02 PM
works great on my vB 2.3.0
* cYbercOsmOnauT clicked on install :)
Thanks mate!
Kriek
06-28-2003, 03:06 PM
First-rate work.
/me clicks install
Salazar
08-05-2003, 11:50 PM
01-29-03 at 04:06 AM sreedchi said this in Post #30 (https://vborg.vbsupport.ru/showthread.php?postid=347686#post347686)
Would be great to know if there was a way to make this default message show as "new."
Yes, and it would also be great if a new user gets a "new pn mail" after registering.
Nevertheless:
* Salazar clicks "install"...
Great hack! :cheeky:
vdich
10-20-2003, 05:34 PM
Hi
I have a problem with the Hack....
All new Users get always 2 default PM together...
How can i make this, to send just one message ?
thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.