mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
shares kiss
This commit is contained in:
@@ -118,13 +118,8 @@ class Share {
|
||||
$photo_bb = $object['body'];
|
||||
}
|
||||
|
||||
if (str_contains($this->item['body'], '[/share]')) {
|
||||
preg_match_all('/\[share(.*?)\[\/share\]/ism', $this->item['body'], $all_shares, PREG_SET_ORDER);
|
||||
foreach ($all_shares as $share) {
|
||||
$bb .= $share[0] . "\r\n";
|
||||
}
|
||||
} else {
|
||||
$bb = "[share author='".urlencode($this->item['author']['xchan_name']).
|
||||
if (!str_contains($this->item['body'], '[/share]')) {
|
||||
$bb .= "[share author='".urlencode($this->item['author']['xchan_name']).
|
||||
"' profile='" . $this->item['author']['xchan_url'] .
|
||||
"' avatar='" . $this->item['author']['xchan_photo_s'] .
|
||||
"' link='" . $this->item['plink'] .
|
||||
@@ -139,7 +134,6 @@ class Share {
|
||||
}
|
||||
|
||||
return $bb;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,10 +120,10 @@ class ThreadItem {
|
||||
$locktype = 0;
|
||||
}
|
||||
|
||||
$shareable = ((local_channel() && $conv->get_profile_owner() == local_channel()) && (intval($item['item_private']) === 0));
|
||||
$shareable = ((local_channel() && $conv->get_profile_owner() == local_channel()) && (intval($item['item_private']) === 0) && !str_contains('[/share]', $item['body']));
|
||||
|
||||
// allow an exemption for sharing stuff from your private feeds
|
||||
if($item['author']['xchan_network'] === 'rss')
|
||||
if ($item['author']['xchan_network'] === 'rss')
|
||||
$shareable = true;
|
||||
|
||||
$repeatable = ((local_channel() && $conv->get_profile_owner() == local_channel()) && intval($item['item_private']) === 0 && in_array($item['author']['xchan_network'], ['zot6', 'activitypub']));
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/security.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
||||
class Embed extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
|
||||
$post_id = ((argc() > 1) ? intval(argv(1)) : 0);
|
||||
|
||||
if(! $post_id)
|
||||
killme();
|
||||
|
||||
echo '[share=' . $post_id . '][/share]';
|
||||
killme();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
2
boot.php
2
boot.php
@@ -70,7 +70,7 @@ require_once('include/security.php');
|
||||
|
||||
|
||||
define('PLATFORM_NAME', 'hubzilla');
|
||||
define('STD_VERSION', '10.7.3');
|
||||
define('STD_VERSION', '10.7.4');
|
||||
define('ZOT_REVISION', '6.0');
|
||||
|
||||
define('DB_UPDATE_VERSION', 1264);
|
||||
|
||||
@@ -222,17 +222,11 @@
|
||||
window.location.href = 'rpost?f=&post_id='+id;
|
||||
}
|
||||
else {
|
||||
|
||||
if ($('#jot-popup').length != 0) $('#jot-popup').show();
|
||||
|
||||
$('#like-rotator-' + id).show();
|
||||
$.get('{{$baseurl}}/embed/' + id, function(data) {
|
||||
if (!editor) $("#profile-jot-text").val("");
|
||||
initEditor(function(){
|
||||
addeditortext(data);
|
||||
$('#like-rotator-' + id).hide();
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
initEditor(function(){
|
||||
addeditortext('[share=' + id + '][/share]');
|
||||
$(window).scrollTop(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user