--- modules/comment/comment.module.old 2007-01-29 22:51:53.000000000 +0100 +++ modules/comment/comment.module 2007-08-26 23:10:44.000000000 +0200 @@ -1634,9 +1634,21 @@ function comment_form_validate($form_id, } function _comment_form_submit($form_values) { - if (!isset($form_values['date'])) { + // New comment should be stamped with now + if (!$form_values['cid']) { $form_values['date'] = 'now'; - } + + // If comment exists, maybe someone with administer comments privileges deletet time + } elseif ((!isset($form_values['date'])) + && user_access('administer comments')) { + $form_values['date'] = 'now'; + + // if user without administer comments privileges edits comment, time should be reloaded from database + } elseif (!isset($form_values['date'])) { + $timestamp = db_result(db_query('SELECT timestamp FROM {comments} WHERE cid = %d', $form_values['cid'])); + $form_values['date'] = format_date($timestamp,'custom', 'Y-m-d H:i O'); + } // else date value exists and stays as entered in form + $form_values['timestamp'] = strtotime($form_values['date']); if (isset($form_values['author'])) { $account = user_load(array('name' => $form_values['author']));