[Comoblog-commit] comoblog/admin post_add.php,1.2,1.3 post_edit.php,1.2,1.3
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-10-07 14:09:56
|
Update of /cvsroot/comoblog/comoblog/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30290/admin Modified Files: post_add.php post_edit.php Log Message: RFE: 1280315 - Allow date editing/updating through admin screens Index: post_add.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/admin/post_add.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- post_add.php 5 Oct 2005 00:45:34 -0000 1.2 +++ post_add.php 7 Oct 2005 14:09:48 -0000 1.3 @@ -58,6 +58,15 @@ $post[$k] = addslashes($v); } + if ($post['post_date_option'] == "now") + { + $post['post_mail_date'] = time(); + } + else if ($post['post_date_option'] == "change") + { + $post['post_mail_date'] = strtotime($post['post_mail_date']); + } + // add post entry in the database $query = " insert into ".CFG_MYSQL_TABPREFIX."posts ( @@ -68,7 +77,7 @@ 'text/plain', '0', '".$post['post_mail_from']."', - '".time()."', + '".$post['post_mail_date']."', '".$post['post_mail_subject']."', '".$post['post_mail_body']."', '".$post['topic_id']."' @@ -151,7 +160,7 @@ } $tpl->parse('main.images'); - +$tpl->assign('NOW_DATE', strftime($CAL_DATE_FORMAT." %H:%M", time())); $tpl->assign('ACTION', basename($_SERVER['PHP_SELF'])); Index: post_edit.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/admin/post_edit.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- post_edit.php 5 Oct 2005 00:45:34 -0000 1.2 +++ post_edit.php 7 Oct 2005 14:09:48 -0000 1.3 @@ -89,6 +89,19 @@ $post[$k] = addslashes($v); } + if ($post['post_date_option'] == "now") + { + $post['post_mail_date'] = time(); + } + else if ($post['post_date_option'] == "change") + { + $post['post_mail_date'] = strtotime($post['post_mail_date']); + } + else + { + $post['post_mail_date'] = strtotime($post['post_mail_date_orig']); + } + $query = " update ".CFG_MYSQL_TABPREFIX."posts @@ -97,6 +110,7 @@ post_mail_subject = '".$post['post_mail_subject'] ."', post_mail_body = '".$post['post_mail_body'] ."', post_images = '".$post['post_images'] ."', + post_mail_date = '".$post['post_mail_date'] ."', topic_id = '".$post['topic_id'] ."' where post_id = '".$post['post_id'] ."' @@ -133,6 +147,9 @@ if ($post) { + $strdate = strftime($CAL_DATE_FORMAT." %H:%M", $post['post_mail_date']); + $post['post_mail_date'] = $strdate; + $tpl->assign('POST', $post); // topics |