1
Peekay
Disable PMs except for notifications hack?
  • 2005/6/19 21:32

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I have posted this as as a feature request, but in the meantime, could anyone suggest a simple code hack that will stop users sending PMs, but allow them to receive and reply to messages from the webmaster? They would of course still need the ability to receive PM notifications?

If this is a pain to do, I would settle for disabling the sending or replying of PMs from the front end completely (comment out the 'Send' button perhaps?). Notifications still has to work.

I am a bit concerned about which template to mess with, or whether this needs some changes to a PHP file, so any help would be appreciated.

2
Mithrandir
Re: Disable PMs except for notifications hack?

Any simple code hack would not be enough, I think.
Even if you stripped everything from the templates, the PHP code would still be there and therefore it would be possible to specify the URL's directly and thus gain access to sending PMs.

Hopefully XOOPS 2.2 will have the option of restricting receiving and/or sending of PMs on a per-group basis, so you can restrict all registered users from sending PMs while they are still able to receive them. The restriction of only sending to a specified group is not in the plans, though.

It was for using the PM as a Helpdesk system, right? Why not use a module such as xHelp or something?

3
Peekay
Re: Disable PMs except for notifications hack?
  • 2005/6/19 22:14

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Thx Mithrandir. I have installed Xhelp (perfect for the job) but my problem is, I want to make sure *everyone* uses it to contact the webmaster - hence my desire to kill PMs on this particular site. The 'restrict from sending' plan you mention for future XOOPS version sounds just the job.

4
Peekay
Re: Disable PMs except for notifications hack?
  • 2005/6/19 23:45

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Actually, although I appreciate it can be circumvented, I have commented out the buttons and it's not a bad solution really, provided you don't use a module that has an explicit 'Send PM' button.

I can't post the exact code now 'cos it's on another PC, but I figured it out so it *must* be easy! If anyone is interested, here's what I did:

Xoops 2.0.10. To remove the PM button from the user profile:
userinfo.php around line 144
Replace the $xoopsTpl
->assign line 
(the one with with the javascript.open command
with a copy of the 'else' statement line directly below it
(so they both return a blank space).

To remove the 'Send' button from the inbox (empty and full):
viewpmsg.php around line 89 (if $display== 1)
Remove the formbutton (PM_SENDcode from the first <TD>.
Leave the delete button code in the second <TD
and 
leave the rest of the line in place
And 
directly below that,
viewpmsg.php around line 91 (the else statement)
Remove the formbutton code from the <TD>.

I generally fill empty TDs with a non-breaking space.

This enables users to reply to messages and delete them and view and delete notifications. Of course webmaster must send PMs from the 'Find Users' admin control.

If for some strange reason you may want to try this back up first. If it doesn't work, replace original files and vow never to take any notice of me ever again!.

Login

Who's Online

264 user(s) are online (172 user(s) are browsing Support Forums)


Members: 0


Guests: 264


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits