Hyper
Active Member
اين مود امكان افزايش توضيحات رو به تاپيك جديد اضافه ميكنه ...
اميدوارم مفيد واقع بشه ...
کد:
#########################################################################################
##
## MOD Title: Add Topic Description ( Optional )
## MOD Version: 1.0.0 ( phpBB 2.0.15 - 2.0.16)
##
## Author: Cyber ( Hyper )
##
## http://www.pptforum.com , [email protected] , [email protected]
##
## Description: This MOD add a description filed to topics . Its optional to add by poster ...
##
## Files to edit: 10
##
## language/xxx/lang_main.php
##
## includes/functions_post.php
## includes/topicreview.php
##
## posting.php
## viewtopic.php
## viewforum.php
##
## templates/xxx/posting_body.tpl
## templates/xxx/posting_preview.tpl
## templates/xxx/posting_topic_review.tpl
## templates/xxx/viewforum_body.tpl
##
#########################################################################################
##
## This MOD adds one new column to the tables "posts" and "topics".
##
#########################################################################################
#
#-----[ SQL ]-------------------------------------------
#
ALTER TABLE phpbb_topics ADD topic_desc CHAR(60) NOT NULL AFTER topic_title;
ALTER TABLE phpbb_posts_text ADD post_desc VARCHAR(60) DEFAULT NULL AFTER post_subject;
#
#########################################################################################
#
#-----[ OPEN ]--------------------------------------------------
#
# language/lang_english/lang_main.php
#
#-----[ FIND ]--------------------------------------------------
#
?>
#
#-----[ BEFORE ADD ]--------------------------------------------------
#
//Add Topic Description ( Optional )
$lang[Extra_desc] = Topic Description;
#
#-----[ OPEN ]--------------------------------------------------
#
# includes/functions_post.php
#
#-----[ FIND ]--------------------------------------------------
#
function prepare_post(&$mode, &$post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
&$subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, &$extra
#
#-----[ FIND ]--------------------------------------------------
#
function submit_post($mode, &$post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
&$post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, &$post_desc
#
#-----[ FIND ]--------------------------------------------------
#
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . "
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
topic_title
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, topic_desc
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
$post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, $post_desc
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
topic_title = $post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, topic_desc = $post_desc
#
#-----[ FIND ]--------------------------------------------------
#
$sql = ( $mode != editpost ) ? "INSERT INTO " . POSTS_TEXT_TABLE . "
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, post_desc
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
$post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, $post_desc
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
post_subject = $post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, post_desc = $post_desc
#
#-----[ OPEN ]--------------------------------------------------
#
# includes/topicreview.php
#
#-----[ FIND ]--------------------------------------------------
#
$sql = "SELECT u.username, u.user_id, p.*
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_desc
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = ( $row[post_subject] != ) ? $row[post_subject] : ;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$post_desc = ( $row[post_desc] != ) ? <b>. $lang[Extra_desc] .: </b> . $row[post_desc] : ;
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$post_desc = preg_replace($orig_word, $replacement_word, $post_desc);
#
#-----[ FIND ]--------------------------------------------------
#
POST_SUBJECT => $post_subject,
#
#-----[ AFTER ADD ]--------------------------------------------------
#
post_desc => $post_desc,
#
#-----[ OPEN ]--------------------------------------------------
#
# posting.php
#
#-----[ FIND ]--------------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_desc
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( !empty($HTTP_POST_VARS[subject]) ) ? trim($HTTP_POST_VARS[subject]) : ;
#
#-----[ AFTER ]--------------------------------------------------
#
$extra = ( !empty($HTTP_POST_VARS[extra]) ) ? trim($HTTP_POST_VARS[extra]) : ;
#
#-----[ FIND ]--------------------------------------------------
#
prepare_post($mode, $post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
$subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, $extra
#
#-----[ FIND ]--------------------------------------------------
#
submit_post($mode, $post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
str_replace("", "", $subject)
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, str_replace("", "", $extra)
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( !empty($HTTP_POST_VARS[subject]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[subject]))) : ;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$extra = ( !empty($HTTP_POST_VARS[extra]) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS[extra]))) : ;
#
#-----[ FIND ]--------------------------------------------------
#
$preview_subject = $subject;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$preview_extra = ( !empty($HTTP_POST_VARS[extra]) ) ? <b>. $lang[Extra_information] .:</b> . $extra : ;
#
#-----[ FIND ]--------------------------------------------------
#
$preview_subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $preview_subject) : ;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$preview_extra = ( !empty($extra) ) ? preg_replace($orig_word, $replacement_word, $preview_extra) : ;
#
#-----[ FIND ]--------------------------------------------------
#
TOPIC_TITLE => $preview_subject,
POST_SUBJECT => $preview_subject,
#
#-----[ AFTER ADD ]--------------------------------------------------
#
topic_desc => $preview_extra,
post_desc => $preview_extra,
#
#-----[ FIND (2x) ]--------------------------------------------------
#
$subject = ;
#
#-----[ always AFTER ADD ]--------------------------------------------------
#
$extra = ;
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( $post_data[first_post] ) ? $post_info[topic_title] : $post_info[post_subject];
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$extra = $post_info[post_desc];
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : ;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$extra = ( !empty($extra) ) ? preg_replace($orig_word, $replace_word, $extra) : ;
#
#-----[ FIND ]--------------------------------------------------
#
SUBJECT => $subject,
#
#-----[ AFTER ADD ]--------------------------------------------------
#
EXTRA => $extra,
L_EXTRA => $lang[Extra_desc],
#
#-----[ OPEN ]--------------------------------------------------
#
# viewtopic.php
#
#-----[ FIND ]--------------------------------------------------
#
$sql = "SELECT u.username, u.user_id
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_desc
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = ( $postrow[$i][post_subject] != ) ? $postrow[$i][post_subject] : ;
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$post_desc = ( $postrow[$i][post_desc] != ) ? <b>. $lang[Extra_desc] .: </b> . $postrow[$i][post_desc] : ;
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$post_desc = preg_replace($orig_word, $replacement_word, $post_desc);
#
#-----[ FIND ]--------------------------------------------------
#
POST_SUBJECT => $post_subject,
#
#-----[ AFTER ADD ]--------------------------------------------------
#
post_desc => $post_desc,
#
#-----[ OPEN ]--------------------------------------------------
#
# viewforum.php
#
#-----[ FIND ]--------------------------------------------------
#
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i][topic_title]) : $topic_rowset[$i][topic_title];
#
#-----[ AFTER ADD ]--------------------------------------------------
#
$topic_desc = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i][topic_desc]) : $topic_rowset[$i][topic_desc];
#
#-----[ FIND ]--------------------------------------------------
#
TOPIC_TITLE => $topic_title,
#
#-----[ AFTER ADD ]--------------------------------------------------
#
topic_desc => ( !empty($topic_rowset[$i][topic_desc]) ) ? <br />. $topic_desc : ,
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_body.tpl
#
#-----[ FIND ]--------------------------------------------------
#
//Add Topic Description ( Optional )
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
<td class="row2" width="78%"> <span class="gen">
<input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
</span> </td>
</tr>
//Add Topic Description ( Optional )
#
#-----[ AFTER ADD ]--------------------------------------------------
#
//Add Topic Description ( Optional )
<tr>
<td class="row1" width="22%"><span class="explaintitle">{L_EXTRA} : </span></td>
<td class="row2" width="78%"> <input type="text" name="extra" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{EXTRA}" onKeyDown="FKeyDown();" onkeypress="FKeyPress();"/></td>
</tr>
//Add Topic Description ( Optional )
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_preview.tpl
#
#-----[ FIND ]--------------------------------------------------
#
<td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0">
#
#-----[ AFTER ADD ]--------------------------------------------------
#
//Add Topic Description ( Optional )
<tr>
<td><span class="gensmall">{post_desc}</span></td>
</tr>
//Add Topic Description ( Optional )
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_topic_review.tpl
#
#-----[ FIND ]--------------------------------------------------
#
<tr>
<td colspan="2"><hr /></td>
</tr>
#
#-----[ AFTER ADD ]--------------------------------------------------
#
//Add Topic Description ( Optional )
<tr>
<td colspan="2"><span class="gensmall">{postrow.post_desc}</span></td>
</tr>
//Add Topic Description ( Optional )
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/viewforum_body.tpl
#
#-----[ FIND ]--------------------------------------------------
#
{topicrow.TOPIC_TITLE}</a></span><span class="gensmall">
#
#-----[ AFTER ADD (before <br />) ]--------------------------------------------------
#
{topicrow.topic_desc}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
اميدوارم مفيد واقع بشه ...