Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard

Reply
 
Thread Tools
Auto-PM to Staff when a User is Banned Details »»
Auto-PM to Staff when a User is Banned
Version: 1.0, by Alan @ CIT Alan @ CIT is offline
Developer Last Online: Apr 2012 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.0 Beta 2 Rating:
Released: 06-17-2006 Last Update: Never Installs: 79
Uses Plugins
Is in Beta Stage  
No support by the author.

AutoPM Staff on Ban
Version 1.0


What does this do?
When one of your moderators or administrators bans a user, this mod will PM all staff (Mods and Admins) letting them know that the user has been banned!


Sounds Great! How do I install?
Installation couldn't be easier. Unzip the attached ZIP file and import the Product XML to your AdminCP as normal. - it adds 2 phrases, and 1 plugin


Can I customize the PM text?
Yep! The PM text is stored in a phrase called autopm_on_ban_message. You can edit this to put your own text in.

Note: In the PM message phrase, {1} is the name of the user who has been banned, and {2} is the name of the person who banned them.[/left]

Note 2: The person who bans the user will NOT receive a PM, so if your not receiving a PM, it's likely because you where the one who banned the user!


Important: Unfortunately, my leased vBulletin licence has now expired, and I won't be renewing it until September which means I will be unable to reply to this thread, or update this mod until then. I'm hopeful that the great vBulletin.org community will step in to answer any questions in my absence though See you all in early September!

Show Your Support

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

Comments
  #2  
Old 06-18-2006, 12:07 AM
Alan @ CIT Alan @ CIT is offline
 
Join Date: Nov 2004
Location: South UK
Posts: 625
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Known bugs: None!
Reply With Quote
  #3  
Old 06-18-2006, 12:45 AM
Christine's Avatar
Christine Christine is offline
 
Join Date: Oct 2001
Location: PA
Posts: 472
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice!

Easy to hook in a few other things with this like removing thread subscriptions.

Thanks!
Reply With Quote
  #4  
Old 06-18-2006, 11:53 AM
D.Ilyin D.Ilyin is offline
 
Join Date: Oct 2005
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alan @ CIT is it posable to add selected group for PM?
For examle admins only or superadmins?
Reply With Quote
  #5  
Old 06-18-2006, 11:55 AM
Alan @ CIT Alan @ CIT is offline
 
Join Date: Nov 2004
Location: South UK
Posts: 625
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not in it's current state I'm afraid. An option may be added to a future version.

Thanks,
Alan.
Reply With Quote
  #6  
Old 06-19-2006, 08:17 AM
Yorixz Yorixz is offline
 
Join Date: Jun 2005
Location: Netherlands
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pretty nice, will you also add the ban reason in the pm in the near future?
Reply With Quote
  #7  
Old 06-19-2006, 12:46 PM
klaush klaush is offline
 
Join Date: Oct 2005
Posts: 340
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds great. Will this still work with 3.5.4?
Reply With Quote
  #8  
Old 06-25-2006, 09:34 AM
bashy bashy is offline
 
Join Date: Nov 2005
Posts: 2,544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

After reading this post i went ahead and tried to install this but got this error
I am on 3.5.4
any ideas please?

