MyBB Community Forums

Full Version: Change ban times in droplist
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

When you try to ban someone from moderator cp, you have a droplist with all the time periods for the ban period to last form.

Eg: 1 day, 2 days, 3 days etc etc then Permanent.

How would I go about changing the ban time to only 2 options.

I want TEMPORARY which would last for 24 hours and PERMANENT (which can obviously stay.

Thanks!
I think which for this you must edit the mybb php file, and I will not recommend because is not secure edit the mybb file ...
I was trying to edit the modcp.php file and found the required section within that file but I didn't understand it.

I'm still willing to edit the modcp.php file if someone could help me out with it. Smile
you can edit a core file or you can use a simple pluign. Its easier to edit the file. Open /inc/functions.php and find "fetch_ban_times".

Locate this:
	// Days-Months-Years
	$ban_times = array(
		"1-0-0" => "1 {$lang->day}",
		"2-0-0" => "2 {$lang->days}",
		"3-0-0" => "3 {$lang->days}",
		"4-0-0" => "4 {$lang->days}",
		"5-0-0" => "5 {$lang->days}",
		"6-0-0" => "6 {$lang->days}",
		"7-0-0" => "1 {$lang->week}",
		"14-0-0" => "2 {$lang->weeks}",
		"21-0-0" => "3 {$lang->weeks}",
		"0-1-0" => "1 {$lang->month}",
		"0-2-0" => "2 {$lang->months}",
		"0-3-0" => "3 {$lang->months}",
		"0-4-0" => "4 {$lang->months}",
		"0-5-0" => "5 {$lang->months}",
		"0-6-0" => "6 {$lang->months}",
		"0-0-1" => "1 {$lang->year}",
		"0-0-2" => "2 {$lang->years}"
	);

and comment out what you dont want, like this

	// Days-Months-Years
	$ban_times = array(
		"1-0-0" => "1 {$lang->day}",
		//"2-0-0" => "2 {$lang->days}",
		//"3-0-0" => "3 {$lang->days}",
		//"4-0-0" => "4 {$lang->days}",
		//"5-0-0" => "5 {$lang->days}",
		//"6-0-0" => "6 {$lang->days}",
		//"7-0-0" => "1 {$lang->week}",
		//"14-0-0" => "2 {$lang->weeks}",
		//"21-0-0" => "3 {$lang->weeks}",
		//"0-1-0" => "1 {$lang->month}",
		//"0-2-0" => "2 {$lang->months}",
		//"0-3-0" => "3 {$lang->months}",
		//"0-4-0" => "4 {$lang->months}",
		//"0-5-0" => "5 {$lang->months}",
		//"0-6-0" => "6 {$lang->months}",
		//"0-0-1" => "1 {$lang->year}",
		//"0-0-2" => "2 {$lang->years}"
	);

the permanent ban option is a couple lines below where it shows "---"
Thanks pavemen for you help.

Marked your answer as best and gave positive rep!