PEAK XOOPS - [Bulletin] 「掲載日時を設定する」の不具合 in englishin japanese

[Bulletin] 「掲載日時を設定する」の不具合

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2008/6/2 20:25
Tom_G3X  二等兵   Posts: 6
こんにちは、Tomです。
すいません、日本語で失礼します。

bulletin HD-2.13 ですが、
記事の編集画面において、「掲載日時」のチェックボックスにチェックの有無に関わらず、投稿日時が、編集時の日時に変更されてしまうようです。

class/formselecttime.php を見ると、以下のように最近修正された形跡があるようですが・・・。
TRUST_PATH/modules/bulletin/class/formselecttime.php
		$thsy = date('Y');
//080411		$year_select  = new XoopsFormSelect('', $name.'[year]', $this->year);
		$year_select  = new XoopsFormSelect('', $name.'_year_', $this->year);
//080411		$year_select  ->addOptionArray(array($thsy-8=>$thsy-8, $thsy-7, $thsy-6, $thsy-5, $thsy-4, $thsy-3, $thsy-2, $thsy-1, $thsy, $thsy+1));
		for($y=1970;$y<2038;$y++) $year_select->addOption($y,$y); // GIJ
//080411		$month_select = new XoopsFormSelect('', $name.'[month]', $this->month);
		$month_select = new XoopsFormSelect('', $name.'_month_', $this->month);
		$month_select ->addOptionArray(array(1=>1,2,3,4,5,6,7,8,9,10,11,12));
//080411		$day_select   = new XoopsFormSelect('', $name.'[day]', $this->day);
		$day_select   = new XoopsFormSelect('', $name.'_day_', $this->day);
		$day_select   ->addOptionArray(array(1=>1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31));
//080411		$hour_select  = new XoopsFormSelect('', $name.'[hour]', $this->hour);
		$hour_select  = new XoopsFormSelect('', $name.'_hour_', $this->hour);
		$hour_select  ->addOptionArray(array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23));
		$sixty_option = array();
		for ($i=0; $i<60; $i++) $sixty_option[] = $i;


それで、暫定的に以下のように変更してみましたら、投稿日時のコントロールができるようになりました。

TRUST_PATH/modules/bulletin/main/submit.php - line102
/*
	$auto['year']  = isset( $_POST['auto']['year'] )  ? intval( $_POST['auto']['year'] )  : formatTimestamp($time, 'Y');
	$auto['month'] = isset( $_POST['auto']['month'] ) ? intval( $_POST['auto']['month'] ) : formatTimestamp($time, 'n');
	$auto['day']   = isset( $_POST['auto']['day'] )   ? intval( $_POST['auto']['day'] )   : formatTimestamp($time, 'd');
	$auto['hour']  = isset( $_POST['auto']['hour'] )  ? intval( $_POST['auto']['hour'] )  : formatTimestamp($time, 'H');
	$auto['min']   = isset( $_POST['auto']['min'] )   ? intval( $_POST['auto']['min'] )   : formatTimestamp($time, 'i');
	$auto['sec']   = isset( $_POST['auto']['sec'] )   ? intval( $_POST['auto']['sec'] )   : date('s');
	$autoexp['year']  = isset( $_POST['autoexp']['year'] )  ? intval( $_POST['autoexp']['year'] )  : formatTimestamp($time, 'Y');
	$autoexp['month'] = isset( $_POST['autoexp']['month'] ) ? intval( $_POST['autoexp']['month'] ) : formatTimestamp($time, 'n');
	$autoexp['day']   = isset( $_POST['autoexp']['day'] )   ? intval( $_POST['autoexp']['day'] )   : formatTimestamp($time, 'd');
	$autoexp['hour']  = isset( $_POST['autoexp']['hour'] )  ? intval( $_POST['autoexp']['hour'] )  : formatTimestamp($time, 'H');
	$autoexp['min']   = isset( $_POST['autoexp']['min'] )   ? intval( $_POST['autoexp']['min'] )   : formatTimestamp($time, 'i');
	$autoexp['sec']   = isset( $_POST['autoexp']['sec'] )   ? intval( $_POST['autoexp']['sec'] )   : date('s');
*/
	$auto['year']  = isset( $_POST['auto_year_'] )  ? intval( $_POST['auto_year_'] )  : formatTimestamp($time, 'Y');
	$auto['month'] = isset( $_POST['auto_month_'] ) ? intval( $_POST['auto_month_'] ) : formatTimestamp($time, 'n');
	$auto['day']   = isset( $_POST['auto_day_'] )   ? intval( $_POST['auto_day_'] )   : formatTimestamp($time, 'd');
	$auto['hour']  = isset( $_POST['auto_hour_'] )  ? intval( $_POST['auto_hour_'] )  : formatTimestamp($time, 'H');
	$auto['min']   = isset( $_POST['auto_min_'] )   ? intval( $_POST['auto_min_'] )   : formatTimestamp($time, 'i');
	$auto['sec']   = isset( $_POST['auto_sec_'] )   ? intval( $_POST['auto_sec_'] )   : date('s');
	$autoexp['year']  = isset( $_POST['autoexp_year_'] )  ? intval( $_POST['autoexp_year_'] )  : formatTimestamp($time, 'Y');
	$autoexp['month'] = isset( $_POST['autoexp_month_'] ) ? intval( $_POST['autoexp_month_'] ) : formatTimestamp($time, 'n');
	$autoexp['day']   = isset( $_POST['autoexp_day_'] )   ? intval( $_POST['autoexp_day_'] )   : formatTimestamp($time, 'd');
	$autoexp['hour']  = isset( $_POST['autoexp_hour_'] )  ? intval( $_POST['autoexp_hour_'] )  : formatTimestamp($time, 'H');
	$autoexp['min']   = isset( $_POST['autoexp_min_'] )   ? intval( $_POST['autoexp_min_'] )   : formatTimestamp($time, 'i');
	$autoexp['sec']   = isset( $_POST['autoexp_sec_'] )   ? intval( $_POST['autoexp_sec_'] )   : date('s');

お手数ですが、ご確認いただきますようお願いいたします。
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2008/6/3 3:52
GIJOE  先任軍曹   Posts: 4110
Tomさん、こんにちは。

Quote:

Tom_G3X wrotes:
bulletin HD-2.13 ですが、
記事の編集画面において、「掲載日時」のチェックボックスにチェックの有無に関わらず、投稿日時が、編集時の日時に変更されてしまうようです。

class/formselecttime.php を見ると、以下のように最近修正された形跡があるようですが・・・。
そのHD-2.13って、どこから落とされました?

少なくともうちのbulletinにはそういうコードはないですよ。

このファイルに手を入れたのは、2007/03/02が最後。

オリジナルだと8年前から1年後までのoptionしかでないので、それを外れたら強制的に書き換わってしまう、という不具合を修正しただけです。


あと、bulletin-HD は2.14が最新ですよ。
もっとも、そのあたりには手が入っていないので、同じ状況のはずですが。
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2008/6/3 10:44
Tom_G3X  二等兵   Posts: 6
Tomです。
今、色々バージョンをDLしたり、SVNをチェックしてみたりしたんですが、そんなコード、どこにもありませんね。
ゴチャゴチャしてる時に、紛れ込んだ可能性もありますが、僕も、身に覚えが無くて、不思議です。

2.14 は、正常に動作いたしました。こちらに更新してみます。

余計なお手数をお掛けして、すみませんでした。
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!