diff --git a/boot.php b/boot.php index 3dff39a33..dcf5b1c1a 100644 --- a/boot.php +++ b/boot.php @@ -2449,3 +2449,11 @@ function feed_salmonlinks($nick) { return $salmon; }} +if(! function_exists('get_plink')) { +function get_plink($item) { + $a = get_app(); + $plink = (((x($item,'plink')) && (! $item['private'])) ? '' : ''); + return $plink; +}} + diff --git a/include/items.php b/include/items.php index b5bdd7833..153debd7d 100644 --- a/include/items.php +++ b/include/items.php @@ -246,7 +246,7 @@ function get_atom_elements($feed,$item) { $res['uri'] = unxmlify($item->get_id()); $res['title'] = unxmlify($item->get_title()); $res['body'] = unxmlify($item->get_content()); - + $res['plink'] = unxmlify($item->get_link(0)); // look for a photo. We should check media size and find the best one, // but for now let's just find any author photo @@ -591,6 +591,7 @@ function item_store($arr,$force_parent = false) { $arr['object'] = ((x($arr,'object')) ? trim($arr['object']) : ''); $arr['target-type'] = ((x($arr,'target-type')) ? notags(trim($arr['target-type'])) : ''); $arr['target'] = ((x($arr,'target')) ? trim($arr['target']) : ''); + $arr['plink'] = ((x($arr,'plink')) ? notags(trim($arr['plink'])) : ''); $arr['allow_cid'] = ((x($arr,'allow_cid')) ? trim($arr['allow_cid']) : ''); $arr['allow_gid'] = ((x($arr,'allow_gid')) ? trim($arr['allow_gid']) : ''); $arr['deny_cid'] = ((x($arr,'deny_cid')) ? trim($arr['deny_cid']) : ''); @@ -1418,7 +1419,7 @@ function atom_entry($item,$type,$author,$owner,$comment = false) { $o .= '' . xmlify(datetime_convert('UTC','UTC',$item['edited'] . '+00:00',ATOM_TIME)) . '' . "\r\n"; $o .= '' . base64url_encode($item['body'], true) . '' . "\r\n"; $o .= '' . xmlify(($type === 'html') ? bbcode($item['body']) : $item['body']) . '' . "\r\n"; - $o .= '' . "\r\n"; + $o .= '' . "\r\n"; if($comment) $o .= '' . intval($item['last-child']) . '' . "\r\n"; diff --git a/mod/display.php b/mod/display.php index b07e1aee5..03003f3c0 100644 --- a/mod/display.php +++ b/mod/display.php @@ -272,6 +272,7 @@ function display_content(&$a) { '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, '$owner_name' => $owner_name, + '$plink' => get_plink($item), '$drop' => $drop, '$vote' => $likebuttons, '$like' => $like, diff --git a/mod/item.php b/mod/item.php index 2cc2b9eb2..5bb4b1b73 100644 --- a/mod/item.php +++ b/mod/item.php @@ -429,10 +429,11 @@ function item_post(&$a) { } } - $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1 + $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `plink` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1 WHERE `id` = %d LIMIT 1", intval($parent), dbesc(($parent == $post_id) ? $uri : $parent_item['uri']), + dbesc($a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id), dbesc(datetime_convert()), intval($post_id) ); diff --git a/mod/network.php b/mod/network.php index f09b302e9..3658c601e 100644 --- a/mod/network.php +++ b/mod/network.php @@ -425,6 +425,7 @@ function network_content(&$a, $update = 0) { '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, '$owner_name' => $owner_name, + '$plink' => get_plink($item), '$drop' => $drop, '$vote' => $likebuttons, '$like' => $like, diff --git a/mod/profile.php b/mod/profile.php index 57abc479d..0723d64fb 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -371,6 +371,7 @@ function profile_content(&$a, $update = 0) { '$lock' => $lock, '$location' => $location, '$indent' => $indent, + '$plink' => get_plink($item), '$drop' => $drop, '$like' => $like, '$vote' => $likebuttons, diff --git a/view/de/wallwall_item.tpl b/view/de/wallwall_item.tpl index fd05a74ac..67b6006cf 100644 --- a/view/de/wallwall_item.tpl +++ b/view/de/wallwall_item.tpl @@ -21,6 +21,7 @@
$title
$body
+ $plink $drop
diff --git a/view/en/wallwall_item.tpl b/view/en/wallwall_item.tpl index f8affd1c5..9c6ad6070 100644 --- a/view/en/wallwall_item.tpl +++ b/view/en/wallwall_item.tpl @@ -21,6 +21,7 @@
$title
$body
+ $plink $drop
diff --git a/view/fr/wallwall_item.tpl b/view/fr/wallwall_item.tpl index f8affd1c5..9c6ad6070 100644 --- a/view/fr/wallwall_item.tpl +++ b/view/fr/wallwall_item.tpl @@ -21,6 +21,7 @@
$title
$body
+ $plink $drop
diff --git a/view/it/wallwall_item.tpl b/view/it/wallwall_item.tpl index bc2d3f2ec..3c7883fc8 100644 --- a/view/it/wallwall_item.tpl +++ b/view/it/wallwall_item.tpl @@ -21,6 +21,7 @@
$title
$body
+ $plink $drop
diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index ac3562d1c..e3a5fd3e7 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -833,6 +833,13 @@ input#dfrn-url { .wall-item-like-buttons img { cursor: pointer; } + +.wall-item-links-wrapper { + float: left; + margin-bottom: 5px; + margin-left: 5px; +} + .wall-item-delete-wrapper { float: right; margin-top: 5px; diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index a87252016..d34c81a45 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -962,6 +962,13 @@ input#dfrn-url { .wall-item-like-buttons img { cursor: pointer; } + +.wall-item-links-wrapper { + float: left; + margin-top: 100px; + margin-left: 10px; +} + .wall-item-delete-wrapper { float: right; margin-top: 20px; diff --git a/view/wall_item.tpl b/view/wall_item.tpl index 67fce4152..b9f27ed4a 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -16,6 +16,7 @@
$title
$body
+ $plink $drop