vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Changing userid for users being banned from modCP (https://vborg.vbsupport.ru/showthread.php?t=43002)

N9ne 08-31-2002 04:21 PM

Changing userid for users being banned from modCP
 
PHP Code:

// ###################### Start doban #######################
if ($HTTP_POST_VARS['action']=="doban") {
  
$perms=getpermissions();
  if (!
$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canbanusers=1")) {
    echo 
"<p>You do not have permission to do this!</p>";
    exit;
  }

  
$banuser=$DB_site->query_first("SELECT username,userid,usergroupid FROM user WHERE userid=$userid");
  
$ismod=$DB_site->query_first("SELECT moderatorid FROM moderator WHERE userid=$userid");
  if (
$banuser['usergroupid']!=or $ismod) {
    echo 
"<p>You may not ban someone who is not a normal registered user!</p>";
  }

  
$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE title='Banned by Moderators'");
  if (!
$bangroup) {
    
$DB_site->query("INSERT INTO usergroup
                       (usergroupid, title, usertitle, cancontrolpanel, canmodifyprofile, canviewmembers,
                        canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown,
                        canreplyothers, canviewothers, caneditpost, candeletepost, canusepm, canpostpoll, canvote,
                        canpostattachment, ismoderator, canpublicevent, canpublicedit, canthreadrate, cantrackpm,
                        candenypmreceipts)
                     VALUES
                        (NULL, 'Banned by Moderators', 'Banned', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"
);
    
$bangroup['usergroupid'] = $DB_site->insert_id();
    
$bangroup['title'] = 'Banned by Moderators';
  }

  if (
$bangroup['usergroupid']>6) {
    
$DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]");
    echo 
"<p>$banuser[username] has been banned!</p>";
  } else {
    echo 
"<p>An unknown error occured while attempting to ban $banuser[username] ($banuser[userid]). The group the user was supposed to be moved to was \"$bangroup[usergroupid]\"</p>";
  }
}

// ###################### Start viewuser ####################### 



That's the code from the root/mod/user.php

See where it says:

PHP Code:

    $bangroup['usergroupid'] = $DB_site->insert_id();
    
$bangroup['title'] = 'Banned by Moderators';
  } 

If I wish to change the group which users banned by moderators go into, do I just change 'Banned by Moderators' to the name of the group I want them to go into? Or is there more to this?

NTLDR 08-31-2002 04:31 PM

You need to change each instance of 'Banned by Moderators' that appears in that large chunk of code to the name of the group you want them to go into.

N9ne 08-31-2002 04:53 PM

Ok I searched and replaced Banned by Moderators with Banned in that code and it works flawlessly :)


All times are GMT. The time now is 03:04 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.02302 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete