Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Send default PM to all new users - templated Details »»
Send default PM to all new users - templated
Version: 1.00, by Overgrow Overgrow is offline
Developer Last Online: Jun 2004 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-02-2002 Last Update: Never Installs: 72
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 01-29-2003, 05:15 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #33  
Old 01-29-2003, 10:17 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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....
Reply With Quote
  #34  
Old 01-31-2003, 04:47 PM
sreedchi sreedchi is offline
 
Join Date: Dec 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.
Reply With Quote
  #35  
Old 01-31-2003, 04:56 PM
sreedchi sreedchi is offline
 
Join Date: Dec 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #36  
Old 02-04-2003, 12:20 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'])."'");
directly after this, add

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
DO THIS:
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];
Add AFTER:
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")."\");");
Amy
Reply With Quote
  #37  
Old 02-04-2003, 12:21 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #38  
Old 02-06-2003, 10:33 AM
Grunt Grunt is offline
 
Join Date: Aug 2002
Location: TN
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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";
		}
Reply With Quote
  #39  
Old 02-06-2003, 12:20 PM
sreedchi sreedchi is offline
 
Join Date: Dec 2002
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Overgrow, Amy, and Gruntie. Good teamwork!
Reply With Quote
  #40  
Old 04-27-2003, 05:07 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #41  
Old 06-19-2003, 06:02 PM
cYbercOsmOnauT's Avatar
cYbercOsmOnauT cYbercOsmOnauT is offline
 
Join Date: May 2003
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great on my vB 2.3.0
[high]* cYbercOsmOnauT clicked on install
[/high]

Thanks mate!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04863 seconds
  • Memory Usage 2,311KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete