2006-05-12, 12:28 PM
(This post was last modified: 2006-05-13, 02:20 AM by Aries-Belgium.)
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:
Installation description:
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" />