Hoşgeldin Misafir

[MOD] Signature Preview / İmza Önizleme

MiRaT

13 Kas 2017
2,077 Mesaj

Aktiflik

Seviye

Deneyim

TIM / GÖREV:
Kod:
###############################################
##   Hack Title:          Signature Preview
##   Hack Version:        1.0.0
##   Author:              DTTVB (****.a. Mechakoopa Revolution) <[email protected]>
##   Description:         View your signature where you are editing the signature
##   Compatibility:       2.0.16
##
##   Installation Level:  Easy
##   Installation Time:   < 3 Minutes
##
##   Files To Edit: 6
##                includes/usercp_register.php
##                templates/subSilver/profile_add_body.tpl
##
##   Included Files: N/A
##
##   Support:     http://www.phpbbhacks.com/forums 
##
##   Copyright:   Copyright (C) 2005 Signature Preview 1.0.0 - DTTVB
###############################################
##
## Author Notes:
##    N/A
##
###############################################
##   Always back up all files related to this hack before use!
############################################### 
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
##   Please visit http://www.phpbbhacks.com/forums for support.
############################################### 
##   This hack is released under the GPL License.
##   This hack can be freely used, but not distributed, without permission.
###############################################
##   You can always contact me via e-mail if you have any questions, suggestions.
##   My e-mail is [email protected]
###############################################

#
#-----[ OPEN ]----------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]----------------------------------------
#
if (
   isset($HTTP_POST_VARS['submit']) ||

#
#-----[ BEFORE, ADD ]----------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

#
#-----[ FIND ]----------------------------------------
#
   include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
   include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
   include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

#
#-----[ REPLACE WITH ]----------------------------------------
#
   include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
   //Begone ; )
   include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

#
#-----[ FIND ]----------------------------------------
#
   $html_status =  ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
   $bbcode_status = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode']  ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
   $smilies_status = ( $userdata['user_allowsmile'] && $board_config['allow_smilies']  ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];

#
#-----[ AFTER, ADD ]----------------------------------------
#
   $user_sig = $userdata['user_sig'];
   $user_sig_bbcode_uid = $userdata['user_sig_bbcode_uid'];
   
   if ( !$board_config['allow_html'] || !$userdata['user_allowhtml']) {
      if ( $user_sig != '' ) { $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "&lt;\\2&gt;", $user_sig); }
   }
   if ( $board_config['allow_bbcode'] ) {
      if ( $user_sig != '' && $user_sig_bbcode_uid != '' ) { $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $user_sig); }
   }
   if ( $board_config['allow_smilies'] ) {
      if ( $userdata['user_allowsmile'] && $user_sig != '' ) { $user_sig = smilies_pass($user_sig); }
   }
   if ( $user_sig != '' ) { $user_sig = str_replace("\n", "\n<br />\n", $user_sig); }

#
#-----[ FIND ]----------------------------------------
#
      'SIGNATURE' => str_replace('<br />', "\n", $signature),

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

      'SIGNATURE_P' => $user_sig,

#
#-----[ FIND ]----------------------------------------
#
            $message = $lang['Profile_updated'] . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ REPLACE WITH ]----------------------------------------
#
            $message = $lang['Profile_updated'] . '<br /><br /><a href="profile.' . $phpEx . '?mode=editprofile#sigprv">Preview your signature</a><br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ OPEN ]----------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]----------------------------------------
#
   <tr> 
     <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>

#
#-----[ BEFORE, ADD ]----------------------------------------
#
   <tr> 
     <th class="thSides" colspan="2" height="12" valign="middle"><a name="sigprv">Signature Panel</th>
   </tr>
   <tr>
     <td class="row1"><span class="gen"><b>Preview:</b></span></td>
     <td class="row2"><span class="gen">{SIGNATURE_P}</span></td>
   </tr>

#
#-----[ SAVE & CLOSE ALL FILES ]----------------------------------------
#
# End of Hack - YAY!