The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Send default PM to all new users - templated Details »» | |||||||||||||||||||||||||||
Send default PM to all new users - templated
Developer Last Online: Jun 2004
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/showthrea...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' Show Your Support
|
Comments |
#32
|
||||
|
||||
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! |
#33
|
||||
|
||||
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....
|
#34
|
|||
|
|||
Quote:
|
#35
|
|||
|
|||
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. |
#36
|
||||
|
||||
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 Code:
$DB_site->query("UPDATE session SET userid=$userid WHERE sessionhash='".addslashes($session['dbsessionhash'])."'"); Code:
// 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 Find: Code:
} 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]; Code:
// 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: Code:
eval("standarderror(\"".gettemplate("error_activatedthanks")."\");"); |
#37
|
||||
|
||||
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.
|
#38
|
|||
|
|||
works great amykhar..thanks to you and Overgrow for this hack...a small change to your code however amy..
instead of Code:
$originating_user = 22; Also, if using amy's hack to the hack, you can ignore this in the original instructions: Code:
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"; } |
#39
|
|||
|
|||
Thanks Overgrow, Amy, and Gruntie. Good teamwork!
|
#40
|
||||
|
||||
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 |
#41
|
||||
|
||||
works great on my vB 2.3.0
[high]* cYbercOsmOnauT clicked on install [/high] Thanks mate! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|