Merge remote-tracking branch 'upstream/develop' into diaspora-reshare

This commit is contained in:
Michael 2022-12-20 06:58:36 +00:00
commit 4db4d1843d
52 changed files with 5745 additions and 5298 deletions

View file

@ -1,14 +1,77 @@
Version 2022.12 (unreleased)
Version 2023.03 (unreleased)
Friendica Core
The rewrite rule in .htaccess-dist has been changed. The change has to be applied manually to the existing .htaccess
Friendica Addons
BREAKING: The functions from the boot.php file have been moved into better fitting classes
this may break your custom addons. See the pull requests #1293 and #1294 in the
addon repository about the needed changes to your addons.
Closed Issues
Version 2022.12 (2022-12-20)
Friendica Core
Updates to the translations DE, FR, HU, PL, RU
Updated to the documentation [foss-, MarekBenjamin, MrPetovan, tobiasd]
Updates to the themes (frio, vier) [loma-one, MarekBenjamin, MrPetovan, tobiasd]
Improved the display of the system settings in the admin panel [MarekBenjamin]
Improved the API [annando, HankG, Schnoop]
Improved getting system information [VVelox]
Improved the PHP 8.1 compatibility [MrPetovan]
Improved the bulk delivery of postings [annando]
Improved the display of attached images to postings [MarekBenjamin]
General code cleanup [annando, MrPetovan, nupplaphil, Quix0r]
Added a blur hash for images else not displayable [annando]
Added a /about route for the /friendica page [nupplaphil]
Added reporting endpoints to the API [annando]
Added support for the "fedifinder" [annando]
Added rel-me verification for the profile homepage [tobiasd]
Added admin notification for new registrations [annando]
Added a moderation section to the admin panel [annando]
Added an option to make the calendar public [matthiasmoritz]
Fixed a bug in the federation with Diaspora* [annando]
Fixec a problem in the federation with GoTo Social and Owncast [annando]
Deprecated old themes (duepuntozero, quattro, smoothy)
NOTE: The Apache2 rewrite rule in the .htaccess-dist has been changed.
The change has to be applied manually to the existing .htaccess.
Friendica Addons
Updates to the translations DE, FR, HU, SV
fancybox:
Added an addon to display images in postings with a fancybox [brockhaus]
impressum:
Fixed a bug when saving informations [tobiasd]
js_upload:
Improved wording [MarekBenjamin]
monolog:
Moved the functionality into an addon [nupplaphil]
nitter:
Updated the wording [AndyHee]
nsfw:
Enhanced regex handling [MrPetovan]
pumpio:
Fixed logger message [MrPetovan]
rendertime:
Fixed empty minimal time [nupplaphil]
Adapt ignored_modules [nupplaphil]
twitter:
Fixed a problem when the image array was missing [MrPetovan]
Added an option to automatically follow contacts in the Fediverse [annando]
Deprecated unmaintained addons: namethingy, superblock, windowsphonepush
BREAKING: The functions from the boot.php file have been moved into better
fitting classes this may break your custom addons. See the pull
requests #1293 and #1294 in the addon repository about the needed
changes to your addons.
Closed Issues
5095, 7574, 9286, 9920, 10100, 10188, 10518, 10875, 11011, 11284,
11553, 11774, 11804, 11875, 11911, 11941, 11998, 12009, 12013, 12023,
12035, 12054, 12059, 12073, 12084, 12085, 12090, 12096, 12112, 12149,
12163, 12182, 12191, 12192, 12193, 12197, 12199, 12201, 12219, 12220,
12229, 12237, 12245, 12262, 12266, 12273, 12275, 12285, 12312, 12327,
12338, 12339, 12342, 12344, 12345, 12355, 12373, 12376, 12382, 12386,
12399, 12401, 12405, 12406, 12408, 12411, 12413, 12421, 12431, 12437,
12441, 12448, 12450, 12456, 12466, 12468, 12476
Version 2022.10 (2022-10-14)
Friendica Core
Added GD translation, updates to the translations AR, DE, FR, HU, PL, SV, ZH CN

View file

@ -38,6 +38,7 @@ aweiher
axelt
balderino
Balázs Úr
Bartosz Małkowski
Beanow
beardyunixer
Beatriz Vital
@ -108,7 +109,7 @@ Filip Bugaj
Filip H.F. "FiXato" Slagter
Finn Dean
FlxAlbroscheit
foss
foss-
Francesco Apruzzese
Frank Dieckmann
Frederico Gonçalves Guimarães
@ -119,7 +120,9 @@ Gidi Kroon
GLComo
greeneyedred
Gregory Smith
Grischa Brockhaus
gudzpoz
GunChleoc
guzzisti
Haakon Meland Eriksen
Hank Grabowski
@ -164,6 +167,7 @@ Koyu Berteon
kPherox
Kris
Kristoffer Grundström
KulikAlex
Lea1995polish
Leberwurscht
Leonard Lausen
@ -175,10 +179,12 @@ Ludovic Grossard
Lynn Stephenson
maase2
Mai Anh Nguyen
Makary
Manuel Pérez Monís
Marcin Klessa
Marcin Mikołajczak
Marcus Müller
Marek Bachmann
Marie Olive
Mariusz Pisz
marmor
@ -216,6 +222,7 @@ pankraz
Paolo Wave
Pascal
Pascal Deklerck
Paul Saunders
Pavel Morozov
PerigGouanvic
peter
@ -251,11 +258,13 @@ RJ Madsen
Roger Meyer
Roland Häder
rwa
Ryan Voots
S.Krumbholz
Sakałoŭ Alaksiej
Sam
Samuli Valavuo
Sandro Santilli
Schnoop
Sebastian Egbers
sella
Senex Petrovic
@ -287,6 +296,7 @@ teho
Thecross
Thomas
Thomas Willingham
Thorsten
thorsten23
Till Mohr
Tim Stahel
@ -318,7 +328,6 @@ very-ape
Viktor Nilsson
Vinzenz Vietzke
vislav
vladimir N
Vladimir Núñez
VVelox
Vít Šesták 'v6ak'

View file

@ -1 +1 @@
2022.12-rc
2023.03-dev

View file

@ -1,5 +1,5 @@
-- ------------------------------------------
-- Friendica 2022.12-rc (Giant Rhubarb)
-- Friendica 2023.03-dev (Giant Rhubarb)
-- DB_UPDATE_VERSION 1502
-- ------------------------------------------

View file

