aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-22 14:29:15 -0800
committerfriendica <info@friendica.com>2013-12-22 14:29:15 -0800
commitc1a85ccbec8f0c41b4e5927846bf1dce0db93dd4 (patch)
treee48c70af8c0e2df1fb006affa2d2b13ef5448530
parent97728543c1cef3a8cd09e2a95189837182dd09bc (diff)
downloadvolse-hubzilla-c1a85ccbec8f0c41b4e5927846bf1dce0db93dd4.tar.gz
volse-hubzilla-c1a85ccbec8f0c41b4e5927846bf1dce0db93dd4.tar.bz2
volse-hubzilla-c1a85ccbec8f0c41b4e5927846bf1dce0db93dd4.zip
add ability to set created date/time from the api
-rw-r--r--mod/item.php7
-rwxr-xr-xview/tpl/jot.tpl1
2 files changed, 4 insertions, 4 deletions
diff --git a/mod/item.php b/mod/item.php
index 7f881d28d..b7ad6b97c 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -66,8 +66,8 @@ function item_post(&$a) {
$owner_hash = null;
- $message_id = ((x($_REQUEST,'message_id') && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
-
+ $message_id = ((x($_REQUEST,'message_id') && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
+ $created = ((x($_REQUEST,'created')) ? datetime_convert('UTC','UTC',$_REQUEST['created']) : datetime_convert());
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
$post_id = ((x($_REQUEST,'post_id')) ? intval($_REQUEST['post_id']) : 0);
$app = ((x($_REQUEST,'source')) ? strip_tags($_REQUEST['source']) : '');
@@ -274,6 +274,7 @@ function item_post(&$a) {
$item_flags = $orig_post['item_flags'];
$item_restrict = $orig_post['item_restrict'];
$postopts = $orig_post['postopts'];
+ $created = $orig_post['created'];
}
else {
@@ -602,7 +603,7 @@ function item_post(&$a) {
$datarray['owner_xchan'] = (($owner_hash) ? $owner_hash : $owner_xchan['xchan_hash']);
$datarray['author_xchan'] = $observer['xchan_hash'];
- $datarray['created'] = datetime_convert();
+ $datarray['created'] = $created;
$datarray['edited'] = datetime_convert();
$datarray['expires'] = $expires;
$datarray['commented'] = datetime_convert();
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index a0bc9c805..9038155be 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -12,7 +12,6 @@
<input type="hidden" name="post_id" value="{{$post_id}}" />
<input type="hidden" name="webpage" value="{{$webpage}}" />
<input type="hidden" name="preview" id="jot-preview" value="0" />
-
{{$mimeselect}}
{{$layoutselect}}