[Tutorial] Banning CAPSLOCK / shouting in posts
#1
Pencil 
This modification will stop your users from "shouting" in posts. (Posting with caps-lock on for everything)

Open newthread.php.

Find (somewhere around line 265):

	// Set up posthandler.
	require_once MYBB_ROOT."inc/datahandlers/post.php";
	$posthandler = new PostDataHandler("insert");
	$posthandler->action = "thread";

Add below:

	// Caps lock / shouting? Nonono!
	if(strtoupper($mybb->input['message']) == $mybb->input['message']) {
			$mybb->input['message'] = $message = ucfirst(strtolower($mybb->input['message']));
	} 


Open newreply.php

Find (somewhere around line 333):

	// Set up posthandler.
	require_once MYBB_ROOT."inc/datahandlers/post.php";
	$posthandler = new PostDataHandler("insert");

Add below:

	// Caps lock / shouting? Nonono!
	if(strtoupper($mybb->input['message']) == $mybb->input['message']) {
		$mybb->input['message'] = $message = ucfirst(strtolower($mybb->input['message']));
	} 



OLD WAY (not recommended):

Open inc/class_parser.php.

Find:
		// Get rid of cartridge returns for they are the workings of the devil
		$message = str_replace("\r", "", $message);

Add below:
		// Caps lock / shouting? Nonono!
		if(strtoupper($message) == $message) {
			$message = strtolower($message);
			$message = ucfirst($message);
		}



Example:
"OH MY GOD YOU ARE STUPID"
will become:
"Oh my god you are stupid"


-Brandon
Reply


Messages In This Thread
[Tutorial] Banning CAPSLOCK / shouting in posts - by king_og - 2013-02-09, 11:46 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)