da ich in ein meiner Foren zig eMails und/oder PNs bekomme warum der post der User immer größer werden obwohl diese auf Antwort geklickt haben dachte ich mir mach mal ein Hinweis Text in der posting_body.tpl rein das das Post nach Angabe im ACP hinzugefügt wird.
Soweit so gut klappt auch alles dh jedenfalls die Angabe im ACP kann ich in der posting_body.tpl ausgeben mit einem Text dazu.
Das Problem ist da die Mod nicht bei Gäste funktioniert und wenn die Zeit die man im ACP eingegeben hat vorbei ist bleibt der text trotzdem stehen.
mmhh wie kriege das den hin das der Hinweis Text nur zu sehen ist wenn die Zeit vom ACP rum ist das der text verschwindet
Bsp:
im ACP gebe ich 0.10 ein.
Das wären 10 Minuten
für 10 Minuten belibt der Hinweis Text sichtbar
nach 10 Minuten soll der Hinweis Text nicht mehr zu sehen sein.
Genau das ist mein Problem, der Hinweis Text bleibt sichtbar.
posting_body.tpl
Code: Alles auswählen
{DOUBLE_POST_TIME}Code: Alles auswählen
//
// Include page header
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'posting_body.tpl',
'pollbody' => 'posting_poll_body.tpl',
'reviewbody' => 'posting_topic_review.tpl')
);
make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
'FORUM_NAME' => $forum_name,
'L_POST_A' => $page_title,
// TEST
// 'TEST' => $board_config['join_interval'],
'DOUBLE_POST_TIME' => $lang['DPT'] .$board_config['join_interval'],
// TEST
'L_POST_SUBJECT' => $lang['Post_subject'],
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
);Code: Alles auswählen
//
// Submit post/vote (newtopic, edit, reply, etc.)
//
// double_post eliminate start
if ( $mode == 'reply' && $userdata['user_id'] != ANONYMOUS )
{
$poster_id = $userdata['user_id'];
$sql = "SELECT post_id, poster_id, post_time, MAX(post_time) FROM " . POSTS_TABLE . " WHERE topic_id = $topic_id GROUP BY post_time ORDER BY post_time DESC LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
$post_id_last_row = $db->sql_fetchrow($result);
$post_id = $post_id_last_row['post_id'];
$current_time = time();
$difference_time = $current_time - $post_id_last_row['post_time'];
$hours = floor($difference_time/60/60);
$minutes = floor($difference_time/60%60);
$seconds = $difference_time%60;
$separator = ' \n\n[size=9][color=#999999]Zugefügt nach';
if ( $hours != 0 ) $separator .= ' ' . $hours . ' Stunde(n)';
if ( $minutes != 0 ) $separator .= ' ' . $minutes . ' Minute(n)';
if ( $hours == 0 && $minutes == 0 ) $separator .= ' ' . $seconds . ' Sekunde(n)';
$separator .= '[/color][/size]\n\n ';
if ( $post_id_last_row['poster_id'] == $poster_id && ( $difference_time < ( $board_config['join_interval'] * 3600 ) ) )
{
$mode = 'editpost';
$sql = "SELECT post_text, bbcode_uid FROM " . POSTS_TEXT_TABLE . " WHERE post_id = $post_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
$last_message_row = $db->sql_fetchrow($result);
$bb_uid = ':' . $last_message_row['bbcode_uid'];
// i don't know much about parsing the message, so it may well be that,
// there are some wrongs, anyway all seems to work fine
$last_message = str_replace($bb_uid, '', $last_message_row['post_text']);
$last_message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $last_message);
$last_message = undo_htmlspecialchars(addslashes($last_message));
}
}
// double_post eliminate end