11
Runeher
Re: Private messages
  • 2008/4/7 11:49

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Ok, i need some explaining here...

<{if $xoops_uid == '10024' or $xoops_uid == '10'}>

What is 10024? i gather theuser in question is user number 10 in the example? can more users be added by using

<{if $xoops_uid == '10024' or $xoops_uid == '10,33,207'}>

or is it the other way around?

Rune

12
Shine
Re: Private messages
  • 2008/4/7 12:32

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


I would prefer to exclude a usergroup ID instead of users.
You can create a usergroup in which you put that/those users who don't have permission to send PM's.
Let's say usergroup ID 5 is the group that isn't alowed to send PM's/

Now as for my question:
What code should be used and where -which file(s) to place?
Something with usergroup that's all I know.

Some pointing out would be great!
Thanks, Shine

13
trabis
Re: Private messages
  • 2008/4/7 12:53

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


If you are NOT using a PM module than you could do this:

Edit pmlite.php

Find around line 49:

xoops_header();
if ($xoopsUser) {
$myts =& MyTextSanitizer::getInstance();

make it this way to prevent the baduser to send a message to the ofended user:

xoops_header();
if ($xoopsUser) {
if ($xoopsUser->getVar('uid')==baduserID && $to_userid==ofendeduserID) redirect_header('index.php', 3, _PM_MESSAGEPOSTED);
$myts =& MyTextSanitizer::getInstance();



make it this way to prevent the baduser to send any messages:

xoops_header();
if ($xoopsUser) {
if ($xoopsUser->getVar('uid')==baduserID) redirect_header('index.php', 3, _PM_MESSAGEPOSTED);
$myts =& MyTextSanitizer::getInstance();


DonĀ“t forget to replace baduserID and ofendeduserID for the right ones.
It will say that the message was posted eheh, this way you will never ear a complaint!

14
Runeher
Re: Private messages
  • 2008/4/7 13:07

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Thanks! can you also separate baduserID's with a ,

15
trabis
Re: Private messages
  • 2008/4/7 18:41

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Do like this:


xoops_header();

$badusers = array(12,34,102,45);

if ($xoopsUser) {
if (in_array($xoopsUser->getVar('uid'), $badusers) && $to_userid==ofendeduserID) redirect_header('index.php', 3, _PM_MESSAGEPOSTED);

$myts =& MyTextSanitizer::getInstance();


replace 12,34,102,45... for the bad users IDs.

16
Runeher
Re: Private messages
  • 2008/4/7 19:19

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Thanks!

17
Shine
Re: Private messages
  • 2008/4/8 6:42

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


What should be the code if it concerns a specific usergroup ID?
Let's say usergroup: trouper (groupID = 5)
Something like...... ??
xoops_header();
if (
$xoopsUser) {
$group $xoopsUser->getGroups();
if (
in_array(5$group)) {  //ENTER GROUPID
redirect_header('index.php'3_PM_MESSAGEPOSTED);
$myts =& MyTextSanitizer::getInstance();
 }
}


??

18
Shine
Re: Private messages
  • 2008/4/9 5:22

  • Shine

  • Just can't stay away

  • Posts: 822

  • Since: 2002/7/22


^bump^

Login

Who's Online

190 user(s) are online (113 user(s) are browsing Support Forums)


Members: 0


Guests: 190


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