Код: Выделить всё
##############################################################
## MOD Title: Enable/disable Quick Reply Form shows
## MOD Version: 1.0.0
## MOD Author: konkere < konkere@netsys.ru > Konkere
## MOD Description: This mod enable/disable shows quick reply form in view topic.
## Users have the ability to turn this
## on or off.
##
## Installation Level: easy
## Installation Time: 5 Minutes
## Files To Edit: viewtopic.php,
## admin/admin_board.php,
## admin/admin_users.php,
## includes/usercp_register.php,
## templates/subSilver/admin/board_config_body.tpl
## templates/subSilver/profile_add_body.tpl,
## templates/subSilver/admin/user_edit_body.tpl,
## language/lang_english/lang_main.php,
## language/lang_russian/lang_main.php,
## language/lang_english/lang_admin.php,
## language/lang_russian/lang_admin.php
##
## Included Files: none
##############################################################
##############################################################
## Author Notes: If you've install anothers templates, you need to apply the modifcations
## to all the templates.
##
##
##############################################################
## MOD History:
##
## 2004-08-28 - Version 1.0.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]-----
#
# Note: Change phpbb_ to your prefix!!!
ALTER TABLE `phpbb_users` ADD user_allowq_reply TINYINT(1) NOT NULL ;
INSERT INTO `phpbb_config` ( `config_name` , `config_value` )
VALUES ('allow_q_reply', '0');
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$sig_no = ( !$new['allow_sig'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$q_reply_yes = ( $new['allow_q_reply'] ) ? "checked=\"checked\"" : "";
$q_reply_no = ( !$new['allow_q_reply'] ) ? "checked=\"checked\"" : "";
#
#-----[ FIND ]------------------------------------------
#
"L_ALLOW_SIG" => $lang['Allow_sig'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"L_ALLOW_Q_REPLY" => $lang['Allow_q_reply'],
#
#-----[ FIND ]------------------------------------------
#
"SIG_SIZE" => $new['max_sig_chars'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
"Q_REPLY_YES" => $q_reply_yes,
"Q_REPLY_NO" => $q_reply_no,
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Extended Quick Reply Form Code
//
if (!(((!$is_auth['auth_reply']) or
($forum_topic_data['forum_status'] == FORUM_LOCKED) or
($forum_topic_data['topic_status'] == TOPIC_LOCKED))
and ($userdata['user_level'] != ADMIN)))
{
$quote_text = '<br /><a title="' . $lang['Quote_text_exp'] . '" href="javascript:quoteSelection(\'' . addslashes($poster). '\')">' . $lang['Quote_text'] . '</a>';
$poster = '<a title="' . $lang['Insert_nikname'] . '" href="javascript:emoticon(\'[b]' . addslashes($poster). '[/b]\\n\')">' . $poster . '</a>';
}
//
// End Of Extended Quick Reply Form Code
//
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ($userdata['user_allowq_reply'])
{
//
// Extended Quick Reply Form Code
//
if (!(((!$is_auth['auth_reply']) or
($forum_topic_data['forum_status'] == FORUM_LOCKED) or
($forum_topic_data['topic_status'] == TOPIC_LOCKED))
and ($userdata['user_level'] != ADMIN)))
{
$quote_text = '<br /><a title="' . $lang['Quote_text_exp'] . '"href="javascript:quoteSelection(\'' . addslashes($poster). '\')">' . $lang['Quote_text'] . '</a>';
$poster = '<a title="' . $lang['Insert_nikname'] . '" href="javascript:emoticon(\'[b]' . addslashes($poster). '[/b]\\n\')">' . $poster . '</a>';
}
//
// End Of Extended Quick Reply Form Code
//
}
else
{
$poster = ( $poster_id == ANONYMOUS ) ? $poster : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id") . '">' .$poster. '</a>';
$quote_text = '';
}
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'quick_reply.'.$phpEx);
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ($userdata['user_allowq_reply']) {
include($phpbb_root_path . 'quick_reply.'.$phpEx);
}
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
$attachsig = ( isset( $HTTP_POST_VARS['attachsig']) ) ? ( ( $HTTP_POST_VARS['attachsig'] ) ? TRUE : 0 ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$allowq_reply = ( isset($HTTP_POST_VARS['allowq_reply']) ) ? ( ($HTTP_POST_VARS['allowq_reply']) ? TRUE : 0 ) : 0;
#
#-----[ FIND ]------------------------------------------
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# $sql = "UPDATE " . USERS_TABLE . "
# SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email)...
$sql = "UPDATE " . USERS_TABLE . "
SET "
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$attachsig,
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
user_allowq_reply = $allowq_reply,
#
#-----[ FIND ]------------------------------------------
#
$attachsig = $this_userdata['user_attachsig'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$allowq_reply = $this_userdata['user_allowq_reply'];
#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="attachsig" value="' . $attachsig . '" />';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="allowq_reply" value="' . $allowq_reply . '" />';
#
#-----[ FIND ]------------------------------------------
#
'ALWAYS_ADD_SIGNATURE_NO' => ( !$attachsig ) ? 'checked="checked"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ALWAYS_ALLOW_QREPLY_YES' => ( $allowq_reply ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_QREPLY_NO' => ( !$allowq_reply ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_ALWAYS_ALLOW_QREPLY' => $lang['Always_q-reply'],
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$allowq_reply = ( isset($HTTP_POST_VARS['allowq_reply']) ) ? ( ($HTTP_POST_VARS['allowq_reply']) ? TRUE : 0) : $board_config['allow_q_reply'];
#
#-----[ FIND ]------------------------------------------
#
$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : 0;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$allowq_reply = ( isset($HTTP_POST_VARS['allowq_reply']) ) ? ( ($HTTP_POST_VARS['allowq_reply']) ? TRUE : 0 ) : $userdata['user_allowq_reply'];
#
#-----[ FIND ]------------------------------------------
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# $sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email)...
$sql = "UPDATE " . USERS_TABLE . "
SET " .
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$attachsig,
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
user_allowq_reply = $allowq_reply,
#
#-----[ FIND ]------------------------------------------
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password,...
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username,
#
#-----[ IN-LINE FIND ]----------------------------------------
#
user_attachsig,
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
user_allowq_reply,
#
#-----[ FIND ]------------------------------------------
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# VALUES ($user_id, '" . str_replace("\'", "''", $username) . "'...
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "'
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$attachsig,
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
$allowq_reply,
#
#-----[ FIND ]------------------------------------------
#
$attachsig = $userdata['user_attachsig'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$allowq_reply = $userdata['user_allowq_reply'];
#
#-----[ FIND ]------------------------------------------
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email,...
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email,
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$attachsig,
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
$allowq_reply,
#
#-----[ FIND ]------------------------------------------
#
'ALWAYS_ADD_SIGNATURE_NO' => ( !$attachsig ) ? 'checked="checked"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ALWAYS_ALLOW_QREPLY_YES' => ( $allowq_reply ) ? 'checked="checked"' : '',
'ALWAYS_ALLOW_QREPLY_NO' => ( !$allowq_reply ) ? 'checked="checked"' : '',
#
#-----[ FIND ]------------------------------------------
#
'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_ALWAYS_ALLOW_QREPLY' => $lang['Always_q-reply'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_MAX_SIG_LENGTH}<br /><span class="gensmall">{L_MAX_SIG_LENGTH_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="5" maxlength="4" name="max_sig_chars" value="{SIG_SIZE}" /></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_ALLOW_Q_REPLY}</td>
<td class="row2"><input type="radio" name="allow_q_reply" value="1" {Q_REPLY_YES} /> {L_YES} <input type="radio" name="allow_q_reply" value="0" {Q_REPLY_NO} /> {L_NO}</td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_HTML}:</span></td>
<td class="row2">
<input type="radio" name="allowhtml" value="1" {ALWAYS_ALLOW_HTML_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="allowhtml" value="0" {ALWAYS_ALLOW_HTML_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_QREPLY}:</span></td>
<td class="row2"><input type="radio" name="allowq_reply" value="1" {ALWAYS_ALLOW_QREPLY_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="allowq_reply" value="0" {ALWAYS_ALLOW_QREPLY_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_HTML}</span></td>
<td class="row2">
<input type="radio" name="allowhtml" value="1" {ALWAYS_ALLOW_HTML_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="allowhtml" value="0" {ALWAYS_ALLOW_HTML_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_QREPLY}:</span></td>
<td class="row2"><input type="radio" name="allowq_reply" value="1" {ALWAYS_ALLOW_QREPLY_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="allowq_reply" value="0" {ALWAYS_ALLOW_QREPLY_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Allow_sig'] = 'Allow Signatures';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Allow_q_reply'] = 'Allow show Quick Reply Form in Topic Page';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Allow_sig'] = 'Разрешить подписи';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Allow_q_reply'] = 'Разрешить показывать форму быстрого ответа';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Always_html'] = 'Always allow HTML';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Always_q-reply'] = 'Always show Quick Reply Form in Topic Page';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Always_html'] = 'HTML всегда включён';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Always_q-reply'] = 'Всегда показывать форму быстрого ответа';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM