vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Users Only Allowed to Send PMs to Staff (staff excluded) (https://vborg.vbsupport.ru/showthread.php?t=59170)

Gary King 12-13-2003 10:00 PM

Users Only Allowed to Send PMs to Staff (staff excluded)
 
Requested here: https://vborg.vbsupport.ru/showthread.php?t=59131

What does this hack do?

It restricts the user's usage of private messages, so that they can only send/receive private messages from administrators, supermoderators or moderators.

You are also able to turn this on or off at will, in the settings area of the admincp.

Instructions

Run the following query:[sql]INSERT INTO `setting` ( `settingid` , `settinggroupid` , `title` , `varname` , `value` , `description` , `optioncode` , `displayorder` ) VALUES ('', '19', 'Only allow staff to send PMs/users to send PMs to staff?', 'staffsendspms', '0', 'Do you want to only allow staff (moderators, supermoderators and administrators) to be allowed to send PMs, and only allow users to send PMs to staff?', 'yesno', '25');[/sql]

Open private.php and find
PHP Code:

  $signature=iif($signature=="yes",1,0); 

Above, add
PHP Code:

    // [Gary W] only allow staff to send / only allow users to send to staff
    
if ($staffsendspms and ($bbuserinfo['usergroupid'] != and $bbuserinfo['usergroupid'] != and $bbuserinfo['usergroupid'] != 7) and ($touserinfo['usergroupid'] != and $touserinfo['usergroupid'] != and $touserinfo['usergroupid'] != 7))
    {
        eval(
"standarderror(\"".gettemplate("error_canonlypmstaff")."\");");
        exit;
    } 

Create a new template named error_canonlypmstaff with the following content
HTML Code:

You can only send PMs to a member of the forum staff (administrator, supermoderator or moderator!)

Enjoy! :D

Dan 12-15-2003 10:35 AM

Nice hack Gary :D Won't use it though since it is for vB2

MindTrix 12-15-2003 03:46 PM

Nice idea mate! Thanks alot

Shell Geeks 12-26-2003 11:39 PM

wow that was an easy install :) great hack, this will be great to fight off all the lamers who register at boards just to blanket it with PM's

Gary King 12-27-2003 12:39 AM

Could people please click on Install if you installed it, just for courtesy, thanks :D

BabesAndStuff 12-28-2003 03:58 PM

can u use this with permissions to give some people normal rights and others the hacks limited to staff rights only

midnightz 01-23-2004 01:11 PM

Is there away, to have it where only accepted groups numbers can PM admins. I get a lot of PM's from newbies and groups and just don't want them. But I would like to kep in touch with the usergroups i feel choice.. ?

Possible,

Thanks

Gary King 01-23-2004 02:44 PM

Quote:

Originally Posted by midnightz
Is there away, to have it where only accepted groups numbers can PM admins. I get a lot of PM's from newbies and groups and just don't want them. But I would like to kep in touch with the usergroups i feel choice.. ?

Possible,

Thanks

Modify
PHP Code:

    if ($staffsendspms and ($bbuserinfo['usergroupid'] != and $bbuserinfo['usergroupid'] != and $bbuserinfo['usergroupid'] != and $bbuserinfo['usergroupid'] != X) and ($touserinfo['usergroupid'] != and $touserinfo['usergroupid'] != and $touserinfo['usergroupid'] != 7))


Replace the X with whatever usergroupid you want to allow to send PMs :)

midnightz 01-23-2004 03:03 PM

Great thanks :)

If I'm not mistaken before installing this will still block users from sending pms to other users?
and also allow myself to PM'ed by shosen usergroups.

Will the above code (i'm not sure) allow Pm's to fully operate as normal, meaning all users can pm all users, except admins (unless the usergroup is listed)

Thanks again for such a quick response :)

Gary King 01-23-2004 06:40 PM

Quote:

Originally Posted by midnightz
Great thanks :)

If I'm not mistaken before installing this will still block users from sending pms to other users?
and also allow myself to PM'ed by shosen usergroups.

Will the above code (i'm not sure) allow Pm's to fully operate as normal, meaning all users can pm all users, except admins (unless the usergroup is listed)

Thanks again for such a quick response :)

This will allow one extra usergroup to send PMs freely to anyone they want.


All times are GMT. The time now is 11:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01260 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete