Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools
Automatic PM on New Thread Details »»
Automatic PM on New Thread
Version: 1.1, by Michael Biddle Michael Biddle is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.7.x Rating:
Released: 07-01-2008 Last Update: 07-01-2008 Installs: 22
Supported DB Changes Uses Plugins Template Edits Auto-Templates
 

Automatic PM on New Thread
by: whitemike


What this hack does?


This hack will allow the admin to setup a certain usergroup to receive an instant PM notification informing that usergroup that a new thread in the specified forum has been created.

How to install?
  1. Import the Product
  2. Template Edit: newthread
    • Find the following:
      HTML Code:
      <tr>
                  <if condition="$prefix_options">
    • Replace with:
      HTML Code:
      $sendpm
              
              <tr>
                  <if condition="$prefix_options">
You will need to go into your vBulletin Admin Control Center and do the following.
  1. On the left frame find: User Profile Fields
  2. Then click on: Add New User Profile Field. Set with these properties
    • Single Selection Menu
    • Title and description you can set to how you want it
    • Options: Yes and No (Make sure you separate by a line break)
    • Set Default: Yes, But No First Blank Option
    • Field Required: No, but display at registration
    • Field Editable by User: Yes
    • Display Page: Other:Options
    • Note: You can change the other settings that I did not list to how you want it
    • Important: After it saves you will be taken back to the User Profile Field Manager, here you will see what field# you have, such as field5, remember that number for later use.
Settings?
  1. vBulletin Options:
    • Userid - Enter the userid that the PM will be sent from
    • Username - Enter the username that the PM will be sent from
    • Usergroupid's - Enter the usergroupid's (separated by a coma) to send the PM to.
    • Custom Profile Field - Enter the custom profile field number that you set up above.
  2. Forum Manager
    • Enable/Disable
Customize it for yourself?

You can go ahead and edit the six phrases to suite your needs with it. The variables are prefixed with autopm_.

Please click install if you use!

Suggestions are always welcomed!

Supporters / CoAuthors

Show Your Support

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

Comments
  #12  
Old 07-03-2008, 12:25 AM
xorex's Avatar
xorex xorex is offline
 
Join Date: Jan 2008
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitemike View Post
Updated. Should have the fix now.

Now mistake


Invalid SQL:

ALTER TABLE forum
ADD sendpm SMALLINT( 5 ) UNSIGNED DEFAULT '0' NOT NULL;

Error MySQL : Duplicate column name 'sendpm'
Reply With Quote
  #13  
Old 07-03-2008, 03:57 AM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is because it was added in the first query. Go ahead and remove that field from the forum table, and then import again.
Reply With Quote
  #14  
Old 07-03-2008, 05:20 AM
VB-STYLE VB-STYLE is offline
 
Join Date: Jun 2005
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great mod & install

If you can do some more things will be wonderful.

1- Automatic PM Title better to be with the thread title. Price quote requested for thread {1}.
2- If there is resend bottum when the thread be come importent and i need to sent it to the defined group.
Reply With Quote
  #15  
Old 07-21-2008, 12:55 PM
chris1979 chris1979 is offline
 
Join Date: Oct 2006
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get this error:



Database error in vBulletin 3.7.0:

Invalid SQL:
SELECT gfpoforumoptions FROM forum WHERE forumid =;

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 '' at line 1
Error Number : 1064
Request Date : Monday, July 21st 2008 @ 01:51:52 PM
Error Date : Monday, July 21st 2008 @ 01:51:53 PM
Script : http://www.nlpconnections.com/newthr...ostthread&f=75
Referrer : http://www.nlpconnections.com/newthr...newthread&f=75
IP Address : xxxxxxxxx
Username : chris_morris
Classname : vB_Database
MySQL Version : 5.0.45
Reply With Quote
  #16  
Old 07-21-2008, 03:34 PM
rooban12 rooban12 is offline
 
Join Date: May 2007
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good work
Reply With Quote
  #17  
Old 07-22-2008, 05:26 AM
Michael Biddle Michael Biddle is offline
 
Join Date: Apr 2004
Location: Anaheim, CA
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by chris1979 View Post
I get this error:



Database error in vBulletin 3.7.0:

Invalid SQL:
SELECT gfpoforumoptions FROM forum WHERE forumid =;

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 '' at line 1
Error Number : 1064
Request Date : Monday, July 21st 2008 @ 01:51:52 PM
Error Date : Monday, July 21st 2008 @ 01:51:53 PM
Script : http://www.nlpconnections.com/newthr...ostthread&f=75
Referrer : http://www.nlpconnections.com/newthr...newthread&f=75
IP Address : xxxxxxxxx
Username : chris_morris
Classname : vB_Database
MySQL Version : 5.0.45
This error has nothing to do with my modification.
Reply With Quote
  #18  
Old 07-22-2008, 06:11 AM
yahoooh yahoooh is offline
 
Join Date: Oct 2002
Posts: 567
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i suggest subscription if the user want to be e-mailed or pm if another user write a new thread
which is usefull
Reply With Quote
  #19  
Old 08-22-2008, 03:57 AM
tk102 tk102 is offline
 
Join Date: Feb 2008
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just installed. Good job, it was just what I was looking for.


Three things:

1) It'd be nice to have the recipient usergroups to be specified on a forum-by-forum basis rather than a single set of groups. Haven't looked at what this would require though.

2) I noticed that for members that have already registered, their new userfield value in the userfield table shows up as NULL rather than Yes or No, which is deceptive since it appears to be Yes in the User Options area of the UCP. There's plenty of workarounds to this including simply reversing the "Yes / No" options to "No / Yes" when creating the userfield during installation. This would cause the No to show up in the UCP by default which has the same behavior here as NULL.

3) I noticed that your "AutoPM Save Thread Info" hook only looks for users who have the recipient usergroup as their primary usergroup. I added the following to the code to search for users who have the recipient group as a secondary group (though there's probably a more efficient means to do this):

After this:
Code:
		while ($name = $vbulletin->db->fetch_array($usernames))
		{
			$pm2users[] = $name['username'];
		}
		
		$vbulletin->db->free_result($usernames);
Insert this:
Code:
                $autopm_groups=explode(',',$vbulletin->options['sendpm_usergroups']);
                while ($autopm_group = array_shift($autopm_groups)) {
                    $usernames = $vbulletin->db->query_read("
                            SELECT username
                            FROM " . TABLE_PREFIX . "user
                            LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (user.userid = userfield.userid)
                            WHERE membergroupids REGEXP '(^|,| )".trim($autopm_group)."($|,| )'
                            AND field" . $vbulletin->options['sendpm_sendme'] . " = 'Yes'
                            ORDER BY username ASC
                    "); 
                    while ($name = $vbulletin->db->fetch_array($usernames))
                    {
			$pm2users[] = $name['username'];
                    }
                    $vbulletin->db->free_result($usernames);   
                }
Thanks for the mod!
Reply With Quote
  #20  
Old 08-23-2008, 02:17 AM
Videx's Avatar
Videx Videx is offline
 
Join Date: Feb 2007
Posts: 3,085
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why should I use this instead of Instant New Thread Notification? It seems to me this mod requires two steps to do what the other one does in one. Or am I missing something?
Reply With Quote
  #21  
Old 09-09-2008, 11:17 AM
students_forum's Avatar
students_forum students_forum is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Videx View Post
Why should I use this instead of Instant New Thread Notification? It seems to me this mod requires two steps to do what the other one does in one. Or am I missing something?
1- it is a PM and not email
2- you have to subscribe to the forum
Reply With Quote
 


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 04:26 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04701 seconds
  • Memory Usage 2,312KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_code
  • (2)bbcode_html
  • (3)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
  • (2)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