aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-25 14:20:57 -0800
committerfriendica <info@friendica.com>2013-11-25 14:20:57 -0800
commitcbe096dd90292613e21725c8468eaf77f934d079 (patch)
tree05ac8669a05ec86c50d89f1dd29f68571a44224b /mod
parent41e9d0f0f90dc8cadc7d8fb101bc3f0b6cf17cc1 (diff)
downloadvolse-hubzilla-cbe096dd90292613e21725c8468eaf77f934d079.tar.gz
volse-hubzilla-cbe096dd90292613e21725c8468eaf77f934d079.tar.bz2
volse-hubzilla-cbe096dd90292613e21725c8468eaf77f934d079.zip
wp-to-red: now supports editing, titles, and native permalinks
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index dba9f01b6..1893bb684 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -77,6 +77,8 @@ function item_post(&$a) {
$webpage = ((x($_REQUEST,'webpage')) ? intval($_REQUEST['webpage']) : 0);
$pagetitle = ((x($_REQUEST,'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : '');
$layout_mid = ((x($_REQUEST,'layout_mid')) ? escape_tags($_REQUEST['layout_mid']): '');
+ $plink = ((x($_REQUEST,'permalink')) ? escape_tags($_REQUEST['permalink']) : '');
+
/*
Check service class limits
*/
@@ -196,6 +198,16 @@ function item_post(&$a) {
$orig_post = null;
+ if($namespace && $remote_id) {
+ // It wasn't an internally generated post - see if we've got an item matching this remote service id
+ $i = q("select iid from item_id where service = '%s' and sid = '%s' limit 1",
+ dbesc($namespace),
+ dbesc($remote_id)
+ );
+ if($i)
+ $post_id = $i[0]['iid'];
+ }
+
if($post_id) {
$i = q("SELECT * FROM `item` WHERE `uid` = %d AND `id` = %d LIMIT 1",
intval($profile_uid),
@@ -616,6 +628,7 @@ function item_post(&$a) {
$datarray['layout_mid'] = $layout_mid;
$datarray['comment_policy'] = map_scope($channel['channel_w_comment']);
$datarray['term'] = $post_tags;
+ $datarray['plink'] = $plink;
// preview mode - prepare the body for display and send it via json