PDA

View Full Version : Banned Member Notification


tEChniiQue
06-17-2006, 10:43 PM
I would like a mod that sends an automated message to Admin and Moderators when a member has been banned. Is there something like this that exists or is there a way to have my board do this?

I'm currently using 3.5.4
Any help is greatly appreciated.

Alan @ CIT
06-18-2006, 12:14 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=118919" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=118919</a> - Should work fine with 3.5.4, but if you have any problems, let me know.

Thanks,
Alan.

tEChniiQue
06-18-2006, 12:34 AM
I did see your other post but "leaving no stones unturned" thanks again. I will apply it in a few minutes and let you know how it goes.

Much Appreciated!
tECh

UPDATE: I installed the file, created a test account but none of the Staff received a notification...any ideas????

Here is the message I get when I install the plugin:

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/plugin.php?do=productadd
IP Address : 67.53.37.197
Username : tEChniiQue
Classname : vb_database

tEChniiQue
06-25-2006, 07:53 AM
Just a freindly bump here wondering if anyone can help me understand why this mod is not working with my board.

A reply here or a PM would be GREATLY appreciated.

tEChniiQue
06-28-2006, 03:18 AM
Well, for those of you that have had problems getting this to install properly on version 3.5.4 I fixed the problem involved. If you need a version that will work with 3.5.4 just PM me and I'll get it to you.