Back to vBulletin 3.7 Template Modifications

Mass Private Messages on Memberlist
Mod Version: 1.00, by ThorstenA

This modification is in the archives.
vB Version: 3.7.4 Rating: (4 votes - 4.75 average) Installs: 32
Released: 19 Aug 2008 Last Update: Never Downloads: 5
Not Supported Template Edits Re-usable Code  

What does this modification do?
On memberlist select multiple users for Mass Private Messages them. This is done by only 2 template edits
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 by chikkoo
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>

Download

No files for download.

Screenshots

Click image for larger version
Name:	pn.JPG
Views:	1054
Size:	49.0 KB
ID:	85745  

Similar Mods

Mass Delete Old Private messages vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024