mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Merge branch 'master' into develop
- Updated new develop version label - Incremented database build number
This commit is contained in:
commit
93daf7883e
474 changed files with 75160 additions and 91301 deletions
|
@ -73,8 +73,8 @@ function wk_social_relay()
|
|||
'subscribe' => $subscribe,
|
||||
'scope' => $scope,
|
||||
'tags' => $taglist,
|
||||
'protocols' => ['diaspora' => System::baseUrl() . '/receive/public',
|
||||
'dfrn' => System::baseUrl() . '/dfrn_notify']
|
||||
'protocols' => ['diaspora' => ['receive' => System::baseUrl() . '/receive/public'],
|
||||
'dfrn' => ['receive' => System::baseUrl() . '/dfrn_notify']]
|
||||
];
|
||||
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
|
|
|
@ -20,6 +20,7 @@ use Friendica\Model\Contact;
|
|||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\Login;
|
||||
use Friendica\Module\Tos;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Temporal;
|
||||
|
||||
|
@ -296,12 +297,15 @@ function admin_content(App $a)
|
|||
*/
|
||||
function admin_page_tos(App $a)
|
||||
{
|
||||
$tos = new Tos();
|
||||
$t = get_markup_template('admin/tos.tpl');
|
||||
return replace_macros($t, [
|
||||
'$title' => L10n::t('Administration'),
|
||||
'$page' => L10n::t('Terms of Service'),
|
||||
'$displaytos' => ['displaytos', L10n::t('Display Terms of Service'), Config::get('system', 'tosdisplay'), L10n::t('Enable the Terms of Service page. If this is enabled a link to the terms will be added to the registration form and the general information page.')],
|
||||
'$displayprivstatement' => ['displayprivstatement', L10n::t('Display Privacy Statement'), Config::get('system','tosprivstatement'), L10n::t('Show some informations regarding the needed information to operate the node according e.g. to <a href="%s" target="_blank">EU-GDPR</a>.','https://en.wikipedia.org/wiki/General_Data_Protection_Regulation')],
|
||||
'$preview' => L10n::t('Privacy Statement Preview'),
|
||||
'$privtext' => $tos->privacy_complete,
|
||||
'$tostext' => ['tostext', L10n::t('The Terms of Service'), Config::get('system', 'tostext'), L10n::t('Enter the Terms of Service for your node here. You can use BBCode. Headers of sections should be [h2] and below.')],
|
||||
'$form_security_token' => get_form_security_token("admin_tos"),
|
||||
'$submit' => L10n::t('Save Settings'),
|
||||
|
@ -551,14 +555,9 @@ function admin_page_deleteitem_post(App $a)
|
|||
if (strpos($guid, '/')) {
|
||||
$guid = substr($guid, strrpos($guid, '/') + 1);
|
||||
}
|
||||
// Now that we have the GUID get all IDs of the associated entries in the
|
||||
// item table of the DB and drop those items, which will also delete the
|
||||
// Now that we have the GUID, drop those items, which will also delete the
|
||||
// associated threads.
|
||||
$r = dba::select('item', ['id'], ['guid' => $guid]);
|
||||
while ($row = dba::fetch($r)) {
|
||||
Item::deleteById($row['id']);
|
||||
}
|
||||
dba::close($r);
|
||||
Item::delete(['guid' => $guid]);
|
||||
}
|
||||
|
||||
info(L10n::t('Item marked for deletion.') . EOL);
|
||||
|
@ -1345,16 +1344,12 @@ function admin_page_site(App $a)
|
|||
}
|
||||
$diaspora_able = ($a->get_path() == "");
|
||||
|
||||
$optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', 100);
|
||||
$optimize_max_tablesize = Config::get('system', 'optimize_max_tablesize', -1);
|
||||
|
||||
if ($optimize_max_tablesize < -1) {
|
||||
if ($optimize_max_tablesize <= 0) {
|
||||
$optimize_max_tablesize = -1;
|
||||
}
|
||||
|
||||
if ($optimize_max_tablesize == 0) {
|
||||
$optimize_max_tablesize = 100;
|
||||
}
|
||||
|
||||
$t = get_markup_template('admin/site.tpl');
|
||||
return replace_macros($t, [
|
||||
'$title' => L10n::t('Administration'),
|
||||
|
@ -1399,7 +1394,7 @@ function admin_page_site(App $a)
|
|||
'$no_oembed_rich_content' => ['no_oembed_rich_content', L10n::t("No OEmbed rich content"), Config::get('system','no_oembed_rich_content'), L10n::t("Don't show the rich content \x28e.g. embedded PDF\x29, except from the domains listed below.")],
|
||||
'$allowed_oembed' => ['allowed_oembed', L10n::t("Allowed OEmbed domains"), Config::get('system','allowed_oembed'), L10n::t("Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.")],
|
||||
'$block_public' => ['block_public', L10n::t("Block public"), Config::get('system','block_public'), L10n::t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")],
|
||||
'$force_publish' => ['publish_all', L10n::t("Force publish"), Config::get('system','publish_all'), L10n::t("Check to force all profiles on this site to be listed in the site directory.")],
|
||||
'$force_publish' => ['publish_all', L10n::t("Force publish"), Config::get('system','publish_all'), L10n::t("Check to force all profiles on this site to be listed in the site directory.") . '<strong>' . L10n::t('Enabling this may violate privacy laws like the GDPR') . '</strong>'],
|
||||
'$global_directory' => ['directory', L10n::t("Global directory URL"), Config::get('system', 'directory', 'https://dir.friendica.social'), L10n::t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")],
|
||||
'$newuser_private' => ['newuser_private', L10n::t("Private posts by default for new users"), Config::get('system','newuser_private'), L10n::t("Set default post permissions for all new members to the default privacy group rather than public.")],
|
||||
'$enotify_no_content' => ['enotify_no_content', L10n::t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), L10n::t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")],
|
||||
|
@ -1425,7 +1420,7 @@ function admin_page_site(App $a)
|
|||
'$maxloadavg' => ['maxloadavg', L10n::t("Maximum Load Average"), Config::get('system', 'maxloadavg', 50), L10n::t("Maximum system load before delivery and poll processes are deferred - default 50.")],
|
||||
'$maxloadavg_frontend' => ['maxloadavg_frontend', L10n::t("Maximum Load Average \x28Frontend\x29"), Config::get('system', 'maxloadavg_frontend', 50), L10n::t("Maximum system load before the frontend quits service - default 50.")],
|
||||
'$min_memory' => ['min_memory', L10n::t("Minimal Memory"), Config::get('system', 'min_memory', 0), L10n::t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 \x28deactivated\x29.")],
|
||||
'$optimize_max_tablesize'=> ['optimize_max_tablesize', L10n::t("Maximum table size for optimization"), $optimize_max_tablesize, L10n::t("Maximum table size \x28in MB\x29 for the automatic optimization - default 100 MB. Enter -1 to disable it.")],
|
||||
'$optimize_max_tablesize'=> ['optimize_max_tablesize', L10n::t("Maximum table size for optimization"), $optimize_max_tablesize, L10n::t("Maximum table size \x28in MB\x29 for the automatic optimization. Enter -1 to disable it.")],
|
||||
'$optimize_fragmentation'=> ['optimize_fragmentation', L10n::t("Minimum level of fragmentation"), Config::get('system', 'optimize_fragmentation', 30), L10n::t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")],
|
||||
|
||||
'$poco_completion' => ['poco_completion', L10n::t("Periodical check of global contacts"), Config::get('system','poco_completion'), L10n::t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")],
|
||||
|
@ -1446,7 +1441,7 @@ function admin_page_site(App $a)
|
|||
'$max_comments' => ['max_comments', L10n::t("Maximum numbers of comments per post"), Config::get('system','max_comments'), L10n::t("How much comments should be shown for each post? Default value is 100.")],
|
||||
'$temppath' => ['temppath', L10n::t("Temp path"), Config::get('system','temppath'), L10n::t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")],
|
||||
'$basepath' => ['basepath', L10n::t("Base path to installation"), Config::get('system','basepath'), L10n::t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")],
|
||||
'$proxy_disabled' => ['proxy_disabled', L10n::t("Disable picture proxy"), Config::get('system','proxy_disabled'), L10n::t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")],
|
||||
'$proxy_disabled' => ['proxy_disabled', L10n::t("Disable picture proxy"), Config::get('system','proxy_disabled'), L10n::t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwidth.")],
|
||||
'$only_tag_search' => ['only_tag_search', L10n::t("Only search in tags"), Config::get('system','only_tag_search'), L10n::t("On large systems the text search can slow down the system extremely.")],
|
||||
|
||||
'$relocate_url' => ['relocate_url', L10n::t("New base url"), System::baseUrl(), L10n::t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")],
|
||||
|
|
|
@ -171,7 +171,7 @@ function community_content(App $a, $update = 0)
|
|||
$s = $r;
|
||||
}
|
||||
|
||||
$o .= conversation($a, $s, 'community', $update);
|
||||
$o .= conversation($a, $s, 'community', $update, false, 'commented', local_user());
|
||||
|
||||
if (!$update) {
|
||||
$o .= alt_pager($a, count($r));
|
||||
|
|
|
@ -83,14 +83,12 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$duplex = $handsfree['duplex'];
|
||||
$cid = 0;
|
||||
$hidden = intval(defaults($handsfree, 'hidden' , 0));
|
||||
$activity = intval(defaults($handsfree, 'activity', 0));
|
||||
} else {
|
||||
$dfrn_id = notags(trim(defaults($_POST, 'dfrn_id' , '')));
|
||||
$intro_id = intval(defaults($_POST, 'intro_id' , 0));
|
||||
$duplex = intval(defaults($_POST, 'duplex' , 0));
|
||||
$cid = intval(defaults($_POST, 'contact_id', 0));
|
||||
$hidden = intval(defaults($_POST, 'hidden' , 0));
|
||||
$activity = intval(defaults($_POST, 'activity' , 0));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -284,6 +282,11 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
}
|
||||
|
||||
if (($status == 0) && $intro_id) {
|
||||
$intro = dba::selectFirst('intro', ['note'], ['id' => $intro_id]);
|
||||
if (DBM::is_result($intro)) {
|
||||
dba::update('contact', ['reason' => $intro['note']], ['id' => $contact_id]);
|
||||
}
|
||||
|
||||
// Success. Delete the notification.
|
||||
dba::delete('intro', ['id' => $intro_id]);
|
||||
}
|
||||
|
@ -385,7 +388,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
);
|
||||
}
|
||||
|
||||
/// @TODO is DBM::is_result() working here?
|
||||
if (!DBM::is_result($r)) {
|
||||
notice(L10n::t('Unable to set contact photo.') . EOL);
|
||||
}
|
||||
|
@ -397,50 +399,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
$ret = Diaspora::sendShare($user, $contact);
|
||||
logger('share returns: ' . $ret);
|
||||
}
|
||||
|
||||
// Send a new friend post if we are allowed to...
|
||||
$profile = dba::selectFirst('profile', ['hide-friends'], ['is-default' => true, 'uid' => $uid]);
|
||||
if (x($profile, 'hide-friends') === 0 && $activity && !$hidden) {
|
||||
$self = dba::selectFirst('contact', [], ['self' => true, 'uid' => $uid]);
|
||||
if (DBM::is_result($self)) {
|
||||
$arr = [];
|
||||
$arr['guid'] = get_guid(32);
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $uid);
|
||||
$arr['uid'] = $uid;
|
||||
$arr['contact-id'] = $self['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self['thumb'];
|
||||
|
||||
$A = '[url=' . $self['url'] . ']' . $self['name'] . '[/url]';
|
||||
$B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
|
||||
$BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
|
||||
|
||||
$arr['verb'] = ACTIVITY_FRIEND;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
|
||||
$arr['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
|
||||
. '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $user['allow_cid'];
|
||||
$arr['allow_gid'] = $user['allow_gid'];
|
||||
$arr['deny_cid'] = $user['deny_cid'];
|
||||
$arr['deny_gid'] = $user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact['id']);
|
||||
|
@ -661,49 +619,6 @@ function dfrn_confirm_post(App $a, $handsfree = null)
|
|||
}
|
||||
}
|
||||
|
||||
// Send a new friend post if we are allowed to...
|
||||
if ($page && intval(PConfig::get($local_uid, 'system', 'post_joingroup'))) {
|
||||
$profile = dba::selectFirst('profile', ['hide-friends'], ['is-default' => true, 'uid' => $local_uid]);
|
||||
if (x($profile, 'hide-friends') === 0) {
|
||||
$self = dba::selectFirst('contact', [], ['self' => true, 'uid' => $local_uid]);
|
||||
if (DBM::is_result($self)) {
|
||||
$arr = [];
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $local_uid);
|
||||
$arr['uid'] = $local_uid;
|
||||
$arr['contact-id'] = $self['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self['thumb'];
|
||||
|
||||
$A = '[url=' . $self['url'] . ']' . $self['name'] . '[/url]';
|
||||
$B = '[url=' . $combined['url'] . ']' . $combined['name'] . '[/url]';
|
||||
$BPhoto = '[url=' . $combined['url'] . ']' . '[img]' . $combined['thumb'] . '[/img][/url]';
|
||||
|
||||
$arr['verb'] = ACTIVITY_JOIN;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_GROUP;
|
||||
$arr['body'] = L10n::t('%1$s has joined %2$s', $A, $B) . "\n\n\n" . $BPhoto;
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
|
||||
. '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $combined['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $user['allow_cid'];
|
||||
$arr['allow_gid'] = $user['allow_gid'];
|
||||
$arr['deny_cid'] = $user['deny_cid'];
|
||||
$arr['deny_gid'] = $user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System::xmlExit(0); // Success
|
||||
return; // NOTREACHED
|
||||
////////////////////// End of this scenario ///////////////////////////////////////////////
|
||||
|
|
|
@ -577,7 +577,6 @@ function dfrn_request_content(App $a)
|
|||
'dfrn_id' => $r[0]['issued-id'],
|
||||
'intro_id' => $intro[0]['id'],
|
||||
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
|
||||
'activity' => intval(PConfig::get($r[0]['uid'], 'system', 'post_newfriend'))
|
||||
];
|
||||
dfrn_confirm_post($a, $handsfree);
|
||||
}
|
||||
|
|
|
@ -211,13 +211,14 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
|
||||
if ($update) {
|
||||
$item_id = $_REQUEST['item_id'];
|
||||
$item = dba::selectFirst('item', ['uid', 'parent'], ['id' => $item_id]);
|
||||
$item = dba::selectFirst('item', ['uid', 'parent', 'parent-uri'], ['id' => $item_id]);
|
||||
if ($item['uid'] != 0) {
|
||||
$a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
|
||||
} else {
|
||||
$a->profile = ['uid' => intval($update_uid), 'profile_uid' => intval($update_uid)];
|
||||
}
|
||||
$item_parent = $item['parent'];
|
||||
$item_parent_uri = $item['parent-uri'];
|
||||
} else {
|
||||
$item_id = (($a->argc > 2) ? $a->argv[2] : 0);
|
||||
|
||||
|
@ -225,23 +226,25 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
$item_parent = 0;
|
||||
|
||||
if (local_user()) {
|
||||
$r = dba::fetch_first("SELECT `id`, `parent` FROM `item`
|
||||
$r = dba::fetch_first("SELECT `id`, `parent`, `parent-uri` FROM `item`
|
||||
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
||||
AND `guid` = ? AND `uid` = ?", $a->argv[1], local_user());
|
||||
if (DBM::is_result($r)) {
|
||||
$item_id = $r["id"];
|
||||
$item_parent = $r["parent"];
|
||||
$item_parent_uri = $r['parent-uri'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($item_parent == 0) {
|
||||
$r = dba::fetch_first("SELECT `item`.`id`, `item`.`parent` FROM `item`
|
||||
$r = dba::fetch_first("SELECT `item`.`id`, `item`.`parent`, `item`.`parent-uri` FROM `item`
|
||||
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
||||
AND NOT `item`.`private` AND `item`.`uid` = 0
|
||||
AND `item`.`guid` = ?", $a->argv[1]);
|
||||
if (DBM::is_result($r)) {
|
||||
$item_id = $r["id"];
|
||||
$item_parent = $r["parent"];
|
||||
$item_parent_uri = $r['parent-uri'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -332,22 +335,21 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
|
||||
$sql_extra = item_permissions_sql($a->profile['uid'], $remote_contact, $groups);
|
||||
|
||||
if ($update) {
|
||||
$r = dba::p("SELECT `id` FROM `item` WHERE
|
||||
`item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = ?)
|
||||
$sql_extra AND `unseen`",
|
||||
$item_id
|
||||
);
|
||||
|
||||
if (dba::num_rows($r) == 0) {
|
||||
return '';
|
||||
}
|
||||
if (local_user() && (local_user() == $a->profile['uid'])) {
|
||||
$condition = ['parent-uri' => $item_parent_uri, 'uid' => local_user(), 'unseen' => true];
|
||||
$unseen = dba::exists('item', $condition);
|
||||
} else {
|
||||
$unseen = false;
|
||||
}
|
||||
|
||||
$r = dba::p(item_query()."AND `item`.`parent` = (SELECT `parent` FROM `item` WHERE `id` = ?)
|
||||
$sql_extra
|
||||
ORDER BY `parent` DESC, `gravity` ASC, `id` ASC",
|
||||
$item_id
|
||||
if ($update && !$unseen) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$r = dba::p(item_query(local_user())."AND `item`.`parent-uri` = (SELECT `parent-uri` FROM `item` WHERE `id` = ?)
|
||||
AND `item`.`uid` IN (0, ?) $sql_extra
|
||||
ORDER BY `item`.`uid` ASC, `parent` DESC, `gravity` ASC, `id` ASC",
|
||||
$item_id, local_user()
|
||||
);
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
|
@ -357,11 +359,9 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
|
||||
$s = dba::inArray($r);
|
||||
|
||||
if (local_user() && (local_user() == $a->profile['uid'])) {
|
||||
$unseen = dba::selectFirst('item', ['id'], ['parent' => $s[0]['parent'], 'unseen' => true]);
|
||||
if (DBM::is_result($unseen)) {
|
||||
dba::update('item', ['unseen' => false], ['parent' => $s[0]['parent'], 'unseen' => true]);
|
||||
}
|
||||
if ($unseen) {
|
||||
$condition = ['parent-uri' => $item_parent_uri, 'uid' => local_user(), 'unseen' => true];
|
||||
dba::update('item', ['unseen' => false], $condition);
|
||||
}
|
||||
|
||||
$items = conv_sort($s, "`commented`");
|
||||
|
@ -369,7 +369,7 @@ function display_content(App $a, $update = false, $update_uid = 0) {
|
|||
if (!$update) {
|
||||
$o .= "<script> var netargs = '?f=&item_id=" . $item_id . "'; </script>";
|
||||
}
|
||||
$o .= conversation($a, $items, 'display', $update_uid);
|
||||
$o .= conversation($a, $items, 'display', $update_uid, false, 'commented', local_user());
|
||||
|
||||
// Preparing the meta header
|
||||
$description = trim(HTML::toPlaintext(BBCode::convert($s[0]["body"], false), 0, true));
|
||||
|
|
|
@ -546,7 +546,7 @@ function events_content(App $a) {
|
|||
|
||||
// Delete only real events (no birthdays)
|
||||
if (DBM::is_result($ev) && $ev[0]['type'] == 'event') {
|
||||
$del = Item::deleteById($ev[0]['itemid']);
|
||||
$del = Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
|
||||
}
|
||||
|
||||
if ($del == 0) {
|
||||
|
|
|
@ -226,7 +226,7 @@ function group_content(App $a) {
|
|||
$entry['label'] = 'members';
|
||||
$entry['photo_menu'] = '';
|
||||
$entry['change_member'] = [
|
||||
'title' => L10n::t("Remove Contact"),
|
||||
'title' => L10n::t("Remove contact from group"),
|
||||
'gid' => $group['id'],
|
||||
'cid' => $member['id'],
|
||||
'sec_token' => $sec_token
|
||||
|
@ -250,7 +250,7 @@ function group_content(App $a) {
|
|||
$entry['label'] = 'contacts';
|
||||
$entry['photo_menu'] = '';
|
||||
$entry['change_member'] = [
|
||||
'title' => L10n::t("Add Contact"),
|
||||
'title' => L10n::t("Add contact to group"),
|
||||
'gid' => $group['id'],
|
||||
'cid' => $member['id'],
|
||||
'sec_token' => $sec_token
|
||||
|
|
|
@ -661,6 +661,11 @@ function item_post(App $a) {
|
|||
$datarray['edit'] = true;
|
||||
}
|
||||
|
||||
// Check for hashtags in the body and repair or add hashtag links
|
||||
if ($preview || $orig_post) {
|
||||
Item::setHashtags($datarray);
|
||||
}
|
||||
|
||||
// preview mode - prepare the body for display and send it via json
|
||||
if ($preview) {
|
||||
require_once 'include/conversation.php';
|
||||
|
@ -872,7 +877,7 @@ function item_content(App $a) {
|
|||
$o = '';
|
||||
if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
|
||||
if (is_ajax()) {
|
||||
$o = Item::deleteById($a->argv[2]);
|
||||
$o = Item::deleteForUser(['id' => $a->argv[2]], local_user());
|
||||
} else {
|
||||
$o = drop_item($a->argv[2]);
|
||||
}
|
||||
|
|
|
@ -345,7 +345,7 @@ function networkConversation($a, $items, $mode, $update, $ordering = '')
|
|||
// Set this so that the conversation function can find out contact info for our wall-wall items
|
||||
$a->page_contact = $a->contact;
|
||||
|
||||
$o = conversation($a, $items, $mode, $update, false, $ordering);
|
||||
$o = conversation($a, $items, $mode, $update, false, $ordering, local_user());
|
||||
|
||||
if (!$update) {
|
||||
if (PConfig::get(local_user(), 'system', 'infinite_scroll')) {
|
||||
|
@ -456,8 +456,8 @@ function networkFlatView(App $a, $update = 0)
|
|||
$items = q("SELECT %s FROM `item` $sql_post_table %s
|
||||
WHERE %s AND `item`.`uid` = %d
|
||||
ORDER BY `item`.`id` DESC $pager_sql ",
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
intval($_SESSION['uid'])
|
||||
item_fieldlists(), item_joins(local_user()), item_condition(),
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
$condition = ['unseen' => true, 'uid' => local_user()];
|
||||
|
@ -610,7 +610,7 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
$sql_tag_nets = (($nets) ? sprintf(" AND `item`.`network` = '%s' ", dbesc($nets)) : '');
|
||||
|
||||
if ($gid) {
|
||||
$group = dba::selectFirst('group', ['name'], ['id' => $gid, 'uid' => $_SESSION['uid']]);
|
||||
$group = dba::selectFirst('group', ['name'], ['id' => $gid, 'uid' => local_user()]);
|
||||
if (!DBM::is_result($group)) {
|
||||
if ($update) {
|
||||
killme();
|
||||
|
@ -626,7 +626,7 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
$contact_str_self = '';
|
||||
|
||||
$contact_str = implode(',', $contacts);
|
||||
$self = dba::selectFirst('contact', ['id'], ['uid' => $_SESSION['uid'], 'self' => true]);
|
||||
$self = dba::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
|
||||
if (DBM::is_result($self)) {
|
||||
$contact_str_self = $self['id'];
|
||||
}
|
||||
|
@ -774,12 +774,15 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
AND (`item`.`parent-uri` != `item`.`uri`
|
||||
OR `contact`.`uid` = `item`.`uid` AND `contact`.`self`
|
||||
OR `contact`.`rel` IN (%d, %d) AND NOT `contact`.`readonly`)
|
||||
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = %d
|
||||
WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`deleted`
|
||||
AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
|
||||
AND NOT `item`.`moderated` AND $sql_extra4
|
||||
$sql_extra3 $sql_extra $sql_range $sql_nets
|
||||
ORDER BY `order_date` DESC LIMIT 100",
|
||||
intval(CONTACT_IS_SHARING),
|
||||
intval(CONTACT_IS_FRIEND),
|
||||
intval(local_user()),
|
||||
intval(local_user())
|
||||
);
|
||||
} else {
|
||||
|
@ -791,12 +794,15 @@ function networkThreadedView(App $a, $update, $parent)
|
|||
AND (`item`.`parent-uri` != `item`.`uri`
|
||||
OR `contact`.`uid` = `item`.`uid` AND `contact`.`self`
|
||||
OR `contact`.`rel` IN (%d, %d) AND NOT `contact`.`readonly`)
|
||||
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = %d
|
||||
WHERE `thread`.`uid` = %d AND `thread`.`visible` AND NOT `thread`.`deleted`
|
||||
AND NOT `thread`.`moderated`
|
||||
AND (`user-item`.`hidden` IS NULL OR NOT `user-item`.`hidden`)
|
||||
$sql_extra2 $sql_extra3 $sql_range $sql_extra $sql_nets
|
||||
ORDER BY `order_date` DESC $pager_sql",
|
||||
intval(CONTACT_IS_SHARING),
|
||||
intval(CONTACT_IS_FRIEND),
|
||||
intval(local_user()),
|
||||
intval(local_user())
|
||||
);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ use Friendica\Core\Addon;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Util\Network;
|
||||
require_once 'include/dba.php';
|
||||
|
||||
function nodeinfo_wellknown(App $a) {
|
||||
$nodeinfo = ['links' => [['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
|
||||
|
@ -153,7 +154,7 @@ function nodeinfo_cron() {
|
|||
|
||||
$a = get_app();
|
||||
|
||||
// If the addon 'statistics_json' is enabled then disable it and actrivate nodeinfo.
|
||||
// If the addon 'statistics_json' is enabled then disable it and activate nodeinfo.
|
||||
if (Addon::isEnabled('statistics_json')) {
|
||||
Config::set('system', 'nodeinfo', true);
|
||||
|
||||
|
@ -176,17 +177,8 @@ function nodeinfo_cron() {
|
|||
if (!Config::get('system', 'nodeinfo')) {
|
||||
return;
|
||||
}
|
||||
$last = Config::get('nodeinfo', 'last_calucation');
|
||||
|
||||
if ($last) {
|
||||
// Calculate every 24 hours
|
||||
$next = $last + (24 * 60 * 60);
|
||||
if ($next > time()) {
|
||||
logger('calculation intervall not reached');
|
||||
return;
|
||||
}
|
||||
}
|
||||
logger('cron_start');
|
||||
logger('cron_start');
|
||||
|
||||
$users = q("SELECT `user`.`uid`, `user`.`login_date`, `contact`.`last-item`
|
||||
FROM `user`
|
||||
|
@ -196,60 +188,43 @@ function nodeinfo_cron() {
|
|||
AND NOT `user`.`blocked` AND NOT `user`.`account_removed`
|
||||
AND NOT `user`.`account_expired`");
|
||||
if (is_array($users)) {
|
||||
$total_users = count($users);
|
||||
$active_users_halfyear = 0;
|
||||
$active_users_monthly = 0;
|
||||
$total_users = count($users);
|
||||
$active_users_halfyear = 0;
|
||||
$active_users_monthly = 0;
|
||||
|
||||
$halfyear = time() - (180 * 24 * 60 * 60);
|
||||
$month = time() - (30 * 24 * 60 * 60);
|
||||
$halfyear = time() - (180 * 24 * 60 * 60);
|
||||
$month = time() - (30 * 24 * 60 * 60);
|
||||
|
||||
foreach ($users AS $user) {
|
||||
if ((strtotime($user['login_date']) > $halfyear) ||
|
||||
(strtotime($user['last-item']) > $halfyear)) {
|
||||
++$active_users_halfyear;
|
||||
}
|
||||
if ((strtotime($user['login_date']) > $month) ||
|
||||
(strtotime($user['last-item']) > $month)) {
|
||||
++$active_users_monthly;
|
||||
}
|
||||
foreach ($users AS $user) {
|
||||
if ((strtotime($user['login_date']) > $halfyear) ||
|
||||
(strtotime($user['last-item']) > $halfyear)) {
|
||||
++$active_users_halfyear;
|
||||
}
|
||||
Config::set('nodeinfo', 'total_users', $total_users);
|
||||
logger('total_users: '.$total_users, LOGGER_DEBUG);
|
||||
if ((strtotime($user['login_date']) > $month) ||
|
||||
(strtotime($user['last-item']) > $month)) {
|
||||
++$active_users_monthly;
|
||||
}
|
||||
}
|
||||
Config::set('nodeinfo', 'total_users', $total_users);
|
||||
Config::set('nodeinfo', 'active_users_halfyear', $active_users_halfyear);
|
||||
Config::set('nodeinfo', 'active_users_monthly', $active_users_monthly);
|
||||
|
||||
Config::set('nodeinfo', 'active_users_halfyear', $active_users_halfyear);
|
||||
Config::set('nodeinfo', 'active_users_monthly', $active_users_monthly);
|
||||
logger('total_users: ' . $total_users . '/' . $active_users_halfyear. '/' . $active_users_monthly, LOGGER_DEBUG);
|
||||
}
|
||||
|
||||
$posts = q("SELECT COUNT(*) AS `local_posts` FROM `thread` WHERE `thread`.`wall` AND `thread`.`uid` != 0");
|
||||
|
||||
if (!is_array($posts)) {
|
||||
$local_posts = -1;
|
||||
} else {
|
||||
$local_posts = $posts[0]['local_posts'];
|
||||
}
|
||||
$local_posts = dba::count('thread', ["`wall` AND NOT `deleted` AND `uid` != 0"]);
|
||||
Config::set('nodeinfo', 'local_posts', $local_posts);
|
||||
logger('local_posts: ' . $local_posts, LOGGER_DEBUG);
|
||||
|
||||
logger('local_posts: '.$local_posts, LOGGER_DEBUG);
|
||||
|
||||
$posts = q("SELECT COUNT(*) AS `local_comments` FROM `contact`
|
||||
INNER JOIN `item` ON `item`.`contact-id` = `contact`.`id` AND `item`.`uid` = `contact`.`uid` AND
|
||||
`item`.`id` != `item`.`parent` AND `item`.`network` IN ('%s', '%s', '%s')
|
||||
WHERE `contact`.`self`",
|
||||
dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_DFRN));
|
||||
|
||||
if (!is_array($posts)) {
|
||||
$local_comments = -1;
|
||||
} else {
|
||||
$local_comments = $posts[0]['local_comments'];
|
||||
}
|
||||
$local_comments = dba::count('item', ["`origin` AND `id` != `parent` AND NOT `deleted` AND `uid` != 0"]);
|
||||
Config::set('nodeinfo', 'local_comments', $local_comments);
|
||||
logger('local_comments: ' . $local_comments, LOGGER_DEBUG);
|
||||
|
||||
// Now trying to register
|
||||
$url = 'http://the-federation.info/register/'.$a->get_hostname();
|
||||
logger('registering url: '.$url, LOGGER_DEBUG);
|
||||
logger('registering url: '.$url, LOGGER_DEBUG);
|
||||
$ret = Network::fetchUrl($url);
|
||||
logger('registering answer: '.$ret, LOGGER_DEBUG);
|
||||
logger('registering answer: '.$ret, LOGGER_DEBUG);
|
||||
|
||||
logger('cron_end');
|
||||
Config::set('nodeinfo', 'last_calucation', time());
|
||||
logger('cron_end');
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ function notes_content(App $a, $update = false)
|
|||
WHERE %s AND `item`.`uid` = %d AND `item`.`type` = 'note'
|
||||
AND `contact`.`self` AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
|
||||
$sql_extra ",
|
||||
item_joins(),
|
||||
item_joins(local_user()),
|
||||
item_condition(),
|
||||
intval(local_user())
|
||||
);
|
||||
|
@ -97,7 +97,7 @@ function notes_content(App $a, $update = false)
|
|||
AND `item`.`id` = `item`.`parent` AND NOT `item`.`wall`
|
||||
$sql_extra
|
||||
ORDER BY `item`.`created` DESC LIMIT %d ,%d ",
|
||||
item_joins(),
|
||||
item_joins(local_user()),
|
||||
item_condition(),
|
||||
intval(local_user()),
|
||||
intval($a->pager['start']),
|
||||
|
@ -119,7 +119,7 @@ function notes_content(App $a, $update = false)
|
|||
$sql_extra
|
||||
ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
|
||||
item_fieldlists(),
|
||||
item_joins(),
|
||||
item_joins(local_user()),
|
||||
item_condition(),
|
||||
intval(local_user()),
|
||||
dbesc($parents_str)
|
||||
|
|
|
@ -173,7 +173,6 @@ function notifications_content(App $a) {
|
|||
'$fullname' => $it['name'],
|
||||
'$url' => $it['url'],
|
||||
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
|
||||
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
|
||||
|
||||
'$knowyou' => $it['knowyou'],
|
||||
'$approve' => L10n::t('Approve'),
|
||||
|
@ -252,7 +251,6 @@ function notifications_content(App $a) {
|
|||
'$gender' => $it['gender'],
|
||||
'$lbl_gender' => L10n::t('Gender:'),
|
||||
'$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($it['hidden'] == 1), ''],
|
||||
'$activity' => ['activity', L10n::t('Post a new friend activity'), $it['post_newfriend'], L10n::t('if applicable')],
|
||||
'$url' => $it['url'],
|
||||
'$zrl' => $it['zrl'],
|
||||
'$lbl_url' => L10n::t('Profile URL'),
|
||||
|
|
|
@ -19,7 +19,7 @@ function openid_content(App $a) {
|
|||
|
||||
if((x($_GET,'openid_mode')) && (x($_SESSION,'openid'))) {
|
||||
|
||||
$openid = new LightOpenID;
|
||||
$openid = new LightOpenID($a->get_hostname());
|
||||
|
||||
if($openid->validate()) {
|
||||
|
||||
|
|
|
@ -284,14 +284,7 @@ function photos_post(App $a)
|
|||
);
|
||||
|
||||
// find and delete the corresponding item with all the comments and likes/dislikes
|
||||
$r = q("SELECT `id` FROM `item` WHERE `resource-id` IN ( $str_res ) AND `uid` = %d",
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if (DBM::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
Item::deleteById($rr['id']);
|
||||
}
|
||||
}
|
||||
Item::deleteForUser(['resource-id' => $res, 'uid' => $page_owner_uid], $page_owner_uid);
|
||||
|
||||
// Update the photo albums cache
|
||||
Photo::clearAlbumCache($page_owner_uid);
|
||||
|
@ -344,16 +337,11 @@ function photos_post(App $a)
|
|||
intval($page_owner_uid),
|
||||
dbesc($r[0]['resource-id'])
|
||||
);
|
||||
$i = q("SELECT `id` FROM `item` WHERE `resource-id` = '%s' AND `uid` = %d LIMIT 1",
|
||||
dbesc($r[0]['resource-id']),
|
||||
intval($page_owner_uid)
|
||||
);
|
||||
if (DBM::is_result($i)) {
|
||||
Item::deleteById($i[0]['id']);
|
||||
|
||||
// Update the photo albums cache
|
||||
Photo::clearAlbumCache($page_owner_uid);
|
||||
}
|
||||
Item::deleteForUser(['resource-id' => $r[0]['resource-id'], 'uid' => $page_owner_uid], $page_owner_uid);
|
||||
|
||||
// Update the photo albums cache
|
||||
Photo::clearAlbumCache($page_owner_uid);
|
||||
}
|
||||
|
||||
goaway('photos/' . $a->data['user']['nickname']);
|
||||
|
|
|
@ -75,6 +75,7 @@ function profile_init(App $a)
|
|||
}
|
||||
|
||||
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($a->profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/dfrn_poll/' . $which . '" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
|
||||
|
@ -338,7 +339,7 @@ function profile_content(App $a, $update = 0)
|
|||
|
||||
$parents_str = implode(', ', $parents_arr);
|
||||
|
||||
$items = q(item_query() . " AND `item`.`uid` = %d
|
||||
$items = q(item_query($a->profile['profile_uid']) . " AND `item`.`uid` = %d
|
||||
AND `item`.`parent` IN (%s)
|
||||
$sql_extra ",
|
||||
intval($a->profile['profile_uid']),
|
||||
|
@ -364,7 +365,7 @@ function profile_content(App $a, $update = 0)
|
|||
}
|
||||
}
|
||||
|
||||
$o .= conversation($a, $items, 'profile', $update);
|
||||
$o .= conversation($a, $items, 'profile', $update, false, 'commented', local_user());
|
||||
|
||||
if (!$update) {
|
||||
$o .= alt_pager($a, count($items));
|
||||
|
|
|
@ -403,9 +403,6 @@ function profiles_post(App $a) {
|
|||
$comma2 = (($region && $country_name) ? ', ' : '');
|
||||
$value = $locality . $comma1 . $region . $comma2 . $country_name;
|
||||
}
|
||||
|
||||
profile_activity($changes,$value);
|
||||
|
||||
}
|
||||
|
||||
$r = q("UPDATE `profile`
|
||||
|
@ -510,96 +507,6 @@ function profiles_post(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function profile_activity($changed, $value) {
|
||||
$a = get_app();
|
||||
|
||||
if (! local_user() || ! is_array($changed) || ! count($changed)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($a->user['hidewall'] || Config::get('system', 'block_public')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! PConfig::get(local_user(), 'system', 'post_profilechange')) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'include/items.php';
|
||||
|
||||
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
if (! DBM::is_result($self)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$arr = [];
|
||||
|
||||
$arr['guid'] = get_guid(32);
|
||||
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
|
||||
$arr['uid'] = local_user();
|
||||
$arr['contact-id'] = $self[0]['id'];
|
||||
$arr['wall'] = 1;
|
||||
$arr['type'] = 'wall';
|
||||
$arr['gravity'] = 0;
|
||||
$arr['origin'] = 1;
|
||||
$arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
|
||||
$arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
|
||||
$arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
|
||||
$arr['verb'] = ACTIVITY_UPDATE;
|
||||
$arr['object-type'] = ACTIVITY_OBJ_PROFILE;
|
||||
|
||||
$A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
|
||||
|
||||
|
||||
$changes = '';
|
||||
$t = count($changed);
|
||||
$z = 0;
|
||||
foreach ($changed as $ch) {
|
||||
if (strlen($changes)) {
|
||||
if ($z == ($t - 1)) {
|
||||
$changes .= L10n::t(' and ');
|
||||
} else {
|
||||
$changes .= ', ';
|
||||
}
|
||||
}
|
||||
$z ++;
|
||||
$changes .= $ch;
|
||||
}
|
||||
|
||||
$prof = '[url=' . $self[0]['url'] . '?tab=profile' . ']' . L10n::t('public profile') . '[/url]';
|
||||
|
||||
if ($t == 1 && strlen($value)) {
|
||||
$message = L10n::t('%1$s changed %2$s to “%3$s”', $A, $changes, $value);
|
||||
$message .= "\n\n" . L10n::t(' - Visit %1$s\'s %2$s', $A, $prof);
|
||||
} else {
|
||||
$message = L10n::t('%1$s has an updated %2$s, changing %3$s.', $A, $prof, $changes);
|
||||
}
|
||||
|
||||
|
||||
$arr['body'] = $message;
|
||||
|
||||
$arr['object'] = '<object><type>' . ACTIVITY_OBJ_PROFILE . '</type><title>' . $self[0]['name'] . '</title>'
|
||||
. '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>';
|
||||
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '?tab=profile' . '" />' . "\n");
|
||||
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n");
|
||||
$arr['object'] .= '</link></object>' . "\n";
|
||||
|
||||
$arr['allow_cid'] = $a->user['allow_cid'];
|
||||
$arr['allow_gid'] = $a->user['allow_gid'];
|
||||
$arr['deny_cid'] = $a->user['deny_cid'];
|
||||
$arr['deny_gid'] = $a->user['deny_gid'];
|
||||
|
||||
$i = Item::insert($arr);
|
||||
if ($i) {
|
||||
Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function profiles_content(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
|
|
|
@ -4,8 +4,8 @@ use Friendica\App;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Model\PushSubscriber;
|
||||
|
||||
function post_var($name) {
|
||||
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
|
||||
|
@ -42,12 +42,11 @@ function pubsubhubbub_init(App $a) {
|
|||
} elseif ($hub_mode === 'unsubscribe') {
|
||||
$subscribe = 0;
|
||||
} else {
|
||||
logger("pubsubhubbub: invalid hub_mode=$hub_mode, ignoring.");
|
||||
logger("Invalid hub_mode=$hub_mode, ignoring.");
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
logger("pubsubhubbub: $hub_mode request from " .
|
||||
$_SERVER['REMOTE_ADDR']);
|
||||
logger("$hub_mode request from " . $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
// get the nick name from the topic, a bit hacky but needed as a fallback
|
||||
$nick = substr(strrchr($hub_topic, "/"), 1);
|
||||
|
@ -58,44 +57,37 @@ function pubsubhubbub_init(App $a) {
|
|||
}
|
||||
|
||||
if (!$nick) {
|
||||
logger('pubsubhubbub: bad hub_topic=$hub_topic, ignoring.');
|
||||
logger('Bad hub_topic=$hub_topic, ignoring.');
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
// fetch user from database given the nickname
|
||||
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s'" .
|
||||
" AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
|
||||
dbesc($nick));
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
logger('pubsubhubbub: local account not found: ' . $nick);
|
||||
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
|
||||
$owner = dba::selectFirst('user', ['uid', 'hidewall'], $condition);
|
||||
if (!DBM::is_result($owner)) {
|
||||
logger('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
$owner = $r[0];
|
||||
|
||||
// abort if user's wall is supposed to be private
|
||||
if ($r[0]['hidewall']) {
|
||||
logger('pubsubhubbub: local user ' . $nick .
|
||||
'has chosen to hide wall, ignoring.');
|
||||
if ($owner['hidewall']) {
|
||||
logger('Local user ' . $nick . 'has chosen to hide wall, ignoring.');
|
||||
System::httpExit(403);
|
||||
}
|
||||
|
||||
// get corresponding row from contact table
|
||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND NOT `blocked`".
|
||||
" AND NOT `pending` AND `self` LIMIT 1",
|
||||
intval($owner['uid']));
|
||||
if (!DBM::is_result($r)) {
|
||||
logger('pubsubhubbub: contact not found.');
|
||||
$condition = ['uid' => $owner['uid'], 'blocked' => false,
|
||||
'pending' => false, 'self' => true];
|
||||
$contact = dba::selectFirst('contact', ['poll'], $condition);
|
||||
if (!DBM::is_result($contact)) {
|
||||
logger('Self contact for user ' . $owner['uid'] . ' not found.');
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
$contact = $r[0];
|
||||
|
||||
// sanity check that topic URLs are the same
|
||||
if (!link_compare($hub_topic, $contact['poll'])) {
|
||||
logger('pubsubhubbub: hub topic ' . $hub_topic . ' != ' .
|
||||
$contact['poll']);
|
||||
$hub_topic2 = str_replace('/feed/', '/dfrn_poll/', $hub_topic);
|
||||
if (!link_compare($hub_topic, $contact['poll']) && !link_compare($hub_topic2, $contact['poll'])) {
|
||||
logger('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
|
@ -117,55 +109,20 @@ function pubsubhubbub_init(App $a) {
|
|||
|
||||
// give up if the HTTP return code wasn't a success (2xx)
|
||||
if ($ret < 200 || $ret > 299) {
|
||||
logger("pubsubhubbub: subscriber verification at $hub_callback ".
|
||||
"returned $ret, ignoring.");
|
||||
logger("Subscriber verification for $hub_topic at $hub_callback returned $ret, ignoring.");
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
// check that the correct hub_challenge code was echoed back
|
||||
if (trim($body) !== $hub_challenge) {
|
||||
logger("pubsubhubbub: subscriber did not echo back ".
|
||||
"hub.challenge, ignoring.");
|
||||
logger("Subscriber did not echo back hub.challenge, ignoring.");
|
||||
logger("\"$hub_challenge\" != \"".trim($body)."\"");
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
// fetch the old subscription if it exists
|
||||
$r = q("SELECT * FROM `push_subscriber` WHERE `callback_url` = '%s'",
|
||||
dbesc($hub_callback));
|
||||
PushSubscriber::renew($owner['uid'], $nick, $subscribe, $hub_callback, $hub_topic, $hub_secret);
|
||||
|
||||
// delete old subscription if it exists
|
||||
dba::delete('push_subscriber', ['callback_url' => $hub_callback]);
|
||||
|
||||
if ($subscribe) {
|
||||
$last_update = DateTimeFormat::utcNow();
|
||||
$push_flag = 0;
|
||||
|
||||
// if we are just updating an old subscription, keep the
|
||||
// old values for push and last_update
|
||||
if (DBM::is_result($r)) {
|
||||
$last_update = $r[0]['last_update'];
|
||||
$push_flag = $r[0]['push'];
|
||||
}
|
||||
|
||||
// subscribe means adding the row to the table
|
||||
q("INSERT INTO `push_subscriber` (`uid`, `callback_url`, " .
|
||||
"`topic`, `nickname`, `push`, `last_update`, `secret`) values " .
|
||||
"(%d, '%s', '%s', '%s', %d, '%s', '%s')",
|
||||
intval($owner['uid']),
|
||||
dbesc($hub_callback),
|
||||
dbesc($hub_topic),
|
||||
dbesc($nick),
|
||||
intval($push_flag),
|
||||
dbesc($last_update),
|
||||
dbesc($hub_secret));
|
||||
logger("pubsubhubbub: successfully subscribed [$hub_callback].");
|
||||
} else {
|
||||
logger("pubsubhubbub: successfully unsubscribed [$hub_callback].");
|
||||
// we do nothing here, since the row was already deleted
|
||||
}
|
||||
System::httpExit(202);
|
||||
}
|
||||
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ use Friendica\Core\PConfig;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Module\Tos;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
@ -232,8 +233,8 @@ function register_content(App $a)
|
|||
$profile_publish = replace_macros($publish_tpl, [
|
||||
'$instance' => 'reg',
|
||||
'$pubdesc' => L10n::t('Include your profile in member directory?'),
|
||||
'$yes_selected' => ' checked="checked" ',
|
||||
'$no_selected' => '',
|
||||
'$yes_selected' => '',
|
||||
'$no_selected' => ' checked="checked"',
|
||||
'$str_yes' => L10n::t('Yes'),
|
||||
'$str_no' => L10n::t('No'),
|
||||
]);
|
||||
|
@ -252,6 +253,8 @@ function register_content(App $a)
|
|||
|
||||
$tpl = $arr['template'];
|
||||
|
||||
$tos = new Tos();
|
||||
|
||||
$o = replace_macros($tpl, [
|
||||
'$oidhtml' => $oidhtml,
|
||||
'$invitations' => Config::get('system', 'invitation_only'),
|
||||
|
@ -286,6 +289,8 @@ function register_content(App $a)
|
|||
'$importt' => L10n::t('Import your profile to this friendica instance'),
|
||||
'$showtoslink' => Config::get('system', 'tosdisplay'),
|
||||
'$tostext' => L10n::t('Terms of Service'),
|
||||
'$showprivstatement' => Config::get('system', 'tosprivstatement'),
|
||||
'$privstatement' => $tos->privacy_complete,
|
||||
'$baseurl' => System::baseurl(),
|
||||
'$form_security_token' => get_form_security_token("register")
|
||||
]);
|
||||
|
|
|
@ -6,6 +6,7 @@ use Friendica\App;
|
|||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once 'include/enotify.php';
|
||||
|
||||
|
@ -33,11 +34,12 @@ function removeme_post(App $a)
|
|||
|
||||
// send notification to admins so that they can clean um the backups
|
||||
// send email to admins
|
||||
$admin_mail_list = "'" . implode("','", array_map(dbesc, explode(",", str_replace(" ", "", $a->config['admin_email'])))) . "'";
|
||||
$adminlist = q("SELECT uid, language, email FROM user WHERE email IN (%s)",
|
||||
$admin_mail_list
|
||||
);
|
||||
foreach ($adminlist as $admin) {
|
||||
$admin_mails = explode(",", str_replace(" ", "", $a->config['admin_email']));
|
||||
foreach ($admin_mails as $mail) {
|
||||
$admin = dba::selectFirst('user', ['uid', 'language', 'email'], ['email' => $mail]);
|
||||
if (!DBM::is_result($admin)) {
|
||||
continue;
|
||||
}
|
||||
notification([
|
||||
'type' => SYSTEM_EMAIL,
|
||||
'subject' => L10n::t('[Friendica System Notify]') . ' ' . L10n::t('User deleted their account'),
|
||||
|
|
|
@ -204,7 +204,7 @@ function search_content(App $a) {
|
|||
AND `term`.`otype` = %d AND `term`.`type` = %d AND `term`.`term` = '%s' AND `item`.`verb` = '%s'
|
||||
AND NOT `author`.`blocked` AND NOT `author`.`hidden`
|
||||
ORDER BY term.created DESC LIMIT %d , %d ",
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
item_fieldlists(), item_joins(local_user()), item_condition(),
|
||||
intval(local_user()),
|
||||
intval(TERM_OBJ_POST), intval(TERM_HASHTAG), dbesc(protect_sprintf($search)), dbesc(ACTIVITY_POST),
|
||||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
|
@ -219,7 +219,7 @@ function search_content(App $a) {
|
|||
AND NOT `author`.`blocked` AND NOT `author`.`hidden`
|
||||
$sql_extra
|
||||
GROUP BY `item`.`uri`, `item`.`id` ORDER BY `item`.`id` DESC LIMIT %d , %d",
|
||||
item_fieldlists(), item_joins(), item_condition(),
|
||||
item_fieldlists(), item_joins(local_user()), item_condition(),
|
||||
intval(local_user()),
|
||||
intval($a->pager['start']), intval($a->pager['itemspage']));
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ function search_content(App $a) {
|
|||
]);
|
||||
|
||||
logger("Start Conversation for '".$search."'", LOGGER_DEBUG);
|
||||
$o .= conversation($a,$r,'search',false);
|
||||
$o .= conversation($a, $r, 'search', false, false, 'commented', local_user());
|
||||
|
||||
$o .= alt_pager($a,count($r));
|
||||
|
||||
|
|
|
@ -442,9 +442,6 @@ function settings_post(App $a)
|
|||
$suggestme = ((x($_POST, 'suggestme')) ? intval($_POST['suggestme']) : 0);
|
||||
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
|
||||
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
|
||||
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
|
||||
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
|
||||
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
|
||||
|
||||
$email_textonly = (($_POST['email_textonly'] == 1) ? 1 : 0);
|
||||
$detailed_notif = (($_POST['detailed_notif'] == 1) ? 1 : 0);
|
||||
|
@ -543,7 +540,7 @@ function settings_post(App $a)
|
|||
if ($openid != $a->user['openid'] || (strlen($openid) && (!strlen($openidserver)))) {
|
||||
if (Network::isUrlValid($openid)) {
|
||||
logger('updating openidserver');
|
||||
$open_id_obj = new LightOpenID;
|
||||
$open_id_obj = new LightOpenID($a->get_hostname());
|
||||
$open_id_obj->identity = $openid;
|
||||
$openidserver = $open_id_obj->discover($open_id_obj->identity);
|
||||
} else {
|
||||
|
@ -558,9 +555,6 @@ function settings_post(App $a)
|
|||
PConfig::set(local_user(), 'expire', 'network_only', $expire_network_only);
|
||||
|
||||
PConfig::set(local_user(), 'system', 'suggestme', $suggestme);
|
||||
PConfig::set(local_user(), 'system', 'post_newfriend', $post_newfriend);
|
||||
PConfig::set(local_user(), 'system', 'post_joingroup', $post_joingroup);
|
||||
PConfig::set(local_user(), 'system', 'post_profilechange', $post_profilechange);
|
||||
|
||||
PConfig::set(local_user(), 'system', 'email_textonly', $email_textonly);
|
||||
PConfig::set(local_user(), 'system', 'detailed_notif', $detailed_notif);
|
||||
|
@ -972,7 +966,7 @@ function settings_content(App $a)
|
|||
'$noinfo' => ['noinfo', L10n::t("Don't show notices"), $noinfo, ''],
|
||||
'$infinite_scroll' => ['infinite_scroll', L10n::t("Infinite scroll"), $infinite_scroll, ''],
|
||||
'$no_auto_update' => ['no_auto_update', L10n::t("Automatic updates only at the top of the network page"), $no_auto_update, L10n::t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
|
||||
'$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwith Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
|
||||
'$bandwidth_saver' => ['bandwidth_saver', L10n::t('Bandwidth Saver Mode'), $bandwidth_saver, L10n::t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
|
||||
'$smart_threading' => ['smart_threading', L10n::t('Smart Threading'), $smart_threading, L10n::t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
|
||||
|
||||
'$d_tset' => L10n::t('General Theme Settings'),
|
||||
|
@ -1020,9 +1014,6 @@ function settings_content(App $a)
|
|||
$expire_photos = PConfig::get(local_user(), 'expire', 'photos', false);
|
||||
$expire_network_only = PConfig::get(local_user(), 'expire', 'network_only', false);
|
||||
$suggestme = PConfig::get(local_user(), 'system', 'suggestme', false);
|
||||
$post_newfriend = PConfig::get(local_user(), 'system', 'post_newfriend', false);
|
||||
$post_joingroup = PConfig::get(local_user(), 'system', 'post_joingroup', false);
|
||||
$post_profilechange = PConfig::get(local_user(), 'system', 'post_profilechange', false);
|
||||
|
||||
// nowarn_insecure
|
||||
|
||||
|
@ -1100,13 +1091,13 @@ function settings_content(App $a)
|
|||
$profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
|
||||
} else {
|
||||
$profile_in_dir = replace_macros($opt_tpl, [
|
||||
'$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory')), [L10n::t('No'), L10n::t('Yes')]]
|
||||
'$field' => ['profile_in_directory', L10n::t('Publish your default profile in your local site directory?'), $profile['publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
|
||||
]);
|
||||
}
|
||||
|
||||
if (strlen(Config::get('system', 'directory'))) {
|
||||
$profile_in_net_dir = replace_macros($opt_tpl, [
|
||||
'$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be published in this node\'s <a href="%s">local directory</a>. Your profile details may be publicly visible depending on the system settings.', System::baseUrl().'/directory'), [L10n::t('No'), L10n::t('Yes')]]
|
||||
'$field' => ['profile_in_netdirectory', L10n::t('Publish your default profile in the global social directory?'), $profile['net-publish'], L10n::t('Your profile will be published in the global friendica directories (e.g. <a href="%s">%s</a>). Your profile will be visible in public.', Config::get('system', 'directory'), Config::get('system', 'directory')), [L10n::t('No'), L10n::t('Yes')]]
|
||||
]);
|
||||
} else {
|
||||
$profile_in_net_dir = '';
|
||||
|
@ -1117,7 +1108,7 @@ function settings_content(App $a)
|
|||
]);
|
||||
|
||||
$hide_wall = replace_macros($opt_tpl, [
|
||||
'$field' => ['hidewall', L10n::t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], L10n::t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Disables posting public messages to Diaspora and other networks.'), [L10n::t('No'), L10n::t('Yes')]],
|
||||
'$field' => ['hidewall', L10n::t('Hide your profile details from anonymous viewers?'), $a->user['hidewall'], L10n::t('Anonymous visitors will only see your profile picture, your display name and the nickname you are using on your profile page. Your public posts and replies will still be accessible by other means.'), [L10n::t('No'), L10n::t('Yes')]],
|
||||
]);
|
||||
|
||||
$blockwall = replace_macros($opt_tpl, [
|
||||
|
@ -1247,10 +1238,6 @@ function settings_content(App $a)
|
|||
|
||||
|
||||
'$h_not' => L10n::t('Notification Settings'),
|
||||
'$activity_options' => L10n::t('By default post a status message when:'),
|
||||
'$post_newfriend' => ['post_newfriend', L10n::t('accepting a friend request'), $post_newfriend, ''],
|
||||
'$post_joingroup' => ['post_joingroup', L10n::t('joining a forum/community'), $post_joingroup, ''],
|
||||
'$post_profilechange' => ['post_profilechange', L10n::t('making an <em>interesting</em> profile change'), $post_profilechange, ''],
|
||||
'$lbl_not' => L10n::t('Send a notification email when:'),
|
||||
'$notify1' => ['notify1', L10n::t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
|
||||
'$notify2' => ['notify2', L10n::t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
|
||||
|
|
|
@ -23,7 +23,7 @@ function update_community_content(App $a) {
|
|||
$replace = "<img\${1} dst=\"\${2}\"";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
|
|
@ -23,7 +23,7 @@ function update_display_content(App $a)
|
|||
$replace = "<img\${1} dst=\"\${2}\"";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
|
||||
$replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
|
|
@ -29,7 +29,7 @@ function update_network_content(App $a)
|
|||
$replace = "<img\${1} dst=\"\${2}\"";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
|
||||
$replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
|
|
@ -36,7 +36,7 @@ function update_notes_content(App $a) {
|
|||
$replace = "<img\${1} dst=\"\${2}\"";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
|
|
@ -35,7 +35,7 @@ function update_profile_content(App $a) {
|
|||
$replace = "<img\${1} dst=\"\${2}\"";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
||||
if (PConfig::get(local_user(), "system", "bandwith_saver")) {
|
||||
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
|
||||
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";
|
||||
$pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
|
||||
$text = preg_replace($pattern, $replace, $text);
|
||||
|
|
|
@ -169,7 +169,7 @@ function videos_post(App $a) {
|
|||
);
|
||||
|
||||
if (DBM::is_result($i)) {
|
||||
Item::deleteById($i[0]['id']);
|
||||
Item::deleteForUser(['id' => $i[0]['id']], local_user());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue