We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Choose Contact via PM
Topic Started: Oct 31 2013, 02:40 AM (486 Views)
x DamnLol
Member
[ *  * ]
Is there an existing code for the "choose contact" that appears if you set it up via address book, but for all groups not just you personally

Ie;
Choose contact but with certain set persons, instead of having to set them urself?

bad at explaining but helly asked me to ask here :L if helena can explain better id be much obliged :p
Offline Profile Goto Top
 
Helena
Member Avatar
M is for Mod

The OP would like a code in which the admin can set up the names that appear in the ""Choose Contact" drop down list on the Compose Message page in the inbox for all members.

I assume that this would be in addition to any contacts members set up for themselves by adding to their own address book, but he can clarify that part.
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

If Helena is correct, it should be possible. Would you like the names you want to add to be added onto the user's address book or replace it?
Offline Profile Goto Top
 
x DamnLol
Member
[ *  * ]
replace it would be the best option
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Admin CP > Board Template > Below the Board:
Code:
 
<script type="text/javascript">
if (location.href === main_url + 'msg/?c=2') {
var contacts = [
['USER #1 ID', 'USER #1 DISPLAY NAME'],
['USER #2 ID', 'USER #2 DISPLAY NAME'],
['USER #3 ID', 'USER #3 DISPLAY NAME']
// LAST ID/NAME DOESN'T GET COMMA AFTER CLOSING BRACKET
],
$this;

if (!$('td.member_send').length) {
$('#pm_compose tbody').prepend('<tr id="choose_contact"><td class="member_send"><label>Choose Contact: <select name="from_contact"><option value="-1">None Selected</option></select></label></td></tr>');
$('#choose_contact').prepend($('#pm_compose tbody tr:eq(1) td:eq(0)').hide().clone().wrap('<span />').removeAttr('style').attr('rowspan', 2).parent().html());
}

$this = $('td.member_send select');

$this.children().each(function () {
if ($(this).index() !== 0) {
$(this).remove();
}
});

for (var id = 0; id < contacts.length; id++) {
$this.append('<option value="' + contacts[id][0] + '">' + contacts[id][1] + '</option>');
}
}
</script>
You'll need the user's ID (go to his/her profile, it's the value that comes after "/profile/") and a display name (it could be the user's username or any nickname you want to give the user). Also, please note that after each entry between the brackets, there should be a comma (and a ' to wrap around the ID and display name) - all except the last one.
Edited by DaPizzaMan, Feb 11 2014, 05:19 PM.
Offline Profile Goto Top
 
Moonface
Member Avatar


Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic