############################################################# 
## MOD Title: Prevent All Caps Posts
## MOD Author: FuNEnD3R < admin@funender.com > (Thomas Jonas) http://www.addyoursitefreesubmit.com/
## MOD Description: This mod will display an error message when a user
## attempts to post a subject or message in ALL CAPS.
## MOD Version: 1.0.1 
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes 
## Files To Edit: includes/functions_post.php, language/lang_english/lang_main.php
## 
## Included Files: N/A
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes: Unlike other mods that try to automatically
## rewrite how the text appears in a post, this mod will display
## an error message which prompts to not type using ALL CAPS TEXT.
##
## Since some users like to only post smilies, this mod will not
## display error for posts with less than 3 characters.
## This mod does not check private messages only posts in the forum.
##
############################################################## 
## MOD History: 
## 
##   2007-3-24 - Version 1.0.1 
##      - First Release 
## 
##
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
 
# 
#-----[ OPEN ]------------------------------------------ 
#

includes/functions_post.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

        // Check message
	if (!empty($message))
	{
		$bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';
		$message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
	}
	else if ($mode != 'delete' && $mode != 'poll_delete') 
	{
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_message'] : $lang['Empty_message'];
	}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	// FuNEnD3R's check ALL CAPS 
	if (strlen($subject) > 3 && (md5(strtoupper($subject)) == md5($subject)) )
	{
        $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['All_caps_subject'] : $lang['All_caps_subject'];
	}
	if (strlen($message) > 3 && (md5(strtoupper($message)) == md5($message)) )
	{
        $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['All_caps_message'] : $lang['All_caps_message'];
	}

# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Empty_message'] = 'You must enter a message when posting';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

$lang['All_caps_subject'] = 'ALL CAPS is not allowed for your subject title, please retype your subject<br />You may have your Caps Lock key on your keyboard pressed';
$lang['All_caps_message'] = 'ALL CAPS is not allowed for your message, please retype your message<br />You may have your Caps Lock key on your keyboard pressed';

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM