Firefox PHP

PM All users

Posted by Brian Moon 
All files from this thread

File Name File Size   Posted by Date  
bulk_pm.php 414 bytes open | download Brian Moon 08/30/2006 Read message
bulk_pm.php 869 bytes open | download Maurice Makaay 07/10/2007 Read message
bulk_pm.php 913 bytes open | download Maurice Makaay 07/11/2007 Read message
PM All users
August 30, 2006 11:48PM
This is a short little module to let an admin (only an admin, not a moderator) send a PM to all users. Simply type the word ALL in the To: field. Of course, if you enable the drop down of users, it does not work.

If you use this module, you may want to consider a template hack I have used on other sites. It basically keeps the PM read page from listing thousands of usernames. That can be a lot of HTML.

    {LANG->To}: 
    <?php if(count($PHORUM["DATA"]["MESSAGE"]["recipients"])>10){ ?>
        {USERINFO->username}
        <?php
            $count = number_format(count($PHORUM["DATA"]["MESSAGE"]["recipients"])-1);
            echo "and $count other users";     
        ?>
    <?php } else { ?>
        {ASSIGN ISFIRST true}
        {LOOP MESSAGE->recipients}
            <div style="display:inline; white-space: nowrap">
                {IF NOT ISFIRST}, {/IF}
                <a href="{MESSAGE->recipients->to_profile_url}">{MESSAGE->recipients->username}</a>
                {IF USERINFO->user_id MESSAGE->from_user_id}
                    {IF NOT MESSAGE->recipients->read_flag}({LANG->PMUnread}){/IF}
                {/IF}
                {ASSIGN ISFIRST false}
            </div>
        {/LOOP MESSAGE->recipients}
    <?php } ?>

Brian - Cowboy Ninja Coder - Personal Blog - Twitter



Edited 1 time(s). Last edit at 11/15/2006 06:01PM by brianlmoon.
Attachments:
open | download - bulk_pm.php (414 bytes)
Re: PM All users
September 01, 2006 10:44AM
Hello Brian,

"Of course, if you enable the drop down of users, it does not work."

You mean "if you disable the drop down of users" ?

Cause it doesn't work without dorp down users for me.
Re: PM All users
September 01, 2006 10:46AM
No, he means "if you enable". Because if you do that, you won't have a text entry where you can type the word "ALL". You only can select users from a predefined list in that way.

Did you use "ALL" in capitals?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: PM All users
September 01, 2006 10:55AM
Yes i use ALL in capitals.

I also have a user registered with the login : All
But i don't think the problem comes from that.
Re: PM All users
September 01, 2006 11:21AM
That would be easy to check out. I do think they might collide. Change "ALL" in Brian's mod to "ALLUSERS" and use that string for posting.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: PM All users
September 12, 2006 02:58PM
I hijack the request pretty early I thought. I would not think having a user named All would be a problem.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: PM All users
July 10, 2007 04:37PM
Hi,

Can you tell me how to install this mod?

Thanks.
Re: PM All users
July 10, 2007 04:54PM
1) Upload it to mods/bulk_pm.php in your Phorum install directory.
2) Enable the module.
3) Enjoy!


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: PM All users
July 10, 2007 05:08PM
Thanks :-)

Having enabled by default the drop down list of users for my little community (since we are not thousands), I cannot access the text entry field where I can input the "ALL" command.

I can change that option in the admin. but will that affect the global settings of the forum and affect my users?

Constantin.



Edited 2 time(s). Last edit at 07/10/2007 05:09PM by Constantin.
Re: PM All users
July 10, 2007 05:27PM
I see. Please try the attached modified version of the module (fully untested code, so I'm not sure if it works). After putting it in de mods directory, go to the modules screen and disable the module. After that, re-enable it to have the new code loaded. If things work like I meant to, then you have an extra option "PM to all users" in the drop down list.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Attachments:
open | download - bulk_pm.php (869 bytes)
Sorry, only registered users may post in this forum.

Click here to login