Kód:
##############################################################
## MOD Title: profile signature preview
## MOD Author: p0rt < > ( ) http://irgoslak.org/
## MOD Description: Allows users the build a favorite topics list
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 2 Minutes
## Files To Edit: includes/usercp_register.php
## Included Files:
## 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:
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_replace = array('>', '<', '"', '&');
#
#-----[ AFTER, ADD ]------------------------------------------
#
$preview = ( isset( $HTTP_POST_VARS['signature'] ) ) ? $HTTP_POST_VARS['signature'] : '';
#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
'USERNAME' => $username,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
if ( $preview )
{
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$signature = str_replace("\n", '<br />', $preview);
$signature = stripslashes(prepare_message(addslashes(unprepare_message($preview)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid));
$bbcode_uid = make_bbcode_uid() ;
$preview = prepare_message($preview, $allowhtml, $allowbbcode, $allowsmilies, $bbcode_uid);
if( !$userdata['user_allowhtml'] )
{
if( $preview != '' || !$userdata['user_allowhtml'] )
{
$preview = preg_replace('#(<)([\/]?.*?)(>)#is', '<\2>', $preview);
}
}
if( $userdata['user_allowbbcode'] )
{
$preview = bbencode_second_pass($preview, $bbcode_uid);
}
if( !empty($orig_word) )
{
$signature = ( !empty($preview) ) ? preg_replace($orig_word, $replacement_word, $signature) : '';
}
if( $userdata['user_allowsmile'] )
{
$preview = smilies_pass($preview);
}
$preview = word_wrap_pass($preview);
$preview = "<br /><table width=\"100%\" height=\"100%\" class=\"gensmall\"><tr><td class=\"row2\">".$lang['Signature']."</td></tr><tr><td class=\"row1\"><br />_________________<br />". str_replace("\n", "\n<br />\n", $preview)."<br /><br /></td></tr></table>";
}
#
#-----[ FIND ]------------------------------------------
#
'PROFILE_SIGNATURE' => $signature,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'SIGNATURE' => str_replace('<br />', "\n", $message),
#
#-----[ FIND ]------------------------------------------
#
'L_SUBMIT' => $lang['Submit'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_PREVIEW' => $lang['Preview'],
#
#-----[ OPEN ]------------------------------------------
#
templates/*/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<textarea name="signature"style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>
#
#-----[ AFTER, ADD ]------------------------------------------
#
{SIG_PREVIEW}
#
#-----[ FIND ]------------------------------------------
#
<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />
#
#-----[ AFTER, ADD ]------------------------------------------
#
<input type="submit" name="preview" value="{L_PREVIEW}" class="post" />
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM