commentプラグインのnodateオプションが無効となっている

メッセージ

commentプラグインで挿入する文字列に日付を付加しないオプションnodateを指定しても日付が挿入されてしまう
sf.jp上の1.34および1.42で確認。orgではnodateが正しく働く。以下、修正案。

+	$now_format = ($post['nodate']=='1') ? '' : COMMENT_NOW_FORMAT ;
-	if ($post['nodate']=='1') {
-		$comment_format = str_replace('$now','',$comment_format);
-	}

	$postdata = '';
	$postdata_old  = get_source($post['refer']);
	$comment_no = 0;
	
	$name = '';
	if ($post['name'] != '') {
		$name = str_replace('$name',$post['name'],COMMENT_NAME_FORMAT);
	}
	
	$head = '';
	if (preg_match('/^(-{1,2})(.*)/',$post['msg'],$match)) {
		$head = $match[1];
		$post['msg'] = $match[2];
	}
	
	$comment = str_replace("\x08MSG\x08",str_replace('$msg',$post['msg'],COMMENT_MSG_FORMAT),$comment_format);
	$comment = str_replace("\x08NAME\x08",$name,$comment);
+	$comment = str_replace("\x08NOW\x08",str_replace('$now',$now,$now_format),$comment);
-	$comment = str_replace("\x08NOW\x08",str_replace('$now',$now,COMMENT_NOW_FORMAT),$comment);
	$comment = $head.$comment;


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2003-05-17 (土) 23:51:09
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.230 sec.

SourceForge