shares kiss

This commit is contained in:
Mario
2025-11-10 19:50:10 +00:00
parent 28692b867c
commit 573c6f3df3
5 changed files with 8 additions and 42 deletions

View File

@@ -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;
}
}

View File

@@ -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']));

View File

@@ -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();
}
}

View File

@@ -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);

View File

@@ -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);
});
}
}