Clan Adverts

www.afgserv.com

 

Check Post Subject Length

Description: This simple hack will force users to use a detailed subject when making a new post.
Version: 1.0
Added on: 22 June 2007
Author: Telli
Difficulty Level: Very Easy
Views: 254
Rating: 7.0 (1 Vote)
Detailed Profile

A very useful tool for providing support. Its also beneficial for users searching for the answer to a problem.

Open includes/functions_post.php and locate this line:

Code:
        // Check subject
        if (!empty($subject))


Just before it add:

Code:

        $min_subject_length = '25';
        // Check subject length
        if (($mode == 'newtopic') && (strlen($subject) > $min_subject_length))
        {
                $subject = $subject;

        }
        else if (($mode == 'newtopic') && (strlen($subject) < $min_subject_length))
        {
                 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Tooshort_subject'] : $lang['Tooshort_subject'];             
        }


Then add the language definition to modules/Forums/language/lang_english/lang_main.php

Code:
$lang['Tooshort_subject'] = 'Your subject is too short. Minimum subject length is 25 characters.';


Compliments of Telli at Codezwiz