Code:
Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
	(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
	('1', '5', 'AutoPM Staff on Ban', 'userdata_postsave', 'if ($usergroups_changed)\r\n{\r\n	// Check to see if the user has just been banned (in the last 10 seconds)\r\n	$ban_info_q = \"SELECT ban.userid, user.username\r\n		FROM \" . TABLE_PREFIX . \"userban AS ban\r\n		LEFT JOIN \" . TABLE_PREFIX . \"user AS user ON (ban.userid = user.userid)\r\n		WHERE ban.userid = \" . intval($userid) . \"\r\n		AND bandate > \" . (TIMENOW - 10) . \"\r\n		ORDER BY bandate DESC\r\n		LIMIT 1\";\r\n\r\n	if ($ban_info_a = $this->dbobject->query_first($ban_info_q))\r\n	{\r\n		// Users just been banned, so fetch the list of admins/mods to PM\r\n		$recipients_q = \"SELECT users.userid, users.username\r\n			FROM \" . TABLE_PREFIX . \"user AS users\r\n			LEFT JOIN \" . TABLE_PREFIX . \"administrator AS admins ON (admins.userid = users.userid)\r\n			LEFT JOIN \" . TABLE_PREFIX . \"moderator AS mods ON (mods.userid = users.userid)\r\n			WHERE users.userid IN (admins.userid)\r\n			OR users.userid IN (mods.userid)\";\r\n\r\n		$recipients_r = $this->dbobject->query_read($recipients_q);\r\n\r\n		while ($recipients_a = $this->dbobject->fetch_array($recipients_r))\r\n		{\r\n			$pmto_a[$recipients_a[\'userid\']] = $recipients_a[\'username\'];\r\n		}\r\n\r\n		// Create the final recipients list for the PM, removing the current user from the PM list\r\n		unset($pmto_a[$this->registry->userinfo[\'userid\']]);\r\n		$recipients = implode(\';\', $pmto_a);\r\n\r\n		global $vbphrase;\r\n\r\n		// Prepare the message title\r\n		$pm_title = construct_phrase(\r\n			$vbphrase[\'x_has_been_banned\'],\r\n			$ban_info_a[\'username\']\r\n		);\r\n\r\n		// Prepare the message text\r\n		$pm_text = construct_phrase(\r\n			$vbphrase[\'autopm_on_ban_message\'],\r\n			$ban_info_a[\'username\'],\r\n			$this->registry->userinfo[\'username\']\r\n		);\r\n\r\n		// Send the PM\r\n		$force_it_baby[\'adminpermissions\'] = 2;\r\n		\r\n		$pm =& datamanager_init(\'PM\', $this->registry, ERRTYPE_SILENT);\r\n		$pm->set(\'fromuserid\', $this->registry->userinfo[\'userid\']);\r\n		$pm->set(\'fromusername\', $this->registry->userinfo[\'username\']);\r\n		$pm->set(\'title\', $pm_title);\r\n		$pm->set(\'message\', $pm_text);\r\n		$pm->set_recipients($recipients, $force_it_baby);\r\n		$pm->set(\'dateline\', TIMENOW);\r\n\r\n		if (!$pm->errors)\r\n		{	\r\n			// No errors, so send the PM\r\n			$pm->save();\r\n		}\r\n	}\r\n\r\n}', 'cit_pm_on_ban');

MySQL Error  : Unknown column 'executionorder' in 'field list'
Error Number : 1054
Date         : Sunday, June 25th 2006 @ 04:31:25 AM
Script       : http://www.bashys-place.com/forums/admincp/plugin.php
Referrer     : http://www.bashys-place.com/forums/admincp/plugin.php?do=productadd
Reply With Quote
  #9  
Old 06-25-2006, 02:29 PM
klaush klaush is offline
 
Join Date: Oct 2005
Posts: 340
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same here!
Reply With Quote
  #10  
Old 06-25-2006, 03:58 PM
tEChniiQue tEChniiQue is offline
 
Join Date: Jan 2006
Location: Hawaii
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I received an error as well...Alan @ CIT I hope you're out there...

Quote:
Database error in vBulletin 3.5.4:

Invalid SQL:

### INSERT QUERY GENERATED BY fetch_query_sql() ###
INSERT INTO plugin
(`active`, `executionorder`, `title`, `hookname`, `phpcode`, `product`)
VALUES
('1', '5', 'AutoPM Staff on Ban', 'userdata_postsave', 'if ($usergroups_changed)\r\n{\r\n // Check to see if the user has just been banned (in the last 10 seconds)\r\n $ban_info_q = \"SELECT ban.userid, user.username\r\n FROM \" . TABLE_PREFIX . \"userban AS ban\r\n LEFT JOIN \" . TABLE_PREFIX . \"user AS user ON (ban.userid = user.userid)\r\n WHERE ban.userid = \" . intval($userid) . \"\r\n AND bandate > \" . (TIMENOW - 10) . \"\r\n ORDER BY bandate DESC\r\n LIMIT 1\";\r\n\r\n if ($ban_info_a = $this->dbobject->query_first($ban_info_q))\r\n {\r\n // Users just been banned, so fetch the list of admins/mods to PM\r\n $recipients_q = \"SELECT users.userid, users.username\r\n FROM \" . TABLE_PREFIX . \"user AS users\r\n LEFT JOIN \" . TABLE_PREFIX . \"administrator AS admins ON (admins.userid = users.userid)\r\n LEFT JOIN \" . TABLE_PREFIX . \"moderator AS mods ON (mods.userid = users.userid)\r\n WHERE users.userid IN (admins.userid)\r\n OR users.userid IN (mods.userid)\";\r\n\r\n $recipients_r = $this->dbobject->query_read($recipients_q);\r\n\r\n while ($recipients_a = $this->dbobject->fetch_array($recipients_r))\r\n {\r\n $pmto_a[$recipients_a[\'userid\']] = $recipients_a[\'username\'];\r\n }\r\n\r\n // Create the final recipients list for the PM, removing the current user from the PM list\r\n unset($pmto_a[$this->registry->userinfo[\'userid\']]);\r\n $recipients = implode(\';\', $pmto_a);\r\n\r\n global $vbphrase;\r\n\r\n // Prepare the message title\r\n $pm_title = construct_phrase(\r\n $vbphrase[\'x_has_been_banned\'],\r\n $ban_info_a[\'username\']\r\n );\r\n\r\n // Prepare the message text\r\n $pm_text = construct_phrase(\r\n $vbphrase[\'autopm_on_ban_message\'],\r\n $ban_info_a[\'username\'],\r\n $this->registry->userinfo[\'username\']\r\n );\r\n\r\n // Send the PM\r\n $force_it_baby[\'adminpermissions\'] = 2;\r\n \r\n $pm =& datamanager_init(\'PM\', $this->registry, ERRTYPE_SILENT);\r\n $pm->set(\'fromuserid\', $this->registry->userinfo[\'userid\']);\r\n $pm->set(\'fromusername\', $this->registry->userinfo[\'username\']);\r\n $pm->set(\'title\', $pm_title);\r\n $pm->set(\'message\', $pm_text);\r\n $pm->set_recipients($recipients, $force_it_baby);\r\n $pm->set(\'dateline\', TIMENOW);\r\n\r\n if (!$pm->errors)\r\n { \r\n // No errors, so send the PM\r\n $pm->save();\r\n }\r\n }\r\n\r\n}', 'cit_pm_on_ban');

MySQL Error : Unknown column 'executionorder' in 'field list'
Error Number : 1054
Date : Saturday, June 17th 2006 @ 07:56:26 PM
Script : http://www.xtreme-source.com/admincp/plugin.php
Referrer : http://www.xtreme-source.com/admincp...?do=productadd
IP Address : 67.53.37.197
Username : tEChniiQue
Classname : vb_database
Reply With Quote
Reply

Thread Tools

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 11:25 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.05370 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
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
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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