Changeset 28497 for trunk/admin/picture_modify.php
- Timestamp:
- May 18, 2014, 12:04:36 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/picture_modify.php
r28496 r28497 109 109 110 110 //--------------------------------------------------------- update informations 111 112 // first, we verify whether there is a mistake on the given creation date 113 if (isset($_POST['date_creation_action']) 114 and 'set' == $_POST['date_creation_action']) 115 { 116 if (!is_numeric($_POST['date_creation_year']) 117 or !checkdate( 118 $_POST['date_creation_month'], 119 $_POST['date_creation_day'], 120 $_POST['date_creation_year']) 121 ) 122 { 123 $page['errors'][] = l10n('wrong date'); 124 } 125 } 126 127 if (isset($_POST['submit']) and count($page['errors']) == 0) 111 if (isset($_POST['submit'])) 128 112 { 129 113 $data = array(); … … 142 126 } 143 127 144 if (!empty($_POST['date_creation_year'])) 145 { 146 $data['date_creation'] = 147 $_POST['date_creation_year'] 148 .'-'.$_POST['date_creation_month'] 149 .'-'.$_POST['date_creation_day'] 150 .' '.$_POST['date_creation_time']; 128 if (!empty($_POST['date_creation'])) 129 { 130 $data['date_creation'] = $_POST['date_creation'].' '.$_POST['date_creation_time']; 151 131 } 152 132 else … … 340 320 unset($day, $month, $year); 341 321 342 if (isset($_POST['date_creation_action']) 343 and 'set' == $_POST['date_creation_action']) 344 { 345 foreach (array('day', 'month', 'year', 'time') as $varname) 346 { 347 $$varname = $_POST['date_creation_'.$varname]; 348 } 349 } 350 else if (isset($row['date_creation']) and !empty($row['date_creation'])) 351 { 352 list($year, $month, $day) = explode('-', substr($row['date_creation'],0,10)); 353 $time = substr($row['date_creation'],11); 322 if (!empty($row['date_creation'])) 323 { 324 list($date, $time) = explode(' ', $row['date_creation']); 354 325 } 355 326 else 356 327 { 357 list($year, $month, $day) = array('', 0, 0);328 $date = ''; 358 329 $time = '00:00:00'; 359 330 } 360 361 362 $month_list = $lang['month'];363 $month_list[0]='------------';364 ksort($month_list);365 331 366 332 $template->assign( 367 333 array( 368 'DATE_CREATION_DAY_VALUE' => (int)$day, 369 'DATE_CREATION_MONTH_VALUE' => (int)$month, 370 'DATE_CREATION_YEAR_VALUE' => $year, 371 'DATE_CREATION_TIME_VALUE' => $time, 372 'month_list' => $month_list, 334 'DATE_CREATION' => $date, 335 'DATE_CREATION_TIME' => $time, 373 336 ) 374 337 );
Note: See TracChangeset
for help on using the changeset viewer.