Seite 1 von 1

Quick Reply und CH-Mod 2.1.1

Verfasst: 26.05.2005 23:06
von mgutt
im neuen CH-Mod gibt es diesen Code neu in der posting.php:

Code: Alles auswählen

$topic_last_post_id = intval($post_info['topic_last_post_id']);
if ( ($submit || $refresh) && in_array($mode, array('reply', 'quote', 'editpost')) )
{
	// check if the last post id is still the same
	if ( _read('last_post', TYPE_INT) != $topic_last_post_id )
	{
		$refresh = $preview = true;
		$submit = false;
		_error($mode == 'editpost' ? 'New_post_meanwhile_edit' : 'New_post_meanwhile_reply');
	}
}
Hier wird vor dem Absenden geprüft, ob der letzte Beitrag in der Zwischenzeit gelöscht oder verändert wurde. Wenn ja, dann wird man nochmal darauf hingewiesen und man hat die Chance seinen Beitrag nochmal zu überarbeiten.

Die Funktion finde ich ganz nett, aber beim Quick Reply Mod wird man immer darauf hingewiesen, obwohl gar kein neuer Beitrag dazwischen gekommen ist.

In diesem Part wird in der quick_reply.php die Nachricht an die posting.php übergeben:

Code: Alles auswählen

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)))
{
        $bbcode_uid = $postrow[$total_posts - 1]['bbcode_uid'];
        $last_poster = $postrow[$total_posts - 1]['username'];
        $last_msg = $postrow[$total_posts - 1]['post_text'];
        $last_msg = str_replace(":1:$bbcode_uid", '', $last_msg);
        $last_msg = str_replace(":$bbcode_uid", '', $last_msg);        
        $last_msg = str_replace("'", ''', $last_msg);
        $last_msg = "[quote=\"$last_poster\"]" . $last_msg . '[/quote]';
        $attach_sig = (( $userdata['session_logged_in'] ) ? $userdata['user_attachsig'] : 0)?"checked='checked'":'';
        $notify_user = (( $userdata['session_logged_in'] ) ? $userdata['user_notify'] : 0)?"checked='checked'":'';
        
        $template->assign_block_vars('quick_reply', array(
                'POST_ACTION' => append_sid("posting.$phpEx"),
                'TOPIC_ID' => $topic_id,
                'SID' => $userdata['session_id'],
                'LAST_MESSAGE' => $last_msg)
        );

        if( $userdata['session_logged_in'])
        {
                $template->assign_block_vars('quick_reply.user_logged_in', array(
                        'ATTACH_SIGNATURE' => $attach_sig,
                        'NOTIFY_ON_REPLY' => $notify_user)
                );
        }else
        {
                $template->assign_block_vars('quick_reply.user_logged_out', array());
        }


        generate_smilies_row();

        $template->assign_vars(array(
                'U_MORE_SMILIES' => append_sid("quick_reply.$phpEx?mode=smilies"),
                'L_USERNAME' => $lang['Username'],
                'L_PREVIEW' => $lang['Preview'],
                'L_OPTIONS' => $lang['Options'],
                'L_SUBMIT' => $lang['Submit'],
                'L_CANCEL' => $lang['Cancel'],
                'L_ATTACH_SIGNATURE' => $lang['Attach_signature'], 
                'L_NOTIFY_ON_REPLY' => $lang['Notify'],
                'L_NOTIFY_ON_REPLY' => $lang['Notify'],
                'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
                'L_ALL_SMILIES' => $lang['Quick_Reply_smilies'],
                'L_QUOTE_SELECTED' => $lang['QuoteSelelected'],
                'L_NO_TEXT_SELECTED' => $lang['QuoteSelelectedEmpty'],
                'L_EMPTY_MESSAGE' => $lang['Empty_message'],
                'L_QUOTE_LAST_MESSAGE' => $lang['Quick_quote'],
                'L_QUICK_REPLY' => $lang['Quick_Reply'],
                'L_PREVIEW' => $lang['Preview'],
                'L_SUBMIT' => $lang['Submit'])
);
}
$template->assign_var_from_handle('QUICKREPLY_OUTPUT', 'quick_reply_output');
Was muss ich ändern, damit die Überprüfung auch mit dem Quick-Reply (schnelle Antwort Mod) funktioniert?