vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Banned by moderator... (https://vborg.vbsupport.ru/showthread.php?t=40724)

Glock 07-06-2002 12:37 AM

Banned by moderator...
 
I want it to be so that when the moderators click the ban button, it moves them to usergroup Banned, a group I have custom created, and wish to have all banned users in.

Thanks

Admin 07-06-2002 04:28 AM

Does it not do this already?

Glock 07-06-2002 04:42 AM

It puts them in usergroup "Banend by Moderator" which is kind of annoying, since I am active in taking care of trolls too, and just want them all in one group, the one that I custom created.

Logician 07-06-2002 06:56 AM

edit MOD\user.php (Notice this is the file under MOD dir)

find:

PHP Code:

 $DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]"); 

Replace it AS:

PHP Code:

 $DB_site->query("UPDATE user SET usergroupid=X WHERE userid=$banuser[userid]"); 

Change X with any user group id you want.

Be careful about writing the correct usergroup id here! We dont want them become Site Admins accidently, do we? :p

Enjoy..
Logician

Glock 07-06-2002 07:07 AM

It puts them in the correct usergroup, but still automatically adds Banned by Moderator, and it also doesn't update their Status to Banned, like it would automatically do if an admin switched their group.

Xenon 07-06-2002 09:02 AM

"and it also doesn't update their Status to Banned, like it would automatically do if an admin switched their group."

Thats a known bug, a fix is somewhere in the releasforum as i know

Glock 07-06-2002 03:51 PM

Have any idea of what it is called? And what about it still adding the other usergroup?

Xenon 07-06-2002 04:04 PM

you have to delete/outcomment this passege in mod/user.php:
PHP Code:

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';
  } 

so no new group would be created..

this is the link to the hack update user title:
https://vborg.vbsupport.ru/showthrea...threadid=33711

Chris M 07-06-2002 04:27 PM

Thanks for that:)

Satan

Glock 07-06-2002 07:48 PM

Outcomment? I'm new at this...

Glock 07-06-2002 08:39 PM

$DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]");

For that hack...this isn't in my file at ALL...and how exactly do I integrate these two?

Xenon 07-06-2002 08:44 PM

outcomment means to make a /* at the beginning of the passage and a */ at the end :)
i hope this phrase exists in english ^^

this line must be in your mod/user.php, if not, you should take the standart file from vb and not a hacked one ;)

Glock 07-06-2002 08:47 PM

So put a slash and then an asterik right before and right after that passage?

Xenon 07-06-2002 08:49 PM

yes, so php will handle it as a comment and wont parse it anymore..:

it should look so:
PHP Code:

/*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';
  }*/ 


Glock 07-06-2002 08:56 PM

I'm getting An unknown error occured while attempting to ban eigthlegion (32). The group the user was supposed to be moved to was "" after outcommenting it...

Xenon 07-06-2002 08:58 PM

yes, you have to apply logicians modifications too
just outcommenting would always produce an error

Glock 07-06-2002 09:02 PM

I did...it's only error when I outcomment it.

Xenon 07-06-2002 09:03 PM

oh, i see, instead of doing all this changes in this thread, you can do a very small change to get what ya want.

take your original user.php

find
PHP Code:

$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE title='Banned by Moderators'"); 

and replace it with this:
PHP Code:

$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE usergroupid=X"); 

replace th x with the usergroupid of your bangroup ;)

Glock 07-06-2002 09:09 PM

Should I still do the outcomment then?

Xenon 07-06-2002 09:10 PM

no, don't use any of the changes here in the thread, wether logicians nor mine, just make the last change i post, this should be enough

Glock 07-06-2002 09:11 PM

And will just doing this instead of outcommenting if I don't need to make the database or anything hinky?

Xenon 07-06-2002 09:12 PM

this small change is all what ya need, you don't have to do anything more

Glock 07-06-2002 09:15 PM

Yep, I tried it and it works...I was just wondering if it will still try and add that usergroup and just get denied, or will it really even matter? Also for the user title, I think it edits the same line of code that I had to change for the current hack, what do I do about that to make it update the title?

Xenon 07-06-2002 09:21 PM

it would just try to create another usergoup if your usergroup x won't exist.

you can implement the hack as it is said in the txt-file, just instead of changing the line to
PHP Code:

$bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE title='Banned by Moderators'"); 

you have to change it to
PHP Code:

$bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE usergroupid=x"); 


Glock 07-06-2002 09:27 PM

It exists, so will it still try to create Banned by Moderator, or just ignore that completely?

Xenon 07-06-2002 09:31 PM

it will ignore that passage

Glock 07-06-2002 09:33 PM

Now I'm getting "You may not ban someone who is not a normal registered user!"

Glock 07-06-2002 09:34 PM

After adding the update title hack at least, not from yours...

Xenon 07-06-2002 09:36 PM

are you sure you haven't banned this person before?
if this person isn't in usergroup 2, you cannot ban it with the mod cp

Glock 07-06-2002 09:41 PM

Yeah, they're listed as a member and it's doing it. Do you want to to post a copy of my current user.php so you can confirm I have the coding right?

Glock 07-06-2002 09:47 PM

Also, should I have:

$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE usergroupid=X");

or

$bangroup=$DB_site->query_first("SELECT usergroupid,title,usertitle FROM usergroup WHERE usergroupid=x");

Since you have said both, but I'm assuming the second and using that...

Glock 07-06-2002 09:50 PM

They are in usergroup 2, If you know at all...why do I have usergroups up to 8, when I only have 6 too?

Xenon 07-07-2002 07:05 AM

the usergroupid of your banned group must be higher than 6:
PHP Code:

if ($bangroup['usergroupid']>6) { 

it's just a security issue, you can change the if-clause if ya want.

this is the line which produces your error:
PHP Code:

if ($banuser['usergroupid']!=or $ismod) {
    echo 
"<p>You may not ban someone who is not a normal registered user!</p>";
  } else { 

as you can see, if the user isn't in usergroup2 or the user is a mod, then it'll occure, no other possibilities to occur, so you have to recheck your user...

Glock 07-07-2002 07:12 AM

For the usergroup, is there a way to allow them to ban other usergroups also, such as going 2,3? For some reason, I redid the file and everything is working normally before, so that's setup fine, thanks fo rhte help. One thing though, I turned on moderate new users, and now all users are autlmatically being set to Administrator, could this hack have had anything to do with it?

Xenon 07-07-2002 08:04 AM

no, this hack hasn't anything to do with this problem.
perhaps you have made the moderated gruop as a secound admingroup?

you shouldn't change the rights of usergroups < 7, because often vb puts automatically users in one of this groups...

to ban also other usergroups, just add a clause to this:
PHP Code:

if ($banuser['usergroupid']!=or $ismod) {
    echo 
"<p>You may not ban someone who is not a normal registered user!</p>";
  } else { 

for example banning also usergroup3:
PHP Code:

if ($banuser['usergroupid']!=or $banuser['usergroupid']!=or $ismod) {
    echo 
"<p>You may not ban someone who is not a normal registered user!</p>";
  } else { 



All times are GMT. The time now is 12:18 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.02254 seconds
  • Memory Usage 1,819KB
  • 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
  • (12)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (35)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