aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/actions
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 22:21:29 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-05 22:21:29 +0000
commit67168b0ea5781951eaf6a7566762b44acc17d12c (patch)
tree654e12b005be9173072a5018280f7865d598957b /mod/blog/actions
parenteb538def799eb54e1ce29996dfbc56f4c960e3f3 (diff)
downloadelgg-67168b0ea5781951eaf6a7566762b44acc17d12c.tar.gz
elgg-67168b0ea5781951eaf6a7566762b44acc17d12c.tar.bz2
Adding a datetime view for use with blog publication.
git-svn-id: http://code.elgg.org/elgg/trunk@5630 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/actions')
-rw-r--r--mod/blog/actions/blog/save.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 7115acaa4..db9ea77e8 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -45,7 +45,6 @@ $values = array(
'title' => '',
'description' => '',
'status' => 'draft',
- 'publish_date' => time(),
'access_id' => ACCESS_DEFAULT,
'comments_on' => 'On',
'excerpt' => '',
@@ -99,14 +98,6 @@ foreach ($values as $name => $default) {
}
break;
- case 'publish_date':
- if (!$value = strtotime($value)) {
- $value = time();
- }
-
- $values[$name] = $value;
- break;
-
// don't try to set the guid
case 'guid':
unset($values['guid']);
@@ -118,6 +109,15 @@ foreach ($values as $name => $default) {
}
}
+// build publish_date
+$publish_month = get_input('publish_month');
+$publish_day = get_input('publish_day');
+$publish_year = get_input('publish_year');
+$publish_hour = get_input('publish_hour');
+$publish_minute = get_input('publish_minute');
+$datetime = "$publish_year-$publish_month-$publish_day $publish_hour:$publish_minute:00";
+$values['publish_date'] = date('U', strtotime($datetime));
+
// assign values to the entity, stopping on error.
if (!$error) {
foreach ($values as $name => $value) {