Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Private Messaging
Avatar
Ozge Ozkaya
Member
Free Members
sp_UserOfflineSmall Offline
Jul 24, 2014 - 3:22 pm

I dont want forum members to use PM among themselves but just with moderators and admins. Is there a way to restrict this in Private Messaging?

Avatar
Ozge Ozkaya
Member
Free Members
sp_UserOfflineSmall Offline
Jul 24, 2014 - 3:37 pm

Sorry wrong images I insert.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 24, 2014 - 4:21 pm

Sorry but I don't think as standard you can decide which groups can receive PM's and which groups can't.. That doesn't mean it cant be achieved.

This might seem a little bit long winded, so please bare with me here!

 

First off, find 'Private Messaging system' in your SP plugins list and click 'options'. In these options you want to check the box that says 'Only allow sending of PMs from Send PM button on posts. You will not be able to address PMs from the PM compose panel.' Make sure its ticked- and update.

This as stated, will NOT allow users to PM people from there buddy list, or by name, and only allow PM's to be sent through the 'send PM' button that appears at the top of each post in the actions list (along with delete, edit, quote etc)

You will need to then open your 'spTopicView.php' template, find the function 'sp_PostIndexSendPm' and after the function you will see

 ('tagClass=spButton spRight', __sp('PM')    -    etc etc

 

Add another class to the tagClass of something like spPMbutton, so it will read

('tagClass=spButton spRight spPMbutton', __sp('PM')    -    etc etc

You've now made it so people can only PM through the PM button on a post, and you have given that PM button it's own class so we can change that class without it affecting the other buttons.

Here's where it gets specific. Each post made on the forum is defined by who posted it, a post from an admin will include the class spType-Admin, and a post from a user will contain spType-User. These classes can be used to change the appearance of that specific usergroup's posts using CSS.

You will then want to create 2 new lines in your stylesheet. If you are using the Default theme, this will be in forum-themes > default > styles > default.php

You will want to add:

#spMainContainer .spType-Admin .spPostActionSection .spPMbutton {
    display: inline;
}

#spMainContainer .spPostActionSection .spPMbutton {
    display: none
}

What this does, is allow the PM button for spType-Admin to show, and because the second line doesn't specify a usergroup, will NOT display the PM button for ANY other group, allowing people to only PM admins.

So there you go. Told you it was long winded, but does what you want. People will only PM admins. You can of course add other usergroups that you want people to be able to PM such as moderators (spType-Moderator) by adding their usergroup to the CSS like:

#spMainContainer .spType-Admin .spPostActionSection .spPMbutton,
#spMainContainer .spType-Moderator .spPostActionSection .spPMbutton{
    display: inline;
}

 

Hope this helps

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jul 24, 2014 - 4:35 pm

That's pretty ingenious...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 24, 2014 - 8:29 pm

clever indeed!

but do need to point out that doesnt prevent the other folks from emailing each other, but hides the button that enables them to do so...  advanced users might discover how to unhide the button and could still email others...

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Jul 25, 2014 - 5:54 am

Very true. I suppose it is as close as it's going to get to achieve what Ozge wants. 

And I forgot to add, If you want to make these changes, you really want to create your own child theme.. 

See creating a theme and child themes to preserve changes

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17344
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10117
Posts: 79600