Mass PM's Mod
#1
I couldn't find an existing mod/plugin to send the same pm to several users, so I modded the private.php file to do that (see attachment). I putted // ####... after each line I changed or added.
To be able to enter more names (seperated by ,) in the to input, you will have to edit the private_send template and delete the maxvalue of the "to" input field.
You will alsa have to add this line somewhere in your messages.language.php:
$l['error_pmerror'] = "An error has occured when sending one or more personal messages:";

Installation description:
Quote:-private.php
--REPLACE (+-r282)
$query = $db->query("SELECT u.uid, u.username, u.email, u.usergroup, u.pmnotify, u.pmpopup, u.receivepms, u.ignorelist, u.lastactive, u.language, COUNT(pms.pmid) AS pms_total, g.canusepms, g.pmquota, g.cancp FROM (".TABLE_PREFIX."users u, ".TABLE_PREFIX."usergroups g) LEFT JOIN ".TABLE_PREFIX."privatemessages pms ON (pms.uid=u.uid) WHERE u.username='".addslashes($mybb->input['to'])."' AND g.gid=u.usergroup GROUP BY u.uid");
--WITH
$error_stack = array();
$tousers = explode(",",$mybb->input['to']);
foreach($tousers as $tousername){
$query = $db->query("SELECT u.uid, u.username, u.email, u.usergroup, u.pmnotify, u.pmpopup, u.receivepms, u.ignorelist, u.lastactive, u.language, COUNT(pms.pmid) AS pms_total, g.canusepms, g.pmquota, g.cancp FROM (".TABLE_PREFIX."users u, ".TABLE_PREFIX."usergroups g) LEFT JOIN ".TABLE_PREFIX."privatemessages pms ON (pms.uid=u.uid) WHERE u.username='".addslashes(trim($tousername))."' AND g.gid=u.usergroup GROUP BY u.uid");

--REPLACE (+-r290)
error($lang->error_invalidpmrecipient);
--WITH
//error($lang->error_invalidpmrecipient);
$error_stack[] = $tousername . ": " . $lang->error_invalidpmrecipient;
continue;

--REPLACE (+-307)
error($lang->error_recipientignoring);
--WITH
//error($lang->error_recipientignoring);
$error_stack[] = $tousername . ": ". $lang->error_recipientignoring;
continue;

--REPLACE (+-311)
error($lang->error_recipientpmturnedoff);
--WITH
//error($lang->error_recipientignoring);
$error_stack[] = $tousername . ": ". $lang->error_recipientignoring;
continue;

--REPLACE (+-369)
error($lang->error_pmrecipientreachedquota);
--WITH
//error($lang->error_pmrecipientreachedquota);
$error_stack[] = $tousername . ": " . $lang->error_pmrecipientreachedquota;
continue;

--AFTER
$plugins->run_hooks("private_do_send_end");
--ADD
}
if(count($error_stack) > 0){
$error_msg = $lang->error_pmerror;
$error_msg .= "<ul>";
foreach($error_stack as $error_item){
$error_msg .= "<li>$error_item</li>";
}
error($error_msg);
exit();
}

-inc/lang/<your language>/messages.lang.php
--AFTER
$l['error_nosplitposts'] = "You cannot split this thread as you did not select any posts to split from this thread.";
--ADD
$l['error_pmerror'] = "An error has occured when sending one or more personal messages:";

-TEMPLATE private_send
--REPLACE
<input type="text" name="to" size="40" maxlength="$settings[maxnamelength]" value="$to" tabindex="1" />
--WITH
<input type="text" name="to" size="40" value="$to" tabindex="1" />


Attached Files
.php   private.php (Size: 39.58 KB / Downloads: 169)
Reply


Messages In This Thread
Mass PM's Mod - by Aries-Belgium - 2006-05-12, 12:28 PM
RE: Mass PM's Mod - by - 2006-05-12, 01:53 PM
RE: Mass PM's Mod - by Aries-Belgium - 2006-05-12, 01:55 PM
RE: Mass PM's Mod - by - 2006-05-12, 01:57 PM
RE: Mass PM's Mod - by zaher1988 - 2006-05-12, 02:10 PM
RE: Mass PM's Mod - by Aries-Belgium - 2006-05-12, 02:17 PM
RE: Mass PM's Mod - by - 2006-05-12, 02:23 PM
RE: Mass PM's Mod - by Aries-Belgium - 2006-05-12, 02:42 PM
RE: Mass PM's Mod - by IMPAQ - 2006-05-12, 02:47 PM
RE: Mass PM's Mod - by nekng - 2006-05-12, 09:14 PM
RE: Mass PM's Mod - by Aries-Belgium - 2006-05-13, 01:43 AM
RE: Mass PM's Mod - by IMPAQ - 2006-05-13, 02:34 AM
RE: Mass PM's Mod - by destroyer - 2006-05-13, 09:47 AM
RE: Mass PM's Mod - by stamp - 2007-08-25, 11:22 AM
RE: Mass PM's Mod - by RazorBlades - 2007-09-10, 07:41 PM

Forum Jump:


Users browsing this thread: 11 Guest(s)