[TUTORIAL] Maximum amount of Lines in Signature > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

[TUTORIAL] Maximum amount of Lines in Signature

wersja drukowalna wersja Microsoft Word wersja HTML

Hello, this quick mod will allow you to edit in your ADMIN (CP) The amount of lines or "Breaks" each user is allowed to have on there signature.

Posted Image



Find in Admin/ad_Settings.php:

$ADMIN->html .= $SKIN->add_td_row( array( "<b>Maximum length (in bytes) for user signatures</b>" ,
                                          $SKIN->form_input( "max_sig_length", $INFO['max_sig_length'] )
                         		)      );


Add Below:

$ADMIN->html .= $SKIN->add_td_row( array( "<b>Number of Lines a Signature can have</b>" ,
                                          $SKIN->form_input( "sig_max_lines", $INFO['sig_max_lines'] )
                         		)      );


Find
$this->save_config( array ( 'av_gal_cols' , "disable_ipbsize", "photo_ext", 'subs_autoprune', 'topicpage_contents', 'postpage_contents', 'allow_skins', 'max_sig_length', 'sig_allow_ibc', 'sig_allow_html','avatar_ext','avatar_url','avup_size_max','avatars_on','avatar_dims','avatar_def', 'max_location_length', 'max_interest_length', 'post_titlechange',


Replace with:
$this->save_config( array ( 'av_gal_cols' , "disable_ipbsize", "photo_ext", 'subs_autoprune', 'topicpage_contents', 'postpage_contents', 'allow_skins', 'max_sig_length', 'sig_max_lines', 'sig_allow_ibc', 'sig_allow_html','avatar_ext','avatar_url','avup_size_max','avatars_on','avatar_dims','avatar_def', 'max_location_length', 'max_interest_length', 'post_titlechange',



Find in: Sources/lib/usercp_function.php:

if ( $HTTP_POST_VARS['key'] != $std->return_md5_check() )
        {
            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'del_post' ) );        }


Add Below:
$max_lines = $ibforums->vars['sig_max_lines'];

$text =  $HTTP_POST_VARS['Post'];
$text = strip_tags($text);
$text .= "\n";
$check = explode("\n", $text);
$lines = count($check);

# Error process.
if ($lines > $max_lines) {
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'sig_max_lines' ) );
}


Open conf_global.php and add
$INFO['sig_max_lines']			=	'0';
Anywhere.



Then just add sig_max_lines to your language file (lang_error.php).

Thank you! and enjoy! Ask questions!

nie, 13 listopad 2011

Komentarze:

Brak komentarzy

Imię/Nick:

Adres email:

Strona WWW:

Treść Komentarza: