The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi all, has anyone managed to force a moderator/staff to enter a reason for banning? i cant for the life of me find how to do it, so if someone could oblige i'd be very happy
![]() The force would need to be when banning via modcp/admincp AND when using the "delete posts as spam" EDIT: vb3.8 |
#2
|
|||
|
|||
![]()
The "delete posts as spam" is done in inlinemod.php. I think you could use hook inlinemod_start and check for $_POST['do'] == 'dodeletespam' and look at $_POST['reason'].
For the admincp/modcp it's done in modcp/banning.php, but there aren't any hooks there. But I guess you could use admin_global and mod_global, and look for $_POST['do'] == 'dobanuser' (it doesn't look like any other script use that value of 'do'). |
#3
|
||||
|
||||
![]()
Thanks Kevin, i was looking at manipulating the <input(s) for the inline mod. I tried your first suggestion
PHP Code:
|
#4
|
|||
|
|||
![]()
You have if (THIS_SCRIPT == 'inlinemod.php') when it should just be 'inlinemod'.
I think you could do something like Code:
eval(standard_error(fetch_error('reason_blank'))); and then make an error phrase with varname reason_blank. I havem't tried it but other errors seem to work that way. I'm not sure if that sends the user back to the previous page or if they'd have to use the back button. |
Благодарность от: | ||
Simon Lloyd |
#5
|
||||
|
||||
![]()
DOH!
Should wake up properly before trying to write stuff ![]() Thanks again Kevin! --------------- Added [DATE]1355914190[/DATE] at [TIME]1355914190[/TIME] --------------- Ok using mod_global (as it's always accessing the mod folder) i did this PHP Code:
|
#6
|
|||
|
|||
![]()
Oh, right, I didn't think about the fact that it's always the modcp global.php. Anyway, there are no THIS_SCRIPT values in the cp scripts. But I did a search and no other scripts use a 'do' value of 'dobanuser', so it's probably OK just to check that. I think there is a way in php to check the requested file name (obviously the current file will always be global.php), if you want to look in to that.
|
#7
|
||||
|
||||
![]()
well, still using the mod_global hook and removing the script check works to some extent, when trying to ban a user you now just get a white page rather than the error message but the dobanuser isn't being processed, so the question now is how to show the error message and return them to the banning page?
|
#8
|
|||
|
|||
![]()
Oh, right - I didn't think about that. You don't want to use the eval(standard_error(... method in the control panel because it doesn't use templates, probably things aren't set up right to use that. What you could do is just change the value of 'do' to show the banning page again, but printing out an error might be difficult since the output hasn't been started yet. I guess another option is to use the admincp 'print' function to print out your own error message and tell the user to use the back button. Or maybe you could copy the code for the banning page (the section in if ($_REQUEST['do'] == 'banuser')) and use it to reproduce the banning page, but add your error message somewhere.
|
#9
|
||||
|
||||
![]()
All sorted, in modcp i print the error and include a back button, in inlinemod i eval the error message and added the back button to the phrase
![]() --------------- Added [DATE]1355933191[/DATE] at [TIME]1355933191[/TIME] --------------- Thanks for your help - as usual ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|