Firefox PHP

Send PM to Group

Posted by achim 
All files from this thread

File Name File Size   Posted by Date  
pm.diff.gz 683 bytes open | download achim 11/27/2006 Read message
Send PM to Group
November 27, 2006 10:22AM
Inspired by Brian's PM All Users Module I wrote a hack that allows admins to send PMs to entire groups. I tried to incorporate the changes into a module but gave up at some point. Making it work as a hack took me only a few minutes, oh my :(

please note that i am using post by id (i.e. a select form to choose recipients from). for name-based selection (edit form), some more modifications would be required.

Here's how it works:
- modified the pm template to present a list of all groups. these are prepended with an '@' and have a leading 'g' in the to_id form variable.

<select id="userselection" name="to_id">
in pm_post.tpl, add
                <?php if ($PHORUM['user']['admin'] ) {
                        $groups = phorum_db_get_groups();
                        foreach($groups as $group) {
                                echo "<option value=\"g{$group['group_id']}\">@".htmlspecialchars($group['name'])."</option>\n";
                } ?>

- modified pm.php to recognize group ids. patch is attached.

have fun

open | download - pm.diff.gz (683 bytes)
Sorry, only registered users may post in this forum.

Click here to login