こんにちは、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');
お手数ですが、ご確認いただきますようお願いいたします。
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が最新ですよ。
もっとも、そのあたりには手が入っていないので、同じ状況のはずですが。