Erstmal sorry AmigaLink, ich habe versehentlich die falsche 'Topic Description' gepostet.
Hier ist die die ich meine
- Code: Alles auswählen
###############################################
## Hack Title: Topic Description
## Hack Version: 1.0.7
## Author: DTTVB (a.k.a. Mechakoopa Revolution) <mechakoopa@gmail.com>
## Description: Adds topic and post description feature.
## Compatibility: 2.0.16 - 2.0.17
##
## Installation Level: Easy
## Installation Time: ~10 Minutes
##
## Files To Edit: 6
## includes/function_post.php
## templates/subSilver/posting_body.tpl
## templates/subSilver/viewforum_body.tpl
## posting.php
## viewforum.php
## viewtopic.php
##
## Included Files: N/A
##
## History:
## 1.0.7: Fixed: First post bug
## 1.0.6: Fixed: Blank line bug
## 1.0.5: MOD Version
##
## Support: http://www.phpbbhacks.com/forums
##
## Copyright: Copyright (C) 2005 Topic Description 1.0.6 - DTTVB
###############################################
##
## Author Notes:
## I gonna make the phpBB have some IPB features.
## You can translate these textz, because this MOD is hard to make,
## so it will be only available in English, if you want to translate it,
## just edit these lines.
## 1: <td class="row1" width="22%"><span class="gen"><b>Topic Description</b></span></td>
## ################# <- Translate This
## 2: 'POST_SUBJECT' => $post_subject . "<br />Description: " . htmlspecialchars($postrow[$i]['post_description']),
## ########### <- Translate This.
##
###############################################
## 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.
###############################################
## Please visit http://www.phpbbhacks.com/ for updates of this hack.
###############################################
## 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 mechakoopa@gmail.com
###############################################
#
#-----[ SQL ]----------------------------------------
#
ALTER TABLE [Prefix]topics ADD topic_description VARCHAR( 100 ) NOT NULL ;
#
#-----[ SQL ]----------------------------------------
#
ALTER TABLE [Prefix]posts_text ADD post_description VARCHAR( 100 ) NOT NULL ;
#
#-----[ OPEN ]---------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]---------------------------------------
#
<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>
#
#-----[ AFTER, ADD ]---------------------------------
#
<tr>
<td class="row1" width="22%"><span class="gen"><b>Topic Description</b></span></td>
<td class="row2" width="78%"> <span class="gen">
<input type="text" name="topicdesc" size="45" maxlength="100" style="width:450px" tabindex="2" class="post" value="{T_DESC}" />
</span> </td>
</tr>
#
#-----[ OPEN ]---------------------------------------
#
posting.php
#
#-----[ FIND ]---------------------------------------
#
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : '';
#
#-----[ AFTER, ADD ]---------------------------------
#
$topic_desc = ( !empty($HTTP_POST_VARS['topicdesc']) ) ? trim($HTTP_POST_VARS['topicdesc']) : '';
#
#-----[ FIND ]---------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
#
#-----[ REPLACE WITH ]-------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $topic_desc);
#
#-----[ FIND ]---------------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : '';
#
#-----[ REPLACE WITH ]-------------------------------
#
$select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, t.topic_description, pt.post_description" : '';
#
#-----[ FIND ]---------------------------------------
#
$subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject'];
#
#-----[ AFTER, ADD ]---------------------------------
#
$topic_desc = ( $post_data['first_post'] ) ? $post_info['topic_description'] : $post_info['post_description'];
#
#-----[ FIND ]---------------------------------------
#
$subject = ( !empty($HTTP_POST_VARS['subject']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : '';
#
#-----[ AFTER, ADD ]---------------------------------
#
$topic_desc = ( !empty($HTTP_POST_VARS['topicdesc']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['topicdesc']))) : '';
#
#-----[ FIND ]---------------------------------------
#
'SUBJECT' => $subject
#
#-----[ AFTER, ADD ]---------------------------------
#
'T_DESC' => $topic_desc,
#
#-----[ OPEN ]---------------------------------------
#
includes/function_post.php
#
#-----[ FIND ]---------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
#
#-----[ REPLACE WITH ]-------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length, &$t_desc)
#
#-----[ FIND ]---------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
#
#-----[ REPLACE WITH ]-------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_description) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '$t_desc')" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", topic_description = '$t_desc' WHERE topic_id = $topic_id";
#
#-----[ FIND ]---------------------------------------
#
$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";
#
#-----[ REPLACE WITH ]-------------------------------
#
$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text, post_description) VALUES ($post_id, '$post_subject', '$bbcode_uid', '$post_message', '$t_desc')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', bbcode_uid = '$bbcode_uid', post_subject = '$post_subject', post_description = '$t_desc' WHERE post_id = $post_id";
#
#-----[ OPEN ]---------------------------------------
#
viewforum.php
#
#-----[ FIND ]---------------------------------------
#
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
#
#-----[ REPLACE WITH ]-------------------------------
#
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username, t.topic_description
#
#-----[ FIND ]---------------------------------------
#
$template->assign_block_vars('topicrow', array(
#
#-----[ AFTER, ADD ]---------------------------------
#
'TOPIC_DESCRIPTION' => (trim(htmlspecialchars($topic_rowset[$i]['topic_description'])) != "") ? htmlspecialchars($topic_rowset[$i]['topic_description']) . "<br>" : "",
#
#-----[ OPEN ]---------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]---------------------------------------
#
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
#
#-----[ AFTER, ADD ]---------------------------------
#
{topicrow.TOPIC_DESCRIPTION}
#
#-----[ OPEN ]---------------------------------------
#
viewtopic.php
#
#-----[ FIND ]---------------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
#
#-----[ REPLACE WITH ]-------------------------------
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, pt.post_description
#
#-----[ FIND ]---------------------------------------
#
'POST_SUBJECT' => $post_subject,
#
#-----[ REPLACE WITH ]-------------------------------
#
'POST_SUBJECT' => $post_subject . "<br />Description: " . htmlspecialchars($postrow[$i]['post_description']),
#
#-----[ SAVE & CLOSE ALL FILES ]---------------------
#
# End of hack.
Und um deinen Fragen zu beantworten,
Nein die werden nicht in der Datenbank gespeichert und auch nicht angezeigt, wenn ein Beitrag editiert wird.
Ich bin grad nochmal den gesamten code durchgegangen und glaube der Fehler liegt in einer Passage des Codes in der function_post.php
Dieser sieht bei mir derzeit so aus.
- Code: Alles auswählen
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote,k_id) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, $k_id)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", k_id=$k_id WHERE topic_id = $topic_id";
Und soll so angepasst werden.
- Code: Alles auswählen
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, k_id, topic_description) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '$t_desc', $k_id)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", k_id=$k_id WHERE topic_id = $topic_id";
Ich glaube die Where Klausel ist bei mir falsch gesetzt.
Ich weiss nämlich nicht wie ich den alten Wert mit dem neuen ersetzen muss bzw. wie genau der String auszusehen hat damit auch der andere Parameter nachher korrekt verarbeitet wird.
Hier mein "Vorschlag"
- Code: Alles auswählen
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote,k_id) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, $k_id)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", k_id=$k_id, topic_description = '$t_desc' WHERE topic_id = $topic_id";
Zugefügt nach 25 Minute(n): Das ist strange -
jetzt funktioniert es
Zugefügt nach weiteren 15 Minute(n): OK,
so langsam wirds ;-)
@AmigaLink, vielleicht kannst du mir zur Thematik noch einen Tip geben.
Und zwar finde ich es nicht so toll, dass die Topic Description in BOLD dargestellt wird.
- Code: Alles auswählen
'POST_SUBJECT' => $post_subject . "<br /> Description: " . htmlspecialchars($postrow[$i]['post_description']),
Wie kann ich das machen, dass Subject und Description mit einem dünnen Balken voneinander getrennt sind. Zum anderen würde ich gern die Description in Schriftgröße 8 und in einer anderen Farbe darstellen.