vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Private Messages Enhancements - Mass Private Messages (https://vborg.vbsupport.ru/showthread.php?t=201059)

ThorstenA 01-07-2009 10:00 PM

Mass Private Messages
 
1 Attachment(s)
Notice: This mod uses Re-usable Code, so please feel free to port it to vbulletin 4 under your username. Thanks.

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 the second instance this code appears:
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>


Hornstar 01-08-2009 11:40 PM

hey do you think you could make a different hack but similiar to this where you can mass pm from within the admincp (I'd like to mass pm certain usergroups sometimes, but I can only email them currently) you would rock if you could do that version.

anyway, thanks for this release, it might come in handy down the track.

ThorstenA 01-09-2009 04:30 AM

This modificationen makes use of memberlist template and therefore has to be completely rewritten for an admincp version. That is why I will not write an admincp version. I'd be glad if another one would complete this task.

NFLfbJunkie 01-09-2009 04:02 PM

I am unsure as to what needs to be done to restrict this to certain user groups. Where exactly does this go and what gets placed in the "here you do put template edits"?

HTML Code:

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


ThorstenA 01-09-2009 04:06 PM

Quote:

Originally Posted by Junkie (Post 1706454)
I am unsure as to what needs to be done to restrict this to certain user groups. Where exactly does this go and what gets placed in the "here you do put template edits"?

HTML Code:

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


You have to do this for all changed parts of this template (4x).

NFLfbJunkie 01-09-2009 04:11 PM

Sould I would put "<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">" at the beginning of your edits and then </if> at the end of your edits?

So your last edit

HTML 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


Would be

HTML Code:

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">
<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
</if>


ThorstenA 01-09-2009 04:19 PM

Only changes from template should be within new <if conditions>. For last change it would be like this:
HTML Code:

<if condition="in_array($bbuserinfo[usergroupid], array(5,6,7))">
<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>
</if>


NFLfbJunkie 01-09-2009 04:24 PM

Why was this left out? I'm still confused. Not that advanced of a coder.

</tr>
$memberlistbits

ThorstenA 01-09-2009 04:29 PM

Quote:

Originally Posted by Junkie (Post 1706475)
Why was this left out? I'm still confused. Not that advanced of a coder.

</tr>
$memberlistbits

This is html code from original template. You have to display this html code for all usergroups.

NFLfbJunkie 01-09-2009 04:31 PM

Would it be possible to get each of the required edits with the additional usergroup code? If so, can you PM it to me?

ThorstenA 01-09-2009 04:34 PM

Sorry, this mod is unsupported.

NFLfbJunkie 01-09-2009 04:38 PM

Can you at least help with the second edit. I have the one you already helped with and I try and do the other two on my own. I'm afraid I won't be able to figure out the big edit.

ThorstenA 01-09-2009 04:42 PM

Sorry, this mod is unsupported. If you want to code yourself and have questions about coding, please go to appropriate forums on vbulletin.org. Thank you.

ThorstenA 03-11-2009 01:48 AM

Re-Use: This code may be used in other modifications as long as the original author is credited.

Matt Lathrop 09-27-2009 12:36 PM

Is there a way to select all?

ThorstenA 09-27-2009 06:04 PM

Quote:

Originally Posted by Matt Lathrop (Post 1891294)
Is there a way to select all?

Yes. There is a "Check / Uncheck All" box.

ThorstenA 11-17-2009 10:39 PM

Notice: This mod uses Re-usable Code, so please feel free to port it to vbulletin 4 under your username. Thanks.

nando99 07-30-2010 08:23 PM

just installed this and reinstalled it like 3 times... i really doubt i'm doing something wrong but you never know :)... it does't work for me... every time i click on "send a private message to selected users" it says "no users selected"...

v3.8.2 here...

any help is appreciated...

togebi33 08-01-2010 03:05 PM

Where is demo ?

ThorstenA 08-01-2010 03:36 PM

No demo available, sorry. I upgraded my board to vb 4 and did not port this product to vb 4.

Notice: This mod uses Re-usable Code, so please feel free to port it to vbulletin 4 under your username. Thanks.

Jorrit787 10-08-2010 08:01 PM

These instructions aren't very precise. There are multiple instances of </form> in the memberlist template. If you don't specify which one to make the edit to, people will mess up their Member List page.

ThorstenA 10-08-2010 09:42 PM

I am unfimiliar with this modification for now. I am using vb 4.0.x and do not use this any more.

You may try to take the first </form> on the template.

Jorrit787 10-08-2010 10:19 PM

Quote:

Originally Posted by ThorstenA (Post 2108265)
I am unfimiliar with this modification for now. I am using vb 4.0.x and do not use this any more.

You may try to take the first </form> on the template.

Nice try but it's actually the second instance ;)

ThorstenA 10-09-2010 09:43 AM

Thanks for your clarification! I have updated my description.

mgurain 11-26-2010 12:22 PM

We are waiting for somebody to make it available for vb 4.x ?

Thanks,,

maryx 11-30-2010 01:20 PM

in 4.x this does not appear in the template:

</tr>
$memberlistbits

so I can't do the last template edit.

Anyone have any ideas about how to change this for 4.x?

I did the other template edits OK.

Anyone have any success with this for 4.x?

oldfan 12-16-2010 07:29 PM

Any luck porting this to 4.x yet?
thanks

Tyran1 03-03-2013 01:00 AM

Not works with 3.8.7


All times are GMT. The time now is 10:38 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.01238 seconds
  • Memory Usage 1,810KB
  • 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
  • (9)bbcode_code_printable
  • (5)bbcode_html_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete