vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Private Messages Enhancements - Mass Private Messages on Memberlist (https://vborg.vbsupport.ru/showthread.php?t=188560)

ThorstenA 08-18-2008 10:00 PM

Mass Private Messages on Memberlist
 
What does this modification do?
On memberlist select multiple users for Mass Private Messages them. This is done by only 2 template edits :D
What is Mass PM? It's like Mass Mail in admincp. You write one pm to multiple users.

How to
In template memberlist_resultsbit replace
Code:

</tr>
with
Code:

<td class="$bgclass"><input type="checkbox" name="deletebox[$userinfo[userid]]" value="$userinfo[userid]" /></td>
</tr>

In template memberlist replace
Code:

<form action="profile.php?do=deleteusergroups&amp;usergroupid=$usergroupid" method="post">
<input type="hidden" name="do" value="deleteusergroups" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="usergroupid" value="$usergroupid" />

with
Code:

        <script type="text/javascript">
        <!--
        function pm(tform)
        {
                var users = new Array();
                var arrCount = 0;
                for (i = 0; i < tform.elements.length; i++)
                {
                        var element = tform.elements[i];
                        if ((element.name != "allbox") && (element.type == "checkbox") && (element.checked == true))
                        {
                                users[arrCount] = element.value;
                                arrCount++;
                        }
                }
                if (arrCount == 0)
                {
                        alert("$vbphrase[no_users_selected]");
                }
                else
                {
                        var querystring = "";
                        for (i = 0; i < users.length; i++)
                        {
                                querystring += "&userid[]=" + users[i];
                        }

                        self.location=        "private.php?$session[sessionurl]do=newpm" + querystring;

                }
        }
        // -->
        </script>
<if condition="$totalcols++"></if>
<form action="private.php" method="post" name="vbform">

In template memberlist also replace
Code:

</form>
with
Code:

<input type="button" class="button" value="$vbphrase[send_private_message_to_selected_users]" onclick="pm(this.form);" title="title" style="float:right"/>
</form>

In template memberlist also replace
Code:

</tr>
$memberlistbits

with
Code:

<td class="thead" align="right"><input type="checkbox" name="allbox" title="$vbphrase[check_uncheck_all]" onclick="js_check_all(this.form);" />$vbphrase[check_uncheck_all]</td>
</tr>
$memberlistbits



How does this template modification work?
This template edit puts a checkbox right to each user. If you click on "Send PMs", the small javascript generates a custom url "private.php?do=newpm&userid[]=1&userid[]=2&userid[]=3" and refreshes actual window with this url. Javascript code is mostly from Quick Links > Open Buddy List.

FAQ
Quote:

Originally Posted by chikkoo (Post 1668587)
I installed this product. But I don't want to show this feature to everyone. Is there a way to restrict few usergroups, such as admin, supermoderators and moderators?

You can for example only show this mod for moderators, supermoderators and administrators (usergroups 5,7,6). Note that you have to put this condition for any template edit you want to only show to these usergroups.
Code:

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">
here you do put template edits
</if>


princeedward 08-19-2008 05:52 PM

:erm: what is Mass PN :confused:

ThorstenA 08-19-2008 05:58 PM

It's like Mass Mail in admincp. You write one pm to multiple users.

steve1966 08-19-2008 05:58 PM

Quote:

Originally Posted by princeedward (Post 1602473)
:erm: what is Mass PN :confused:

Private message i presume

blind-eddie 08-19-2008 06:07 PM

Finally, great job.
I tried to get this very same edit to work for me long ago.

I assume this picks up usergroup permissions?

ThorstenA 08-19-2008 06:11 PM

Quote:

Originally Posted by blind-eddie (Post 1602486)
Finally, great job.
I tried to get this very same edit to work for me long ago.

I assume this picks up usergroup permissions?

All usergroup permissions are used from vbulletin.

This template edit just puts a checkbox right to each user. If you click on "Send PMs", the small javascript just generates a custom url "private.php?do=newpm&userid[]=1&userid[]=2&userid[]=3" and refreshes actual window with this url. Nothing special here, javascript code is mostly from Quick Links > Open Buddy List.

blind-eddie 08-19-2008 06:13 PM

Awesome, Thank you.

ThorstenA 08-19-2008 06:15 PM

I am also working on a "Select All" checkbox, help is appreciated :D

blind-eddie 08-19-2008 06:26 PM

Quote:

Originally Posted by ThorstenA (Post 1602500)
I am also working on a "Select All" checkbox, help is appreciated :D

Incorporate this into it.

Code:

<td class="thead" align="right"><input type="checkbox" name="allbox" title="Check All" onclick="js_check_all(this.form);" />Check All</td>

ThorstenA 08-19-2008 06:35 PM

Quote:

Originally Posted by blind-eddie (Post 1602516)
Incorporate this into it.

Code:

<td class="thead" align="right"><input type="checkbox" name="allbox" title="Check All" onclick="js_check_all(this.form);" />Check All</td>

Thank you very much! It works great. I have added this to my template modification how to.


All times are GMT. The time now is 11:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02213 seconds
  • Memory Usage 1,753KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete