summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/blogapi.module6
-rw-r--r--modules/blogapi/blogapi.module6
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/blogapi.module b/modules/blogapi.module
index ce7edce8d..bb187084e 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -223,6 +223,9 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
+ if (user_access('administer nodes') && !isset($edit['date'])) {
+ $edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
+ }
$node = node_submit($edit);
node_save($node);
if ($node->nid) {
@@ -274,6 +277,9 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return blogapi_error(implode("\n", $errors));
}
+ if (user_access('administer nodes') && !isset($edit['date'])) {
+ $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
+ }
$node = node_submit($node);
node_save($node);
if ($node->nid) {
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index ce7edce8d..bb187084e 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -223,6 +223,9 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
+ if (user_access('administer nodes') && !isset($edit['date'])) {
+ $edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
+ }
$node = node_submit($edit);
node_save($node);
if ($node->nid) {
@@ -274,6 +277,9 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return blogapi_error(implode("\n", $errors));
}
+ if (user_access('administer nodes') && !isset($edit['date'])) {
+ $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
+ }
$node = node_submit($node);
node_save($node);
if ($node->nid) {