posting
Geplaatst: 09 mar 2007, 01:22
Ik heb de mod die hieronder staat geinstaleerd, hij werkt uitstekend alleen heb ik een probleem... het is een mod die extra velden toevoegd bij posting (Plaats een nieuw onderwerp) dat moet ook dus dat deel werk.. nu het probleem.. de extra velden zijn ook te zijn als ik reageer op een bericht (plaats nieuw bericht/Plaats een reactie) en dat is nou niet de bedoeling, zou iemand mij daarbij kunnen helpen??
Code: Selecteer alles
##
## MOD Title: New field to posting part
## MOD Version: 1.4.2 (phpBB 2.0.5 - 2.0.10)
## Author: Acid
##
## Description: Just a simple way to add a new field to the posting area. "extra" can
## be changed to "whatever" of course but be aware of the spelling (e.g.
## "EXTRA", "extra", "topic_extra").
## If you want to add more than one field duplicate the following steps
## and change "extra" to "whatever" (be aware of the spelling).
## The field "extra" is just an example.
## The new field will be displayed above the post (post view) and below
## topic title (topic view).
##
## Files to edit: 11
## language/lang_english/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/viewtopic_body.tpl
## templates/xxx/viewforum_body.tpl
##
#########################################################################################
##
## Note:
## First always make a backup from the files/database that you're going to edit.
##
## This MOD adds one new column to the tables "posts" and "topics".
##
#########################################################################################
##
## Versions:
##
## 1.4.2 - optional part ("forums and users", "info is mandatory", "search for info" and
## "dropdown instead input") altered
## - "an_option" removed again (it´s a separate MOD now)
## 1.4.1 - optional part "search for info" updated (missed some code and code was wrong)
## - an_option.zip added (simple explanation how to add an option)
## 1.4.0 - guides rewritten
## - optional part added ("info in notification", "forums and users", "info is
## mandatory")
## 1.2.1 - missed a sql query for optional part ("search for info")
## 1.2.0 - optional part added ("dropdown instead input", "info in modcp", "info in
## search", "search for info"),
## - template alteration changed, preview code altered
## 1.0.2 - fixed a typo in posting.php (edit display)
## 1.0.1 - fixed some language/template bugs
## 1.0 - Release
##
#########################################################################################
#
#-----[ SQL ]-------------------------------------------
#
# You have to execute the following queries via phpmyadmin (change prefix)..
ALTER TABLE phpbb_topics ADD topic_extra CHAR(60) NOT NULL AFTER topic_title;
ALTER TABLE phpbb_posts_text ADD post_extra VARCHAR(60) DEFAULT NULL AFTER post_subject;
# ..if you´re going to add/change several fields duplicate the above queries and
# change the column name "topic_extra"/"post_extra".
#
#########################################################################################
#
#-----[ OPEN ]--------------------------------------------------
#
# language/lang_english/lang_main.php
#
#-----[ FIND ]--------------------------------------------------
#
//
// Posting/Replying (Not private messaging!)
//
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$lang['Extra_information'] = 'Extra Information';
#
#-----[ OPEN ]--------------------------------------------------
#
# includes/functions_post.php
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
function prepare_post(&$mode, &$post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
&$subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, &$extra
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
function submit_post($mode, &$post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
&$post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, &$post_extra
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
$sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . "
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
topic_title
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, topic_extra
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
'$post_subject'
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, '$post_extra'
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
topic_title = '$post_subject'
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, topic_extra = '$post_extra'
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
$sql = ( $mode != 'editpost' ) ? "INSERT INTO " . POSTS_TEXT_TABLE . "
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, post_extra
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
'$post_subject'
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, '$post_extra'
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
post_subject = '$post_subject'
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, post_extra = '$post_extra'
#
#-----[ OPEN ]--------------------------------------------------
#
# includes/topicreview.php
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
$sql = "SELECT u.username, u.user_id, p.*
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_extra
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = ( $row['post_subject'] != '' ) ? $row['post_subject'] : '';
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$post_extra = ( $row['post_extra'] != '' ) ? ''. $lang['Extra_information'] .': '. $row['post_extra'] : '';
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$post_extra = preg_replace($orig_word, $replacement_word, $post_extra);
#
#-----[ FIND ]--------------------------------------------------
#
'POST_SUBJECT' => $post_subject,
#
#-----[ BELOW ADD ]--------------------------------------------------
#
'POST_EXTRA' => $post_extra,
#
#-----[ OPEN ]--------------------------------------------------
#
# posting.php
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_extra
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : '';
#
#-----[ BELOW ]--------------------------------------------------
#
$extra = ( !empty($HTTP_POST_VARS['extra']) ) ? trim($HTTP_POST_VARS['extra']) : '';
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
prepare_post($mode, $post_data
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
$subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, $extra
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
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']))) : '';
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$extra = ( !empty($HTTP_POST_VARS['extra']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['extra']))) : '';
#
#-----[ FIND ]--------------------------------------------------
#
$preview_subject = $subject;
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$preview_extra = ( !empty($HTTP_POST_VARS['extra']) ) ? ''. $lang['Extra_information'] .': '. $extra : '';
#
#-----[ FIND ]--------------------------------------------------
#
$preview_subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $preview_subject) : '';
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$preview_extra = ( !empty($extra) ) ? preg_replace($orig_word, $replacement_word, $preview_extra) : '';
#
#-----[ FIND ]--------------------------------------------------
#
'TOPIC_TITLE' => $preview_subject,
'POST_SUBJECT' => $preview_subject,
#
#-----[ BELOW ADD ]--------------------------------------------------
#
'TOPIC_EXTRA' => $preview_extra,
'POST_EXTRA' => $preview_extra,
#
#-----[ FIND (2x) ]--------------------------------------------------
#
$subject = '';
#
#-----[ always BELOW ADD ]--------------------------------------------------
#
$extra = '';
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject'];
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$extra = $post_info['post_extra'];
#
#-----[ FIND ]--------------------------------------------------
#
$subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : '';
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$extra = ( !empty($extra) ) ? preg_replace($orig_word, $replace_word, $extra) : '';
#
#-----[ FIND ]--------------------------------------------------
#
'SUBJECT' => $subject,
#
#-----[ BELOW ADD ]--------------------------------------------------
#
'EXTRA' => $extra,
'L_EXTRA' => $lang['Extra_information'],
#
#-----[ OPEN ]--------------------------------------------------
#
# viewtopic.php
#
#-----[ FIND (just a quote) ]--------------------------------------------------
#
$sql = "SELECT u.username, u.user_id
#
#-----[ IN-LINE FIND ]--------------------------------------------------
#
pt.post_subject
#
#-----[ IN-LINE ADD ]--------------------------------------------------
#
, pt.post_extra
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : '';
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$post_extra = ( $postrow[$i]['post_extra'] != '' ) ? ''. $lang['Extra_information'] .': '. $postrow[$i]['post_extra'] : '';
#
#-----[ FIND ]--------------------------------------------------
#
$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$post_extra = preg_replace($orig_word, $replacement_word, $post_extra);
#
#-----[ FIND ]--------------------------------------------------
#
'POST_SUBJECT' => $post_subject,
#
#-----[ BELOW ADD ]--------------------------------------------------
#
'POST_EXTRA' => $post_extra,
#
#-----[ 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'];
#
#-----[ BELOW ADD ]--------------------------------------------------
#
$topic_extra = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_extra']) : $topic_rowset[$i]['topic_extra'];
#
#-----[ FIND ]--------------------------------------------------
#
'TOPIC_TITLE' => $topic_title,
#
#-----[ BELOW ADD ]--------------------------------------------------
#
'TOPIC_EXTRA' => ( !empty($topic_rowset[$i]['topic_extra']) ) ? '
'. $topic_extra : '',
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_body.tpl
#
#-----[ FIND ]--------------------------------------------------
#
{L_SUBJECT}
#
#-----[ BELOW ADD ]--------------------------------------------------
#
{L_EXTRA}
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_preview.tpl
#
#-----[ FIND ]--------------------------------------------------
#
#
#-----[ BELOW ADD ]--------------------------------------------------
#
{POST_EXTRA}
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/posting_topic_review.tpl
#
#-----[ FIND ]--------------------------------------------------
#
--------------------------------------------------------------------------------
#
#-----[ BELOW ADD ]--------------------------------------------------
#
{postrow.POST_EXTRA}
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/viewtopic_body.tpl
#
#-----[ FIND ]--------------------------------------------------
#
--------------------------------------------------------------------------------
#
#-----[ BELOW ADD ]--------------------------------------------------
#
{postrow.POST_EXTRA}
#
#-----[ OPEN ]--------------------------------------------------
#
# templates/xxx/viewforum_body.tpl
#
#-----[ FIND ]--------------------------------------------------
#
{topicrow.TOPIC_TITLE}
#
#-----[ AFTER ADD (before
) ]--------------------------------------------------
#
{topicrow.TOPIC_EXTRA}
#########################################################################################
#########################################################################################
#########################################################################################