@ -191,7 +191,6 @@ The available features are client specific and may differ.
#### iOS
* [Fedi](https://github.com/Big-Fig/Fediverse.app) ([AppStore](https://apps.apple.com/de/app/fedi-for-pleroma-and-mastodon/id1478806281))
* [Mastodon](https://joinmastodon.org/apps) ([AppStore](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974))
* [Stella*](https://www.stella-app.net/) ([AppStore](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048))
* [Tooot](https://github.com/tooot-app) ([AppStore](https://apps.apple.com/app/id1549772269)

View file

@ -1,6 +1,6 @@
Contact: mailto:info@friendi.ca
Expires: Sun, 30 Jun 2023 23:59 +0000
Expires: Sun, 31 Dec 2023 23:59 +0000
Preferred-Languages: en

View file

@ -64,7 +64,7 @@ class App
{
const PLATFORM = 'Friendica';
const CODENAME = 'Giant Rhubarb';
const VERSION = '2022.12-rc';
const VERSION = '2023.03-dev';
// Allow themes to control internal parameters
// by changing App values in theme.php

View file

@ -25,7 +25,7 @@ use Friendica\BaseEntity;
/**
* @property-read int $uid
* @property-read int $cid
* @property-read int $cid Either a public contact id (DFRN suggestion) or user-specific id (Contact::addRelationship)
* @property-read int|null $sid
* @property-read bool $knowyou
* @property-read string $note

View file

@ -736,22 +736,22 @@ class HTML
'[youtube]$2[/youtube]',
$s
);
$s = preg_replace(
'#<iframe[^>](.*?)https?://www.youtube.com/embed/([A-Za-z0-9\-_=]+)(.*?)</iframe>#ism',
'[youtube]$2[/youtube]',
$s
);
$s = preg_replace(
'#<iframe[^>](.*?)https?://player.vimeo.com/video/([0-9]+)(.*?)</iframe>#ism',
'[vimeo]$2[/vimeo]',
$s
);
return $s;
}
/**
* transform link href and img src from relative to absolute
*
@ -764,30 +764,30 @@ class HTML
if (empty($base)) {
return $text;
}
$base = rtrim($base, '/');
$base2 = $base . "/";
// Replace links
$pattern = "/<a([^>]*) href=\"(?!http|https|\/)([^\"]*)\"/";
$replace = "<a\${1} href=\"" . $base2 . "\${2}\"";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<a([^>]*) href=\"(?!http|https)([^\"]*)\"/";
$replace = "<a\${1} href=\"" . $base . "\${2}\"";
$text = preg_replace($pattern, $replace, $text);
// Replace images
$pattern = "/<img([^>]*) src=\"(?!http|https|\/)([^\"]*)\"/";
$replace = "<img\${1} src=\"" . $base2 . "\${2}\"";
$text = preg_replace($pattern, $replace, $text);
$pattern = "/<img([^>]*) src=\"(?!http|https)([^\"]*)\"/";
$replace = "<img\${1} src=\"" . $base . "\${2}\"";
$text = preg_replace($pattern, $replace, $text);
// Done
return $text;
}
@ -907,19 +907,6 @@ class HTML
return Renderer::replaceMacros(Renderer::getMarkupTemplate('searchbox.tpl'), $values);
}
/**
* Replace naked text hyperlink with HTML formatted hyperlink
*
* @param string $s
* @return string
*/
public static function toLink(string $s): string
{
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $s);
$s = preg_replace("/\<(.*?)(src|href)=(.*?)\&amp\;(.*?)\>/ism", '<$1$2=$3&$4>', $s);
return $s;
}
/**
* Given a HTML text and a set of filtering reasons, adds a content hiding header with the provided reasons
*

View file

@ -251,7 +251,7 @@ class System
// Don't show multiple calls from the Database classes to show the essential parts of the callstack
$func['database'] = in_array($func['class'], ['Friendica\Database\DBA', 'Friendica\Database\Database']);
if (!$previous['database'] || !$func['database']) {
if (!$previous['database'] || !$func['database']) {
$classparts = explode("\\", $func['class']);
$callstack[] = array_pop($classparts).'::'.$func['function'];
$previous = $func;
@ -678,7 +678,7 @@ class System
$html = BBCode::convert($rulelist, false, BBCode::EXTERNAL);
$msg = HTML::toPlaintext($html, 0, true);
foreach (explode("\n", $msg) as $line) {
foreach (explode("\n", trim($msg)) as $line) {
$line = trim($line);
if ($line) {
$rules[] = ['id' => (string)++$id, 'text' => $line];

View file

@ -74,12 +74,13 @@ class Photo extends BaseFactory
if (empty($photos)) {
throw new HTTPException\NotFoundException();
}
$data = $photos[0];
$data['id'] = $data['resource-id'];
$data = $photos[0];
$data['media-id'] = $data['id'];
$data['id'] = $data['resource-id'];
if (is_int($scale)) {
$data['data'] = base64_encode(ModelPhoto::getImageDataForPhoto($data));
} else {
unset($data['datasize']); //needed only with scale param
}
if ($type == 'xml') {
@ -99,12 +100,21 @@ class Photo extends BaseFactory
} else {
$data['link'][$id] = $link;
}
if (is_null($scale)) {
$data['scales'][] = [
'id' => $photo['id'],
'scale' => $photo['scale'],
'link' => $link,
'width' => $photo['width'],
'height' => $photo['height'],
'size' => $photo['datasize'],
];
}
}
unset($data['backend-class']);
unset($data['backend-ref']);
unset($data['resource-id']);
unset($data['scale']);
if ($with_posts) {
// retrieve item element for getting activities (like, dislike etc.) related to photo

View file

@ -24,6 +24,7 @@ namespace Friendica\Factory\Api\Mastodon;
use Friendica\App\BaseURL;
use Friendica\BaseFactory;
use Friendica\Contact\Introduction\Entity\Introduction;
use Friendica\Database\DBA;
use Friendica\Model\APContact;
use Friendica\Model\Contact;
use Friendica\Network\HTTPException;
@ -49,18 +50,12 @@ class FollowRequest extends BaseFactory
*/
public function createFromIntroduction(Introduction $introduction): \Friendica\Object\Api\Mastodon\FollowRequest
{
$cdata = Contact::getPublicAndUserContactID($introduction->cid, $introduction->uid);
if (empty($cdata)) {
$account = DBA::selectFirst('account-user-view', [], ['id' => $introduction->cid, 'uid' => [0, $introduction->uid]]);
if (empty($account)) {
$this->logger->warning('Wrong introduction data', ['Introduction' => $introduction]);
throw new HTTPException\InternalServerErrorException('Wrong introduction data');
}
$publicContact = Contact::getById($cdata['public']);
$userContact = Contact::getById($cdata['user']);
$apContact = APContact::getByURL($publicContact['url'], false);
return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apContact, $userContact);
return new \Friendica\Object\Api\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $account);
}
}

View file

@ -1130,39 +1130,25 @@ class Contact
* Returns the data array for the photo menu of a given contact
*
* @param array $contact contact
* @param int $uid optional, default 0
* @param int $uid Visitor user id
* @return array
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function photoMenu(array $contact, int $uid = 0): array
public static function photoMenu(array $contact, int $uid): array
{
$pm_url = '';
// Anonymous visitor
if (!$uid) {
return ['profile' => [DI::l10n()->t('View Profile'), self::magicLinkByContact($contact), true]];
}
$pm_url = '';
$status_link = '';
$photos_link = '';
if ($uid == 0) {
$uid = DI::userSession()->getLocalUserId();
}
if (empty($contact['uid']) || ($contact['uid'] != $uid)) {
if ($uid == 0) {
$profile_link = self::magicLinkByContact($contact);
$menu = ['profile' => [DI::l10n()->t('View Profile'), $profile_link, true]];
return $menu;
}
// Look for our own contact if the uid doesn't match and isn't public
$contact_own = DBA::selectFirst('contact', [], ['nurl' => $contact['nurl'], 'network' => $contact['network'], 'uid' => $uid]);
if (DBA::isResult($contact_own)) {
return self::photoMenu($contact_own, $uid);
}
}
$sparkle = false;
if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
$sparkle = true;
$sparkle = true;
$profile_link = 'contact/redir/' . $contact['id'];
} else {
$profile_link = $contact['url'];
@ -1173,8 +1159,8 @@ class Contact
}
if ($sparkle) {
$status_link = $profile_link . '/status';
$photos_link = $profile_link . '/photos';
$status_link = $profile_link . '/status';
$photos_link = $profile_link . '/photos';
$profile_link = $profile_link . '/profile';
}
@ -1183,15 +1169,14 @@ class Contact
}
$contact_url = 'contact/' . $contact['id'];
$posts_link = 'contact/' . $contact['id'] . '/conversations';
$follow_link = '';
$follow_link = '';
$unfollow_link = '';
if (!$contact['self'] && Protocol::supportsFollow($contact['network'])) {
if ($contact['uid'] && in_array($contact['rel'], [self::SHARING, self::FRIEND])) {
$unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1';
} elseif(!$contact['pending']) {
} elseif (!$contact['pending']) {
$follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1';
}
}
@ -1202,27 +1187,27 @@ class Contact
*/
if (empty($contact['uid'])) {
$menu = [
'profile' => [DI::l10n()->t('View Profile') , $profile_link , true],
'network' => [DI::l10n()->t('Network Posts') , $posts_link , false],
'edit' => [DI::l10n()->t('View Contact') , $contact_url , false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link , true],
'unfollow'=> [DI::l10n()->t('Unfollow') , $unfollow_link, true],
'profile' => [DI::l10n()->t('View Profile') , $profile_link , true ],
'network' => [DI::l10n()->t('Network Posts') , $posts_link , false],
'edit' => [DI::l10n()->t('View Contact') , $contact_url , false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link , true ],
'unfollow' => [DI::l10n()->t('Unfollow') , $unfollow_link, true ],
];
} else {
$menu = [
'status' => [DI::l10n()->t('View Status') , $status_link , true],
'profile' => [DI::l10n()->t('View Profile') , $profile_link , true],
'photos' => [DI::l10n()->t('View Photos') , $photos_link , true],
'network' => [DI::l10n()->t('Network Posts') , $posts_link , false],
'edit' => [DI::l10n()->t('View Contact') , $contact_url , false],
'pm' => [DI::l10n()->t('Send PM') , $pm_url , false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link , true],
'unfollow'=> [DI::l10n()->t('Unfollow') , $unfollow_link , true],
'status' => [DI::l10n()->t('View Status') , $status_link , true ],
'profile' => [DI::l10n()->t('View Profile') , $profile_link , true ],
'photos' => [DI::l10n()->t('View Photos') , $photos_link , true ],
'network' => [DI::l10n()->t('Network Posts') , $posts_link , false],
'edit' => [DI::l10n()->t('View Contact') , $contact_url , false],
'pm' => [DI::l10n()->t('Send PM') , $pm_url , false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link , true ],
'unfollow' => [DI::l10n()->t('Unfollow') , $unfollow_link, true ],
];
if (!empty($contact['pending'])) {
try {
$intro = DI::intro()->selectForContact($contact['id']);
$intro = DI::intro()->selectForContact($contact['id']);
$menu['follow'] = [DI::l10n()->t('Approve'), 'notifications/intros/' . $intro->id, true];
} catch (IntroductionNotFoundException $exception) {
DI::logger()->error('Pending contact doesn\'t have an introduction.', ['exception' => $exception]);
@ -1401,14 +1386,18 @@ class Contact
if ($data['network'] == Protocol::DIASPORA) {
try {
DI::dsprContact()->updateFromProbeArray($data);
} catch (HTTPException\NotFoundException $e) {
Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data]);
} catch (\InvalidArgumentException $e) {
Logger::error($e->getMessage(), ['url' => $url, 'data' => $data]);
Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data]);
}
} elseif (!empty($data['networks'][Protocol::DIASPORA])) {
try {
DI::dsprContact()->updateFromProbeArray($data['networks'][Protocol::DIASPORA]);
} catch (HTTPException\NotFoundException $e) {
Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data['networks'][Protocol::DIASPORA]]);
} catch (\InvalidArgumentException $e) {
Logger::error($e->getMessage(), ['url' => $url, 'data' => $data['networks'][Protocol::DIASPORA]]);
Logger::notice($e->getMessage(), ['url' => $url, 'data' => $data['networks'][Protocol::DIASPORA]]);
}
}
@ -2513,14 +2502,18 @@ class Contact
if ($data['network'] == Protocol::DIASPORA) {
try {
DI::dsprContact()->updateFromProbeArray($data);
} catch (HTTPException\NotFoundException $e) {
Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
} catch (\InvalidArgumentException $e) {
Logger::error($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
}
} elseif (!empty($data['networks'][Protocol::DIASPORA])) {
try {
DI::dsprContact()->updateFromProbeArray($data['networks'][Protocol::DIASPORA]);
} catch (HTTPException\NotFoundException $e) {
Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
} catch (\InvalidArgumentException $e) {
Logger::error($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
Logger::notice($e->getMessage(), ['id' => $id, 'network' => $network, 'contact' => $contact, 'data' => $data]);
}
}
@ -2923,15 +2916,8 @@ class Contact
}
// check if we already have a contact
// the poll url is more reliable than the profile url, as we may have
// indirect links or webfinger links
$condition = ['uid' => $uid, 'poll' => [$ret['poll'], Strings::normaliseLink($ret['poll'])], 'network' => $ret['network'], 'pending' => false];
$contact = DBA::selectFirst('contact', ['id', 'rel'], $condition);
if (!DBA::isResult($contact)) {
$condition = ['uid' => $uid, 'nurl' => Strings::normaliseLink($ret['url']), 'network' => $ret['network'], 'pending' => false];
$contact = DBA::selectFirst('contact', ['id', 'rel'], $condition);
}
$condition = ['uid' => $uid, 'nurl' => Strings::normaliseLink($ret['url'])];
$contact = DBA::selectFirst('contact', ['id', 'rel', 'url', 'pending', 'hub-verify'], $condition);
$protocol = self::getProtocol($ret['url'], $ret['network']);
@ -2987,7 +2973,13 @@ class Contact
// update contact
$new_relation = (in_array($contact['rel'], [self::FOLLOWER, self::FRIEND]) ? self::FRIEND : self::SHARING);
$fields = ['rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false];
$fields = ['rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false, 'network' => $ret['network']];
if ($contact['pending'] && !empty($contact['hub-verify'])) {
ActivityPub\Transmitter::sendContactAccept($contact['url'], $contact['hub-verify'], $uid);
$fields['pending'] = false;
}
self::update($fields, ['id' => $contact['id']]);
} else {
$new_relation = (in_array($protocol, [Protocol::MAIL]) ? self::FRIEND : self::SHARING);

View file

@ -412,66 +412,66 @@ class Event
public static function getStrings(): array
{
// First day of the week (0 = Sunday).
$firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
$firstDay = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'first_day_of_week') ?? 0;
$defaultView = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'calendar', 'defaultView') ?? 'month';
$i18n = [
"firstDay" => $firstDay,
"allday" => DI::l10n()->t("all-day"),
return [
'firstDay' => $firstDay,
'defaultView' => $defaultView,
'allday' => DI::l10n()->t('all-day'),
"Sun" => DI::l10n()->t("Sun"),
"Mon" => DI::l10n()->t("Mon"),
"Tue" => DI::l10n()->t("Tue"),
"Wed" => DI::l10n()->t("Wed"),
"Thu" => DI::l10n()->t("Thu"),
"Fri" => DI::l10n()->t("Fri"),
"Sat" => DI::l10n()->t("Sat"),
'Sun' => DI::l10n()->t('Sun'),
'Mon' => DI::l10n()->t('Mon'),
'Tue' => DI::l10n()->t('Tue'),
'Wed' => DI::l10n()->t('Wed'),
'Thu' => DI::l10n()->t('Thu'),
'Fri' => DI::l10n()->t('Fri'),
'Sat' => DI::l10n()->t('Sat'),
"Sunday" => DI::l10n()->t("Sunday"),
"Monday" => DI::l10n()->t("Monday"),
"Tuesday" => DI::l10n()->t("Tuesday"),
"Wednesday" => DI::l10n()->t("Wednesday"),
"Thursday" => DI::l10n()->t("Thursday"),
"Friday" => DI::l10n()->t("Friday"),
"Saturday" => DI::l10n()->t("Saturday"),
'Sunday' => DI::l10n()->t('Sunday'),
'Monday' => DI::l10n()->t('Monday'),
'Tuesday' => DI::l10n()->t('Tuesday'),
'Wednesday' => DI::l10n()->t('Wednesday'),
'Thursday' => DI::l10n()->t('Thursday'),
'Friday' => DI::l10n()->t('Friday'),
'Saturday' => DI::l10n()->t('Saturday'),
"Jan" => DI::l10n()->t("Jan"),
"Feb" => DI::l10n()->t("Feb"),
"Mar" => DI::l10n()->t("Mar"),
"Apr" => DI::l10n()->t("Apr"),
"May" => DI::l10n()->t("May"),
"Jun" => DI::l10n()->t("Jun"),
"Jul" => DI::l10n()->t("Jul"),
"Aug" => DI::l10n()->t("Aug"),
"Sep" => DI::l10n()->t("Sept"),
"Oct" => DI::l10n()->t("Oct"),
"Nov" => DI::l10n()->t("Nov"),
"Dec" => DI::l10n()->t("Dec"),
'Jan' => DI::l10n()->t('Jan'),
'Feb' => DI::l10n()->t('Feb'),
'Mar' => DI::l10n()->t('Mar'),
'Apr' => DI::l10n()->t('Apr'),
'May' => DI::l10n()->t('May'),
'Jun' => DI::l10n()->t('Jun'),
'Jul' => DI::l10n()->t('Jul'),
'Aug' => DI::l10n()->t('Aug'),
'Sep' => DI::l10n()->t('Sept'),
'Oct' => DI::l10n()->t('Oct'),
'Nov' => DI::l10n()->t('Nov'),
'Dec' => DI::l10n()->t('Dec'),
"January" => DI::l10n()->t("January"),
"February" => DI::l10n()->t("February"),
"March" => DI::l10n()->t("March"),
"April" => DI::l10n()->t("April"),
"June" => DI::l10n()->t("June"),
"July" => DI::l10n()->t("July"),
"August" => DI::l10n()->t("August"),
"September" => DI::l10n()->t("September"),
"October" => DI::l10n()->t("October"),
"November" => DI::l10n()->t("November"),
"December" => DI::l10n()->t("December"),
'January' => DI::l10n()->t('January'),
'February' => DI::l10n()->t('February'),
'March' => DI::l10n()->t('March'),
'April' => DI::l10n()->t('April'),
'June' => DI::l10n()->t('June'),
'July' => DI::l10n()->t('July'),
'August' => DI::l10n()->t('August'),
'September' => DI::l10n()->t('September'),
'October' => DI::l10n()->t('October'),
'November' => DI::l10n()->t('November'),
'December' => DI::l10n()->t('December'),
"today" => DI::l10n()->t("today"),
"month" => DI::l10n()->t("month"),
"week" => DI::l10n()->t("week"),
"day" => DI::l10n()->t("day"),
'today' => DI::l10n()->t('today'),
'month' => DI::l10n()->t('month'),
'week' => DI::l10n()->t('week'),
'day' => DI::l10n()->t('day'),
"noevent" => DI::l10n()->t("No events to display"),
'noevent' => DI::l10n()->t('No events to display'),
"dtstart_label" => DI::l10n()->t("Starts:"),
"dtend_label" => DI::l10n()->t("Finishes:"),
"location_label" => DI::l10n()->t("Location:")
'dtstart_label' => DI::l10n()->t('Starts:'),
'dtend_label' => DI::l10n()->t('Finishes:'),
'location_label' => DI::l10n()->t('Location:')
];
return $i18n;
}
/**

View file

@ -167,27 +167,43 @@ class GServer
/**
* Checks if the given server is reachable
*
* @param string $profile URL of the given profile
* @param string $server URL of the given server (If empty, taken from profile)
* @param string $network Network value that is used, when detection failed
* @param boolean $force Force an update.
* @param array $contact Contact that should be checked
*
* @return boolean 'true' if server seems vital
*/
public static function reachable(string $profile, string $server = '', string $network = '', bool $force = false): bool
public static function reachable(array $contact): bool
{
if ($server == '') {
$contact = Contact::getByURL($profile, null, ['baseurl']);
if (!empty($contact['baseurl'])) {
$server = $contact['baseurl'];
}
}
if ($server == '') {
if (!empty($contact['gsid'])) {
$gsid = $contact['gsid'];
} elseif (!empty($contact['baseurl'])) {
$server = $contact['baseurl'];
} elseif ($contact['network'] == Protocol::DIASPORA) {
$parts = parse_url($contact['url']);
unset($parts['path']);
$server = (string)Uri::fromParts($parts);
} else {
return true;
}
return self::check($server, $network, $force);
if (!empty($gsid)) {
$condition = ['id' => $gsid];
} else {
$condition = ['nurl' => Strings::normaliseLink($server)];
}
$gserver = DBA::selectFirst('gserver', ['url', 'next_contact', 'failed'], $condition);
if (empty($gserver)) {
$reachable = true;
} else {
$reachable = !$gserver['failed'];
$server = $gserver['url'];
}
if (!empty($server) && (empty($gserver) || strtotime($gserver['next_contact']) < time())) {
Worker::add(Worker::PRIORITY_LOW, 'UpdateGServer', $server, false);
}
return $reachable;
}
/**

View file

@ -3030,6 +3030,7 @@ class Item
$shared = DI::contentItem()->getSharedPost($item, $fields);
if (!empty($shared['post'])) {
$shared_item = $shared['post'];
$shared_item['body'] = Post\Media::removeFromEndOfBody($shared_item['body']);
$quote_uri_id = $shared['post']['uri-id'];
$shared_links[] = strtolower($shared['post']['uri']);
$item['body'] = BBCode::removeSharedData($item['body']);

View file

@ -388,10 +388,6 @@ class Site extends BaseAdmin
/* Banner */
$banner = DI::config()->get('system', 'banner');
if ($banner == false) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" width="32" height="32" src="images/friendica.svg" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
$email_banner = DI::config()->get('system', 'email_banner');
if ($email_banner == false) {

View file

@ -35,6 +35,7 @@ use Friendica\DI;
use Friendica\Model;
use Friendica\Model\User;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Network\HTTPException\NotFoundException;
/**
@ -494,16 +495,18 @@ class Contact extends BaseModule
*
* @param array $contact Contact array
* @return array Template fields
* @throws InternalServerErrorException
* @throws \ImagickException
*/
public static function getContactTemplateVars(array $contact)
public static function getContactTemplateVars(array $contact): array
{
$alt_text = '';
if (!empty($contact['url']) && isset($contact['uid']) && ($contact['uid'] == 0) && DI::userSession()->getLocalUserId()) {
$personal = Model\Contact::getByURL($contact['url'], false, ['uid', 'rel', 'self'], DI::userSession()->getLocalUserId());
if (!empty($personal)) {
$contact['uid'] = $personal['uid'];
$contact['rel'] = $personal['rel'];
$contact['uid'] = $personal['uid'];
$contact['rel'] = $personal['rel'];
$contact['self'] = $personal['self'];
}
}
@ -545,15 +548,15 @@ class Contact extends BaseModule
if ($contact['self']) {
$alt_text = DI::l10n()->t('This is you');
$url = $contact['url'];
$sparkle = '';
$url = $contact['url'];
$sparkle = '';
}
return [
'id' => $contact['id'],
'url' => $url,
'img_hover' => DI::l10n()->t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'photo_menu' => Model\Contact::photoMenu($contact),
'photo_menu' => Model\Contact::photoMenu($contact, DI::userSession()->getLocalUserId()),
'thumb' => Model\Contact::getThumb($contact, true),
'alt_text' => $alt_text,
'name' => $contact['name'],

View file

@ -21,54 +21,72 @@
namespace Friendica\Module\Contact;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Model;
use Friendica\Model\User;
use Friendica\Module;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
class Contacts extends BaseModule
{
/** @var IHandleUserSessions */
private $userSession;
/** @var App\Page */
private $page;
public function __construct(App\Page $page, IHandleUserSessions $userSession, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->userSession = $userSession;
$this->page = $page;
}
protected function content(array $request = []): string
{
if (!DI::userSession()->getLocalUserId()) {
if (!$this->userSession->getLocalUserId()) {
throw new HTTPException\ForbiddenException();
}
$cid = $this->parameters['id'];
$type = $this->parameters['type'] ?? 'all';
$accounttype = $_GET['accounttype'] ?? '';
$accounttype = $request['accounttype'] ?? '';
$accounttypeid = User::getAccountTypeByString($accounttype);
if (!$cid) {
throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.'));
throw new HTTPException\BadRequestException($this->t('Invalid contact.'));
}
$contact = Model\Contact::getById($cid, []);
if (empty($contact)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Contact not found.'));
throw new HTTPException\NotFoundException($this->t('Contact not found.'));
}
$localContactId = Model\Contact::getPublicIdByUserId(DI::userSession()->getLocalUserId());
$localContactId = Model\Contact::getPublicIdByUserId($this->userSession->getLocalUserId());
DI::page()['aside'] = Widget\VCard::getHTML($contact);
$this->page['aside'] = Widget\VCard::getHTML($contact);
$condition = [
'blocked' => false,
'self' => false,
'hidden' => false,
'failed' => false,
'self' => false,
'hidden' => false,
'failed' => false,
];
if (isset($accounttypeid)) {
$condition['contact-type'] = $accounttypeid;
}
$noresult_label = DI::l10n()->t('No known contacts.');
$noresult_label = $this->t('No known contacts.');
switch ($type) {
case 'followers':
@ -82,50 +100,61 @@ class Contacts extends BaseModule
break;
case 'common':
$total = Model\Contact\Relation::countCommon($localContactId, $cid, $condition);
$noresult_label = DI::l10n()->t('No common contacts.');
$noresult_label = $this->t('No common contacts.');
break;
default:
$total = Model\Contact\Relation::countAll($cid, $condition);
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 30);
$pager = new Pager($this->l10n, $this->args->getQueryString(), 30);
$desc = '';
switch ($type) {
case 'followers':
$friends = Model\Contact\Relation::listFollowers($cid, $condition, $pager->getItemsPerPage(), $pager->getStart());
$title = DI::l10n()->tt('Follower (%s)', 'Followers (%s)', $total);
$title = $this->tt('Follower (%s)', 'Followers (%s)', $total);
break;
case 'following':
$friends = Model\Contact\Relation::listFollows($cid, $condition, $pager->getItemsPerPage(), $pager->getStart());
$title = DI::l10n()->tt('Following (%s)', 'Following (%s)', $total);
$title = $this->tt('Following (%s)', 'Following (%s)', $total);
break;
case 'mutuals':
$friends = Model\Contact\Relation::listMutuals($cid, $condition, $pager->getItemsPerPage(), $pager->getStart());
$title = DI::l10n()->tt('Mutual friend (%s)', 'Mutual friends (%s)', $total);
$desc = DI::l10n()->t(
$title = $this->tt('Mutual friend (%s)', 'Mutual friends (%s)', $total);
$desc = $this->t(
'These contacts both follow and are followed by <strong>%s</strong>.',
htmlentities($contact['name'], ENT_COMPAT, 'UTF-8')
);
break;
case 'common':
$friends = Model\Contact\Relation::listCommon($localContactId, $cid, $condition, $pager->getItemsPerPage(), $pager->getStart());
$title = DI::l10n()->tt('Common contact (%s)', 'Common contacts (%s)', $total);
$desc = DI::l10n()->t(
$title = $this->tt('Common contact (%s)', 'Common contacts (%s)', $total);
$desc = $this->t(
'Both <strong>%s</strong> and yourself have publicly interacted with these contacts (follow, comment or likes on public posts).',
htmlentities($contact['name'], ENT_COMPAT, 'UTF-8')
);
break;
default:
$friends = Model\Contact\Relation::listAll($cid, $condition, $pager->getItemsPerPage(), $pager->getStart());
$title = DI::l10n()->tt('Contact (%s)', 'Contacts (%s)', $total);
$title = $this->tt('Contact (%s)', 'Contacts (%s)', $total);
}
$o = Module\Contact::getTabsHTML($contact, Module\Contact::TAB_CONTACTS);
$tabs = self::getContactFilterTabs('contact/' . $cid, $type, true);
$contacts = array_map([Module\Contact::class, 'getContactTemplateVars'], $friends);
// Contact list is obtained from the visited contact, but the contact display is visitor dependent
$contacts = array_map(
function ($contact) {
$contact = Model\Contact::selectFirst(
[],
['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
['order' => ['uid' => 'DESC']]
);
return Module\Contact::getContactTemplateVars($contact);
},
$friends
);
$tpl = Renderer::getMarkupTemplate('profile/contacts.tpl');
$o .= Renderer::replaceMacros($tpl, [
@ -139,7 +168,7 @@ class Contacts extends BaseModule
'$paginate' => $pager->renderFull($total),
]);
DI::page()['aside'] .= Widget::accountTypes($_SERVER['REQUEST_URI'], $accounttype);
$this->page['aside'] .= Widget::accountTypes($_SERVER['REQUEST_URI'], $accounttype);
return $o;
}

View file

@ -21,26 +21,45 @@
namespace Friendica\Module\Contact;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
/**
* Asynchronous HTML fragment provider for frio contact hovercards
*/
class Hovercard extends BaseModule
{
/** @var IManageConfigValues */
private $config;
/** @var IHandleUserSessions */
private $userSession;
public function __construct(IHandleUserSessions $userSession, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config;
$this->userSession = $userSession;
}
protected function rawContent(array $request = [])
{
$contact_url = $_REQUEST['url'] ?? '';
$contact_url = $request['url'] ?? '';
// Get out if the system doesn't have public access allowed
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
if ($this->config->get('system', 'block_public') && !$this->userSession->isAuthenticated()) {
throw new HTTPException\ForbiddenException();
}
@ -50,7 +69,7 @@ class Hovercard extends BaseModule
*/
if (strpos($contact_url, 'contact/') === 0 && preg_match('/(\d+)/', $contact_url, $matches)) {
$remote_contact = Contact::selectFirst(['nurl'], ['id' => $matches[1]]);
$contact_url = $remote_contact['nurl'] ?? '';
$contact_url = $remote_contact['nurl'] ?? '';
}
if (!$contact_url) {
@ -59,8 +78,8 @@ class Hovercard extends BaseModule
// Search for contact data
// Look if the local user has got the contact
if (DI::userSession()->isAuthenticated()) {
$contact = Contact::getByURLForUser($contact_url, DI::userSession()->getLocalUserId());
if ($this->userSession->isAuthenticated()) {
$contact = Contact::getByURLForUser($contact_url, $this->userSession->getLocalUserId());
} else {
$contact = Contact::getByURL($contact_url, false);
}
@ -70,15 +89,15 @@ class Hovercard extends BaseModule
}
// Get the photo_menu - the menu if possible contact actions
if (DI::userSession()->isAuthenticated()) {
$actions = Contact::photoMenu($contact);
if ($this->userSession->isAuthenticated()) {
$actions = Contact::photoMenu($contact, $this->userSession->getLocalUserId());
} else {
$actions = [];
}
// Move the contact data to the profile array so we can deliver it to
$tpl = Renderer::getMarkupTemplate('hovercard.tpl');
$o = Renderer::replaceMacros($tpl, [
$o = Renderer::replaceMacros($tpl, [
'$profile' => [
'name' => $contact['name'],
'nick' => $contact['nick'],
@ -96,7 +115,6 @@ class Hovercard extends BaseModule
],
]);
echo $o;
System::exit();
System::httpExit($o);
}
}

View file

@ -21,51 +21,71 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Module;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Module\BaseProfile;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
class Common extends BaseProfile
{
/** @var IManageConfigValues */
private $config;
/** @var IHandleUserSessions */
private $userSession;
/** @var App */
private $app;
public function __construct(App $app, IHandleUserSessions $userSession, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config;
$this->userSession = $userSession;
$this->app = $app;
}
protected function content(array $request = []): string
{
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
if ($this->config->get('system', 'block_public') && !$this->userSession->isAuthenticated()) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
$a = DI::app();
Nav::setSelected('home');
$nickname = $this->parameters['nickname'];
$profile = Profile::load($a, $nickname);
$profile = Profile::load($this->app, $nickname);
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
if (!empty($profile['hide-friends'])) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
throw new HTTPException\ForbiddenException($this->t('Permission denied.'));
}
$displayCommonTab = DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId();
$displayCommonTab = $this->userSession->isAuthenticated() && $profile['uid'] != $this->userSession->getLocalUserId();
if (!$displayCommonTab) {
$a->redirect('profile/' . $nickname . '/contacts');
$this->baseUrl->redirect('profile/' . $nickname . '/contacts');
};
$o = self::getTabsHTML('contacts', false, $profile['nickname'], $profile['hide-friends']);
$tabs = self::getContactFilterTabs('profile/' . $nickname, 'common', $displayCommonTab);
$sourceId = Contact::getIdForURL(Profile::getMyURL());
$sourceId = Contact::getIdForURL($this->userSession->getMyUrl());
$targetId = Contact::getPublicIdByUserId($profile['uid']);
$condition = [
@ -76,14 +96,25 @@ class Common extends BaseProfile
$total = Contact\Relation::countCommon($sourceId, $targetId, $condition);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 30);
$pager = new Pager($this->l10n, $this->args->getQueryString(), 30);
$commonFollows = Contact\Relation::listCommon($sourceId, $targetId, $condition, $pager->getItemsPerPage(), $pager->getStart());
$contacts = array_map([Module\Contact::class, 'getContactTemplateVars'], $commonFollows);
// Contact list is obtained from the visited profile user, but the contact display is visitor dependent
$contacts = array_map(
function ($contact) {
$contact = Contact::selectFirst(
[],
['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
['order' => ['uid' => 'DESC']]
);
return Module\Contact::getContactTemplateVars($contact);
},
$commonFollows
);
$title = DI::l10n()->tt('Common contact (%s)', 'Common contacts (%s)', $total);
$desc = DI::l10n()->t(
$title = $this->tt('Common contact (%s)', 'Common contacts (%s)', $total);
$desc = $this->t(
'Both <strong>%s</strong> and yourself have publicly interacted with these contacts (follow, comment or likes on public posts).',
htmlentities($profile['name'], ENT_COMPAT, 'UTF-8')
);
@ -94,7 +125,7 @@ class Common extends BaseProfile
'$desc' => $desc,
'$tabs' => $tabs,
'$noresult_label' => DI::l10n()->t('No common contacts.'),
'$noresult_label' => $this->t('No common contacts.'),
'$contacts' => $contacts,
'$paginate' => $pager->renderFull($total),

View file

@ -21,45 +21,68 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Database;
use Friendica\Model;
use Friendica\Module;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
class Contacts extends Module\BaseProfile
{
/** @var IManageConfigValues */
private $config;
/** @var IHandleUserSessions */
private $userSession;
/** @var App */
private $app;
/** @var Database */
private $database;
public function __construct(Database $database, App $app, IHandleUserSessions $userSession, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config;
$this->userSession = $userSession;
$this->app = $app;
$this->database = $database;
}
protected function content(array $request = []): string
{
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
if ($this->config->get('system', 'block_public') && !$this->userSession->isAuthenticated()) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
$a = DI::app();
$nickname = $this->parameters['nickname'];
$type = $this->parameters['type'] ?? 'all';
$type = $this->parameters['type'] ?? 'all';
$profile = Model\Profile::load($a, $nickname);
$profile = Model\Profile::load($this->app, $nickname);
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
$is_owner = $profile['uid'] == DI::userSession()->getLocalUserId();
$is_owner = $profile['uid'] == $this->userSession->getLocalUserId();
if ($profile['hide-friends'] && !$is_owner) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
throw new HTTPException\ForbiddenException($this->t('Permission denied.'));
}
Nav::setSelected('home');
$o = self::getTabsHTML('contacts', $is_owner, $profile['nickname'], $profile['hide-friends']);
$tabs = self::getContactFilterTabs('profile/' . $nickname, $type, DI::userSession()->isAuthenticated() && $profile['uid'] != DI::userSession()->getLocalUserId());
$tabs = self::getContactFilterTabs('profile/' . $nickname, $type, $this->userSession->isAuthenticated() && $profile['uid'] != $this->userSession->getLocalUserId());
$condition = [
'uid' => $profile['uid'],
@ -73,50 +96,64 @@ class Contacts extends Module\BaseProfile
];
switch ($type) {
case 'followers': $condition['rel'] = [Model\Contact::FOLLOWER, Model\Contact::FRIEND]; break;
case 'following': $condition['rel'] = [Model\Contact::SHARING, Model\Contact::FRIEND]; break;
case 'mutuals': $condition['rel'] = Model\Contact::FRIEND; break;
case 'followers':
$condition['rel'] = [Model\Contact::FOLLOWER, Model\Contact::FRIEND];
break;
case 'following':
$condition['rel'] = [Model\Contact::SHARING, Model\Contact::FRIEND];
break;
case 'mutuals':
$condition['rel'] = Model\Contact::FRIEND;
break;
}
$total = DBA::count('contact', $condition);
$total = $this->database->count('contact', $condition);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 30);
$pager = new Pager($this->l10n, $this->args->getQueryString(), 30);
$params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
// Contact list is obtained from the visited profile user, but the contact display is visitor dependent
$contacts = array_map(
[Module\Contact::class, 'getContactTemplateVars'],
Model\Contact::selectToArray([], $condition, $params)
function ($contact) {
$contact = Model\Contact::selectFirst(
[],
['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
['order' => ['uid' => 'DESC']]
);
return Module\Contact::getContactTemplateVars($contact);
},
Model\Contact::selectToArray(['uri-id'], $condition, $params)
);
$desc = '';
switch ($type) {
case 'followers':
$title = DI::l10n()->tt('Follower (%s)', 'Followers (%s)', $total);
$title = $this->tt('Follower (%s)', 'Followers (%s)', $total);
break;
case 'following':
$title = DI::l10n()->tt('Following (%s)', 'Following (%s)', $total);
$title = $this->tt('Following (%s)', 'Following (%s)', $total);
break;
case 'mutuals':
$title = DI::l10n()->tt('Mutual friend (%s)', 'Mutual friends (%s)', $total);
$desc = DI::l10n()->t(
$title = $this->tt('Mutual friend (%s)', 'Mutual friends (%s)', $total);
$desc = $this->t(
'These contacts both follow and are followed by <strong>%s</strong>.',
htmlentities($profile['name'], ENT_COMPAT, 'UTF-8')
);
break;
case 'all':
default:
$title = DI::l10n()->tt('Contact (%s)', 'Contacts (%s)', $total);
$title = $this->tt('Contact (%s)', 'Contacts (%s)', $total);
break;
}
$tpl = Renderer::getMarkupTemplate('profile/contacts.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$title' => $title,
'$desc' => $desc,
'$tabs' => $tabs,
$o .= Renderer::replaceMacros($tpl, [
'$title' => $title,
'$desc' => $desc,
'$tabs' => $tabs,
'$noresult_label' => DI::l10n()->t('No contacts.'),
'$noresult_label' => $this->t('No contacts.'),
'$contacts' => $contacts,
'$paginate' => $pager->renderFull($total),

View file

@ -21,8 +21,19 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Content\Conversation;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Database;
use Friendica\Module\Response;
use Friendica\Profile\ProfileField\Repository\ProfileField;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
/**
* Profile index router
@ -35,13 +46,50 @@ use Friendica\Core\L10n;
*/
class Index extends BaseModule
{
/** @var Database */
private $database;
/** @var App */
private $app;
/** @var IHandleUserSessions */
private $session;
/** @var IManageConfigValues */
private $config;
/** @var App\Page */
private $page;
/** @var ProfileField */
private $profileField;
/** @var DateTimeFormat */
private $dateTimeFormat;
/** @var Conversation */
private $conversation;
/** @var IManagePersonalConfigValues */
private $pConfig;
/** @var App\Mode */
private $mode;
public function __construct(App\Mode $mode, IManagePersonalConfigValues $pConfig, Conversation $conversation, DateTimeFormat $dateTimeFormat, ProfileField $profileField, App\Page $page, IManageConfigValues $config, IHandleUserSessions $session, App $app, Database $database, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database;
$this->app = $app;
$this->session = $session;
$this->config = $config;
$this->page = $page;
$this->profileField = $profileField;
$this->dateTimeFormat = $dateTimeFormat;
$this->conversation = $conversation;
$this->pConfig = $pConfig;
$this->mode = $mode;
}
protected function rawContent(array $request = [])
{
(new Profile($this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->rawContent();
(new Profile($this->profileField, $this->page, $this->config, $this->session, $this->app, $this->database, $this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->rawContent();
}
protected function content(array $request = []): string
{
return (new Status($this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->content();
return (new Status($this->mode, $this->pConfig, $this->conversation, $this->session, $this->config, $this->dateTimeFormat, $this->page, $this->app, $this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->content();
}
}

View file

@ -78,7 +78,7 @@ class Photos extends \Friendica\Module\BaseProfile
$this->systemMessages = $systemMessages;
$this->aclFormatter = $aclFormatter;
$owner = Profile::load($this->app, $this->parameters['nickname'] ?? '');
$owner = Profile::load($this->app, $this->parameters['nickname'] ?? '', false);
if (!$owner || $owner['account_removed'] || $owner['account_expired']) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
@ -318,16 +318,8 @@ class Photos extends \Friendica\Module\BaseProfile
$owner_uid = $this->owner['uid'];
$is_owner = $this->session->getLocalUserId() == $owner_uid;
$remote_contact = false;
if ($this->session->getRemoteContactID($owner_uid)) {
$contact_id = $this->session->getRemoteContactID($owner_uid);
$contact = Contact::getContactForUser($contact_id, $owner_uid, ['blocked', 'pending']);
$remote_contact = $contact && !$contact['blocked'] && !$contact['pending'];
}
if ($this->owner['hidewall'] && !$this->session->isAuthenticated()) {
$this->baseUrl->redirect('profile/' . $owner['nickname'] . '/restricted');
$this->baseUrl->redirect('profile/' . $this->owner['nickname'] . '/restricted');
}
$this->session->set('photo_return', $this->args->getCommand());
@ -412,6 +404,11 @@ class Photos extends \Friendica\Module\BaseProfile
]);
}
// Removing vCard for owner
if ($is_owner) {
$this->page['aside'] = '';
}
if (!empty($photo_albums_widget)) {
$this->page['aside'] .= $photo_albums_widget;
}

View file

@ -21,35 +21,68 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Nav;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile as ProfileModel;
use Friendica\Model\Tag;
use Friendica\Model\User;
use Friendica\Module\BaseProfile;
use Friendica\Module\Response;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException;
use Friendica\Profile\ProfileField\Repository\ProfileField;
use Friendica\Protocol\ActivityPub;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
use Psr\Log\LoggerInterface;
class Profile extends BaseProfile
{
/** @var Database */
private $database;
/** @var App */
private $app;
/** @var IHandleUserSessions */
private $session;
/** @var IManageConfigValues */
private $config;
/** @var App\Page */
private $page;
/** @var ProfileField */
private $profileField;
public function __construct(ProfileField $profileField, App\Page $page, IManageConfigValues $config, IHandleUserSessions $session, App $app, Database $database, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database;
$this->app = $app;
$this->session = $session;
$this->config = $config;
$this->page = $page;
$this->profileField = $profileField;
}
protected function rawContent(array $request = [])
{
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'], 'account_removed' => false]);
if (DBA::isResult($user)) {
$user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'account_removed' => false]);
if ($user) {
try {
$data = ActivityPub\Transmitter::getProfile($user['uid']);
header('Access-Control-Allow-Origin: *');
@ -60,7 +93,7 @@ class Profile extends BaseProfile
}
}
if (DBA::exists('userd', ['username' => $this->parameters['nickname']])) {
if ($this->database->exists('userd', ['username' => $this->parameters['nickname']])) {
// Known deleted user
$data = ActivityPub\Transmitter::getDeletedUser($this->parameters['nickname']);
@ -74,43 +107,41 @@ class Profile extends BaseProfile
protected function content(array $request = []): string
{
$a = DI::app();
$profile = ProfileModel::load($a, $this->parameters['nickname'] ?? '');
$profile = ProfileModel::load($this->app, $this->parameters['nickname'] ?? '');
if (!$profile) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Profile not found.'));
throw new HTTPException\NotFoundException($this->t('Profile not found.'));
}
$remote_contact_id = DI::userSession()->getRemoteContactID($profile['uid']);
$remote_contact_id = $this->session->getRemoteContactID($profile['uid']);
if (DI::config()->get('system', 'block_public') && !DI::userSession()->isAuthenticated()) {
if ($this->config->get('system', 'block_public') && !$this->session->isAuthenticated()) {
return Login::form();
}
if (!empty($profile['hidewall']) && !DI::userSession()->isAuthenticated()) {
if (!empty($profile['hidewall']) && !$this->session->isAuthenticated()) {
$this->baseUrl->redirect('profile/' . $profile['nickname'] . '/restricted');
}
if (!empty($profile['page-flags']) && $profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY) {
DI::page()['htmlhead'] .= '<meta name="friendica.community" content="true" />' . "\n";
$this->page['htmlhead'] .= '<meta name="friendica.community" content="true" />' . "\n";
}
DI::page()['htmlhead'] .= self::buildHtmlHead($profile, $this->parameters['nickname'], $remote_contact_id);
$this->page['htmlhead'] .= $this->buildHtmlHead($profile, $this->parameters['nickname']);
Nav::setSelected('home');
$is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
$o = self::getTabsHTML('profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
$is_owner = $this->session->getLocalUserId() == $profile['uid'];
$o = self::getTabsHTML('profile', $is_owner, $profile['nickname'], $profile['hide-friends']);
$view_as_contacts = [];
$view_as_contact_id = 0;
$view_as_contacts = [];
$view_as_contact_id = 0;
$view_as_contact_alert = '';
if ($is_owner) {
$view_as_contact_id = intval($_GET['viewas'] ?? 0);
$view_as_contact_id = intval($request['viewas'] ?? 0);
$view_as_contacts = Contact::selectToArray(['id', 'name'], [
'uid' => DI::userSession()->getLocalUserId(),
'rel' => [Contact::FOLLOWER, Contact::SHARING, Contact::FRIEND],
'uid' => $this->session->getLocalUserId(),
'rel' => [Contact::FOLLOWER, Contact::SHARING, Contact::FRIEND],
'network' => Protocol::DFRN,
'blocked' => false,
]);
@ -123,7 +154,7 @@ class Profile extends BaseProfile
}
if (($key = array_search($view_as_contact_id, $view_as_contact_ids)) !== false) {
$view_as_contact_alert = DI::l10n()->t(
$view_as_contact_alert = $this->t(
'You\'re currently viewing your profile as <b>%s</b> <a href="%s" class="btn btn-sm pull-right">Cancel</a>',
htmlentities($view_as_contacts[$key]['name'], ENT_COMPAT, 'UTF-8'),
'profile/' . $this->parameters['nickname'] . '/profile'
@ -133,47 +164,51 @@ class Profile extends BaseProfile
$basic_fields = [];
$basic_fields += self::buildField('fullname', DI::l10n()->t('Full Name:'), $profile['name']);
$basic_fields += self::buildField('fullname', $this->t('Full Name:'), $profile['name']);
if (Feature::isEnabled($profile['uid'], 'profile_membersince')) {
$basic_fields += self::buildField(
'membersince',
DI::l10n()->t('Member since:'),
$this->t('Member since:'),
DateTimeFormat::local($profile['register_date'])
);
}
if (!empty($profile['dob']) && $profile['dob'] > DBA::NULL_DATE) {
$year_bd_format = DI::l10n()->t('j F, Y');
$short_bd_format = DI::l10n()->t('j F');
$year_bd_format = $this->t('j F, Y');
$short_bd_format = $this->t('j F');
$dob = DI::l10n()->getDay(
$dob = $this->l10n->getDay(
intval($profile['dob']) ?
DateTimeFormat::utc($profile['dob'] . ' 00:00 +00:00', $year_bd_format)
: DateTimeFormat::utc('2001-' . substr($profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format)
);
$basic_fields += self::buildField('dob', DI::l10n()->t('Birthday:'), $dob);
$basic_fields += self::buildField('dob', $this->t('Birthday:'), $dob);
if ($age = Temporal::getAgeByTimezone($profile['dob'], $profile['timezone'])) {
$basic_fields += self::buildField('age', DI::l10n()->t('Age: '), DI::l10n()->tt('%d year old', '%d years old', $age));
$basic_fields += self::buildField('age', $this->t('Age: '), $this->tt('%d year old', '%d years old', $age));
}
}
if ($profile['about']) {
$basic_fields += self::buildField('about', DI::l10n()->t('Description:'), BBCode::convertForUriId($profile['uri-id'], $profile['about']));
$basic_fields += self::buildField('about', $this->t('Description:'), BBCode::convertForUriId($profile['uri-id'], $profile['about']));
}
if ($profile['xmpp']) {
$basic_fields += self::buildField('xmpp', DI::l10n()->t('XMPP:'), $profile['xmpp']);
$basic_fields += self::buildField('xmpp', $this->t('XMPP:'), $profile['xmpp']);
}
if ($profile['matrix']) {
$basic_fields += self::buildField('matrix', DI::l10n()->t('Matrix:'), $profile['matrix']);
$basic_fields += self::buildField('matrix', $this->t('Matrix:'), $profile['matrix']);
}
if ($profile['homepage']) {
$basic_fields += self::buildField('homepage', DI::l10n()->t('Homepage:'), HTML::toLink($profile['homepage']));
$basic_fields += self::buildField(
'homepage',
$this->t('Homepage:'),
$this->tryRelMe($profile['homepage']) ?: $profile['homepage']
);
}
if (
@ -183,7 +218,7 @@ class Profile extends BaseProfile
|| $profile['region']
|| $profile['country-name']
) {
$basic_fields += self::buildField('location', DI::l10n()->t('Location:'), ProfileModel::formatLocation($profile));
$basic_fields += self::buildField('location', $this->t('Location:'), ProfileModel::formatLocation($profile));
}
if ($profile['pub_keywords']) {
@ -191,12 +226,12 @@ class Profile extends BaseProfile
// Separator is defined in Module\Settings\Profile\Index::cleanKeywords
foreach (explode(', ', $profile['pub_keywords']) as $tag_label) {
$tags[] = [
'url' => '/search?tag=' . $tag_label,
'url' => '/search?tag=' . $tag_label,
'label' => Tag::TAG_CHARACTER[Tag::HASHTAG] . $tag_label,
];
}
$basic_fields += self::buildField('pub_keywords', DI::l10n()->t('Tags:'), $tags);
$basic_fields += self::buildField('pub_keywords', $this->t('Tags:'), $tags);
}
$custom_fields = [];
@ -205,54 +240,54 @@ class Profile extends BaseProfile
$contact_id = $view_as_contact_id ?: $remote_contact_id ?: 0;
if ($is_owner && $contact_id === 0) {
$profile_fields = DI::profileField()->selectByUserId($profile['uid']);
$profile_fields = $this->profileField->selectByUserId($profile['uid']);
} else {
$profile_fields = DI::profileField()->selectByContactId($contact_id, $profile['uid']);
$profile_fields = $this->profileField->selectByContactId($contact_id, $profile['uid']);
}
foreach ($profile_fields as $profile_field) {
$custom_fields += self::buildField(
'custom_' . $profile_field->order,
$profile_field->label,
BBCode::convertForUriId($profile['uri-id'], $profile_field->value),
$this->tryRelMe($profile_field->value) ?: BBCode::convertForUriId($profile['uri-id'], $profile_field->value),
'aprofile custom'
);
};
}
//show subcribed forum if it is enabled in the usersettings
if (Feature::isEnabled($profile['uid'], 'forumlist_profile')) {
$custom_fields += self::buildField(
'forumlist',
DI::l10n()->t('Forums:'),
$this->t('Forums:'),
ForumManager::profileAdvanced($profile['uid'])
);
}
$tpl = Renderer::getMarkupTemplate('profile/profile.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$title' => DI::l10n()->t('Profile'),
'$yourself' => DI::l10n()->t('Yourself'),
'$view_as_contacts' => $view_as_contacts,
'$view_as_contact_id' => $view_as_contact_id,
$o .= Renderer::replaceMacros($tpl, [
'$title' => $this->t('Profile'),
'$yourself' => $this->t('Yourself'),
'$view_as_contacts' => $view_as_contacts,
'$view_as_contact_id' => $view_as_contact_id,
'$view_as_contact_alert' => $view_as_contact_alert,
'$view_as' => DI::l10n()->t('View profile as:'),
'$submit' => DI::l10n()->t('Submit'),
'$basic' => DI::l10n()->t('Basic'),
'$advanced' => DI::l10n()->t('Advanced'),
'$is_owner' => $profile['uid'] == DI::userSession()->getLocalUserId(),
'$query_string' => DI::args()->getQueryString(),
'$basic_fields' => $basic_fields,
'$custom_fields' => $custom_fields,
'$profile' => $profile,
'$edit_link' => [
'url' => DI::baseUrl() . '/settings/profile', DI::l10n()->t('Edit profile'),
'$view_as' => $this->t('View profile as:'),
'$submit' => $this->t('Submit'),
'$basic' => $this->t('Basic'),
'$advanced' => $this->t('Advanced'),
'$is_owner' => $profile['uid'] == $this->session->getLocalUserId(),
'$query_string' => $this->args->getQueryString(),
'$basic_fields' => $basic_fields,
'$custom_fields' => $custom_fields,
'$profile' => $profile,
'$edit_link' => [
'url' => 'settings/profile', $this->t('Edit profile'),
'title' => '',
'label' => DI::l10n()->t('Edit profile')
'label' => $this->t('Edit profile')
],
'$viewas_link' => [
'url' => DI::args()->getQueryString() . '#viewas',
'$viewas_link' => [
'url' => $this->args->getQueryString() . '#viewas',
'title' => '',
'label' => DI::l10n()->t('View as')
'label' => $this->t('View as')
],
]);
@ -270,20 +305,18 @@ class Profile extends BaseProfile
* @param string $class Optional CSS class to apply to the field
* @return array
*/
private static function buildField(string $name, string $label, $value, string $class = 'aprofile')
private static function buildField(string $name, string $label, $value, string $class = 'aprofile'): array
{
return [$name => [
'id' => 'aprofile-' . $name,
'id' => 'aprofile-' . $name,
'class' => $class,
'label' => $label,
'value' => $value,
]];
}
private static function buildHtmlHead(array $profile, string $nickname, int $remote_contact_id)
private function buildHtmlHead(array $profile, string $nickname): string
{
$baseUrl = DI::baseUrl();
$htmlhead = "\n";
if (!empty($profile['page-flags']) && $profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY) {
@ -300,8 +333,8 @@ class Profile extends BaseProfile
}
// site block
$blocked = !DI::userSession()->isAuthenticated() && DI::config()->get('system', 'block_public');
$userblock = !DI::userSession()->isAuthenticated() && $profile['hidewall'];
$blocked = !$this->session->isAuthenticated() && $this->config->get('system', 'block_public');
$userblock = !$this->session->isAuthenticated() && $profile['hidewall'];
if (!$blocked && !$userblock) {
$keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], $profile['pub_keywords'] ?? '');
if (strlen($keywords)) {
@ -315,19 +348,34 @@ class Profile extends BaseProfile
$htmlhead .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl . '/dfrn_poll/' . $nickname . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl . '/feed/' . $nickname . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl . '/feed/' . $nickname . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $baseUrl . '/feed/' . $nickname . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $baseUrl->getHostname() . ($baseUrl->getUrlPath() ? '/' . $baseUrl->getUrlPath() : ''));
$htmlhead .= '<link rel="lrdd" type="application/xrd+xml" href="' . $baseUrl . '/xrd/?uri=' . $uri . '" />' . "\n";
header('Link: <' . $baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/dfrn_poll/' . $nickname . '" title="DFRN: ' . $this->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/" title="' . $this->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/comments" title="' . $this->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/activity" title="' . $this->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHostname() . ($this->baseUrl->getUrlPath() ? '/' . $this->baseUrl->getUrlPath() : ''));
$htmlhead .= '<link rel="lrdd" type="application/xrd+xml" href="' . $this->baseUrl . '/xrd/?uri=' . $uri . '" />' . "\n";
header('Link: <' . $this->baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
foreach ($dfrn_pages as $dfrn) {
$htmlhead .= '<link rel="dfrn-' . $dfrn . '" href="' . $baseUrl . '/dfrn_' . $dfrn . '/' . $nickname . '" />' . "\n";
$htmlhead .= '<link rel="dfrn-' . $dfrn . '" href="' . $this->baseUrl . '/dfrn_' . $dfrn . '/' . $nickname . '" />' . "\n";
}
return $htmlhead;
}
/**
* Check if the input is an HTTP(S) link and returns a rel="me" link if yes, empty string if not
*
* @param string $input
* @return string
*/
private function tryRelMe(string $input): string
{
if (preg_match(Strings::onlyLinkRegEx(), trim($input))) {
return '<a href="' . trim($input) . '" target="_blank" rel="noopener noreferrer me">' . trim($input) . '</a>';
}
return '';
}
}

View file

@ -21,13 +21,18 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\Content\Conversation;
use Friendica\Content\Nav;
use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\ACL;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Post;
@ -36,150 +41,176 @@ use Friendica\Model\Profile as ProfileModel;
use Friendica\Model\User;
use Friendica\Model\Verb;
use Friendica\Module\BaseProfile;
use Friendica\Module\Response;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Security\Security;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Friendica\Util\XML;
use Psr\Log\LoggerInterface;
class Status extends BaseProfile
{
/** @var App */
private $app;
/** @var App\Page */
private $page;
/** @var DateTimeFormat */
private $dateTimeFormat;
/** @var IManageConfigValues */
private $config;
/** @var IHandleUserSessions */
private $session;
/** @var Conversation */
private $conversation;
/** @var IManagePersonalConfigValues */
private $pConfig;
/** @var App\Mode */
private $mode;
public function __construct(App\Mode $mode, IManagePersonalConfigValues $pConfig, Conversation $conversation, IHandleUserSessions $session, IManageConfigValues $config, DateTimeFormat $dateTimeFormat, App\Page $page, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->app = $app;
$this->page = $page;
$this->dateTimeFormat = $dateTimeFormat;
$this->config = $config;
$this->session = $session;
$this->conversation = $conversation;
$this->pConfig = $pConfig;
$this->mode = $mode;
}
protected function content(array $request = []): string
{
$args = DI::args();
$a = DI::app();
$profile = ProfileModel::load($a, $this->parameters['nickname']);
$profile = ProfileModel::load($this->app, $this->parameters['nickname'] ?? '');
if (empty($profile)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
throw new HTTPException\NotFoundException($this->t('User not found.'));
}
if ($this->config->get('system', 'block_public') && !$this->session->isAuthenticated()) {
return Login::form();
}
if (!empty($profile['hidewall']) && !$this->session->isAuthenticated()) {
$this->baseUrl->redirect('profile/' . $profile['nickname'] . '/restricted');
}
if (!$profile['net-publish']) {
DI::page()['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
$this->page['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
}
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . $this->parameters['nickname'] . '" title="DFRN: ' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/" title="' . DI::l10n()->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/comments" title="' . DI::l10n()->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
DI::page()['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . $this->parameters['nickname'] . '/activity" title="' . DI::l10n()->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$this->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/dfrn_poll/' . $this->parameters['nickname'] . '" title="DFRN: ' . $this->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$this->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $this->parameters['nickname'] . '/" title="' . $this->t('%s\'s posts', $profile['name']) . '"/>' . "\n";
$this->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $this->parameters['nickname'] . '/comments" title="' . $this->t('%s\'s comments', $profile['name']) . '"/>' . "\n";
$this->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $this->parameters['nickname'] . '/activity" title="' . $this->t('%s\'s timeline', $profile['name']) . '"/>' . "\n";
$category = $datequery = $datequery2 = '';
$dtFormat = DI::dtFormat();
if ($args->getArgc() > 3) {
for ($x = 3; $x < $args->getArgc(); $x++) {
if ($dtFormat->isYearMonthDay($args->get($x))) {
if ($this->args->getArgc() > 3) {
for ($x = 3; $x < $this->args->getArgc(); $x++) {
if ($this->dateTimeFormat->isYearMonthDay($this->args->get($x))) {
if ($datequery) {
$datequery2 = Strings::escapeHtml($args->get($x));
$datequery2 = $this->args->get($x);
} else {
$datequery = Strings::escapeHtml($args->get($x));
$datequery = $this->args->get($x);
}
} else {
$category = $args->get($x);
$category = $this->args->get($x);
}
}
}
if (empty($category)) {
$category = $_GET['category'] ?? '';
$category = $request['category'] ?? '';
}
$hashtags = $_GET['tag'] ?? '';
if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($profile['uid'])) {
return Login::form();
}
$hashtags = $request['tag'] ?? '';
$o = '';
if ($profile['uid'] == DI::userSession()->getLocalUserId()) {
if ($profile['uid'] == $this->session->getLocalUserId()) {
Nav::setSelected('home');
}
$remote_contact = DI::userSession()->getRemoteContactID($profile['uid']);
$is_owner = DI::userSession()->getLocalUserId() == $profile['uid'];
$last_updated_key = "profile:" . $profile['uid'] . ":" . DI::userSession()->getLocalUserId() . ":" . $remote_contact;
if (!empty($profile['hidewall']) && !DI::userSession()->isAuthenticated()) {
$this->baseUrl->redirect('profile/' . $profile['nickname'] . '/restricted');
}
$remote_contact = $this->session->getRemoteContactID($profile['uid']);
$is_owner = $this->session->getLocalUserId() == $profile['uid'];
$last_updated_key = "profile:" . $profile['uid'] . ":" . $this->session->getLocalUserId() . ":" . $remote_contact;
$o .= self::getTabsHTML('status', $is_owner, $profile['nickname'], $profile['hide-friends']);
$o .= Widget::commonFriendsVisitor($profile['uid'], $profile['nickname']);
$commpage = $profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
$commpage = $profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
$commvisitor = $commpage && $remote_contact;
DI::page()['aside'] .= Widget::postedByYear(DI::baseUrl() . '/profile/' . $profile['nickname'] . '/status', $profile['profile_uid'] ?? 0, true);
DI::page()['aside'] .= Widget::categories($profile['uid'], DI::baseUrl() . '/profile/' . $profile['nickname'] . '/status', $category);
DI::page()['aside'] .= Widget::tagCloud($profile['uid']);
$this->page['aside'] .= Widget::postedByYear($this->baseUrl . '/profile/' . $profile['nickname'] . '/status', $profile['profile_uid'] ?? 0, true);
$this->page['aside'] .= Widget::categories($profile['uid'], $this->baseUrl . '/profile/' . $profile['nickname'] . '/status', $category);
$this->page['aside'] .= Widget::tagCloud($profile['uid']);
if (Security::canWriteToUserWall($profile['uid'])) {
$x = [
'is_owner' => $is_owner,
'allow_location' => ($is_owner || $commvisitor) && $profile['allow_location'],
'is_owner' => $is_owner,
'allow_location' => ($is_owner || $commvisitor) && $profile['allow_location'],
'default_location' => $is_owner ? $profile['default-location'] : '',
'nickname' => $profile['nickname'],
'acl' => $is_owner ? ACL::getFullSelectorHTML(DI::page(), $a->getLoggedInUserId(), true) : '',
'visitor' => $is_owner || $commvisitor ? 'block' : 'none',
'profile_uid' => $profile['uid'],
'nickname' => $profile['nickname'],
'acl' => $is_owner ? ACL::getFullSelectorHTML($this->page, $this->app->getLoggedInUserId(), true) : '',
'visitor' => $is_owner || $commvisitor ? 'block' : 'none',
'profile_uid' => $profile['uid'],
];
$o .= DI::conversation()->statusEditor($x);
$o .= $this->conversation->statusEditor($x);
}
// Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
$condition = Item::getPermissionsConditionArrayByUserId($profile['uid']);
$last_updated_array = DI::session()->get('last_updated', []);
$last_updated_array = $this->session->get('last_updated', []);
if (!empty($category)) {
$condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `category-view` WHERE `name` = ? AND `type` = ? AND `uid` = ?)",
$category, Category::CATEGORY, $profile['uid']]);
$category, Category::CATEGORY, $profile['uid']]);
}
if (!empty($hashtags)) {
$condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `tag-search-view` WHERE `name` = ? AND `uid` = ?)",
$hashtags, $profile['uid']]);
$hashtags, $profile['uid']]);
}
if (!empty($datequery)) {
$condition = DBA::mergeConditions($condition, ["`received` <= ?", DateTimeFormat::convert($datequery, 'UTC', $a->getTimeZone())]);
$condition = DBA::mergeConditions($condition, ["`received` <= ?", DateTimeFormat::convert($datequery, 'UTC', $this->app->getTimeZone())]);
}
if (!empty($datequery2)) {
$condition = DBA::mergeConditions($condition, ["`received` >= ?", DateTimeFormat::convert($datequery2, 'UTC', $a->getTimeZone())]);
$condition = DBA::mergeConditions($condition, ["`received` >= ?", DateTimeFormat::convert($datequery2, 'UTC', $this->app->getTimeZone())]);
}
// Does the profile page belong to a forum?
// If not then we can improve the performance with an additional condition
$condition2 = ['uid' => $profile['uid'], 'account-type' => User::ACCOUNT_TYPE_COMMUNITY];
if (!DBA::exists('user', $condition2)) {
if ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY) {
$condition = DBA::mergeConditions($condition, ['contact-id' => $profile['id']]);
}
if (DI::mode()->isMobile()) {
$itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
DI::config()->get('system', 'itemspage_network_mobile'));
if ($this->mode->isMobile()) {
$itemspage_network = $this->pConfig->get($this->session->getLocalUserId(), 'system', 'itemspage_mobile_network',
$this->config->get('system', 'itemspage_network_mobile'));
} else {
$itemspage_network = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network',
DI::config()->get('system', 'itemspage_network'));
$itemspage_network = $this->pConfig->get($this->session->getLocalUserId(), 'system', 'itemspage_network',
$this->config->get('system', 'itemspage_network'));
}
$condition = DBA::mergeConditions($condition, ["((`gravity` = ? AND `wall`) OR
(`gravity` = ? AND `vid` = ? AND `origin`
AND EXISTS(SELECT `uri-id` FROM `post` WHERE `uri-id` = `post-user-view`.`thr-parent-id` AND `gravity` = ? AND `network` IN (?, ?))))",
Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB, Protocol::DFRN]);
Item::GRAVITY_PARENT, Item::GRAVITY_ACTIVITY, Verb::getID(Activity::ANNOUNCE), Item::GRAVITY_PARENT, Protocol::ACTIVITYPUB, Protocol::DFRN]);
$condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED,
'visible' => true, 'deleted' => false]);
$condition = DBA::mergeConditions($condition, ['uid' => $profile['uid'], 'network' => Protocol::FEDERATED,
'visible' => true, 'deleted' => false]);
$pager = new Pager(DI::l10n(), $args->getQueryString(), $itemspage_network);
$pager = new Pager($this->l10n, $this->args->getQueryString(), $itemspage_network);
$params = ['limit' => [$pager->getStart(), $pager->getItemsPerPage()], 'order' => ['received' => true]];
$items_stmt = Post::select(['uri-id', 'thr-parent-id', 'gravity', 'author-id', 'received'], $condition, $params);
@ -187,29 +218,29 @@ class Status extends BaseProfile
// Set a time stamp for this page. We will make use of it when we
// search for new items (update routine)
$last_updated_array[$last_updated_key] = time();
DI::session()->set('last_updated', $last_updated_array);
$this->session->set('last_updated', $last_updated_array);
if ($is_owner && !DI::config()->get('theme', 'hide_eventlist')) {
if ($is_owner && !$this->config->get('theme', 'hide_eventlist')) {
$o .= ProfileModel::getBirthdays();
$o .= ProfileModel::getEventsReminderHTML();
}
if ($is_owner) {
$unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
$unseen = Post::exists(['wall' => true, 'unseen' => true, 'uid' => $this->session->getLocalUserId()]);
if ($unseen) {
Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => DI::userSession()->getLocalUserId()]);
Item::update(['unseen' => false], ['wall' => true, 'unseen' => true, 'uid' => $this->session->getLocalUserId()]);
}
}
$items = Post::toArray($items_stmt);
if ($pager->getStart() == 0 && !empty($profile['uid'])) {
$pcid = Contact::getPublicIdByUserId($profile['uid']);
$pcid = Contact::getPublicIdByUserId($profile['uid']);
$pinned = Post\Collection::selectToArrayForContact($pcid, Post\Collection::FEATURED);
$items = array_merge($items, $pinned);
$items = array_merge($items, $pinned);
}
$o .= DI::conversation()->create($items, 'profile', false, false, 'pinned_received', $profile['uid']);
$o .= $this->conversation->create($items, 'profile', false, false, 'pinned_received', $profile['uid']);
$o .= $pager->renderMinimal(count($items));

View file

@ -21,44 +21,71 @@
namespace Friendica\Module\Settings;
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Theme;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\BaseSettings;
use Friendica\Module\Response;
use Friendica\Navigation\SystemMessages;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
/**
* Module to update user settings
*/
class Display extends BaseSettings
{
/** @var IManageConfigValues */
private $config;
/** @var IManagePersonalConfigValues */
private $pConfig;
/** @var App */
private $app;
/** @var SystemMessages */
private $systemMessages;
public function __construct(SystemMessages $systemMessages, App $app, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{
parent::__construct($session, $page, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config;
$this->pConfig = $pConfig;
$this->app = $app;
$this->systemMessages = $systemMessages;
}
protected function post(array $request = [])
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
$uid = $this->session->getLocalUserId();
if (!$uid) {
throw new HTTPException\ForbiddenException($this->t('Permission denied.'));
}
self::checkFormSecurityTokenRedirectOnError('/settings/display', 'settings_display');
$user = User::getById(DI::userSession()->getLocalUserId());
$user = User::getById($uid);
$theme = !empty($_POST['theme']) ? trim($_POST['theme']) : $user['theme'];
$mobile_theme = !empty($_POST['mobile_theme']) ? trim($_POST['mobile_theme']) : '';
$enable_smile = !empty($_POST['enable_smile']) ? intval($_POST['enable_smile']) : 0;
$first_day_of_week = !empty($_POST['first_day_of_week']) ? intval($_POST['first_day_of_week']) : 0;
$infinite_scroll = !empty($_POST['infinite_scroll']) ? intval($_POST['infinite_scroll']) : 0;
$no_auto_update = !empty($_POST['no_auto_update']) ? intval($_POST['no_auto_update']) : 0;
$enable_smart_threading = !empty($_POST['enable_smart_threading']) ? intval($_POST['enable_smart_threading']) : 0;
$enable_dislike = !empty($_POST['enable_dislike']) ? intval($_POST['enable_dislike']) : 0;
$display_resharer = !empty($_POST['display_resharer']) ? intval($_POST['display_resharer']) : 0;
$stay_local = !empty($_POST['stay_local']) ? intval($_POST['stay_local']) : 0;
$preview_mode = !empty($_POST['preview_mode']) ? intval($_POST['preview_mode']) : 0;
$browser_update = !empty($_POST['browser_update']) ? intval($_POST['browser_update']) : 0;
$theme = !empty($request['theme']) ? trim($request['theme']) : $user['theme'];
$mobile_theme = !empty($request['mobile_theme']) ? trim($request['mobile_theme']) : '';
$enable_smile = !empty($request['enable_smile']) ? intval($request['enable_smile']) : 0;
$first_day_of_week = !empty($request['first_day_of_week']) ? intval($request['first_day_of_week']) : 0;
$calendar_default_view = !empty($request['calendar_default_view']) ? trim($request['calendar_default_view']) : 'month';
$infinite_scroll = !empty($request['infinite_scroll']) ? intval($request['infinite_scroll']) : 0;
$no_auto_update = !empty($request['no_auto_update']) ? intval($request['no_auto_update']) : 0;
$enable_smart_threading = !empty($request['enable_smart_threading']) ? intval($request['enable_smart_threading']) : 0;
$enable_dislike = !empty($request['enable_dislike']) ? intval($request['enable_dislike']) : 0;
$display_resharer = !empty($request['display_resharer']) ? intval($request['display_resharer']) : 0;
$stay_local = !empty($request['stay_local']) ? intval($request['stay_local']) : 0;
$preview_mode = !empty($request['preview_mode']) ? intval($request['preview_mode']) : 0;
$browser_update = !empty($request['browser_update']) ? intval($request['browser_update']) : 0;
if ($browser_update != -1) {
$browser_update = $browser_update * 1000;
if ($browser_update < 10000) {
@ -66,89 +93,92 @@ class Display extends BaseSettings
}
}
$itemspage_network = !empty($_POST['itemspage_network']) ?
intval($_POST['itemspage_network']) :
DI::config()->get('system', 'itemspage_network');
$itemspage_network = !empty($request['itemspage_network']) ?
intval($request['itemspage_network']) :
$this->config->get('system', 'itemspage_network');
if ($itemspage_network > 100) {
$itemspage_network = 100;
}
$itemspage_mobile_network = !empty($_POST['itemspage_mobile_network']) ?
intval($_POST['itemspage_mobile_network']) :
DI::config()->get('system', 'itemspage_network_mobile');
$itemspage_mobile_network = !empty($request['itemspage_mobile_network']) ?
intval($request['itemspage_mobile_network']) :
$this->config->get('system', 'itemspage_network_mobile');
if ($itemspage_mobile_network > 100) {
$itemspage_mobile_network = 100;
}
if ($mobile_theme !== '') {
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'mobile_theme', $mobile_theme);
$this->pConfig->set($uid, 'system', 'mobile_theme', $mobile_theme);
}
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network' , $itemspage_network);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'update_interval' , $browser_update);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update' , $no_auto_update);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_smilies' , !$enable_smile);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll' , $infinite_scroll);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'no_smart_threading' , !$enable_smart_threading);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike' , !$enable_dislike);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'display_resharer' , $display_resharer);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'stay_local' , $stay_local);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week' , $first_day_of_week);
DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'preview_mode' , $preview_mode);
$this->pConfig->set($uid, 'system', 'itemspage_network' , $itemspage_network);
$this->pConfig->set($uid, 'system', 'itemspage_mobile_network', $itemspage_mobile_network);
$this->pConfig->set($uid, 'system', 'update_interval' , $browser_update);
$this->pConfig->set($uid, 'system', 'no_auto_update' , $no_auto_update);
$this->pConfig->set($uid, 'system', 'no_smilies' , !$enable_smile);
$this->pConfig->set($uid, 'system', 'infinite_scroll' , $infinite_scroll);
$this->pConfig->set($uid, 'system', 'no_smart_threading' , !$enable_smart_threading);
$this->pConfig->set($uid, 'system', 'hide_dislike' , !$enable_dislike);
$this->pConfig->set($uid, 'system', 'display_resharer' , $display_resharer);
$this->pConfig->set($uid, 'system', 'stay_local' , $stay_local);
$this->pConfig->set($uid, 'system', 'preview_mode' , $preview_mode);
$this->pConfig->set($uid, 'calendar', 'first_day_of_week' , $first_day_of_week);
$this->pConfig->set($uid, 'calendar', 'default_view' , $calendar_default_view);
if (in_array($theme, Theme::getAllowedList())) {
if ($theme == $user['theme']) {
// call theme_post only if theme has not been changed
if (($themeconfigfile = Theme::getConfigFile($theme)) !== null) {
if ($themeconfigfile = Theme::getConfigFile($theme)) {
require_once $themeconfigfile;
theme_post(DI::app());
theme_post($this->app);
}
} else {
DBA::update('user', ['theme' => $theme], ['uid' => DI::userSession()->getLocalUserId()]);
User::update(['theme' => $theme], $uid);
}
} else {
DI::sysmsg()->addNotice(DI::l10n()->t('The theme you chose isn\'t available.'));
$this->systemMessages->addNotice($this->t('The theme you chose isn\'t available.'));
}
Hook::callAll('display_settings_post', $_POST);
Hook::callAll('display_settings_post', $request);
DI::baseUrl()->redirect('settings/display');
$this->baseUrl->redirect('settings/display');
}
protected function content(array $request = []): string
{
parent::content();
if (!DI::userSession()->getLocalUserId()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
$uid = $this->session->getLocalUserId();
if (!$uid) {
throw new HTTPException\ForbiddenException($this->t('Permission denied.'));
}
$default_theme = DI::config()->get('system', 'theme');
$default_theme = $this->config->get('system', 'theme');
if (!$default_theme) {
$default_theme = 'default';
}
$default_mobile_theme = DI::config()->get('system', 'mobile-theme');
$default_mobile_theme = $this->config->get('system', 'mobile-theme');
if (!$default_mobile_theme) {
$default_mobile_theme = 'none';
}
$user = User::getById(DI::userSession()->getLocalUserId());
$user = User::getById($uid);
$allowed_themes = Theme::getAllowedList();
$themes = [];
$mobile_themes = ["---" => DI::l10n()->t('No special theme for mobile devices')];
$mobile_themes = ['---' => $this->t('No special theme for mobile devices')];
foreach ($allowed_themes as $theme) {
$is_experimental = file_exists('view/theme/' . $theme . '/experimental');
$is_unsupported = file_exists('view/theme/' . $theme . '/unsupported');
$is_mobile = file_exists('view/theme/' . $theme . '/mobile');
if (!$is_experimental || (DI::config()->get('experimentals', 'exp_themes') || is_null(DI::config()->get('experimentals', 'exp_themes')))) {
if (!$is_experimental || $this->config->get('experimental', 'exp_themes')) {
$theme_name = ucfirst($theme);
if ($is_unsupported) {
$theme_name = DI::l10n()->t('%s - (Unsupported)', $theme_name);
$theme_name = $this->t('%s - (Unsupported)', $theme_name);
} elseif ($is_experimental) {
$theme_name = DI::l10n()->t('%s - (Experimental)', $theme_name);
$theme_name = $this->t('%s - (Experimental)', $theme_name);
}
if ($is_mobile) {
@ -160,84 +190,92 @@ class Display extends BaseSettings
}
$theme_selected = $user['theme'] ?: $default_theme;
$mobile_theme_selected = DI::session()->get('mobile-theme', $default_mobile_theme);
$mobile_theme_selected = $this->session->get('mobile-theme', $default_mobile_theme);
$itemspage_network = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_network'));
$itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : DI::config()->get('system', 'itemspage_network'));
$itemspage_mobile_network = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network'));
$itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : DI::config()->get('system', 'itemspage_network_mobile'));
$itemspage_network = intval($this->pConfig->get($uid, 'system', 'itemspage_network'));
$itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : $this->config->get('system', 'itemspage_network'));
$itemspage_mobile_network = intval($this->pConfig->get($uid, 'system', 'itemspage_mobile_network'));
$itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : $this->config->get('system', 'itemspage_network_mobile'));
$browser_update = intval(DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'update_interval'));
if (intval($browser_update) != -1) {
$browser_update = intval($this->pConfig->get($uid, 'system', 'update_interval'));
if ($browser_update != -1) {
$browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
}
$no_auto_update = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_auto_update', 0);
$enable_smile = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_smilies', 0);
$infinite_scroll = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'infinite_scroll', 0);
$enable_smart_threading = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'no_smart_threading', 0);
$enable_dislike = !DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'hide_dislike', 0);
$display_resharer = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'display_resharer', 0);
$stay_local = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local', 0);
$preview_mode = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'preview_mode', BBCode::PREVIEW_LARGE);
$no_auto_update = $this->pConfig->get($uid, 'system', 'no_auto_update', 0);
$enable_smile = !$this->pConfig->get($uid, 'system', 'no_smilies', 0);
$infinite_scroll = $this->pConfig->get($uid, 'system', 'infinite_scroll', 0);
$enable_smart_threading = !$this->pConfig->get($uid, 'system', 'no_smart_threading', 0);
$enable_dislike = !$this->pConfig->get($uid, 'system', 'hide_dislike', 0);
$display_resharer = $this->pConfig->get($uid, 'system', 'display_resharer', 0);
$stay_local = $this->pConfig->get($uid, 'system', 'stay_local', 0);
$first_day_of_week = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'first_day_of_week', 0);
$weekdays = [
0 => DI::l10n()->t("Sunday"),
1 => DI::l10n()->t("Monday"),
2 => DI::l10n()->t("Tuesday"),
3 => DI::l10n()->t("Wednesday"),
4 => DI::l10n()->t("Thursday"),
5 => DI::l10n()->t("Friday"),
6 => DI::l10n()->t("Saturday")
$preview_mode = $this->pConfig->get($uid, 'system', 'preview_mode', BBCode::PREVIEW_LARGE);
$preview_modes = [
BBCode::PREVIEW_NONE => $this->t('No preview'),
BBCode::PREVIEW_NO_IMAGE => $this->t('No image'),
BBCode::PREVIEW_SMALL => $this->t('Small Image'),
BBCode::PREVIEW_LARGE => $this->t('Large Image'),
];
$preview_modes = [
BBCode::PREVIEW_NONE => DI::l10n()->t('No preview'),
BBCode::PREVIEW_NO_IMAGE => DI::l10n()->t('No image'),
BBCode::PREVIEW_SMALL => DI::l10n()->t('Small Image'),
BBCode::PREVIEW_LARGE => DI::l10n()->t('Large Image'),
$first_day_of_week = $this->pConfig->get($uid, 'system', 'first_day_of_week', 0);
$weekdays = [
0 => $this->t('Sunday'),
1 => $this->t('Monday'),
2 => $this->t('Tuesday'),
3 => $this->t('Wednesday'),
4 => $this->t('Thursday'),
5 => $this->t('Friday'),
6 => $this->t('Saturday')
];
$calendar_default_view = $this->pConfig->get($uid, 'calendar', 'default_view', 'month');
$calendarViews = [
'month' => $this->t('month'),
'agendaWeek' => $this->t('week'),
'agendaDay' => $this->t('day'),
'listMonth' => $this->t('list')
];
$theme_config = '';
if ($themeconfigfile = Theme::getConfigFile($theme_selected)) {
require_once $themeconfigfile;
$theme_config = theme_content(DI::app());
$theme_config = theme_content($this->app);
}
$tpl = Renderer::getMarkupTemplate('settings/display.tpl');
$o = Renderer::replaceMacros($tpl, [
'$ptitle' => DI::l10n()->t('Display Settings'),
'$submit' => DI::l10n()->t('Save Settings'),
'$d_tset' => DI::l10n()->t('General Theme Settings'),
'$d_ctset' => DI::l10n()->t('Custom Theme Settings'),
'$d_cset' => DI::l10n()->t('Content Settings'),
'$stitle' => DI::l10n()->t('Theme settings'),
'$calendar_title' => DI::l10n()->t('Calendar'),
return Renderer::replaceMacros($tpl, [
'$ptitle' => $this->t('Display Settings'),
'$submit' => $this->t('Save Settings'),
'$d_tset' => $this->t('General Theme Settings'),
'$d_ctset' => $this->t('Custom Theme Settings'),
'$d_cset' => $this->t('Content Settings'),
'$stitle' => $this->t('Theme settings'),
'$calendar_title' => $this->t('Calendar'),
'$form_security_token' => self::getFormSecurityToken('settings_display'),
'$baseurl' => DI::baseUrl()->get(true),
'$uid' => DI::userSession()->getLocalUserId(),
'$baseurl' => $this->baseUrl->get(true),
'$uid' => $uid,
'$theme' => ['theme', DI::l10n()->t('Display Theme:'), $theme_selected, '', $themes, true],
'$mobile_theme' => ['mobile_theme', DI::l10n()->t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
'$theme' => ['theme', $this->t('Display Theme:'), $theme_selected, '', $themes, true],
'$mobile_theme' => ['mobile_theme', $this->t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
'$theme_config' => $theme_config,
'$itemspage_network' => ['itemspage_network' , DI::l10n()->t('Number of items to display per page:'), $itemspage_network, DI::l10n()->t('Maximum of 100 items')],
'$itemspage_mobile_network' => ['itemspage_mobile_network', DI::l10n()->t('Number of items to display per page when viewed from mobile device:'), $itemspage_mobile_network, DI::l10n()->t('Maximum of 100 items')],
'$ajaxint' => ['browser_update' , DI::l10n()->t('Update browser every xx seconds'), $browser_update, DI::l10n()->t('Minimum of 10 seconds. Enter -1 to disable it.')],
'$no_auto_update' => ['no_auto_update' , DI::l10n()->t('Automatic updates only at the top of the post stream pages'), $no_auto_update, DI::l10n()->t('Auto update may add new posts at the top of the post stream pages, which can affect the scroll position and perturb normal reading if it happens anywhere else the top of the page.')],
'$enable_smile' => ['enable_smile' , DI::l10n()->t('Display emoticons'), $enable_smile, DI::l10n()->t('When enabled, emoticons are replaced with matching symbols.')],
'$infinite_scroll' => ['infinite_scroll' , DI::l10n()->t('Infinite scroll'), $infinite_scroll, DI::l10n()->t('Automatic fetch new items when reaching the page end.')],
'$enable_smart_threading' => ['enable_smart_threading' , DI::l10n()->t('Enable Smart Threading'), $enable_smart_threading, DI::l10n()->t('Enable the automatic suppression of extraneous thread indentation.')],
'$enable_dislike' => ['enable_dislike' , DI::l10n()->t('Display the Dislike feature'), $enable_dislike, DI::l10n()->t('Display the Dislike button and dislike reactions on posts and comments.')],
'$display_resharer' => ['display_resharer' , DI::l10n()->t('Display the resharer'), $display_resharer, DI::l10n()->t('Display the first resharer as icon and text on a reshared item.')],
'$stay_local' => ['stay_local' , DI::l10n()->t('Stay local'), $stay_local, DI::l10n()->t("Don't go to a remote system when following a contact link.")],
'$preview_mode' => ['preview_mode' , DI::l10n()->t('Link preview mode'), $preview_mode, 'Appearance of the link preview that is added to each post with a link.', $preview_modes, false],
'$itemspage_network' => ['itemspage_network' , $this->t('Number of items to display per page:'), $itemspage_network, $this->t('Maximum of 100 items')],
'$itemspage_mobile_network' => ['itemspage_mobile_network', $this->t('Number of items to display per page when viewed from mobile device:'), $itemspage_mobile_network, $this->t('Maximum of 100 items')],
'$ajaxint' => ['browser_update' , $this->t('Update browser every xx seconds'), $browser_update, $this->t('Minimum of 10 seconds. Enter -1 to disable it.')],
'$no_auto_update' => ['no_auto_update' , $this->t('Automatic updates only at the top of the post stream pages'), $no_auto_update, $this->t('Auto update may add new posts at the top of the post stream pages, which can affect the scroll position and perturb normal reading if it happens anywhere else the top of the page.')],
'$enable_smile' => ['enable_smile' , $this->t('Display emoticons'), $enable_smile, $this->t('When enabled, emoticons are replaced with matching symbols.')],
'$infinite_scroll' => ['infinite_scroll' , $this->t('Infinite scroll'), $infinite_scroll, $this->t('Automatic fetch new items when reaching the page end.')],
'$enable_smart_threading' => ['enable_smart_threading' , $this->t('Enable Smart Threading'), $enable_smart_threading, $this->t('Enable the automatic suppression of extraneous thread indentation.')],
'$enable_dislike' => ['enable_dislike' , $this->t('Display the Dislike feature'), $enable_dislike, $this->t('Display the Dislike button and dislike reactions on posts and comments.')],
'$display_resharer' => ['display_resharer' , $this->t('Display the resharer'), $display_resharer, $this->t('Display the first resharer as icon and text on a reshared item.')],
'$stay_local' => ['stay_local' , $this->t('Stay local'), $stay_local, $this->t("Don't go to a remote system when following a contact link.")],
'$preview_mode' => ['preview_mode' , $this->t('Link preview mode'), $preview_mode, $this->t('Appearance of the link preview that is added to each post with a link.'), $preview_modes, false],
'$first_day_of_week' => ['first_day_of_week', DI::l10n()->t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
'$first_day_of_week' => ['first_day_of_week' , $this->t('Beginning of week:') , $first_day_of_week , '', $weekdays , false],
'$calendar_default_view' => ['calendar_default_view', $this->t('Default calendar view:'), $calendar_default_view, '', $calendarViews, false],
]);
return $o;
}
}

View file

@ -262,7 +262,7 @@ class Index extends BaseSettings
<p>Reorder by dragging the field title.</p>
<p>Empty the label field to remove a custom field.</p>
<p>Non-public fields can only be seen by the selected Friendica contacts or the Friendica contacts in the selected groups.</p>",
'profile/' . $profile['nickname']
'profile/' . $profile['nickname'] . '/profile'
),
'$custom_fields' => $custom_fields,
]);

View file

@ -83,13 +83,15 @@ class Tos extends BaseModule
$tpl = Renderer::getMarkupTemplate('tos.tpl');
if ($this->config->get('system', 'tosdisplay')) {
$lines = $this->config->get('system', 'tosrules');
if (!empty($lines)) {
$rules = "[list=1]";
$lines = trim($this->config->get('system', 'tosrules') ?: '');
if ($lines) {
$rules = "[ol]";
foreach (explode("\n", $lines) as $line) {
$rules .= "\n[*]" . $line;
if (trim($line)) {
$rules .= "\n[*]" . trim($line);
}
}
$rules .= "\n[/list]\n";
$rules .= "\n[/ol]\n";
} else {
$rules = '';
}

View file

@ -59,9 +59,9 @@ class Display extends DisplayModule
$parentUriId = $item['parent-uri-id'];
if (empty($force)) {
$browserUpdate = $this->pConfig->get($profileUid, 'system', 'update_interval');
if (!empty($browserUpdate)) {
$updateDate = date(DateTimeFormat::MYSQL, time() - (intval($browserUpdate) / 500));
$browserUpdate = intval($this->pConfig->get($profileUid, 'system', 'update_interval') ?? 40000);
if ($browserUpdate >= 1000) {
$updateDate = date(DateTimeFormat::MYSQL, time() - ($browserUpdate * 2 / 1000));
if (!Post::exists([
"`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?",
$parentUriId, 0,

View file

@ -139,8 +139,17 @@ class Probe
foreach ([Protocol::DIASPORA, Protocol::OSTATUS] as $network) {
if (!empty($data['networks'][$network])) {
$data['networks'][$network]['subscribe'] = $newdata['subscribe'] ?? '';
$data['networks'][$network]['baseurl'] = $newdata['baseurl'] ?? '';
$data['networks'][$network]['gsid'] = $newdata['gsid'] ?? 0;
if (empty($data['networks'][$network]['baseurl'])) {
$data['networks'][$network]['baseurl'] = $newdata['baseurl'] ?? '';
} else {
$newdata['baseurl'] = $data['networks'][$network]['baseurl'];
}
if (!empty($newdata['baseurl'])) {
$newdata['gsid'] = $data['networks'][$network]['gsid'] = GServer::getID($newdata['baseurl']);
} else {
$newdata['gsid'] = $data['networks'][$network]['gsid'] = null;
}
$newdata['networks'][$network] = self::rearrangeData($data['networks'][$network]);
unset($newdata['networks'][$network]['networks']);
}

View file

@ -37,14 +37,12 @@ class FollowRequest extends Account
*
* @param BaseURL $baseUrl
* @param int $introduction_id Introduction record id
* @param array $publicContact Full contact table record with uid = 0
* @param array $apcontact Optional full apcontact table record
* @param array $userContact Optional full contact table record with uid != 0
* @param array $account entry of "account-user-view"
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function __construct(BaseURL $baseUrl, int $introduction_id, array $publicContact, array $apcontact = [], array $userContact = [])
public function __construct(BaseURL $baseUrl, int $introduction_id, array $account)
{
parent::__construct($baseUrl, $publicContact, new Fields(), $apcontact, $userContact);
parent::__construct($baseUrl, $account, new Fields());
$this->id = $introduction_id;
}

View file

@ -114,7 +114,7 @@ class Status extends BaseDataTransferObject
$visibility = ['public', 'private', 'unlisted'];
$this->visibility = $visibility[$item['private']];
$languages = json_decode($item['language'], true);
$languages = json_decode($item['language'] ?? '', true);
if (is_array($languages)) {
reset($languages);
$this->language = key($languages);

View file

@ -66,6 +66,7 @@ class Image
$this->type = $type;
if ($this->isImagick() && (empty($data) || $this->loadData($data))) {
$this->valid = !empty($data);
return;
} else {
// Failed to load with Imagick, fallback
@ -158,12 +159,11 @@ class Image
$this->image->setCompressionQuality($quality);
}
// The 'width' and 'height' properties are only used by non-Imagick routines.
$this->width = $this->image->getImageWidth();
$this->height = $this->image->getImageHeight();
$this->valid = true;
$this->valid = !empty($this->image);
return true;
return $this->valid;
}
$this->valid = false;
@ -210,9 +210,6 @@ class Image
return false;
}
if ($this->isImagick()) {
return $this->image->getImageWidth();
}
return $this->width;
}
@ -225,9 +222,6 @@ class Image
return false;
}
if ($this->isImagick()) {
return $this->image->getImageHeight();
}
return $this->height;
}
@ -353,6 +347,9 @@ class Image
do {
$this->image->rotateImage(new ImagickPixel(), -$degrees); // ImageMagick rotates in the opposite direction of imagerotate()
} while ($this->image->nextImage());
$this->width = $this->image->getImageWidth();
$this->height = $this->image->getImageHeight();
return;
}
@ -576,7 +573,6 @@ class Image
}
} while ($this->image->nextImage());
// These may not be necessary anymore
$this->width = $this->image->getImageWidth();
$this->height = $this->image->getImageHeight();
} else {
@ -659,7 +655,7 @@ class Image
if ($this->image) {
imagedestroy($this->image);
}
$this->image = $dest;
$this->image = $dest;
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
@ -734,7 +730,7 @@ class Image
public function getBlurHash(): string
{
$image = New Image($this->asString());
if (empty($image)) {
if (empty($image) || !$this->isValid()) {
return '';
}
@ -809,12 +805,14 @@ class Image
if ($this->isImagick()) {
$this->image->drawImage($draw);
$this->width = $this->image->getImageWidth();
$this->height = $this->image->getImageHeight();
} else {
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
}
$this->valid = true;
$this->valid = !empty($this->image);
$this->scaleUp(min($width, $height));
}

View file

@ -1477,28 +1477,28 @@ class Transmitter
*/
private static function removePictures(string $body): string
{
// Simplify image codes
$body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
$body = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $body);
return BBCode::performWithEscapedTags($body, ['code', 'noparse', 'nobb', 'pre'], function ($text) {
// Simplify image codes
$text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $text);
$text = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/ism", '[img]$1[/img]', $text);
// Now remove local links
$body = preg_replace_callback(
'/\[url=([^\[\]]*)\]\[img\](.*)\[\/img\]\[\/url\]/Usi',
function ($match) {
// We remove the link when it is a link to a local photo page
if (Photo::isLocalPage($match[1])) {
return '';
}
// otherwise we just return the link
return '[url]' . $match[1] . '[/url]';
},
$body
);
// Now remove local links
$text = preg_replace_callback(
'/\[url=([^\[\]]*)\]\[img\](.*)\[\/img\]\[\/url\]/Usi',
function ($match) {
// We remove the link when it is a link to a local photo page
if (Photo::isLocalPage($match[1])) {
return '';
}
// otherwise we just return the link
return '[url]' . $match[1] . '[/url]';
},
$text
);
// Remove all pictures
$body = preg_replace("/\[img\]([^\[\]]*)\[\/img\]/Usi", '', $body);
return $body;
// Remove all pictures
return preg_replace("/\[img\]([^\[\]]*)\[\/img\]/Usi", '', $text);
});
}
/**

View file

@ -499,7 +499,7 @@ class Diaspora
}
if (!($fields = self::validPosting($msg))) {
Logger::warning('Invalid posting', ['msg' => $msg]);
Logger::notice('Invalid posting', ['msg' => $msg]);
return false;
}

View file

@ -140,7 +140,7 @@ class JsonLD
* @return array Compacted JSON array
* @throws Exception
*/
public static function compact($json, bool $logfailed = true)
public static function compact($json, bool $logfailed = true): array
{
jsonld_set_document_loader('Friendica\Util\JsonLD::documentLoader');
@ -177,6 +177,12 @@ class JsonLD
if (!in_array('https://w3id.org/security/v1', $json['@context'])) {
$json['@context'][] = 'https://w3id.org/security/v1';
}
// Issue 12419: Workaround for GoToSocial
$pos = array_search('http://joinmastodon.org/ns', $json['@context']);
if (is_int($pos)) {
$json['@context'][$pos] = ['toot' => 'http://joinmastodon.org/ns#'];
}
}
// Bookwyrm transmits "id" fields with "null", which isn't allowed.
@ -203,6 +209,11 @@ class JsonLD
$json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);
if ($json === false) {
Logger::notice('JSON encode->decode failed', ['orig_json' => $orig_json, 'compacted' => $compacted]);
$json = [];
}
return $json;
}

View file

@ -380,29 +380,47 @@ class Strings
* Returns the regular expression string to match URLs in a given text
*
* @return string
* @see https://daringfireball.net/2010/07/improved_regex_for_matching_urls
*/
public static function autoLinkRegEx(): string
{
return '@
(?<![=\'\]"/]) # Not preceded by [, =, \', ], ", /
(?<![=\'\]"/]) # Not preceded by [, =, \', ], ", /
\b
( # Capture 1: entire matched URL
https?:// # http or https protocol
( # Capture 1: entire matched URL
' . self::linkRegEx() . '
)@xiu';
}
/**
* Returns the regular expression string to match only an HTTP URL
*
* @return string
*/
public static function onlyLinkRegEx(): string
{
return '@^' . self::linkRegEx() . '$@xiu';
}
/**
* @return string
* @see https://daringfireball.net/2010/07/improved_regex_for_matching_urls
*/
private static function linkRegEx(): string
{
return 'https?:// # http or https protocol
(?:
[^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’.] # Domain can\'t start with a .
[^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’]+ # Domain can\'t end with a .
[^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’.] # Domain can\'t start with a .
[^/\s\xA0`!()\[\]{};:\'",<>?«»“”‘’]+ # Domain can\'t end with a .
\.
[^/\s\xA0`!()\[\]{};:\'".,<>?«»“”‘’]+/? # Followed by a slash
)
(?: # One or more:
[^\s\xA0()<>]+ # Run of non-space, non-()<>
| # or
\(([^\s\xA0()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
| # or
[^\s\xA0`!()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
)*
)@xiu';
(?: # One or more:
[^\s\xA0()<>]+ # Run of non-space, non-()<>
| # or
\(([^\s\xA0()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels
| # or
[^\s\xA0`!()\[\]{};:\'".,<>?«»“”‘’] # not a space or one of these punct chars
)*';
}
/**

View file

@ -30,6 +30,7 @@ use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
use Friendica\Model\Group;
use Friendica\Model\GServer;
use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Model\PushSubscriber;
@ -99,7 +100,7 @@ class Notifier
$uid = $target_id;
$condition = ['uid' => $target_id, 'self' => false, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
$delivery_contacts_stmt = DBA::select('contact', ['id', 'url', 'addr', 'network', 'protocol', 'batch'], $condition);
$delivery_contacts_stmt = DBA::select('contact', ['id', 'url', 'addr', 'network', 'protocol', 'baseurl', 'gsid', 'batch'], $condition);
} else {
$post = Post::selectFirst(['id'], ['uri-id' => $post_uriid, 'uid' => $sender_uid]);
if (!DBA::isResult($post)) {
@ -425,7 +426,7 @@ class Notifier
if (!empty($networks)) {
$condition['network'] = $networks;
}
$delivery_contacts_stmt = DBA::select('contact', ['id', 'addr', 'url', 'network', 'protocol', 'batch'], $condition);
$delivery_contacts_stmt = DBA::select('contact', ['id', 'addr', 'url', 'network', 'protocol', 'baseurl', 'gsid', 'batch'], $condition);
}
$conversants = [];
@ -437,7 +438,7 @@ class Notifier
if ($diaspora_delivery && !$unlisted) {
$batch_delivery = true;
$participants = DBA::selectToArray('contact', ['batch', 'network', 'protocol', 'id', 'url', 'name'],
$participants = DBA::selectToArray('contact', ['batch', 'network', 'protocol', 'baseurl', 'gsid', 'id', 'url', 'name'],
["`network` = ? AND `batch` != '' AND `uid` = ? AND `rel` != ? AND NOT `blocked` AND NOT `pending` AND NOT `archive`", Protocol::DIASPORA, $owner['uid'], Contact::SHARING],
['group_by' => ['batch', 'network', 'protocol']]);
@ -449,7 +450,7 @@ class Notifier
$condition = ['network' => Protocol::DFRN, 'uid' => $owner['uid'], 'blocked' => false,
'pending' => false, 'archive' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]];
$contacts = DBA::selectToArray('contact', ['id', 'url', 'addr', 'name', 'network', 'protocol'], $condition);
$contacts = DBA::selectToArray('contact', ['id', 'url', 'addr', 'name', 'network', 'protocol', 'baseurl', 'gsid'], $condition);
$conversants = array_merge($contacts, $participants);
@ -563,6 +564,11 @@ class Notifier
continue;
}
if (!GServer::reachable($contact)) {
Logger::info('Server is not reachable', ['id' => $post_uriid, 'uid' => $sender_uid, 'contact' => $contact]);
continue;
}
Logger::info('Delivery', ['batch' => $in_batch, 'target' => $post_uriid, 'uid' => $sender_uid, 'guid' => $target_item['guid'] ?? '', 'to' => $contact]);
// Ensure that posts with our own protocol arrives before Diaspora posts arrive.

View file

@ -64,6 +64,10 @@ return [
// Themes users can change to in their settings.
'allowed_themes' => 'frio,vier',
// banner (HTML string)
// HTML snippet of the top navigation banner. Not supported by frio.
'banner' => '<a href="https://friendi.ca"><img id="logo-img" width="32" height="32" src="images/friendica.svg" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>',
// cache_contact_avatar (Boolean)
// Cache versions of the contact avatars. Uses a lot of storage space
'cache_contact_avatar' => true,

View file

@ -1138,4 +1138,10 @@ function update_1497()
{
DBA::e("UPDATE `user` SET `last-activity` = DATE(`login_date`) WHERE `last-activity` IS NULL");
return Update::SUCCESS;
}
}
function update_1502()
{
DBA::e("UPDATE `pconfig` SET `cat` = 'calendar' WHERE `k` = 'first_day_of_week'");
return Update::SUCCESS;
}

View file

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 2022.12-rc\n"
"Project-Id-Version: 2023.03-dev\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-14 21:56-0500\n"
"POT-Creation-Date: 2022-12-17 23:06-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -27,7 +27,7 @@ msgstr ""
#: src/Model/Event.php:522 src/Module/Attach.php:55 src/Module/BaseApi.php:94
#: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52
#: src/Module/Calendar/Event/API.php:88 src/Module/Calendar/Event/Form.php:84
#: src/Module/Calendar/Export.php:62 src/Module/Calendar/Show.php:81
#: src/Module/Calendar/Export.php:62 src/Module/Calendar/Show.php:82
#: src/Module/Contact/Advanced.php:60 src/Module/Contact/Follow.php:86
#: src/Module/Contact/Follow.php:160 src/Module/Contact/MatchInterests.php:86
#: src/Module/Contact/Suggestions.php:54 src/Module/Contact/Unfollow.php:66
@ -47,7 +47,7 @@ msgstr ""
#: src/Module/Register.php:245 src/Module/Search/Directory.php:37
#: src/Module/Settings/Account.php:50 src/Module/Settings/Account.php:407
#: src/Module/Settings/Delegation.php:41 src/Module/Settings/Delegation.php:69
#: src/Module/Settings/Display.php:43 src/Module/Settings/Display.php:123
#: src/Module/Settings/Display.php:69 src/Module/Settings/Display.php:153
#: src/Module/Settings/Profile/Photo/Crop.php:165
#: src/Module/Settings/Profile/Photo/Index.php:111
#: src/Module/Settings/RemoveMe.php:117 src/Module/Settings/UserExport.php:80
@ -245,7 +245,7 @@ msgstr ""
msgid "Discard"
msgstr ""
#: mod/message.php:136 src/Content/Nav.php:282 view/theme/frio/theme.php:247
#: mod/message.php:136 src/Content/Nav.php:282 view/theme/frio/theme.php:248
msgid "Messages"
msgstr ""
@ -385,7 +385,7 @@ msgstr ""
#: mod/photos.php:66 mod/photos.php:137 mod/photos.php:582
#: src/Model/Event.php:514 src/Model/Profile.php:234
#: src/Module/Calendar/Export.php:67 src/Module/Calendar/Show.php:73
#: src/Module/Calendar/Export.php:67 src/Module/Calendar/Show.php:74
#: src/Module/DFRN/Poll.php:43 src/Module/Feed.php:65 src/Module/HCard.php:51
#: src/Module/Profile/Common.php:40 src/Module/Profile/Common.php:51
#: src/Module/Profile/Contacts.php:39 src/Module/Profile/Contacts.php:49
@ -649,11 +649,11 @@ msgstr ""
msgid "Map"
msgstr ""
#: src/App.php:492
#: src/App.php:500
msgid "No system theme config value set."
msgstr ""
#: src/App.php:613
#: src/App.php:621
msgid "Apologies but the website is unavailable at the moment."
msgstr ""
@ -1535,7 +1535,7 @@ msgstr ""
msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr ""
#: src/Content/Item.php:386 view/theme/frio/theme.php:268
#: src/Content/Item.php:386 view/theme/frio/theme.php:269
msgid "Follow Thread"
msgstr ""
@ -1628,54 +1628,54 @@ msgstr ""
#: src/Content/Nav.php:193 src/Module/BaseProfile.php:57
#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380
#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:235
#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:236
msgid "Status"
msgstr ""
#: src/Content/Nav.php:193 src/Content/Nav.php:272
#: view/theme/frio/theme.php:235
#: view/theme/frio/theme.php:236
msgid "Your posts and conversations"
msgstr ""
#: src/Content/Nav.php:194 src/Module/BaseProfile.php:49
#: src/Module/BaseSettings.php:100 src/Module/Contact.php:460
#: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:233
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:236
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:237
msgid "Profile"
msgstr ""
#: src/Content/Nav.php:194 view/theme/frio/theme.php:236
#: src/Content/Nav.php:194 view/theme/frio/theme.php:237
msgid "Your profile page"
msgstr ""
#: src/Content/Nav.php:195 src/Module/BaseProfile.php:65
#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:240
#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:241
msgid "Photos"
msgstr ""
#: src/Content/Nav.php:195 view/theme/frio/theme.php:240
#: src/Content/Nav.php:195 view/theme/frio/theme.php:241
msgid "Your photos"
msgstr ""
#: src/Content/Nav.php:196 src/Module/BaseProfile.php:73
#: src/Module/BaseProfile.php:76 src/Module/Contact.php:452
#: view/theme/frio/theme.php:241
#: view/theme/frio/theme.php:242
msgid "Media"
msgstr ""
#: src/Content/Nav.php:196 view/theme/frio/theme.php:241
#: src/Content/Nav.php:196 view/theme/frio/theme.php:242
msgid "Your postings with media"
msgstr ""
#: src/Content/Nav.php:197 src/Content/Nav.php:257
#: src/Module/BaseProfile.php:85 src/Module/BaseProfile.php:88
#: src/Module/BaseProfile.php:96 src/Module/BaseProfile.php:99
#: src/Module/Settings/Display.php:216 view/theme/frio/theme.php:242
#: view/theme/frio/theme.php:246
#: src/Module/Settings/Display.php:255 view/theme/frio/theme.php:243
#: view/theme/frio/theme.php:247
msgid "Calendar"
msgstr ""
#: src/Content/Nav.php:197 view/theme/frio/theme.php:242
#: src/Content/Nav.php:197 view/theme/frio/theme.php:243
msgid "Your calendar"
msgstr ""
@ -1745,7 +1745,7 @@ msgstr ""
#: src/Content/Nav.php:238 src/Content/Nav.php:293
#: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:127
#: src/Module/BaseProfile.php:130 src/Module/Contact.php:373
#: src/Module/Contact.php:467 view/theme/frio/theme.php:249
#: src/Module/Contact.php:467 view/theme/frio/theme.php:250
msgid "Contacts"
msgstr ""
@ -1784,11 +1784,11 @@ msgstr ""
msgid "Terms of Service of this Friendica instance"
msgstr ""
#: src/Content/Nav.php:270 view/theme/frio/theme.php:245
#: src/Content/Nav.php:270 view/theme/frio/theme.php:246
msgid "Network"
msgstr ""
#: src/Content/Nav.php:270 view/theme/frio/theme.php:245
#: src/Content/Nav.php:270 view/theme/frio/theme.php:246
msgid "Conversations from your friends"
msgstr ""
@ -1817,7 +1817,7 @@ msgstr ""
msgid "Mark all system notifications as seen"
msgstr ""
#: src/Content/Nav.php:282 view/theme/frio/theme.php:247
#: src/Content/Nav.php:282 view/theme/frio/theme.php:248
msgid "Private mail"
msgstr ""
@ -1839,15 +1839,15 @@ msgstr ""
#: src/Content/Nav.php:291 src/Module/Admin/Addons/Details.php:114
#: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:170
#: src/Module/Welcome.php:52 view/theme/frio/theme.php:248
#: src/Module/Welcome.php:52 view/theme/frio/theme.php:249
msgid "Settings"
msgstr ""
#: src/Content/Nav.php:291 view/theme/frio/theme.php:248
#: src/Content/Nav.php:291 view/theme/frio/theme.php:249
msgid "Account settings"
msgstr ""
#: src/Content/Nav.php:293 view/theme/frio/theme.php:249
#: src/Content/Nav.php:293 view/theme/frio/theme.php:250
msgid "Manage/edit friends and contacts"
msgstr ""
@ -1920,8 +1920,8 @@ msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr ""
#: src/Content/Text/BBCode.php:1257 src/Model/Item.php:3688
#: src/Model/Item.php:3694 src/Model/Item.php:3695
#: src/Content/Text/BBCode.php:1257 src/Model/Item.php:3586
#: src/Model/Item.php:3592 src/Model/Item.php:3593
msgid "Link to source"
msgstr ""
@ -2150,7 +2150,7 @@ msgid "Matrix:"
msgstr ""
#: src/Content/Widget/VCard.php:104 src/Model/Event.php:82
#: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:958
#: src/Model/Event.php:109 src/Model/Event.php:473 src/Model/Event.php:958
#: src/Model/Profile.php:373 src/Module/Contact/Profile.php:369
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187
#: src/Module/Profile/Profile.php:186
@ -2547,142 +2547,142 @@ msgstr ""
msgid "Could not connect to database."
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:430
#: src/Module/Settings/Display.php:187
#: src/Core/L10n.php:403 src/Model/Event.php:432
#: src/Module/Settings/Display.php:225
msgid "Monday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:431
#: src/Module/Settings/Display.php:188
#: src/Core/L10n.php:403 src/Model/Event.php:433
#: src/Module/Settings/Display.php:226
msgid "Tuesday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:432
#: src/Module/Settings/Display.php:189
#: src/Core/L10n.php:403 src/Model/Event.php:434
#: src/Module/Settings/Display.php:227
msgid "Wednesday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:433
#: src/Module/Settings/Display.php:190
#: src/Core/L10n.php:403 src/Model/Event.php:435
#: src/Module/Settings/Display.php:228
msgid "Thursday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:434
#: src/Module/Settings/Display.php:191
#: src/Core/L10n.php:403 src/Model/Event.php:436
#: src/Module/Settings/Display.php:229
msgid "Friday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:435
#: src/Module/Settings/Display.php:192
#: src/Core/L10n.php:403 src/Model/Event.php:437
#: src/Module/Settings/Display.php:230
msgid "Saturday"
msgstr ""
#: src/Core/L10n.php:403 src/Model/Event.php:429
#: src/Module/Settings/Display.php:186
#: src/Core/L10n.php:403 src/Model/Event.php:431
#: src/Module/Settings/Display.php:224
msgid "Sunday"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:450
#: src/Core/L10n.php:407 src/Model/Event.php:452
msgid "January"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:451
#: src/Core/L10n.php:407 src/Model/Event.php:453
msgid "February"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:452
#: src/Core/L10n.php:407 src/Model/Event.php:454
msgid "March"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:453
#: src/Core/L10n.php:407 src/Model/Event.php:455
msgid "April"
msgstr ""
#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:441
#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:443
msgid "May"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:454
#: src/Core/L10n.php:407 src/Model/Event.php:456
msgid "June"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:455
#: src/Core/L10n.php:407 src/Model/Event.php:457
msgid "July"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:456
#: src/Core/L10n.php:407 src/Model/Event.php:458
msgid "August"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:457
#: src/Core/L10n.php:407 src/Model/Event.php:459
msgid "September"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:458
#: src/Core/L10n.php:407 src/Model/Event.php:460
msgid "October"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:459
#: src/Core/L10n.php:407 src/Model/Event.php:461
msgid "November"
msgstr ""
#: src/Core/L10n.php:407 src/Model/Event.php:460
#: src/Core/L10n.php:407 src/Model/Event.php:462
msgid "December"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:422
#: src/Core/L10n.php:422 src/Model/Event.php:424
msgid "Mon"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:423
#: src/Core/L10n.php:422 src/Model/Event.php:425
msgid "Tue"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:424
#: src/Core/L10n.php:422 src/Model/Event.php:426
msgid "Wed"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:425
#: src/Core/L10n.php:422 src/Model/Event.php:427
msgid "Thu"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:426
#: src/Core/L10n.php:422 src/Model/Event.php:428
msgid "Fri"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:427
#: src/Core/L10n.php:422 src/Model/Event.php:429
msgid "Sat"
msgstr ""
#: src/Core/L10n.php:422 src/Model/Event.php:421
#: src/Core/L10n.php:422 src/Model/Event.php:423
msgid "Sun"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:437
#: src/Core/L10n.php:426 src/Model/Event.php:439
msgid "Jan"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:438
#: src/Core/L10n.php:426 src/Model/Event.php:440
msgid "Feb"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:439
#: src/Core/L10n.php:426 src/Model/Event.php:441
msgid "Mar"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:440
#: src/Core/L10n.php:426 src/Model/Event.php:442
msgid "Apr"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:442
#: src/Core/L10n.php:426 src/Model/Event.php:444
msgid "Jun"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:443
#: src/Core/L10n.php:426 src/Model/Event.php:445
msgid "Jul"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:444
#: src/Core/L10n.php:426 src/Model/Event.php:446
msgid "Aug"
msgstr ""
@ -2690,15 +2690,15 @@ msgstr ""
msgid "Sep"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:446
#: src/Core/L10n.php:426 src/Model/Event.php:448
msgid "Oct"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:447
#: src/Core/L10n.php:426 src/Model/Event.php:449
msgid "Nov"
msgstr ""
#: src/Core/L10n.php:426 src/Model/Event.php:448
#: src/Core/L10n.php:426 src/Model/Event.php:450
msgid "Dec"
msgstr ""
@ -2835,7 +2835,7 @@ msgstr ""
msgid "%s: Database update"
msgstr ""
#: src/Database/DBStructure.php:479
#: src/Database/DBStructure.php:480
#, php-format
msgid "%s: updating %s table."
msgstr ""
@ -2944,45 +2944,45 @@ msgstr ""
msgid "l F d, Y \\@ g:i A \\G\\M\\TP (e)"
msgstr ""
#: src/Model/Event.php:75 src/Model/Event.php:92 src/Model/Event.php:469
#: src/Model/Event.php:75 src/Model/Event.php:92 src/Model/Event.php:471
#: src/Model/Event.php:940
msgid "Starts:"
msgstr ""
#: src/Model/Event.php:78 src/Model/Event.php:98 src/Model/Event.php:470
#: src/Model/Event.php:78 src/Model/Event.php:98 src/Model/Event.php:472
#: src/Model/Event.php:944
msgid "Finishes:"
msgstr ""
#: src/Model/Event.php:419
#: src/Model/Event.php:421
msgid "all-day"
msgstr ""
#: src/Model/Event.php:445
#: src/Model/Event.php:447
msgid "Sept"
msgstr ""
#: src/Model/Event.php:462 src/Module/Calendar/Show.php:126
#: src/Model/Event.php:464 src/Module/Calendar/Show.php:128
#: src/Util/Temporal.php:339
msgid "today"
msgstr ""
#: src/Model/Event.php:463 src/Module/Calendar/Show.php:127
#: src/Util/Temporal.php:349
#: src/Model/Event.php:465 src/Module/Calendar/Show.php:129
#: src/Module/Settings/Display.php:235 src/Util/Temporal.php:349
msgid "month"
msgstr ""
#: src/Model/Event.php:464 src/Module/Calendar/Show.php:128
#: src/Util/Temporal.php:350
#: src/Model/Event.php:466 src/Module/Calendar/Show.php:130
#: src/Module/Settings/Display.php:236 src/Util/Temporal.php:350
msgid "week"
msgstr ""
#: src/Model/Event.php:465 src/Module/Calendar/Show.php:129
#: src/Util/Temporal.php:351
#: src/Model/Event.php:467 src/Module/Calendar/Show.php:131
#: src/Module/Settings/Display.php:237 src/Util/Temporal.php:351
msgid "day"
msgstr ""
#: src/Model/Event.php:467
#: src/Model/Event.php:469
msgid "No events to display"
msgstr ""
@ -3102,49 +3102,49 @@ msgstr ""
msgid "post"
msgstr ""
#: src/Model/Item.php:3077
#: src/Model/Item.php:3082
#, php-format
msgid "Content warning: %s"
msgstr ""
#: src/Model/Item.php:3600
#: src/Model/Item.php:3498
msgid "bytes"
msgstr ""
#: src/Model/Item.php:3631
#: src/Model/Item.php:3529
#, php-format
msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3633
#: src/Model/Item.php:3531
#, php-format
msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3638
#: src/Model/Item.php:3536
#, php-format
msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s"
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3640
#: src/Model/Item.php:3538
#, php-format
msgid "%d voter."
msgid_plural "%d voters."
msgstr[0] ""
msgstr[1] ""
#: src/Model/Item.php:3642
#: src/Model/Item.php:3540
#, php-format
msgid "Poll end: %s"
msgstr ""
#: src/Model/Item.php:3676 src/Model/Item.php:3677
#: src/Model/Item.php:3574 src/Model/Item.php:3575
msgid "View on separate page"
msgstr ""
@ -3630,7 +3630,7 @@ msgstr ""
#: src/Module/Settings/Account.php:560 src/Module/Settings/Addons.php:81
#: src/Module/Settings/Connectors.php:159
#: src/Module/Settings/Connectors.php:244
#: src/Module/Settings/Delegation.php:169 src/Module/Settings/Display.php:211
#: src/Module/Settings/Delegation.php:169 src/Module/Settings/Display.php:250
#: src/Module/Settings/Features.php:76
msgid "Save Settings"
msgstr ""
@ -3982,11 +3982,11 @@ msgstr ""
msgid "%s is no valid input for maximum image size"
msgstr ""
#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:141
#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:171
msgid "No special theme for mobile devices"
msgstr ""
#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:151
#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:181
#, php-format
msgid "%s - (Experimental)"
msgstr ""
@ -5563,19 +5563,19 @@ msgstr ""
msgid "calendar"
msgstr ""
#: src/Module/Calendar/Show.php:122
#: src/Module/Calendar/Show.php:124
msgid "Events"
msgstr ""
#: src/Module/Calendar/Show.php:123
#: src/Module/Calendar/Show.php:125
msgid "View"
msgstr ""
#: src/Module/Calendar/Show.php:124
#: src/Module/Calendar/Show.php:126
msgid "Create New Event"
msgstr ""
#: src/Module/Calendar/Show.php:130
#: src/Module/Calendar/Show.php:132 src/Module/Settings/Display.php:238
msgid "list"
msgstr ""
@ -9536,148 +9536,156 @@ msgstr ""
msgid "No entries."
msgstr ""
#: src/Module/Settings/Display.php:110
#: src/Module/Settings/Display.php:139
msgid "The theme you chose isn't available."
msgstr ""
#: src/Module/Settings/Display.php:149
#: src/Module/Settings/Display.php:179
#, php-format
msgid "%s - (Unsupported)"
msgstr ""
#: src/Module/Settings/Display.php:196
#: src/Module/Settings/Display.php:215
msgid "No preview"
msgstr ""
#: src/Module/Settings/Display.php:197
#: src/Module/Settings/Display.php:216
msgid "No image"
msgstr ""
#: src/Module/Settings/Display.php:198
#: src/Module/Settings/Display.php:217
msgid "Small Image"
msgstr ""
#: src/Module/Settings/Display.php:199
#: src/Module/Settings/Display.php:218
msgid "Large Image"
msgstr ""
#: src/Module/Settings/Display.php:210
#: src/Module/Settings/Display.php:249
msgid "Display Settings"
msgstr ""
#: src/Module/Settings/Display.php:212
#: src/Module/Settings/Display.php:251
msgid "General Theme Settings"
msgstr ""
#: src/Module/Settings/Display.php:213
#: src/Module/Settings/Display.php:252
msgid "Custom Theme Settings"
msgstr ""
#: src/Module/Settings/Display.php:214
#: src/Module/Settings/Display.php:253
msgid "Content Settings"
msgstr ""
#: src/Module/Settings/Display.php:215 view/theme/duepuntozero/config.php:86
#: src/Module/Settings/Display.php:254 view/theme/duepuntozero/config.php:86
#: view/theme/frio/config.php:172 view/theme/quattro/config.php:88
#: view/theme/vier/config.php:136
msgid "Theme settings"
msgstr ""
#: src/Module/Settings/Display.php:222
#: src/Module/Settings/Display.php:261
msgid "Display Theme:"
msgstr ""
#: src/Module/Settings/Display.php:223
#: src/Module/Settings/Display.php:262
msgid "Mobile Theme:"
msgstr ""
#: src/Module/Settings/Display.php:226
#: src/Module/Settings/Display.php:265
msgid "Number of items to display per page:"
msgstr ""
#: src/Module/Settings/Display.php:226 src/Module/Settings/Display.php:227
#: src/Module/Settings/Display.php:265 src/Module/Settings/Display.php:266
msgid "Maximum of 100 items"
msgstr ""
#: src/Module/Settings/Display.php:227
#: src/Module/Settings/Display.php:266
msgid "Number of items to display per page when viewed from mobile device:"
msgstr ""
#: src/Module/Settings/Display.php:228
#: src/Module/Settings/Display.php:267
msgid "Update browser every xx seconds"
msgstr ""
#: src/Module/Settings/Display.php:228
#: src/Module/Settings/Display.php:267
msgid "Minimum of 10 seconds. Enter -1 to disable it."
msgstr ""
#: src/Module/Settings/Display.php:229
#: src/Module/Settings/Display.php:268
msgid "Automatic updates only at the top of the post stream pages"
msgstr ""
#: src/Module/Settings/Display.php:229
#: src/Module/Settings/Display.php:268
msgid ""
"Auto update may add new posts at the top of the post stream pages, which can "
"affect the scroll position and perturb normal reading if it happens anywhere "
"else the top of the page."
msgstr ""
#: src/Module/Settings/Display.php:230
#: src/Module/Settings/Display.php:269
msgid "Display emoticons"
msgstr ""
#: src/Module/Settings/Display.php:230
#: src/Module/Settings/Display.php:269
msgid "When enabled, emoticons are replaced with matching symbols."
msgstr ""
#: src/Module/Settings/Display.php:231
#: src/Module/Settings/Display.php:270
msgid "Infinite scroll"
msgstr ""
#: src/Module/Settings/Display.php:231
#: src/Module/Settings/Display.php:270
msgid "Automatic fetch new items when reaching the page end."
msgstr ""
#: src/Module/Settings/Display.php:232
#: src/Module/Settings/Display.php:271
msgid "Enable Smart Threading"
msgstr ""
#: src/Module/Settings/Display.php:232
#: src/Module/Settings/Display.php:271
msgid "Enable the automatic suppression of extraneous thread indentation."
msgstr ""
#: src/Module/Settings/Display.php:233
#: src/Module/Settings/Display.php:272
msgid "Display the Dislike feature"
msgstr ""
#: src/Module/Settings/Display.php:233
#: src/Module/Settings/Display.php:272
msgid "Display the Dislike button and dislike reactions on posts and comments."
msgstr ""
#: src/Module/Settings/Display.php:234
#: src/Module/Settings/Display.php:273
msgid "Display the resharer"
msgstr ""
#: src/Module/Settings/Display.php:234
#: src/Module/Settings/Display.php:273
msgid "Display the first resharer as icon and text on a reshared item."
msgstr ""
#: src/Module/Settings/Display.php:235
#: src/Module/Settings/Display.php:274
msgid "Stay local"
msgstr ""
#: src/Module/Settings/Display.php:235
#: src/Module/Settings/Display.php:274
msgid "Don't go to a remote system when following a contact link."
msgstr ""
#: src/Module/Settings/Display.php:236
#: src/Module/Settings/Display.php:275
msgid "Link preview mode"
msgstr ""
#: src/Module/Settings/Display.php:238
#: src/Module/Settings/Display.php:275
msgid "Appearance of the link preview that is added to each post with a link."
msgstr ""
#: src/Module/Settings/Display.php:277
msgid "Beginning of week:"
msgstr ""
#: src/Module/Settings/Display.php:278
msgid "Default calendar view:"
msgstr ""
#: src/Module/Settings/Features.php:74
msgid "Additional Features"
msgstr ""
@ -11566,11 +11574,11 @@ msgstr ""
msgid "Back to top"
msgstr ""
#: view/theme/frio/theme.php:217
#: view/theme/frio/theme.php:218
msgid "Guest"
msgstr ""
#: view/theme/frio/theme.php:220
#: view/theme/frio/theme.php:221
msgid "Visitor"
msgstr ""

View file

@ -50,7 +50,7 @@ msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-14 21:56-0500\n"
"POT-Creation-Date: 2022-12-17 23:06-0500\n"
"PO-Revision-Date: 2011-05-05 10:19+0000\n"
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2016-2022\n"
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
@ -69,7 +69,7 @@ msgstr "Konnte den Originalbeitrag nicht finden."
#: src/Model/Event.php:522 src/Module/Attach.php:55 src/Module/BaseApi.php:94
#: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52
#: src/Module/Calendar/Event/API.php:88 src/Module/Calendar/Event/Form.php:84
#: src/Module/Calendar/Export.php:62 src/Module/Calendar/Show.php:81
#: src/Module/Calendar/Export.php:62 src/Module/Calendar/Show.php:82
#: src/Module/Contact/Advanced.php:60 src/Module/Contact/Follow.php:86
#: src/Module/Contact/Follow.php:160 src/Module/Contact/MatchInterests.php:86
#: src/Module/Contact/Suggestions.php:54 src/Module/Contact/Unfollow.php:66
@ -89,7 +89,7 @@ msgstr "Konnte den Originalbeitrag nicht finden."
#: src/Module/Register.php:245 src/Module/Search/Directory.php:37
#: src/Module/Settings/Account.php:50 src/Module/Settings/Account.php:407
#: src/Module/Settings/Delegation.php:41 src/Module/Settings/Delegation.php:69
#: src/Module/Settings/Display.php:43 src/Module/Settings/Display.php:123
#: src/Module/Settings/Display.php:69 src/Module/Settings/Display.php:153
#: src/Module/Settings/Profile/Photo/Crop.php:165
#: src/Module/Settings/Profile/Photo/Index.php:111
#: src/Module/Settings/RemoveMe.php:117 src/Module/Settings/UserExport.php:80
@ -283,7 +283,7 @@ msgstr "Konnte Nachrichten nicht abrufen."
msgid "Discard"
msgstr "Verwerfen"
#: mod/message.php:136 src/Content/Nav.php:282 view/theme/frio/theme.php:247
#: mod/message.php:136 src/Content/Nav.php:282 view/theme/frio/theme.php:248
msgid "Messages"
msgstr "Nachrichten"
@ -423,7 +423,7 @@ msgstr "Speichern"
#: mod/photos.php:66 mod/photos.php:137 mod/photos.php:582
#: src/Model/Event.php:514 src/Model/Profile.php:234
#: src/Module/Calendar/Export.php:67 src/Module/Calendar/Show.php:73
#: src/Module/Calendar/Export.php:67 src/Module/Calendar/Show.php:74
#: src/Module/DFRN/Poll.php:43 src/Module/Feed.php:65 src/Module/HCard.php:51
#: src/Module/Profile/Common.php:40 src/Module/Profile/Common.php:51
#: src/Module/Profile/Contacts.php:39 src/Module/Profile/Contacts.php:49
@ -689,11 +689,11 @@ msgstr "Ich mag das nicht (toggle)"
msgid "Map"
msgstr "Karte"
#: src/App.php:492
#: src/App.php:500
msgid "No system theme config value set."
msgstr "Es wurde kein Konfigurationswert für das systemweite Theme gesetzt."
#: src/App.php:613
#: src/App.php:621
msgid "Apologies but the website is unavailable at the moment."
msgstr "Entschuldigung, aber die Webseite ist derzeit nicht erreichbar."
@ -1577,7 +1577,7 @@ msgstr "Foto"
msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr "%1$s hat %2$ss %3$s mit %4$s getaggt"
#: src/Content/Item.php:386 view/theme/frio/theme.php:268
#: src/Content/Item.php:386 view/theme/frio/theme.php:269
msgid "Follow Thread"
msgstr "Folge der Unterhaltung"
@ -1671,54 +1671,54 @@ msgstr "Anmelden"
#: src/Content/Nav.php:193 src/Module/BaseProfile.php:57
#: src/Module/Contact.php:436 src/Module/Contact/Profile.php:380
#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:235
#: src/Module/Settings/TwoFactor/Index.php:119 view/theme/frio/theme.php:236
msgid "Status"
msgstr "Status"
#: src/Content/Nav.php:193 src/Content/Nav.php:272
#: view/theme/frio/theme.php:235
#: view/theme/frio/theme.php:236
msgid "Your posts and conversations"
msgstr "Deine Beiträge und Unterhaltungen"
#: src/Content/Nav.php:194 src/Module/BaseProfile.php:49
#: src/Module/BaseSettings.php:100 src/Module/Contact.php:460
#: src/Module/Contact/Profile.php:382 src/Module/Profile/Profile.php:233
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:236
#: src/Module/Welcome.php:57 view/theme/frio/theme.php:237
msgid "Profile"
msgstr "Profil"
#: src/Content/Nav.php:194 view/theme/frio/theme.php:236
#: src/Content/Nav.php:194 view/theme/frio/theme.php:237
msgid "Your profile page"
msgstr "Deine Profilseite"
#: src/Content/Nav.php:195 src/Module/BaseProfile.php:65
#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:240
#: src/Module/Media/Photo/Browser.php:74 view/theme/frio/theme.php:241
msgid "Photos"
msgstr "Bilder"
#: src/Content/Nav.php:195 view/theme/frio/theme.php:240
#: src/Content/Nav.php:195 view/theme/frio/theme.php:241
msgid "Your photos"
msgstr "Deine Fotos"
#: src/Content/Nav.php:196 src/Module/BaseProfile.php:73
#: src/Module/BaseProfile.php:76 src/Module/Contact.php:452
#: view/theme/frio/theme.php:241
#: view/theme/frio/theme.php:242
msgid "Media"
msgstr "Medien"
#: src/Content/Nav.php:196 view/theme/frio/theme.php:241
#: src/Content/Nav.php:196 view/theme/frio/theme.php:242
msgid "Your postings with media"
msgstr "Deine Beiträge die Medien beinhalten"
#: src/Content/Nav.php:197 src/Content/Nav.php:257
#: src/Module/BaseProfile.php:85 src/Module/BaseProfile.php:88
#: src/Module/BaseProfile.php:96 src/Module/BaseProfile.php:99
#: src/Module/Settings/Display.php:216 view/theme/frio/theme.php:242
#: view/theme/frio/theme.php:246
#: src/Module/Settings/Display.php:255 view/theme/frio/theme.php:243
#: view/theme/frio/theme.php:247
msgid "Calendar"
msgstr "Kalender"
#: src/Content/Nav.php:197 view/theme/frio/theme.php:242
#: src/Content/Nav.php:197 view/theme/frio/theme.php:243
msgid "Your calendar"
msgstr "Dein Kalender"
@ -1788,7 +1788,7 @@ msgstr "Tags"
#: src/Content/Nav.php:238 src/Content/Nav.php:293
#: src/Content/Text/HTML.php:899 src/Module/BaseProfile.php:127
#: src/Module/BaseProfile.php:130 src/Module/Contact.php:373
#: src/Module/Contact.php:467 view/theme/frio/theme.php:249
#: src/Module/Contact.php:467 view/theme/frio/theme.php:250
msgid "Contacts"
msgstr "Kontakte"
@ -1827,11 +1827,11 @@ msgstr "Nutzungsbedingungen"
msgid "Terms of Service of this Friendica instance"
msgstr "Die Nutzungsbedingungen dieser Friendica-Instanz"
#: src/Content/Nav.php:270 view/theme/frio/theme.php:245
#: src/Content/Nav.php:270 view/theme/frio/theme.php:246
msgid "Network"
msgstr "Netzwerk"
#: src/Content/Nav.php:270 view/theme/frio/theme.php:245
#: src/Content/Nav.php:270 view/theme/frio/theme.php:246
msgid "Conversations from your friends"
msgstr "Unterhaltungen Deiner Kontakte"
@ -1860,7 +1860,7 @@ msgstr "Als gelesen markieren"
msgid "Mark all system notifications as seen"
msgstr "Markiere alle Systembenachrichtigungen als gelesen"
#: src/Content/Nav.php:282 view/theme/frio/theme.php:247
#: src/Content/Nav.php:282 view/theme/frio/theme.php:248
msgid "Private mail"
msgstr "Private E-Mail"
@ -1882,15 +1882,15 @@ msgstr "Andere Seiten verwalten"
#: src/Content/Nav.php:291 src/Module/Admin/Addons/Details.php:114
#: src/Module/Admin/Themes/Details.php:93 src/Module/BaseSettings.php:170
#: src/Module/Welcome.php:52 view/theme/frio/theme.php:248
#: src/Module/Welcome.php:52 view/theme/frio/theme.php:249
msgid "Settings"
msgstr "Einstellungen"
#: src/Content/Nav.php:291 view/theme/frio/theme.php:248
#: src/Content/Nav.php:291 view/theme/frio/theme.php:249
msgid "Account settings"
msgstr "Kontoeinstellungen"
#: src/Content/Nav.php:293 view/theme/frio/theme.php:249
#: src/Content/Nav.php:293 view/theme/frio/theme.php:250
msgid "Manage/edit friends and contacts"
msgstr "Freunde und Kontakte verwalten/bearbeiten"
@ -1962,8 +1962,8 @@ msgstr "Bild/Foto"
msgid "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a>%3$s"
#: src/Content/Text/BBCode.php:1257 src/Model/Item.php:3688
#: src/Model/Item.php:3694 src/Model/Item.php:3695
#: src/Content/Text/BBCode.php:1257 src/Model/Item.php:3586
#: src/Model/Item.php:3592 src/Model/Item.php:3593
msgid "Link to source"
msgstr "Link zum Originalbeitrag"
@ -2192,7 +2192,7 @@ msgid "Matrix:"
msgstr "Matrix:"
#: src/Content/Widget/VCard.php:104 src/Model/Event.php:82
#: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:958
#: src/Model/Event.php:109 src/Model/Event.php:473 src/Model/Event.php:958
#: src/Model/Profile.php:373 src/Module/Contact/Profile.php:369
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187
#: src/Module/Profile/Profile.php:186
@ -2590,142 +2590,142 @@ msgstr "Die Datenbank wird bereits verwendet."
msgid "Could not connect to database."
msgstr "Verbindung zur Datenbank gescheitert."
#: src/Core/L10n.php:403 src/Model/Event.php:430
#: src/Module/Settings/Display.php:187
#: src/Core/L10n.php:403 src/Model/Event.php:432
#: src/Module/Settings/Display.php:225
msgid "Monday"
msgstr "Montag"
#: src/Core/L10n.php:403 src/Model/Event.php:431
#: src/Module/Settings/Display.php:188
#: src/Core/L10n.php:403 src/Model/Event.php:433
#: src/Module/Settings/Display.php:226
msgid "Tuesday"
msgstr "Dienstag"
#: src/Core/L10n.php:403 src/Model/Event.php:432
#: src/Module/Settings/Display.php:189
#: src/Core/L10n.php:403 src/Model/Event.php:434
#: src/Module/Settings/Display.php:227
msgid "Wednesday"
msgstr "Mittwoch"
#: src/Core/L10n.php:403 src/Model/Event.php:433
#: src/Module/Settings/Display.php:190
#: src/Core/L10n.php:403 src/Model/Event.php:435
#: src/Module/Settings/Display.php:228
msgid "Thursday"
msgstr "Donnerstag"
#: src/Core/L10n.php:403 src/Model/Event.php:434
#: src/Module/Settings/Display.php:191
#: src/Core/L10n.php:403 src/Model/Event.php:436
#: src/Module/Settings/Display.php:229
msgid "Friday"
msgstr "Freitag"
#: src/Core/L10n.php:403 src/Model/Event.php:435
#: src/Module/Settings/Display.php:192
#: src/Core/L10n.php:403 src/Model/Event.php:437
#: src/Module/Settings/Display.php:230
msgid "Saturday"
msgstr "Samstag"
#: src/Core/L10n.php:403 src/Model/Event.php:429
#: src/Module/Settings/Display.php:186
#: src/Core/L10n.php:403 src/Model/Event.php:431
#: src/Module/Settings/Display.php:224
msgid "Sunday"
msgstr "Sonntag"
#: src/Core/L10n.php:407 src/Model/Event.php:450
#: src/Core/L10n.php:407 src/Model/Event.php:452
msgid "January"
msgstr "Januar"
#: src/Core/L10n.php:407 src/Model/Event.php:451
#: src/Core/L10n.php:407 src/Model/Event.php:453
msgid "February"
msgstr "Februar"
#: src/Core/L10n.php:407 src/Model/Event.php:452
#: src/Core/L10n.php:407 src/Model/Event.php:454
msgid "March"
msgstr "März"
#: src/Core/L10n.php:407 src/Model/Event.php:453
#: src/Core/L10n.php:407 src/Model/Event.php:455
msgid "April"
msgstr "April"
#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:441
#: src/Core/L10n.php:407 src/Core/L10n.php:426 src/Model/Event.php:443
msgid "May"
msgstr "Mai"
#: src/Core/L10n.php:407 src/Model/Event.php:454
#: src/Core/L10n.php:407 src/Model/Event.php:456
msgid "June"
msgstr "Juni"
#: src/Core/L10n.php:407 src/Model/Event.php:455
#: src/Core/L10n.php:407 src/Model/Event.php:457
msgid "July"
msgstr "Juli"
#: src/Core/L10n.php:407 src/Model/Event.php:456
#: src/Core/L10n.php:407 src/Model/Event.php:458
msgid "August"
msgstr "August"
#: src/Core/L10n.php:407 src/Model/Event.php:457
#: src/Core/L10n.php:407 src/Model/Event.php:459
msgid "September"
msgstr "September"
#: src/Core/L10n.php:407 src/Model/Event.php:458
#: src/Core/L10n.php:407 src/Model/Event.php:460
msgid "October"
msgstr "Oktober"
#: src/Core/L10n.php:407 src/Model/Event.php:459
#: src/Core/L10n.php:407 src/Model/Event.php:461
msgid "November"
msgstr "November"
#: src/Core/L10n.php:407 src/Model/Event.php:460
#: src/Core/L10n.php:407 src/Model/Event.php:462
msgid "December"
msgstr "Dezember"
#: src/Core/L10n.php:422 src/Model/Event.php:422
#: src/Core/L10n.php:422 src/Model/Event.php:424
msgid "Mon"
msgstr "Mo"
#: src/Core/L10n.php:422 src/Model/Event.php:423
#: src/Core/L10n.php:422 src/Model/Event.php:425
msgid "Tue"
msgstr "Di"
#: src/Core/L10n.php:422 src/Model/Event.php:424
#: src/Core/L10n.php:422 src/Model/Event.php:426
msgid "Wed"
msgstr "Mi"
#: src/Core/L10n.php:422 src/Model/Event.php:425
#: src/Core/L10n.php:422 src/Model/Event.php:427
msgid "Thu"
msgstr "Do"
#: src/Core/L10n.php:422 src/Model/Event.php:426
#: src/Core/L10n.php:422 src/Model/Event.php:428
msgid "Fri"
msgstr "Fr"
#: src/Core/L10n.php:422 src/Model/Event.php:427
#: src/Core/L10n.php:422 src/Model/Event.php:429
msgid "Sat"
msgstr "Sa"
#: src/Core/L10n.php:422 src/Model/Event.php:421
#: src/Core/L10n.php:422 src/Model/Event.php:423
msgid "Sun"
msgstr "So"
#: src/Core/L10n.php:426 src/Model/Event.php:437
#: src/Core/L10n.php:426 src/Model/Event.php:439
msgid "Jan"
msgstr "Jan"
#: src/Core/L10n.php:426 src/Model/Event.php:438
#: src/Core/L10n.php:426 src/Model/Event.php:440
msgid "Feb"
msgstr "Feb"
#: src/Core/L10n.php:426 src/Model/Event.php:439
#: src/Core/L10n.php:426 src/Model/Event.php:441
msgid "Mar"
msgstr "März"
#: src/Core/L10n.php:426 src/Model/Event.php:440
#: src/Core/L10n.php:426 src/Model/Event.php:442
msgid "Apr"
msgstr "Apr"
#: src/Core/L10n.php:426 src/Model/Event.php:442
#: src/Core/L10n.php:426 src/Model/Event.php:444
msgid "Jun"
msgstr "Jun"
#: src/Core/L10n.php:426 src/Model/Event.php:443
#: src/Core/L10n.php:426 src/Model/Event.php:445
msgid "Jul"
msgstr "Juli"
#: src/Core/L10n.php:426 src/Model/Event.php:444
#: src/Core/L10n.php:426 src/Model/Event.php:446
msgid "Aug"
msgstr "Aug"
@ -2733,15 +2733,15 @@ msgstr "Aug"
msgid "Sep"
msgstr "Sep"
#: src/Core/L10n.php:426 src/Model/Event.php:446
#: src/Core/L10n.php:426 src/Model/Event.php:448
msgid "Oct"
msgstr "Okt"
#: src/Core/L10n.php:426 src/Model/Event.php:447
#: src/Core/L10n.php:426 src/Model/Event.php:449
msgid "Nov"
msgstr "Nov"
#: src/Core/L10n.php:426 src/Model/Event.php:448
#: src/Core/L10n.php:426 src/Model/Event.php:450
msgid "Dec"
msgstr "Dez"
@ -2877,7 +2877,7 @@ msgstr "Es läuft bereits ein anderes Datenbank Update"
msgid "%s: Database update"
msgstr "%s: Datenbank Aktualisierung"
#: src/Database/DBStructure.php:479
#: src/Database/DBStructure.php:480
#, php-format
msgid "%s: updating %s table."
msgstr "%s: aktualisiere Tabelle %s"
@ -2986,45 +2986,45 @@ msgstr "Konnte die Kontaktinformationen nicht empfangen."
msgid "l F d, Y \\@ g:i A \\G\\M\\TP (e)"
msgstr "l F d, Y \\@ g:i A \\G\\M\\TP (e)"
#: src/Model/Event.php:75 src/Model/Event.php:92 src/Model/Event.php:469
#: src/Model/Event.php:75 src/Model/Event.php:92 src/Model/Event.php:471
#: src/Model/Event.php:940
msgid "Starts:"
msgstr "Beginnt:"
#: src/Model/Event.php:78 src/Model/Event.php:98 src/Model/Event.php:470
#: src/Model/Event.php:78 src/Model/Event.php:98 src/Model/Event.php:472
#: src/Model/Event.php:944
msgid "Finishes:"
msgstr "Endet:"
#: src/Model/Event.php:419
#: src/Model/Event.php:421
msgid "all-day"
msgstr "ganztägig"
#: src/Model/Event.php:445
#: src/Model/Event.php:447
msgid "Sept"
msgstr "Sep"
#: src/Model/Event.php:462 src/Module/Calendar/Show.php:126
#: src/Model/Event.php:464 src/Module/Calendar/Show.php:128
#: src/Util/Temporal.php:339
msgid "today"
msgstr "Heute"
#: src/Model/Event.php:463 src/Module/Calendar/Show.php:127
#: src/Util/Temporal.php:349
#: src/Model/Event.php:465 src/Module/Calendar/Show.php:129
#: src/Module/Settings/Display.php:235 src/Util/Temporal.php:349
msgid "month"
msgstr "Monat"
#: src/Model/Event.php:464 src/Module/Calendar/Show.php:128
#: src/Util/Temporal.php:350
#: src/Model/Event.php:466 src/Module/Calendar/Show.php:130
#: src/Module/Settings/Display.php:236 src/Util/Temporal.php:350
msgid "week"
msgstr "Woche"
#: src/Model/Event.php:465 src/Module/Calendar/Show.php:129
#: src/Util/Temporal.php:351
#: src/Model/Event.php:467 src/Module/Calendar/Show.php:131
#: src/Module/Settings/Display.php:237 src/Util/Temporal.php:351
msgid "day"
msgstr "Tag"
#: src/Model/Event.php:467
#: src/Model/Event.php:469
msgid "No events to display"
msgstr "Keine Veranstaltung zum Anzeigen"
@ -3144,49 +3144,49 @@ msgstr "Kommentar"
msgid "post"
msgstr "Beitrag"
#: src/Model/Item.php:3077
#: src/Model/Item.php:3082
#, php-format
msgid "Content warning: %s"
msgstr "Inhaltswarnung: %s"
#: src/Model/Item.php:3600
#: src/Model/Item.php:3498
msgid "bytes"
msgstr "Byte"
#: src/Model/Item.php:3631
#: src/Model/Item.php:3529
#, php-format
msgid "%2$s (%3$d%%, %1$d vote)"
msgid_plural "%2$s (%3$d%%, %1$d votes)"
msgstr[0] "%2$s (%3$d%%, %1$d Stimme)"
msgstr[1] "%2$s (%3$d%%, %1$d Stimmen)"
#: src/Model/Item.php:3633
#: src/Model/Item.php:3531
#, php-format
msgid "%2$s (%1$d vote)"
msgid_plural "%2$s (%1$d votes)"
msgstr[0] "%2$s (%1$d Stimme)"
msgstr[1] "%2$s (%1$d Stimmen)"
#: src/Model/Item.php:3638
#: src/Model/Item.php:3536
#, php-format
msgid "%d voter. Poll end: %s"
msgid_plural "%d voters. Poll end: %s"
msgstr[0] "%d Stimme, Abstimmung endet: %s"
msgstr[1] "%d Stimmen, Abstimmung endet: %s"
#: src/Model/Item.php:3640
#: src/Model/Item.php:3538
#, php-format
msgid "%d voter."
msgid_plural "%d voters."
msgstr[0] "%d Stimme."
msgstr[1] "%d Stimmen."
#: src/Model/Item.php:3642
#: src/Model/Item.php:3540
#, php-format
msgid "Poll end: %s"
msgstr "Abstimmung endet: %s"
#: src/Model/Item.php:3676 src/Model/Item.php:3677
#: src/Model/Item.php:3574 src/Model/Item.php:3575
msgid "View on separate page"
msgstr "Auf separater Seite ansehen"
@ -3660,7 +3660,7 @@ msgstr "Addon %s konnte nicht installiert werden"
#: src/Module/Settings/Account.php:560 src/Module/Settings/Addons.php:81
#: src/Module/Settings/Connectors.php:159
#: src/Module/Settings/Connectors.php:244
#: src/Module/Settings/Delegation.php:169 src/Module/Settings/Display.php:211
#: src/Module/Settings/Delegation.php:169 src/Module/Settings/Display.php:250
#: src/Module/Settings/Features.php:76
msgid "Save Settings"
msgstr "Einstellungen speichern"
@ -4012,11 +4012,11 @@ msgstr "Priorität"
msgid "%s is no valid input for maximum image size"
msgstr "%s ist keine gültige Angabe der maximalen Größe von Bildern"
#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:141
#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:171
msgid "No special theme for mobile devices"
msgstr "Kein spezielles Theme für mobile Geräte verwenden."
#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:151
#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:181
#, php-format
msgid "%s - (Experimental)"
msgstr "%s - (Experimentell)"
@ -5592,19 +5592,19 @@ msgstr "Keine exportierbaren Daten gefunden"
msgid "calendar"
msgstr "Kalender"
#: src/Module/Calendar/Show.php:122
#: src/Module/Calendar/Show.php:124
msgid "Events"
msgstr "Veranstaltungen"
#: src/Module/Calendar/Show.php:123
#: src/Module/Calendar/Show.php:125
msgid "View"
msgstr "Ansehen"
#: src/Module/Calendar/Show.php:124
#: src/Module/Calendar/Show.php:126
msgid "Create New Event"
msgstr "Neue Veranstaltung erstellen"
#: src/Module/Calendar/Show.php:130
#: src/Module/Calendar/Show.php:132 src/Module/Settings/Display.php:238
msgid "list"
msgstr "Liste"
@ -9564,149 +9564,157 @@ msgstr "Hinzufügen"
msgid "No entries."
msgstr "Keine Einträge."
#: src/Module/Settings/Display.php:110
#: src/Module/Settings/Display.php:139
msgid "The theme you chose isn't available."
msgstr "Das gewählte Theme ist nicht verfügbar"
#: src/Module/Settings/Display.php:149
#: src/Module/Settings/Display.php:179
#, php-format
msgid "%s - (Unsupported)"
msgstr "%s - (Nicht unterstützt)"
#: src/Module/Settings/Display.php:196
#: src/Module/Settings/Display.php:215
msgid "No preview"
msgstr "Keine Vorschau"
#: src/Module/Settings/Display.php:197
#: src/Module/Settings/Display.php:216
msgid "No image"
msgstr "Kein Bild"
#: src/Module/Settings/Display.php:198
#: src/Module/Settings/Display.php:217
msgid "Small Image"
msgstr "Kleines Bild"
#: src/Module/Settings/Display.php:199
#: src/Module/Settings/Display.php:218
msgid "Large Image"
msgstr "Große Bilder"
#: src/Module/Settings/Display.php:210
#: src/Module/Settings/Display.php:249
msgid "Display Settings"
msgstr "Anzeige-Einstellungen"
#: src/Module/Settings/Display.php:212
#: src/Module/Settings/Display.php:251
msgid "General Theme Settings"
msgstr "Allgemeine Theme-Einstellungen"
#: src/Module/Settings/Display.php:213
#: src/Module/Settings/Display.php:252
msgid "Custom Theme Settings"
msgstr "Benutzerdefinierte Theme-Einstellungen"
#: src/Module/Settings/Display.php:214
#: src/Module/Settings/Display.php:253
msgid "Content Settings"
msgstr "Einstellungen zum Inhalt"
#: src/Module/Settings/Display.php:215 view/theme/duepuntozero/config.php:86
#: src/Module/Settings/Display.php:254 view/theme/duepuntozero/config.php:86
#: view/theme/frio/config.php:172 view/theme/quattro/config.php:88
#: view/theme/vier/config.php:136
msgid "Theme settings"
msgstr "Theme-Einstellungen"
#: src/Module/Settings/Display.php:222
#: src/Module/Settings/Display.php:261
msgid "Display Theme:"
msgstr "Theme:"
#: src/Module/Settings/Display.php:223
#: src/Module/Settings/Display.php:262
msgid "Mobile Theme:"
msgstr "Mobiles Theme"
#: src/Module/Settings/Display.php:226
#: src/Module/Settings/Display.php:265
msgid "Number of items to display per page:"
msgstr "Zahl der Beiträge, die pro Netzwerkseite angezeigt werden sollen: "
#: src/Module/Settings/Display.php:226 src/Module/Settings/Display.php:227
#: src/Module/Settings/Display.php:265 src/Module/Settings/Display.php:266
msgid "Maximum of 100 items"
msgstr "Maximal 100 Beiträge"
#: src/Module/Settings/Display.php:227
#: src/Module/Settings/Display.php:266
msgid "Number of items to display per page when viewed from mobile device:"
msgstr "Zahl der Beiträge, die pro Netzwerkseite auf mobilen Geräten angezeigt werden sollen:"
#: src/Module/Settings/Display.php:228
#: src/Module/Settings/Display.php:267
msgid "Update browser every xx seconds"
msgstr "Browser alle xx Sekunden aktualisieren"
#: src/Module/Settings/Display.php:228
#: src/Module/Settings/Display.php:267
msgid "Minimum of 10 seconds. Enter -1 to disable it."
msgstr "Minimum sind 10 Sekunden. Gib -1 ein, um abzuschalten."
#: src/Module/Settings/Display.php:229
#: src/Module/Settings/Display.php:268
msgid "Automatic updates only at the top of the post stream pages"
msgstr "Automatische Updates nur, wenn du oben auf den Beitragsstream-Seiten bist."
#: src/Module/Settings/Display.php:229
#: src/Module/Settings/Display.php:268
msgid ""
"Auto update may add new posts at the top of the post stream pages, which can"
" affect the scroll position and perturb normal reading if it happens "
"anywhere else the top of the page."
msgstr "Das automatische Aktualisieren des Streams kann neue Beiträge am Anfang des Stream einfügen. Dies kann die angezeigte Position im Stream beeinflussen, wenn du gerade nicht den Anfang des Streams betrachtest."
#: src/Module/Settings/Display.php:230
#: src/Module/Settings/Display.php:269
msgid "Display emoticons"
msgstr "Zeige Emoticons"
#: src/Module/Settings/Display.php:230
#: src/Module/Settings/Display.php:269
msgid "When enabled, emoticons are replaced with matching symbols."
msgstr "Wenn dies aktiviert ist, werden Text-Emoticons in Beiträgen durch Symbole ersetzt."
#: src/Module/Settings/Display.php:231
#: src/Module/Settings/Display.php:270
msgid "Infinite scroll"
msgstr "Endloses Scrollen"
#: src/Module/Settings/Display.php:231
#: src/Module/Settings/Display.php:270
msgid "Automatic fetch new items when reaching the page end."
msgstr "Automatisch neue Beiträge laden, wenn das Ende der Seite erreicht ist."
#: src/Module/Settings/Display.php:232
#: src/Module/Settings/Display.php:271
msgid "Enable Smart Threading"
msgstr "Intelligentes Threading aktivieren"
#: src/Module/Settings/Display.php:232
#: src/Module/Settings/Display.php:271
msgid "Enable the automatic suppression of extraneous thread indentation."
msgstr "Schaltet das automatische Unterdrücken von überflüssigen Thread-Einrückungen ein."
#: src/Module/Settings/Display.php:233
#: src/Module/Settings/Display.php:272
msgid "Display the Dislike feature"
msgstr "Das \"Nicht-mögen\" Feature anzeigen"
#: src/Module/Settings/Display.php:233
#: src/Module/Settings/Display.php:272
msgid ""
"Display the Dislike button and dislike reactions on posts and comments."
msgstr "Einen \"Ich mag das nicht\" Button und die dislike Reaktion auf Beiträge und Kommentare anzeigen."
#: src/Module/Settings/Display.php:234
#: src/Module/Settings/Display.php:273
msgid "Display the resharer"
msgstr "Teilenden anzeigen"
#: src/Module/Settings/Display.php:234
#: src/Module/Settings/Display.php:273
msgid "Display the first resharer as icon and text on a reshared item."
msgstr "Zeige das Profilbild des ersten Kontakts von dem ein Beitrag geteilt wurde."
#: src/Module/Settings/Display.php:235
#: src/Module/Settings/Display.php:274
msgid "Stay local"
msgstr "Bleib lokal"
#: src/Module/Settings/Display.php:235
#: src/Module/Settings/Display.php:274
msgid "Don't go to a remote system when following a contact link."
msgstr "Gehe nicht zu einem Remote-System, wenn einem Kontaktlink gefolgt wird"
#: src/Module/Settings/Display.php:236
#: src/Module/Settings/Display.php:275
msgid "Link preview mode"
msgstr "Vorschau Modus für Links"
#: src/Module/Settings/Display.php:238
#: src/Module/Settings/Display.php:275
msgid "Appearance of the link preview that is added to each post with a link."
msgstr "Aussehen der Linkvorschau, die zu jedem Beitrag mit einem Link hinzugefügt wird."
#: src/Module/Settings/Display.php:277
msgid "Beginning of week:"
msgstr "Wochenbeginn:"
#: src/Module/Settings/Display.php:278
msgid "Default calendar view:"
msgstr "Standard-Kalenderansicht:"
#: src/Module/Settings/Features.php:74
msgid "Additional Features"
msgstr "Zusätzliche Features"
@ -11598,11 +11606,11 @@ msgstr "Zum Inhalt der Seite gehen"
msgid "Back to top"
msgstr "Zurück nach Oben"
#: view/theme/frio/theme.php:217
#: view/theme/frio/theme.php:218
msgid "Guest"
msgstr "Gast"
#: view/theme/frio/theme.php:220
#: view/theme/frio/theme.php:221
msgid "Visitor"
msgstr "Besucher"

View file

@ -2401,7 +2401,9 @@ $a->strings['Display the first resharer as icon and text on a reshared item.'] =
$a->strings['Stay local'] = 'Bleib lokal';
$a->strings['Don\'t go to a remote system when following a contact link.'] = 'Gehe nicht zu einem Remote-System, wenn einem Kontaktlink gefolgt wird';
$a->strings['Link preview mode'] = 'Vorschau Modus für Links';
$a->strings['Appearance of the link preview that is added to each post with a link.'] = 'Aussehen der Linkvorschau, die zu jedem Beitrag mit einem Link hinzugefügt wird.';
$a->strings['Beginning of week:'] = 'Wochenbeginn:';
$a->strings['Default calendar view:'] = 'Standard-Kalenderansicht:';
$a->strings['Additional Features'] = 'Zusätzliche Features';
$a->strings['Connected Apps'] = 'Verbundene Programme';
$a->strings['Remove authorization'] = 'Autorisierung entziehen';

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,8 @@
<link rel="stylesheet" type="text/css" href="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" />
<link rel="stylesheet" type="text/css" href="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.print.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" media="print" />
<script type="text/javascript" src="{{$baseurl}}/view/asset/moment/min/moment-with-locales.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<script type="text/javascript" src="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<script>
function showEvent(eventid) {
$.get(
@ -10,7 +15,7 @@
function doEventPreview() {
$('#event-edit-preview').val(1);
$.post('calendar', $('#event-edit-form').serialize(), function(data) {
$.post('events', $('#event-edit-form').serialize(), function(data) {
$.colorbox({ html: data });
});
$('#event-edit-preview').val(0);
@ -26,6 +31,7 @@
$(document).ready(function() {
$('#events-calendar').fullCalendar({
defaultView: '{{$i18n.defaultView|escape:'quotes'}}',
firstDay: '{{$i18n.firstDay|escape:'quotes'}}',
monthNames: [
'{{$i18n.January|escape:'quotes'}}',
@ -87,13 +93,13 @@
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
timeFormat: 'H(:mm)',
eventClick: function(calEvent, jsEvent, view) {
timeFormat: 'H:mm',
eventClick: function(calEvent) {
showEvent(calEvent.id);
},
loading: function(isLoading, view) {
loading: function(isLoading) {
if(!isLoading) {
$('td.fc-day').dblclick(function() { window.location.href='calendar/event/new?start=' + $(this).data('date'); });
$('td.fc-day').dblclick(function() { window.location.href='/calendar/event/new?start=' + $(this).data('date'); });
}
},
@ -101,57 +107,39 @@
if (event.item['author-name']==null) return;
switch(view.name){
case "month":
element.find(".fc-title").html(
"<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(
event.item['author-avatar'],
event.item['author-name'],
event.title
));
break;
element.find(".fc-title").html(
"{0}".format(
event.title
));
break;
case "agendaWeek":
element.find(".fc-title").html(
"<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-avatar'],
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
element.find(".fc-title").html(
"{0}<p>{1}</p><p>{2}</p>".format(
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
case "agendaDay":
element.find(".fc-title").html(
"<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(
event.item['author-avatar'],
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
element.find(".fc-title").html(
"{0}<p>{1}</p><p>{2}</p>".format(
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
}
}
})
// center on date
var args=location.href.replace(baseurl,"").split("/");
{{if $modparams == 2}}
if (args.length>=5) {
$("#events-calendar").fullCalendar('gotoDate',args[3] , args[4]-1);
}
{{else}}
if (args.length>=4) {
$("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1);
}
{{/if}}
// show event popup
var hash = location.hash.split("-")
if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
let hash = location.hash.split("-");
if (hash.length === 2 && hash[0] === "#link") showEvent(hash[1]);
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#comment-edit-text-desc").bbco_autocomplete('bbcode');
@ -166,7 +154,7 @@
}).trigger('change');
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
let selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
selstr = $(this).html();
$('#jot-public').hide();
@ -174,15 +162,12 @@
if(selstr == null) {
$('#jot-public').show();
}
}).trigger('change');
// disable the finish time input if the user disable it
$('#id_nofinish').change(function() {
enableDisableFinishDate()
}).trigger('change');
});
</script>

View file

@ -24,6 +24,7 @@
<h2>{{$calendar_title}}</h2>
{{include file="field_select.tpl" field=$first_day_of_week}}
{{include file="field_select.tpl" field=$calendar_default_view}}
<div class="settings-submit-wrapper">
<input type="submit" name="submit" class="settings-submit" value="{{$submit}}"/>

View file

@ -39,7 +39,7 @@ $(document).ready(function () {
});
}
},
defaultView: "month",
defaultView: aStr.defaultView,
aspectRatio: 1,
eventRender: function (event, element, view) {
switch (view.name) {

View file

@ -63,6 +63,7 @@
aStr.dtendLabel = '{{$i18n.dtend_label|escape:'quotes'}}';
aStr.locationLabel = '{{$i18n.location_label|escape:'quotes'}}';
aStr.defaultView = '{{$i18n.defaultView|escape:'quotes'}}';
var calendar_api = '{{$calendar_api}}';
var event_api = '{{$event_api}}';

View file

@ -86,6 +86,7 @@
<div id="calendar-settings-content" class="panel-collapse collapse{{if !$theme && !$mobile_theme && !$theme_config}} in{{/if}}" role="tabpanel" aria-labelledby="calendar-settings">
<div class="panel-body">
{{include file="field_select.tpl" field=$first_day_of_week}}
{{include file="field_select.tpl" field=$calendar_default_view}}
</div>
<div class="panel-footer">
<button type="submit" name="submit" class="btn btn-primary" value="{{$submit}}">{{$submit}}</button>

View file

@ -1,178 +0,0 @@
<link rel="stylesheet" type="text/css" href="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" />
<link rel="stylesheet" type="text/css" href="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.print.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" media="print" />
<script type="text/javascript" src="{{$baseurl}}/view/asset/moment/min/moment-with-locales.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<script type="text/javascript" src="{{$baseurl}}/view/asset/fullcalendar/dist/fullcalendar.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<script>
function showEvent(eventid) {
$.get(
'{{$event_api}}/'+ eventid,
function(data){
$.colorbox({html:data});
}
);
}
function doEventPreview() {
$('#event-edit-preview').val(1);
$.post('events',$('#event-edit-form').serialize(), function(data) {
$.colorbox({ html: data });
});
$('#event-edit-preview').val(0);
}
// disable the input for the finish date if it is not available
function enableDisableFinishDate() {
if( $('#id_nofinish').is(':checked'))
$('#id_finish_text').prop("disabled", true);
else
$('#id_finish_text').prop("disabled", false);
}
$(document).ready(function() {
$('#events-calendar').fullCalendar({
firstDay: '{{$i18n.firstDay|escape:'quotes'}}',
monthNames: [
'{{$i18n.January|escape:'quotes'}}',
'{{$i18n.February|escape:'quotes'}}',
'{{$i18n.March|escape:'quotes'}}',
'{{$i18n.April|escape:'quotes'}}',
'{{$i18n.May|escape:'quotes'}}',
'{{$i18n.June|escape:'quotes'}}',
'{{$i18n.July|escape:'quotes'}}',
'{{$i18n.August|escape:'quotes'}}',
'{{$i18n.September|escape:'quotes'}}',
'{{$i18n.October|escape:'quotes'}}',
'{{$i18n.November|escape:'quotes'}}',
'{{$i18n.December|escape:'quotes'}}'
],
monthNamesShort: [
'{{$i18n.Jan|escape:'quotes'}}',
'{{$i18n.Feb|escape:'quotes'}}',
'{{$i18n.Mar|escape:'quotes'}}',
'{{$i18n.Apr|escape:'quotes'}}',
'{{$i18n.May|escape:'quotes'}}',
'{{$i18n.Jun|escape:'quotes'}}',
'{{$i18n.Jul|escape:'quotes'}}',
'{{$i18n.Aug|escape:'quotes'}}',
'{{$i18n.Sep|escape:'quotes'}}',
'{{$i18n.Oct|escape:'quotes'}}',
'{{$i18n.Nov|escape:'quotes'}}',
'{{$i18n.Dec|escape:'quotes'}}'
],
dayNames: [
'{{$i18n.Sunday|escape:'quotes'}}',
'{{$i18n.Monday|escape:'quotes'}}',
'{{$i18n.Tuesday|escape:'quotes'}}',
'{{$i18n.Wednesday|escape:'quotes'}}',
'{{$i18n.Thursday|escape:'quotes'}}',
'{{$i18n.Friday|escape:'quotes'}}',
'{{$i18n.Saturday|escape:'quotes'}}'
],
dayNamesShort: [
'{{$i18n.Sun|escape:'quotes'}}',
'{{$i18n.Mon|escape:'quotes'}}',
'{{$i18n.Tue|escape:'quotes'}}',
'{{$i18n.Wed|escape:'quotes'}}',
'{{$i18n.Thu|escape:'quotes'}}',
'{{$i18n.Fri|escape:'quotes'}}',
'{{$i18n.Sat|escape:'quotes'}}'
],
allDayText: '{{$i18n.allday|escape:'quotes'}}',
noEventsMessage: '{{$i18n.noevent|escape:'quotes'}}',
buttonText: {
today: '{{$i18n.today|escape:'quotes'}}',
month: '{{$i18n.month|escape:'quotes'}}',
week: '{{$i18n.week|escape:'quotes'}}',
day: '{{$i18n.day|escape:'quotes'}}'
},
events: '{{$calendar_api}}',
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
timeFormat: 'H:mm',
eventClick: function(calEvent, jsEvent, view) {
showEvent(calEvent.id);
},
loading: function(isLoading, view) {
if(!isLoading) {
$('td.fc-day').dblclick(function() { window.location.href='/calendar/event/new?start=' + $(this).data('date'); });
}
},
eventRender: function(event, element, view) {
if (event.item['author-name']==null) return;
switch(view.name){
case "month":
element.find(".fc-title").html(
"{0}".format(
event.title
));
break;
case "agendaWeek":
element.find(".fc-title").html(
"{0}<p>{1}</p><p>{2}</p>".format(
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
case "agendaDay":
element.find(".fc-title").html(
"{0}<p>{1}</p><p>{2}</p>".format(
event.item['author-name'],
event.item.desc,
event.item.location
));
break;
}
}
})
// show event popup
var hash = location.hash.split("-")
if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]);
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#comment-edit-text-desc").bbco_autocomplete('bbcode');
$('#id_share').change(function() {
if ($('#id_share').is(':checked')) {
$('#acl-wrapper').show();
}
else {
$('#acl-wrapper').hide();
}
}).trigger('change');
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
selstr = $(this).html();
$('#jot-public').hide();
});
if(selstr == null) {
$('#jot-public').show();
}
}).trigger('change');
// disable the finish time input if the user disable it
$('#id_nofinish').change(function() {
enableDisableFinishDate()
}).trigger('change');
});
</script>