Compare commits

..

1 Commits

Author SHA1 Message Date
Tobias Diekershoff 8e461fb7bd
Merge pull request #5154 from MrPetovan/master
Fix version number in database.sql
2018-06-01 13:48:50 +02:00
80 changed files with 12226 additions and 17613 deletions

4
.gitattributes vendored
View File

@ -1,2 +1,2 @@
# Disable LF normalization for all files
* -text
# Disable LF normalization for all files
* -text

126
.gitignore vendored
View File

@ -1,65 +1,61 @@
favicon.*
.htconfig.php
.htpreconfig.php
\#*
include/jquery-1.4.2.min.js
*.log
*.out
*.version*
favicon.*
home.html
addon
*~
robots.txt
#ignore documentation, it should be newly built
doc/html
#ignore reports, should be generted with every build
report/
#ignore config files from eclipse, we don't want IDE files in our repository
.project
.buildpath
.externalToolBuilders
.settings
#ignore OSX .DS_Store files
.DS_Store
#ignore NetBeans IDE's private files (at least)
/nbproject/private/
#ignore smarty cache
/view/smarty3/compiled/
#ignore cache folders
/privacy_image_cache/
/photo/
/proxy/
nbproject
#ignore vagrant dir
.vagrant/
#ignore local folder
/local/
#ignore config files from Visual Studio
/.vs/
/php_friendica.phpproj
/php_friendica.sln
/php_friendica.phpproj.user
#ignore things from transifex-client
venv/
#ignore Composer dependencies
/vendor
/view/asset
#ignore config files from JetBrains
/.idea
#ignore addons/ directory
addons/
favicon.*
.htconfig.php
.htpreconfig.php
\#*
include/jquery-1.4.2.min.js
*.log
*.out
*.version*
favicon.*
home.html
addon
*.orig
*~
robots.txt
#ignore documentation, it should be newly built
doc/html
#ignore reports, should be generted with every build
report/
#ignore config files from eclipse, we don't want IDE files in our repository
.project
.buildpath
.externalToolBuilders
.settings
#ignore OSX .DS_Store files
.DS_Store
/nbproject/private/
#ignore smarty cache
/view/smarty3/compiled/
#ignore cache folders
/privacy_image_cache/
/photo/
/proxy/
nbproject
#ignore vagrant dir
.vagrant/
#ignore local folder
/local/
#ignore config files from Visual Studio
/.vs/
/php_friendica.phpproj
/php_friendica.sln
/php_friendica.phpproj.user
#ignore things from transifex-client
venv/
#ignore Composer dependencies
/vendor
/view/asset
#ignore config files from JetBrains
/.idea

View File

@ -4,7 +4,7 @@ AddType audio/ogg .oga
#AddHandler php53-cgi .php
<FilesMatch "\.(out|log)$">
<IfModule authz_host_module>
<IfModule authz_host_module>
#Apache 2.4
Require all denied
</IfModule>
@ -38,3 +38,4 @@ AddType audio/ogg .oga
RewriteRule ^(.*)$ index.php?pagename=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
</IfModule>

View File

@ -7,14 +7,4 @@ php:
- 7.1
- 7.2
services:
- mysql
env:
- USER=travis DB=test
install:
- composer install
before_script:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
# In order to avoid bin/worker.php warnings
- touch .htconfig.php
install: composer install

View File

@ -1 +1 @@
2018.08-dev
2018.05

View File

@ -6,38 +6,8 @@
*
* This script was taken from http://php.net/manual/en/function.pcntl-fork.php
*/
use Friendica\App;
use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\Worker;
// Ensure that daemon.php is executed from the base path of the installation
if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != "/") {
$directory = $_SERVER["PWD"]."/".$directory;
}
$directory = realpath($directory."/..");
chdir($directory);
}
require_once "boot.php";
require_once "include/dba.php";
$a = new App(dirname(__DIR__));
BaseObject::setApp($a);
require_once ".htconfig.php";
dba::connect($db_host, $db_user, $db_pass, $db_data);
Config::load();
if (!isset($pidfile)) {
die('Please specify a pid file in the variable $pidfile in the .htconfig.php. For example:'."\n".
'$pidfile = "/path/to/daemon.pid";'."\n");
function shutdown() {
posix_kill(posix_getpid(), SIGHUP);
}
if (in_array("start", $_SERVER["argv"])) {
@ -60,11 +30,27 @@ if (empty($_SERVER["argv"][0])) {
die("Unexpected script behaviour. This message should never occur.\n");
}
$pid = @file_get_contents($pidfile);
// Fetch the base directory
$directory = dirname($_SERVER["argv"][0]);
if (empty($pid) && in_array($mode, ["stop", "status"])) {
Config::set('system', 'worker_daemon_mode', false);
die("Pidfile wasn't found. Is the daemon running?\n");
if (substr($directory, 0, 1) != "/") {
$directory = $_SERVER["PWD"]."/".$directory;
}
$directory = realpath($directory."/..");
@include($directory."/.htconfig.php");
if (!isset($pidfile)) {
die('Please specify a pid file in the variable $pidfile in the .htconfig.php. For example:'."\n".
'$pidfile = "/path/to/daemon.pid";'."\n");
}
if (in_array($mode, array("stop", "status"))) {
$pid = @file_get_contents($pidfile);
if (!$pid) {
die("Pidfile wasn't found. Is the daemon running?\n");
}
}
if ($mode == "status") {
@ -74,7 +60,6 @@ if ($mode == "status") {
unlink($pidfile);
Config::set('system', 'worker_daemon_mode', false);
die("Daemon process $pid isn't running.\n");
}
@ -83,19 +68,17 @@ if ($mode == "stop") {
unlink($pidfile);
logger("Worker daemon process $pid was killed.", LOGGER_DEBUG);
Config::set('system', 'worker_daemon_mode', false);
die("Worker daemon process $pid was killed.\n");
}
if (!empty($pid) && posix_kill($pid, 0)) {
die("Daemon process $pid is already running.\n");
}
logger('Starting worker daemon.', LOGGER_DEBUG);
echo "Starting worker daemon.\n";
if (isset($a->config['php_path'])) {
$php = $a->config['php_path'];
} else {
$php = "php";
}
// Switch over to daemon mode.
if ($pid = pcntl_fork())
return; // Parent
@ -112,51 +95,32 @@ if (posix_setsid() < 0)
if ($pid = pcntl_fork())
return; // Parent
// We lose the database connection upon forking
dba::connect($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
Config::set('system', 'worker_daemon_mode', true);
// Just to be sure that this script really runs endlessly
set_time_limit(0);
$pid = getmypid();
file_put_contents($pidfile, $pid);
$wait_interval = intval(Config::get('system', 'cron_interval', 5)) * 60;
$do_cron = true;
$last_cron = 0;
// Now running as a daemon.
while (true) {
if (!$do_cron && ($last_cron + $wait_interval) < time()) {
logger('Forcing cron worker call.', LOGGER_DEBUG);
$do_cron = true;
// Just to be sure that this script really runs endlessly
set_time_limit(0);
// Call the worker
$cmdline = $php.' bin/worker.php';
$executed = false;
if (function_exists('proc_open')) {
$resource = proc_open($cmdline . ' &', array(), $foo, $directory);
if (is_resource($resource)) {
$executed = true;
proc_close($resource);
}
}
Worker::spawnWorker($do_cron);
if ($do_cron) {
$last_cron = time();
if (!$executed) {
exec($cmdline.' spawn');
}
logger("Sleeping", LOGGER_DEBUG);
$i = 0;
do {
sleep(1);
} while (($i++ < $wait_interval) && !Worker::IPCJobsExists());
if ($i >= $wait_interval) {
$do_cron = true;
logger("Woke up after $wait_interval seconds.", LOGGER_DEBUG);
} else {
$do_cron = false;
logger("Worker jobs are calling to be forked.", LOGGER_DEBUG);
}
}
function shutdown() {
posix_kill(posix_getpid(), SIGHUP);
// Now sleep for 5 minutes
sleep(300);
}

View File

@ -39,9 +39,9 @@ require_once 'include/text.php';
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily');
define('FRIENDICA_VERSION', '2018.08-dev');
define('FRIENDICA_VERSION', '2018.05');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1268);
define('DB_UPDATE_VERSION', 1266);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/**
@ -1076,7 +1076,6 @@ function is_site_admin()
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
//if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email']))
/// @TODO This if() + 2 returns can be shrinked into one return
if (local_user() && x($a->user, 'email') && x($a->config, 'admin_email') && in_array($a->user['email'], $adminlist)) {
return true;
}
@ -1174,7 +1173,7 @@ function random_digits($digits)
{
$rn = '';
for ($i = 0; $i < $digits; $i++) {
/// @TODO Avoid rand/mt_rand, when it comes to cryptography, they are generating predictable (seedable) numbers.
/// @TODO rand() is different to mt_rand() and maybe lesser "random"
$rn .= rand(0, 9);
}
return $rn;
@ -1188,7 +1187,7 @@ function get_server()
$server = "https://dir.friendica.social";
}
return $server;
return($server);
}
function get_temppath()
@ -1237,7 +1236,7 @@ function get_cachefile($file, $writemode = true)
$cache = get_itemcachepath();
if ((!$cache) || (!is_dir($cache))) {
return "";
return("");
}
$subfolder = $cache . "/" . substr($file, 0, 2);
@ -1251,6 +1250,7 @@ function get_cachefile($file, $writemode = true)
}
}
/// @TODO no need to put braces here
return $cachepath;
}
@ -1357,6 +1357,7 @@ function get_spoolpath()
return "";
}
if (!function_exists('exif_imagetype')) {
function exif_imagetype($file)
{
@ -1394,7 +1395,7 @@ function validate_include(&$file)
}
// Simply return flag
return $valid;
return ($valid);
}
function current_load()

View File

@ -47,8 +47,7 @@
],
"autoload": {
"psr-4": {
"Friendica\\": "src/",
"Friendica\\Test\\": "tests/"
"Friendica\\": "src/"
},
"psr-0": {
"": "library/"
@ -69,13 +68,5 @@
"exclude": [
"log", "cache", "/photo", "/proxy"
]
},
"require-dev": {
"phpunit/dbunit": "^2.0",
"phpdocumentor/reflection-docblock": "^3.0.2",
"phpunit/php-token-stream": "^1.4.2"
},
"scripts": {
"test": "phpunit"
}
}

1379
composer.lock generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,6 @@ Friendica Documentation and Resources
* [Translate Friendica](help/translations)
* [Use Composer](help/Composer)
* [Move classes to `src`](help/Developer-How-To-Move-Classes-to-src)
* [Run tests](help/Tests)
* Reference
* [Twitter/GNU Social API Functions](help/api)
* [Code (Doxygen generated - sets cookies)](doc/html/)
@ -73,3 +72,4 @@ Friendica Documentation and Resources
* [Site/Version Info](friendica)
* [Friendica Credits](credits)

View File

@ -1,18 +0,0 @@
# Themes
* [Home](help)
You can run unit tests with [PHPUnit](https://phpunit.de/):
```bash
phpunit
```
Some tests require access to a MySQL database.
You can specify the database credentials in environment variables:
```bash
USER=database_user PASS=database_password DB=database_name phpunit
```
**Warning**: This will empty all the tables! Never use this on a production database.

View File

@ -56,7 +56,6 @@ Friendica - Dokumentation und Ressourcen
* [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/)
* [Twitter/GNU Social API Functions](help/api) (EN)
* [Translation of Friendica](help/translations) (EN)
* [Run tests](help/Tests) (EN)
**Externe Ressourcen**
@ -73,3 +72,4 @@ Friendica - Dokumentation und Ressourcen
* [Seite/Friendica-Version](friendica)
* [Mitwirkenden bei Friendica](credits)

View File

@ -344,14 +344,6 @@ Mit den folgenden Einstellungen kannst du die Zugriffsdaten für den Datenbank S
$db_pass = 'db_password';
$db_data = 'database_name';
Sollten alle der folgenden Environment-Variablen gesetzt sein, wird Friendica diese anstatt der vorher konfigurierten Werte nutzen.
MYSQL_HOST
MYSQL_PORT
MYSQL_USERNAME
MYSQL_PASSWORD
MYSQL_DATABASE
## Administratoren
Du kannst einen, oder mehrere Accounts, zu Administratoren machen.

View File

@ -124,11 +124,3 @@ The configuration variables db_host, db_user, db_pass and db_data are holding yo
If you need to specify a port to access the database, you can do so by appending ":portnumber" to the db_host variable.
$db_host = 'your.mysqlhost.com:123456';
If all of the following environment variables are set, Friendica will use them instead of the previously configured variables for the db:
MYSQL_HOST
MYSQL_PORT
MYSQL_USERNAME
MYSQL_PASSWORD
MYSQL_DATABASE

View File

@ -54,7 +54,7 @@ define('API_METHOD_POST', 'POST,PUT');
define('API_METHOD_DELETE', 'POST,DELETE');
$API = [];
$called_api = [];
$called_api = null;
/**
* It is not sufficient to use local_user() to check whether someone is allowed to use the API,
@ -492,7 +492,7 @@ function api_rss_extra(App $a, $arr, $user_info)
*/
function api_unique_id_to_nurl($id)
{
$r = dba::selectFirst('contact', ['nurl'], ['id' => $id]);
$r = dba::selectFirst('contact', ['nurl'], ['uid' => 0, 'id' => $id]);
if (DBM::is_result($r)) {
return $r["nurl"];
@ -532,7 +532,7 @@ function api_get_user(App $a, $contact_id = null)
$user = dbesc(api_unique_id_to_nurl(intval($contact_id)));
if ($user == "") {
throw new BadRequestException("User ID ".$contact_id." not found.");
throw new BadRequestException("User not found.");
}
$url = $user;
@ -546,7 +546,7 @@ function api_get_user(App $a, $contact_id = null)
$user = dbesc(api_unique_id_to_nurl($_GET['user_id']));
if ($user == "") {
throw new BadRequestException("User ID ".$_GET['user_id']." not found.");
throw new BadRequestException("User not found.");
}
$url = $user;
@ -670,14 +670,13 @@ function api_get_user(App $a, $contact_id = null)
'statusnet_profile_url' => $r[0]["url"],
'uid' => 0,
'cid' => Contact::getIdForURL($r[0]["url"], api_user(), true),
'pid' => Contact::getIdForURL($r[0]["url"], 0, true),
'self' => 0,
'network' => $r[0]["network"],
];
return $ret;
} else {
throw new BadRequestException("User ".$url." not found.");
throw new BadRequestException("User not found.");
}
}
@ -810,7 +809,6 @@ function api_get_user(App $a, $contact_id = null)
'statusnet_profile_url' => $uinfo[0]['url'],
'uid' => intval($uinfo[0]['uid']),
'cid' => intval($uinfo[0]['cid']),
'pid' => Contact::getIdForURL($uinfo[0]["url"], 0, true),
'self' => $uinfo[0]['self'],
'network' => $uinfo[0]['network'],
];
@ -858,12 +856,16 @@ function api_get_user(App $a, $contact_id = null)
*/
function api_item_get_user(App $a, $item)
{
$status_user = api_get_user($a, $item["author-id"]);
$status_user = api_get_user($a, $item["author-link"]);
$status_user["protected"] = $item["private"];
$status_user["protected"] = (($item["allow_cid"] != "") ||
($item["allow_gid"] != "") ||
($item["deny_cid"] != "") ||
($item["deny_gid"] != "") ||
$item["private"]);
if ($item['thr-parent'] == $item['uri']) {
$owner_user = api_get_user($a, $item["owner-id"]);
$owner_user = api_get_user($a, $item["owner-link"]);
} else {
$owner_user = $status_user;
}
@ -933,7 +935,7 @@ function api_reformat_xml(&$item, &$key)
*
* @return string The XML data
*/
function api_create_xml(array $data, $root_element)
function api_create_xml($data, $root_element)
{
$childname = key($data);
$data2 = array_pop($data);
@ -958,7 +960,7 @@ function api_create_xml(array $data, $root_element)
$i = 1;
foreach ($data2 as $item) {
$data4[$i++ . ":" . $childname] = $item;
$data4[$i++.":".$childname] = $item;
}
$data2 = $data4;
@ -1066,7 +1068,7 @@ function requestdata($k)
}
/**
* Deprecated function to upload media.
* Waitman Gobble Mod
*
* @param string $type Return type (atom, rss, xml, json)
*
@ -1098,12 +1100,14 @@ function api_statuses_mediap($type)
}
$txt = HTML::toBBCode($txt);
$a->argv[1] = $user_info['screen_name']; //should be set to username?
$a->argv[1]=$user_info['screen_name']; //should be set to username?
$picture = wall_upload_post($a, false);
// tell wall_upload function to return img info instead of echo
$_REQUEST['hush'] = 'yeah';
$bebop = wall_upload_post($a);
// now that we have the img url in bbcode we can add it to the status and insert the wall item.
$_REQUEST['body'] = $txt . "\n\n" . '[url=' . $picture["albumpage"] . '][img]' . $picture["preview"] . "[/img][/url]";
$_REQUEST['body'] = $txt . "\n\n" . $bebop;
item_post($a);
// this should output the last post (the one we just posted).
@ -1252,9 +1256,10 @@ function api_statuses_update($type)
if (x($_FILES, 'media')) {
// upload the image if we have one
$picture = wall_upload_post($a, false);
if (is_array($picture)) {
$_REQUEST['body'] .= "\n\n" . '[url=' . $picture["albumpage"] . '][img]' . $picture["preview"] . "[/img][/url]";
$_REQUEST['hush'] = 'yeah'; //tell wall_upload function to return img info instead of echo
$media = wall_upload_post($a);
if (strlen($media) > 0) {
$_REQUEST['body'] .= "\n\n" . $media;
}
}
@ -1351,17 +1356,31 @@ function api_status_show($type)
logger('api_status_show: user_info: '.print_r($user_info, true), LOGGER_DEBUG);
if ($type == "raw") {
$privacy_sql = "AND NOT `private`";
$privacy_sql = "AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''";
} else {
$privacy_sql = "";
}
// get last public wall message
$condition = ["`owner-id` = ? AND `uid` = ? AND `type` != 'activity' ".$privacy_sql,
$user_info['pid'], api_user()];
$lastwall = dba::selectFirst('item', [], $condition, ['order' => ['id' => true]]);
$lastwall = q(
"SELECT `item`.*
FROM `item`
WHERE `item`.`contact-id` = %d AND `item`.`uid` = %d
AND ((`item`.`author-link` IN ('%s', '%s')) OR (`item`.`owner-link` IN ('%s', '%s')))
AND `item`.`type` != 'activity' $privacy_sql
ORDER BY `item`.`id` DESC
LIMIT 1",
intval($user_info['cid']),
intval(api_user()),
dbesc($user_info['url']),
dbesc(normalise_link($user_info['url'])),
dbesc($user_info['url']),
dbesc(normalise_link($user_info['url']))
);
if (DBM::is_result($lastwall)) {
$lastwall = $lastwall[0];
$in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall);
@ -1409,10 +1428,10 @@ function api_status_show($type)
$status_info["entities"] = $converted["entities"];
}
if ($status_info["source"] == 'web') {
$status_info["source"] = ContactSelector::networkToName($lastwall['network'], $user_info['url']);
} elseif (ContactSelector::networkToName($lastwall['network'], $user_info['url']) != $status_info["source"]) {
$status_info["source"] = trim($status_info["source"].' ('.ContactSelector::networkToName($lastwall['network'], $user_info['url']).')');
if (($lastwall['item_network'] != "") && ($status_info["source"] == 'web')) {
$status_info["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
} elseif (($lastwall['item_network'] != "") && (ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) != $status_info["source"])) {
$status_info["source"] = trim($status_info["source"].' ('.ContactSelector::networkToName($lastwall['item_network'], $user_info['url']).')');
}
// "uid" and "self" are only needed for some internal stuff, so remove it from here
@ -1441,12 +1460,28 @@ function api_users_show($type)
$a = get_app();
$user_info = api_get_user($a);
$condition = ["`owner-id` = ? AND `uid` = ? AND `verb` = ? AND `type` != 'activity' AND NOT `private`",
$user_info['pid'], api_user(), ACTIVITY_POST];
$lastwall = dba::selectFirst('item', [], $condition, ['order' => ['id' => true]]);
$lastwall = q(
"SELECT `item`.*
FROM `item`
INNER JOIN `contact` ON `contact`.`id`=`item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
WHERE `item`.`uid` = %d AND `verb` = '%s' AND `item`.`contact-id` = %d
AND ((`item`.`author-link` IN ('%s', '%s')) OR (`item`.`owner-link` IN ('%s', '%s')))
AND `type`!='activity'
AND `item`.`allow_cid`='' AND `item`.`allow_gid`='' AND `item`.`deny_cid`='' AND `item`.`deny_gid`=''
ORDER BY `id` DESC
LIMIT 1",
intval(api_user()),
dbesc(ACTIVITY_POST),
intval($user_info['cid']),
dbesc($user_info['url']),
dbesc(normalise_link($user_info['url'])),
dbesc($user_info['url']),
dbesc(normalise_link($user_info['url']))
);
if (DBM::is_result($lastwall)) {
$lastwall = $lastwall[0];
$in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall);
@ -1484,12 +1519,12 @@ function api_users_show($type)
$user_info["status"]["entities"] = $converted["entities"];
}
if ($user_info["status"]["source"] == 'web') {
$user_info["status"]["source"] = ContactSelector::networkToName($lastwall['network'], $user_info['url']);
if (($lastwall['item_network'] != "") && ($user_info["status"]["source"] == 'web')) {
$user_info["status"]["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
}
if (ContactSelector::networkToName($lastwall['network'], $user_info['url']) != $user_info["status"]["source"]) {
$user_info["status"]["source"] = trim($user_info["status"]["source"] . ' (' . ContactSelector::networkToName($lastwall['network'], $user_info['url']) . ')');
if (($lastwall['item_network'] != "") && (ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) != $user_info["status"]["source"])) {
$user_info["status"]["source"] = trim($user_info["status"]["source"] . ' (' . ContactSelector::networkToName($lastwall['item_network'], $user_info['url']) . ')');
}
}
@ -1538,10 +1573,10 @@ function api_users_search($type)
}
$userlist = ["users" => $userlist];
} else {
throw new BadRequestException("User ".$_GET["q"]." not found.");
throw new BadRequestException("User not found.");
}
} else {
throw new BadRequestException("No user specified.");
throw new BadRequestException("User not found.");
}
return api_format_data("users", $type, $userlist);
@ -1700,14 +1735,19 @@ function api_statuses_home_timeline($type)
$sql_extra .= ' AND `item`.`parent` = ' . intval($conversation_id);
}
$r = q("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
$sql_extra
AND `item`.`id` > %d
ORDER BY `item`.`id` DESC LIMIT %d ,%d",
AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()),
dbesc(ACTIVITY_POST),
intval($since_id),
@ -1976,8 +2016,12 @@ function api_statuses_show($type)
$id = $item['id'];
$r = q(
"SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`uid` IN (0, %d) AND `item`.`verb` = '%s'
@ -2063,8 +2107,13 @@ function api_conversation_show($type)
$sql_extra = ' AND `item`.`id` <= ' . intval($max_id);
}
$r = q("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`parent` = %d AND `item`.`visible`
AND NOT `item`.`moderated` AND NOT `item`.`deleted`
@ -2126,11 +2175,17 @@ function api_statuses_repeat($type)
logger('API: api_statuses_repeat: '.$id);
$r = q("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`nick` as `reply_author`,
`contact`.`name`, `contact`.`photo` as `reply_photo`, `contact`.`url` as `reply_url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND NOT `item`.`private`
AND NOT `item`.`private` AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = ''
AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
AND `item`.`id`=%d",
intval($id)
);
@ -2161,7 +2216,7 @@ function api_statuses_repeat($type)
}
// this should output the last post (the one we just posted).
$called_api = [];
$called_api = null;
return api_status_show($type);
}
@ -2244,25 +2299,36 @@ function api_statuses_mentions($type)
$start = ($page - 1) * $count;
// Ugly code - should be changed
$myurl = System::baseUrl() . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl, strpos($myurl, '://') + 3);
$myurl = str_replace('www.', '', $myurl);
$sql_extra = '';
if ($max_id > 0) {
$sql_extra = ' AND `item`.`id` <= ' . intval($max_id);
$sql_extra .= ' AND `item`.`id` <= ' . intval($max_id);
}
$r = q("SELECT `item`.* FROM `item` FORCE INDEX (`uid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item` FORCE INDEX (`uid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `item`.`verb` = '%s'
AND `item`.`author-id` != %d
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND NOT (`item`.`author-link` IN ('https://%s', 'http://%s'))
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`parent` IN (SELECT `iid` FROM `thread` WHERE `uid` = %d AND `mention` AND NOT `ignored`)
AND `item`.`parent` IN (SELECT `iid` FROM `thread` WHERE `uid` = %d AND `mention` AND !`ignored`)
$sql_extra
AND `item`.`id` > %d
ORDER BY `item`.`id` DESC LIMIT %d ,%d",
AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()),
dbesc(ACTIVITY_POST),
intval($user_info['pid']),
dbesc(protect_sprintf($myurl)),
dbesc(protect_sprintf($myurl)),
intval(api_user()),
intval($since_id),
intval($start),
@ -2342,15 +2408,20 @@ function api_statuses_user_timeline($type)
$sql_extra .= ' AND `item`.`id` <= ' . intval($max_id);
}
$r = q("SELECT `item`.* FROM `item` FORCE INDEX (`uid_contactid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item` FORCE INDEX (`uid_contactid_id`)
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`contact-id` = %d
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
$sql_extra
AND `item`.`id` > %d
ORDER BY `item`.`id` DESC LIMIT %d ,%d",
ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()),
dbesc(ACTIVITY_POST),
intval($user_info['cid']),
@ -2495,15 +2566,20 @@ function api_favorites($type)
$sql_extra .= ' AND `item`.`id` <= ' . intval($max_id);
}
$r = q("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`, `contact`
WHERE `item`.`uid` = %d
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`starred`
AND `item`.`visible` = 1 AND `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `item`.`starred` = 1
AND `contact`.`id` = `item`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
$sql_extra
AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d",
ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()),
intval($since_id),
intval($start),
@ -2656,7 +2732,7 @@ function api_convert_item($item)
*
* @param string $body
*
* @return array
* @return array|false
*/
function api_get_attachments(&$body)
{
@ -2667,7 +2743,7 @@ function api_get_attachments(&$body)
$ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images);
if (!$ret) {
return [];
return false;
}
$attachments = [];
@ -2925,8 +3001,8 @@ function api_format_items_activities(&$item, $type = "json")
];
$items = q(
'SELECT * FROM `item`
WHERE `uid` = %d AND `thr-parent` = "%s" AND `visible` AND NOT `deleted`',
'SELECT * FROM item
WHERE uid=%d AND `thr-parent`="%s" AND visible AND NOT deleted',
intval($item['uid']),
dbesc($item['uri'])
);
@ -2936,7 +3012,7 @@ function api_format_items_activities(&$item, $type = "json")
//builtin_activity_puller($i, $activities);
// get user data and add it to the array of the activity
$user = api_get_user($a, $i['author-id']);
$user = api_get_user($a, $i['author-link']);
switch ($i['verb']) {
case ACTIVITY_LIKE:
$activities['like'][] = $user;
@ -3092,18 +3168,26 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json")
$status["entities"] = $converted["entities"];
}
if ($status["source"] == 'web') {
$status["source"] = ContactSelector::networkToName($item['network'], $user_info['url']);
} elseif (ContactSelector::networkToName($item['network'], $user_info['url']) != $status["source"]) {
$status["source"] = trim($status["source"].' ('.ContactSelector::networkToName($item['network'], $user_info['url']).')');
if (($item['item_network'] != "") && ($status["source"] == 'web')) {
$status["source"] = ContactSelector::networkToName($item['item_network'], $user_info['url']);
} elseif (($item['item_network'] != "") && (ContactSelector::networkToName($item['item_network'], $user_info['url']) != $status["source"])) {
$status["source"] = trim($status["source"].' ('.ContactSelector::networkToName($item['item_network'], $user_info['url']).')');
}
// Retweets are only valid for top postings
// It doesn't work reliable with the link if its a feed
//$IsRetweet = ($item['owner-link'] != $item['author-link']);
//if ($IsRetweet)
// $IsRetweet = (($item['owner-name'] != $item['author-name']) || ($item['owner-avatar'] != $item['author-avatar']));
if ($item["id"] == $item["parent"]) {
$retweeted_item = api_share_as_retweet($item);
if ($retweeted_item !== false) {
$retweeted_status = $status;
try {
$retweeted_status["user"] = api_get_user($a, $retweeted_item["author-id"]);
$retweeted_status["user"] = api_get_user($a, $retweeted_item["author-link"]);
} catch (BadRequestException $e) {
// user not found. should be found?
/// @todo check if the user should be always found
@ -3311,8 +3395,13 @@ function api_lists_statuses($type)
$sql_extra .= ' AND `item`.`parent` = ' . intval($conversation_id);
}
$statuses = dba::p("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$statuses = dba::p(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`, `group_member`.`gid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
STRAIGHT_JOIN `group_member` ON `group_member`.`contact-id` = `item`.`contact-id`
WHERE `item`.`uid` = ? AND `verb` = ?
@ -4306,6 +4395,7 @@ function api_fr_photo_create_update($type)
throw new InternalServerErrorException("unknown error - this error on uploading or updating a photo should never happen");
}
/**
* @brief delete a single photo from the database through api
*
@ -4444,7 +4534,6 @@ function api_account_update_profile_image($type)
} else {
throw new InternalServerErrorException('Unsupported filetype');
}
// change specified profile or all profiles to the new resource-id
if ($is_default_profile) {
$condition = ["`profile` AND `resource-id` != ? AND `uid` = ?", $data['photo']['id'], api_user()];
@ -4458,6 +4547,7 @@ function api_account_update_profile_image($type)
Contact::updateSelfFromUserID(api_user(), true);
// Update global directory in background
//$user = api_get_user(get_app());
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url);
@ -4847,8 +4937,13 @@ function prepare_photo_data($type, $scale, $photo_id)
$data['photo']['friendica_activities'] = api_format_items_activities($item[0], $type);
// retrieve comments on photo
$r = q("SELECT `item`.* FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
$r = q(
"SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
`contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
`contact`.`id` AS `cid`
FROM `item`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`parent` = %d AND `item`.`visible`
AND NOT `item`.`moderated` AND NOT `item`.`deleted`
@ -5160,7 +5255,7 @@ function api_in_reply_to($item)
$in_reply_to['status_id_str'] = (string) intval($in_reply_to['status_id']);
$r = q(
"SELECT `contact`.`nick`, `contact`.`name`, `contact`.`id`, `contact`.`url` FROM `item`
"SELECT `contact`.`nick`, `contact`.`name`, `contact`.`id`, `contact`.`url` FROM item
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`author-id`
WHERE `item`.`id` = %d LIMIT 1",
intval($in_reply_to['status_id'])
@ -5194,27 +5289,27 @@ function api_in_reply_to($item)
/**
*
* @param string $text
* @param string $Text
*
* @return string
*/
function api_clean_plain_items($text)
function api_clean_plain_items($Text)
{
$include_entities = strtolower(x($_REQUEST, 'include_entities') ? $_REQUEST['include_entities'] : "false");
$text = BBCode::cleanPictureLinks($text);
$Text = BBCode::cleanPictureLinks($Text);
$URLSearchString = "^\[\]";
$text = preg_replace("/([!#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $text);
$Text = preg_replace("/([!#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
if ($include_entities == "true") {
$text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url=$1]$1[/url]', $text);
$Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '[url=$1]$1[/url]', $Text);
}
// Simplify "attachment" element
$text = api_clean_attachments($text);
$Text = api_clean_attachments($Text);
return $text;
return($Text);
}
/**

View File

@ -116,7 +116,7 @@ function localize_item(&$item) {
$item['body'] = item_redir_and_replace_images($extracted['body'], $extracted['images'], $item['contact-id']);
}
/// @TODO Separted ???
/// @Separted ???
$xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
if (activity_match($item['verb'], ACTIVITY_LIKE)
|| activity_match($item['verb'], ACTIVITY_DISLIKE)
@ -162,19 +162,22 @@ function localize_item(&$item) {
if (activity_match($item['verb'], ACTIVITY_LIKE)) {
$bodyverb = L10n::t('%1$s likes %2$s\'s %3$s');
} elseif (activity_match($item['verb'], ACTIVITY_DISLIKE)) {
}
elseif (activity_match($item['verb'], ACTIVITY_DISLIKE)) {
$bodyverb = L10n::t('%1$s doesn\'t like %2$s\'s %3$s');
} elseif (activity_match($item['verb'], ACTIVITY_ATTEND)) {
}
elseif (activity_match($item['verb'], ACTIVITY_ATTEND)) {
$bodyverb = L10n::t('%1$s attends %2$s\'s %3$s');
} elseif (activity_match($item['verb'], ACTIVITY_ATTENDNO)) {
}
elseif (activity_match($item['verb'], ACTIVITY_ATTENDNO)) {
$bodyverb = L10n::t('%1$s doesn\'t attend %2$s\'s %3$s');
} elseif (activity_match($item['verb'], ACTIVITY_ATTENDMAYBE)) {
}
elseif (activity_match($item['verb'], ACTIVITY_ATTENDMAYBE)) {
$bodyverb = L10n::t('%1$s attends maybe %2$s\'s %3$s');
}
$item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
}
}
if (activity_match($item['verb'], ACTIVITY_FRIEND)) {
if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return;
@ -197,10 +200,10 @@ function localize_item(&$item) {
}
}
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
$A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") {
$Bphoto = '[url=' . Contact::magicLink($Blink) . '][img]' . $Bphoto . '[/img][/url]';
$Bphoto = '[url=' . Profile::zrl($Blink) . '][img]' . $Bphoto . '[/img][/url]';
}
$item['body'] = L10n::t('%1$s is now friends with %2$s', $A, $B)."\n\n\n".$Bphoto;
@ -234,10 +237,10 @@ function localize_item(&$item) {
}
}
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
$A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") {
$Bphoto = '[url=' . Contact::magicLink($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]';
$Bphoto = '[url=' . Profile::zrl($Blink) . '][img=80x80]' . $Bphoto . '[/img][/url]';
}
/*
@ -269,8 +272,8 @@ function localize_item(&$item) {
$obj = $r[0];
$author = '[url=' . Contact::magicLinkById($item['author-id']) . ']' . $item['author-name'] . '[/url]';
$objauthor = '[url=' . Contact::magicLinkById($obj['author-id']) . ']' . $obj['author-name'] . '[/url]';
$author = '[url=' . Profile::zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
$objauthor = '[url=' . Profile::zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]';
switch ($obj['verb']) {
case ACTIVITY_POST:
@ -301,8 +304,8 @@ function localize_item(&$item) {
$item['body'] = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag );
}
if (activity_match($item['verb'], ACTIVITY_FAVORITE)) {
if ($item['object-type'] == "") {
return;
}
@ -323,8 +326,8 @@ function localize_item(&$item) {
$target = $r[0];
$Bname = $target['author-name'];
$Blink = $target['author-link'];
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]';
$A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
$P = '[url=' . $target['plink'] . ']' . L10n::t('post/item') . '[/url]';
$item['body'] = L10n::t('%1$s marked %2$s\'s %3$s as favorite', $A, $B, $P)."\n";
}
@ -334,7 +337,7 @@ function localize_item(&$item) {
if (preg_match_all('/@\[url=(.*?)\]/is', $item['body'], $matches, PREG_SET_ORDER)) {
foreach ($matches as $mtch) {
if (!strpos($mtch[1], 'zrl=')) {
$item['body'] = str_replace($mtch[0], '@[url=' . Contact::magicLink($mtch[1]) . ']', $item['body']);
$item['body'] = str_replace($mtch[0], '@[url=' . Profile::zrl($mtch[1]) . ']', $item['body']);
}
}
}
@ -347,7 +350,16 @@ function localize_item(&$item) {
}
// add sparkle links to appropriate permalinks
$item['plink'] = Contact::magicLinkById($item['author-id'], $item['plink']);
$x = stristr($item['plink'],'/display/');
if ($x) {
$sparkle = false;
$y = best_link_url($item, $sparkle);
if (strstr($y, '/redir/')) {
$item['plink'] = $y . '?f=&url=' . $item['plink'];
}
}
}
/**
@ -382,9 +394,10 @@ function visible_activity($item) {
}
}
// @TODO below if() block can be rewritten to a single line: $isVisible = allConditionsHere;
if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && empty($item['self']) && $item['uid'] == local_user()) {
return false;
if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE) {
if (!($item['self'] && ($item['uid'] == local_user()))) {
return false;
}
}
return true;
@ -418,6 +431,7 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`inform`,
`item`.`pubmail`,
`item`.`visible`,
`item`.`spam`,
`item`.`bookmark`,
`item`.`unseen`,
`item`.`deleted`,
@ -425,12 +439,10 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`mention`,
`item`.`global`,
`item`.`shadow`,
`item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
`item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
*/
return "`item`.`author-id`,
`item`.`owner-id`,
return "`item`.`author-id`, `item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
`item`.`owner-id`, `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
`item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`,
`item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
`item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`,
@ -442,9 +454,7 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`allow_cid`, `item`.`allow_gid`, `item`.`deny_cid`, `item`.`deny_gid`,
`item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
`author`.`url` AS `author-link`, `author`.`name` AS `author-name`, `author`.`thumb` AS `author-avatar`,
`owner`.`url` AS `owner-link`, `owner`.`name` AS `owner-name`, `owner`.`thumb` AS `owner-avatar`,
`contact`.`url` AS `contact-link`, `contact`.`name` AS `contact-name`, `contact`.`thumb` AS `contact-avatar`,
`author`.`thumb` AS `author-thumb`, `owner`.`thumb` AS `owner-thumb`,
`contact`.`network`, `contact`.`url`, `contact`.`name`, `contact`.`writable`,
`contact`.`self`, `contact`.`id` AS `cid`, `contact`.`alias`,
@ -535,6 +545,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
. ((x($_GET, 'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
. ((x($_GET, 'liked')) ? '&liked=' . $_GET['liked'] : '')
. ((x($_GET, 'conv')) ? '&conv=' . $_GET['conv'] : '')
. ((x($_GET, 'spam')) ? '&spam=' . $_GET['spam'] : '')
. ((x($_GET, 'nets')) ? '&nets=' . $_GET['nets'] : '')
. ((x($_GET, 'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
. ((x($_GET, 'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
@ -660,13 +671,6 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
continue;
}
if ($item['network'] == NETWORK_FEED) {
$item['author-avatar'] = $item['contact-avatar'];
$item['author-name'] = $item['contact-name'];
$item['owner-avatar'] = $item['contact-avatar'];
$item['owner-name'] = $item['contact-name'];
}
$profile_name = (strlen($item['author-name']) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && !$item['author-name']) {
$profile_name = $item['author-link'];
@ -674,10 +678,34 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
$tags = \Friendica\Model\Term::populateTagsFromItem($item);
$profile_link = Contact::magicLinkbyId($item['author-id']);
$sp = false;
$profile_link = best_link_url($item, $sp);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
if (strpos($profile_link, 'redir/') === 0) {
if ($sp) {
$sparkle = ' sparkle';
} else {
$profile_link = Profile::zrl($profile_link);
}
if (!x($item, 'author-thumb') || ($item['author-thumb'] == "")) {
$author_contact = Contact::getDetailsByURL($item['author-link'], $profile_owner);
if ($author_contact["thumb"]) {
$item['author-thumb'] = $author_contact["thumb"];
} else {
$item['author-thumb'] = $item['author-avatar'];
}
}
if (!isset($item['owner-thumb']) || ($item['owner-thumb'] == "")) {
$owner_contact = Contact::getDetailsByURL($item['owner-link'], $profile_owner);
if ($owner_contact["thumb"]) {
$item['owner-thumb'] = $owner_contact["thumb"];
} else {
$item['owner-thumb'] = $item['owner-avatar'];
}
}
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
@ -740,7 +768,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
'name' => $profile_name_e,
'sparkle' => $sparkle,
'lock' => $lock,
'thumb' => System::removedBaseUrl(proxy_url($item['author-avatar'], false, PROXY_SIZE_THUMB)),
'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
'title' => $title_e,
'body' => $body_e,
'tags' => $tags_e,
@ -759,7 +787,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
'indent' => '',
'owner_name' => $owner_name_e,
'owner_url' => $owner_url,
'owner_photo' => System::removedBaseUrl(proxy_url($item['owner-avatar'], false, PROXY_SIZE_THUMB)),
'owner_photo' => System::removedBaseUrl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
'plink' => get_plink($item),
'edpost' => false,
'isstarred' => $isstarred,
@ -899,6 +927,48 @@ function conversation_add_children($parents, $block_authors, $order, $uid) {
return $items;
}
function best_link_url($item, &$sparkle, $url = '') {
$best_url = '';
$sparkle = false;
$clean_url = normalise_link($item['author-link']);
if (local_user()) {
$condition = [
'network' => NETWORK_DFRN,
'uid' => local_user(),
'nurl' => normalise_link($clean_url),
'pending' => false
];
$contact = dba::selectFirst('contact', ['id'], $condition);
if (DBM::is_result($contact)) {
$best_url = 'redir/' . $contact['id'];
$sparkle = true;
if ($url != '') {
$hostname = get_app()->get_hostname();
if (!strstr($url, $hostname)) {
$best_url .= "?url=".$url;
} else {
$best_url = $url;
}
}
}
}
if (!$best_url) {
if ($url != '') {
$best_url = $url;
} elseif (strlen($item['author-link'])) {
$best_url = $item['author-link'];
} else {
$best_url = $item['url'];
}
}
return $best_url;
}
function item_photo_menu($item) {
$sub_link = '';
$poke_link = '';
@ -912,8 +982,11 @@ function item_photo_menu($item) {
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
}
$profile_link = Contact::magicLinkById($item['author-id']);
$sparkle = (strpos($profile_link, 'redir/') === 0);
$sparkle = false;
$profile_link = best_link_url($item, $sparkle);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
$cid = 0;
$network = '';
@ -931,7 +1004,7 @@ function item_photo_menu($item) {
$photos_link = $profile_link . '?url=photos';
$profile_link = $profile_link . '?url=profile';
} else {
$profile_link = Contact::magicLink($profile_link);
$profile_link = Profile::zrl($profile_link);
}
if ($cid && !$item['self']) {
@ -1019,14 +1092,17 @@ function builtin_activity_puller($item, &$conv_responses) {
}
if (activity_match($item['verb'], $verb) && ($item['id'] != $item['parent'])) {
$url = Contact::MagicLinkbyId($item['author-id']);
if (strpos($url, 'redir/') === 0) {
$url = $item['author-link'];
if (local_user() && (local_user() == $item['uid']) && ($item['network'] === NETWORK_DFRN) && !$item['self'] && link_compare($item['author-link'], $item['url'])) {
$url = 'redir/' . $item['contact-id'];
$sparkle = ' class="sparkle" ';
} else {
$url = Profile::zrl($url);
}
$url = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>';
if (!x($item, 'thr-parent')) {
if (!$item['thr-parent']) {
$item['thr-parent'] = $item['parent-uri'];
}
@ -1514,17 +1590,19 @@ function sort_thr_commented(array $a, array $b)
return strcmp($b['commented'], $a['commented']);
}
function render_location_dummy(array $item) {
if (x($item, 'location') && !empty($item['location'])) {
/// @TODO Add type-hint
function render_location_dummy($item) {
if ($item['location'] != "") {
return $item['location'];
}
if (x($item, 'coord') && !empty($item['coord'])) {
if ($item['coord'] != "") {
return $item['coord'];
}
}
function get_responses(array $conv_responses, array $response_verbs, $ob, array $item) {
/// @TODO Add type-hint
function get_responses($conv_responses, $response_verbs, $ob, $item) {
$ret = [];
foreach ($response_verbs as $v) {
$ret[$v] = [];

View File

@ -26,7 +26,7 @@ class dba {
private static $relation = [];
public static function connect($serveraddr, $user, $pass, $db) {
if (!is_null(self::$db) && self::connected()) {
if (!is_null(self::$db)) {
return true;
}
@ -92,15 +92,6 @@ class dba {
return self::$connected;
}
/**
* Return the database object.
* @return PDO|mysqli
*/
public static function get_db()
{
return self::$db;
}
/**
* @brief Returns the MySQL server version string
*

View File

@ -152,7 +152,7 @@ function notification($params)
}
// "your post"
if (DBM::is_result($item) && $item['owner-id'] == $item['author-id'] && $item['wall']) {
if (DBM::is_result($item) && $item['owner-name'] == $item['author-name'] && $item['wall']) {
$dest_str = L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink,

View File

@ -274,7 +274,6 @@ function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0)
function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
$a = get_app();
$r = null;
if (is_array($importer)) {
$r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1",

View File

@ -254,7 +254,6 @@ function can_write_wall($owner)
return false;
}
/// @TODO $groups should be array
function permissions_sql($owner_id, $remote_verified = false, $groups = null)
{
$local_user = local_user();
@ -276,13 +275,6 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null)
*/
if ($local_user && $local_user == $owner_id) {
$sql = '';
/**
* Authenticated visitor. Unless pre-verified,
* check that the contact belongs to this $owner_id
* and load the groups the visitor belongs to.
* If pre-verified, the caller is expected to have already
* done this and passed the groups into this function.
*/
} elseif ($remote_user) {
/*
* Authenticated visitor. Unless pre-verified,
@ -306,10 +298,9 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null)
if ($remote_verified) {
$gs = '<<>>'; // should be impossible to match
if (is_array($groups)) {
foreach ($groups as $g) {
if (is_array($groups) && count($groups)) {
foreach ($groups as $g)
$gs .= '|<' . intval($g) . '>';
}
}
$sql = sprintf(

View File

@ -152,7 +152,7 @@ function autoname($len) {
'nd','ng','nk','nt','rn','rp','rt'];
$noend = ['bl', 'br', 'cl','cr','dr','fl','fr','gl','gr',
'kh', 'kl','kr','mn','pl','pr','rh','tr','qu','wh','q'];
'kh', 'kl','kr','mn','pl','pr','rh','tr','qu','wh'];
$start = mt_rand(0,2);
if ($start == 0) {
@ -178,13 +178,14 @@ function autoname($len) {
$word = substr($word,0,$len);
foreach ($noend as $noe) {
$noelen = strlen($noe);
if ((strlen($word) > $noelen) && (substr($word, -$noelen) == $noe)) {
$word = autoname($len);
if ((strlen($word) > 2) && (substr($word, -2) == $noe)) {
$word = substr($word, 0, -1);
break;
}
}
if (substr($word, -1) == 'q') {
$word = substr($word, 0, -1);
}
return $word;
}
@ -452,7 +453,7 @@ function perms2str($p) {
if (is_array($p)) {
$tmp = $p;
} else {
$tmp = explode(',', $p);
$tmp = explode(',',$p);
}
if (is_array($tmp)) {
@ -961,9 +962,13 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
$redir = false;
if ($redirect) {
$url = Contact::magicLink($contact['url']);
if (strpos($url, 'redir/') === 0) {
$redirect_url = 'redir/' . $contact['id'];
if (local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) {
$redir = true;
$url = $redirect_url;
$sparkle = ' sparkle';
} else {
$url = Profile::zrl($url);
}
}
@ -1296,7 +1301,11 @@ function prepare_body(array &$item, $attach = false, $is_preview = false)
foreach ($matches as $mtch) {
$mime = $mtch[3];
$the_url = Contact::magicLinkById($item['author-id'], $mtch[1]);
if ((local_user() == $item['uid']) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) {
$the_url = 'redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1];
} else {
$the_url = $mtch[1];
}
if (strpos($mime, 'video') !== false) {
if (!$vhead) {
@ -1652,11 +1661,10 @@ function bb_translate_video($s) {
$r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER);
if ($r) {
foreach ($matches as $mtch) {
if ((stristr($mtch[1], 'youtube')) || (stristr($mtch[1], 'youtu.be'))) {
$s = str_replace($mtch[0], '[youtube]' . $mtch[1] . '[/youtube]', $s);
} elseif (stristr($mtch[1], 'vimeo')) {
$s = str_replace($mtch[0], '[vimeo]' . $mtch[1] . '[/vimeo]', $s);
}
if ((stristr($mtch[1],'youtube')) || (stristr($mtch[1],'youtu.be')))
$s = str_replace($mtch[0],'[youtube]' . $mtch[1] . '[/youtube]',$s);
elseif (stristr($mtch[1],'vimeo'))
$s = str_replace($mtch[0],'[vimeo]' . $mtch[1] . '[/vimeo]',$s);
}
}
return $s;
@ -1774,7 +1782,7 @@ function file_tag_file_query($table,$s,$type = 'file') {
}
// ex. given music,video return <music><video> or [music][video]
function file_tag_list_to_file($list, $type = 'file') {
function file_tag_list_to_file($list,$type = 'file') {
$tag_list = '';
if (strlen($list)) {
$list_array = explode(",",$list);
@ -1796,7 +1804,7 @@ function file_tag_list_to_file($list, $type = 'file') {
}
// ex. given <music><video>[friends], return music,video or friends
function file_tag_file_to_list($file, $type = 'file') {
function file_tag_file_to_list($file,$type = 'file') {
$matches = false;
$list = '';
if ($type == 'file') {
@ -1822,7 +1830,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
if (!intval($uid)) {
return false;
} elseif ($file_old == $file_new) {
}
if ($file_old == $file_new) {
return true;
}
@ -1845,9 +1854,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
$check_new_tags = explode(",",file_tag_file_to_list($file_new,$type));
foreach ($check_new_tags as $tag) {
if (! stristr($saved,$lbracket . file_tag_encode($tag) . $rbracket)) {
if (! stristr($saved,$lbracket . file_tag_encode($tag) . $rbracket))
$new_tags[] = $tag;
}
}
$filetags_updated .= file_tag_list_to_file(implode(",",$new_tags),$type);
@ -1857,9 +1865,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
$check_deleted_tags = explode(",",file_tag_file_to_list($file_old,$type));
foreach ($check_deleted_tags as $tag) {
if (! stristr($file_new,$lbracket . file_tag_encode($tag) . $rbracket)) {
if (! stristr($file_new,$lbracket . file_tag_encode($tag) . $rbracket))
$deleted_tags[] = $tag;
}
}
foreach ($deleted_tags as $key => $tag) {
@ -1973,22 +1980,17 @@ function protect_sprintf($s) {
return str_replace('%', '%%', $s);
}
/// @TODO Rewrite this
function is_a_date_arg($s) {
$i = intval($s);
if ($i > 1900) {
$y = date('Y');
if ($i <= $y + 1 && strpos($s, '-') == 4) {
$m = intval(substr($s, 5));
if ($m > 0 && $m <= 12) {
$m = intval(substr($s,5));
if ($m > 0 && $m <= 12)
return true;
}
}
}
return false;
}
@ -2006,7 +2008,6 @@ function deindent($text, $chr = "[\t ]", $count = NULL) {
preg_match("|^" . $chr . "*|", $lines[$k], $m);
$count = strlen($m[0]);
}
for ($k = 0; $k < count($lines); $k++) {
$lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
}

View File

@ -65,7 +65,7 @@ function admin_post(App $a)
case 'addons':
if ($a->argc > 2 &&
is_file("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php")) {
include_once "addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php";
@include_once("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php");
if (function_exists($a->argv[2] . '_addon_admin_post')) {
$func = $a->argv[2] . '_addon_admin_post';
$func($a);
@ -801,7 +801,7 @@ function admin_page_summary(App $a)
$warningtext[] = L10n::t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
}
$last_worker_call = Config::get('system', 'last_worker_execution', false);
$last_worker_call = Config::get('system', 'last_poller_execution', false);
if (!$last_worker_call) {
$showwarning = true;
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');
@ -916,7 +916,6 @@ function admin_page_site_post(App $a)
$upds = implode(", ", $upd);
$r = q("UPDATE %s SET %s;", $table_name, $upds);
if (!DBM::is_result($r)) {
notice("Failed updating '$table_name': " . dba::errorMessage());
goaway('admin/site');
@ -928,7 +927,7 @@ function admin_page_site_post(App $a)
update_table("term", ['url'], $old_url, $new_url);
update_table("contact", ['photo', 'thumb', 'micro', 'url', 'nurl', 'alias', 'request', 'notify', 'poll', 'confirm', 'poco', 'avatar'], $old_url, $new_url);
update_table("gcontact", ['url', 'nurl', 'photo', 'server_url', 'notify', 'alias'], $old_url, $new_url);
update_table("item", ['owner-link', 'author-link', 'body', 'plink', 'tag'], $old_url, $new_url);
update_table("item", ['owner-link', 'owner-avatar', 'author-link', 'author-avatar', 'body', 'plink', 'tag'], $old_url, $new_url);
// update profile addresses in the format "user@server.tld"
update_table("contact", ['addr'], $old_host, $new_host);
@ -1298,18 +1297,15 @@ function admin_page_site(App $a)
$user_names = [];
$user_names['---'] = L10n::t('Multi user instance');
$users = q("SELECT `username`, `nickname` FROM `user`");
foreach ($users as $user) {
$user_names[$user['nickname']] = $user['username'];
}
/* Banner */
$banner = Config::get('system', 'banner');
if ($banner == false) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
$banner = htmlspecialchars($banner);
$info = Config::get('config', 'info');
$info = htmlspecialchars($info);
@ -1505,12 +1501,9 @@ function admin_page_dbsync(App $a)
if ($a->argc > 2 && intval($a->argv[2])) {
require_once 'update.php';
$func = 'update_' . intval($a->argv[2]);
if (function_exists($func)) {
$retval = $func();
if ($retval === UPDATE_FAILED) {
$o .= L10n::t("Executing %s failed with error: %s", $func, $retval);
} elseif ($retval === UPDATE_SUCCESS) {
@ -1523,13 +1516,11 @@ function admin_page_dbsync(App $a)
$o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "<br />";
Config::set('database', $func, 'success');
}
return $o;
}
$failed = [];
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$upd = intval(substr($rr['k'], 7));
@ -1539,7 +1530,6 @@ function admin_page_dbsync(App $a)
$failed[] = $upd;
}
}
if (!count($failed)) {
$o = replace_macros(get_markup_template('structure_check.tpl'), [
'$base' => System::baseUrl(true),
@ -1774,8 +1764,8 @@ function admin_page_users(App $a)
$e['page-flags-raw'] = $e['page-flags'];
$e['page-flags'] = $page_types[$e['page-flags']];
$e['account-type-raw'] = ($e['page_flags_raw'] == 0) ? $e['account-type'] : -1;
$e['account-type'] = ($e['page_flags_raw'] == 0) ? $account_types[$e['account-type']] : "";
$e['account-type-raw'] = ($e['page_flags_raw']==0) ? $e['account-type'] : -1;
$e['account-type'] = ($e['page_flags_raw']==0) ? $account_types[$e['account-type']] : "";
$e['register_date'] = Temporal::getRelativeDate($e['register_date']);
$e['login_date'] = Temporal::getRelativeDate($e['login_date']);
@ -1926,7 +1916,7 @@ function admin_page_addons(App $a)
$admin_form = "";
if (in_array($addon, $a->addons_admin)) {
require_once "addon/$addon/$addon.php";
@require_once("addon/$addon/$addon.php");
$func = $addon . '_addon_admin';
$func($a, $admin_form);
}
@ -2167,7 +2157,6 @@ function admin_page_themes(App $a)
}
$readme = null;
if (is_file("view/theme/$theme/README.md")) {
$readme = Markdown::convert(file_get_contents("view/theme/$theme/README.md"), false);
} elseif (is_file("view/theme/$theme/README")) {

View File

@ -70,7 +70,7 @@ function allfriends_content(App $a)
} else {
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($rr['url'])],
'profile' => [L10n::t("View Profile"), Profile::zrl($rr['url'])],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}

View File

@ -65,7 +65,7 @@ function contacts_init(App $a)
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
'$name' => htmlentities($a->data['contact']['name']),
'$photo' => $a->data['contact']['photo'],
'$url' => Contact::MagicLink($a->data['contact']['url']),
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/" . $a->data['contact']['id'] : $a->data['contact']['url'],
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname,
'$network' => L10n::t('Network:'),
@ -536,10 +536,11 @@ function contacts_content(App $a)
$relation_text = sprintf($relation_text, htmlentities($contact['name']));
$url = Contact::magicLink($contact['url']);
if (strpos($url, 'redir/') === 0) {
if (($contact['network'] === NETWORK_DFRN) && ($contact['rel'])) {
$url = "redir/{$contact['id']}";
$sparkle = ' class="sparkle" ';
} else {
$url = $contact['url'];
$sparkle = '';
}
@ -939,11 +940,11 @@ function _contact_detail_for_template($rr)
default:
break;
}
$url = Contact::magicLink($rr['url']);
if (strpos($url, 'redir/') === 0) {
if (($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
$url = "redir/{$rr['id']}";
$sparkle = ' class="sparkle" ';
} else {
$url = $rr['url'];
$sparkle = '';
}

View File

@ -189,6 +189,7 @@ function dfrn_request_post(App $a)
}
// (ignore reply, nothing we can do it failed)
// Old: goaway(Profile::zrl($dfrn_url));
goaway($forwardurl);
return; // NOTREACHED
}

View File

@ -156,7 +156,7 @@ function directory_content(App $a)
$location_e = $location;
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($profile_link)]
'profile' => [L10n::t("View Profile"), Profile::zrl($profile_link)]
];
$entry = [

View File

@ -11,6 +11,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\Network;
@ -213,7 +214,7 @@ function dirfind_content(App $a, $prefix = "") {
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = L10n::t('Connect');
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($jj->url)],
'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
}
@ -222,7 +223,7 @@ function dirfind_content(App $a, $prefix = "") {
$entry = [
'alt_text' => $alt_text,
'url' => Contact::magicLink($jj->url),
'url' => Profile::magicLink($jj->url),
'itemurl' => $itemurl,
'name' => htmlentities($jj->name),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),

View File

@ -49,7 +49,8 @@ function display_init(App $a)
// Does the local user have this item?
if (local_user()) {
$r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
$r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
`author-avatar`, `network`, `body`, `uid`, `owner-link`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND `guid` = ? AND `uid` = ? LIMIT 1", $a->argv[1], local_user());
if (DBM::is_result($r)) {
@ -59,7 +60,8 @@ function display_init(App $a)
// Is it an item with uid=0?
if (!DBM::is_result($r)) {
$r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
$r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
`author-avatar`, `network`, `body`, `uid`, `owner-link`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0
AND `guid` = ? LIMIT 1", $a->argv[1]);
@ -71,7 +73,8 @@ function display_init(App $a)
return;
}
} elseif (($a->argc == 3) && ($nick == 'feed-item')) {
$r = dba::fetch_first("SELECT `id`, `parent`, `author-id`, `body`, `uid`
$r = dba::fetch_first("SELECT `id`, `parent`, `author-name`, `author-link`,
`author-avatar`, `network`, `body`, `uid`, `owner-link`
FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0
AND `id` = ? LIMIT 1", $a->argv[2]);
@ -84,7 +87,7 @@ function display_init(App $a)
}
if ($r["id"] != $r["parent"]) {
$r = dba::fetch_first("SELECT `id`, `author-id`, `body`, `uid` FROM `item`
$r = dba::fetch_first("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid`, `owner-link` FROM `item`
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND `id` = ?", $r["parent"]);
}
@ -114,16 +117,14 @@ function display_init(App $a)
}
function display_fetchauthor($a, $item) {
$author = dba::selectFirst('contact', ['name', 'nick', 'photo', 'network', 'url'], ['id' => $item['author-id']]);
$profiledata = [];
$profiledata['uid'] = -1;
$profiledata['nickname'] = $author['nick'];
$profiledata['name'] = $author['name'];
$profiledata['picdate'] = '';
$profiledata['photo'] = $author['photo'];
$profiledata['url'] = $author['url'];
$profiledata['network'] = $author['network'];
$profiledata["uid"] = -1;
$profiledata["nickname"] = $item["author-name"];
$profiledata["name"] = $item["author-name"];
$profiledata["picdate"] = "";
$profiledata["photo"] = $item["author-avatar"];
$profiledata["url"] = $item["author-link"];
$profiledata["network"] = $item["network"];
// Check for a repeated message
$skip = false;

View File

@ -433,7 +433,6 @@ function events_content(App $a) {
if (x($_REQUEST, 'location')) {$orig_event['location'] = $_REQUEST['location'];}
if (x($_REQUEST, 'start')) {$orig_event['start'] = $_REQUEST['start'];}
if (x($_REQUEST, 'finish')) {$orig_event['finish'] = $_REQUEST['finish'];}
if (x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');

View File

@ -72,7 +72,7 @@ function hovercard_content()
'nick' => $contact['nick'],
'addr' => defaults($contact, 'addr', $contact['url']),
'thumb' => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB),
'url' => Contact::magicLink($contact['url']),
'url' => $cid ? ('redir/' . $cid) : Profile::zrl($contact['url']),
'nurl' => $contact['nurl'], // We additionally store the nurl as identifier
'location' => $contact['location'],
'gender' => $contact['gender'],

View File

@ -86,14 +86,14 @@ function match_content(App $a)
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($jj->url)],
'profile' => [L10n::t("View Profile"), Profile::zrl($jj->url)],
'follow' => [L10n::t("Connect/Follow"), $connlnk]
];
$contact_details = Contact::getDetailsByURL($jj->url, local_user());
$entry = [
'url' => Contact::magicLink($jj->url),
'url' => Profile::zrl($jj->url),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url),
'name' => $jj->name,
'details' => $contact_details['location'],

View File

@ -341,8 +341,11 @@ function message_content(App $a)
if ($message['from-url'] == $myprofile) {
$from_url = $myprofile;
$sparkle = '';
} elseif ($message['contact-id'] != 0) {
$from_url = 'redir/' . $message['contact-id'];
$sparkle = ' sparkle';
} else {
$from_url = Contact::magicLink($message['from-url']);
$from_url = $message['from-url'] . "?zrl=" . urlencode($myprofile);
$sparkle = ' sparkle';
}
@ -467,7 +470,7 @@ function render_messages(array $msg, $t)
$rslt .= replace_macros($tpl, [
'$id' => $rr['id'],
'$from_name' => $participants,
'$from_url' => Contact::magicLink($rr['url']),
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
'$from_addr' => $contact['addr'],
'$sparkle' => ' sparkle',
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),

View File

@ -103,6 +103,7 @@ function network_init(App $a)
'/new', //new
'', //starred
'', //bookmarked
'', //spam
];
$tab_args = [
'f=&order=comment', //all
@ -111,6 +112,7 @@ function network_init(App $a)
'', //new
'f=&star=1', //starred
'f=&bmark=1', //bookmarked
'f=&spam=1', //spam
];
$k = array_search('active', $last_sel_tabs);
@ -216,8 +218,9 @@ function saved_searches($search)
* '/network/new', => $new_active = 'active'
* '/network?f=&star=1', => $starred_active = 'active'
* '/network?f=&bmark=1', => $bookmarked_active = 'active'
* '/network?f=&spam=1', => $spam_active = 'active'
*
* @return Array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active);
* @return Array ($no_active, $comment_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
*/
function network_query_get_sel_tab(App $a)
{
@ -227,6 +230,7 @@ function network_query_get_sel_tab(App $a)
$bookmarked_active = '';
$all_active = '';
$conv_active = '';
$spam_active = '';
$postord_active = '';
if (($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) {
@ -245,7 +249,11 @@ function network_query_get_sel_tab(App $a)
$conv_active = 'active';
}
if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') && ($conv_active == '')) {
if (x($_GET, 'spam')) {
$spam_active = 'active';
}
if (($new_active == '') && ($starred_active == '') && ($bookmarked_active == '') && ($conv_active == '') && ($spam_active == '')) {
$no_active = 'active';
}
@ -256,7 +264,7 @@ function network_query_get_sel_tab(App $a)
}
}
return [$no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active];
return [$no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active];
}
function network_query_get_sel_group(App $a)
@ -920,7 +928,7 @@ function network_tabs(App $a)
// item filter tabs
/// @TODO fix this logic, reduce duplication
/// $a->page['content'] .= '<div class="tabs-wrapper">';
list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active) = network_query_get_sel_tab($a);
list($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active) = network_query_get_sel_tab($a);
// if no tabs are selected, defaults to comments
if ($no_active == 'active') {
@ -996,7 +1004,7 @@ function network_tabs(App $a)
// save selected tab, but only if not in file mode
if (!x($_GET, 'file')) {
PConfig::set(local_user(), 'network.view', 'tab.selected', [
$all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active
$all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active
]);
}

69
mod/p.php Normal file
View File

@ -0,0 +1,69 @@
<?php
/*
This file is part of the Diaspora protocol. It is used for fetching single public posts.
*/
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
function p_init($a){
if ($a->argc != 2) {
header($_SERVER["SERVER_PROTOCOL"].' 510 '.L10n::t('Not Extended'));
killme();
}
$guid = $a->argv[1];
if (strtolower(substr($guid, -4)) != ".xml") {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
$guid = strtolower(substr($guid, 0, -4));
// Fetch the item
$item = q("SELECT `uid`, `title`, `body`, `guid`, `contact-id`, `private`, `created`, `app`, `location`, `coord`
FROM `item` WHERE `wall` AND NOT `private` AND `guid` = '%s' AND `network` IN ('%s', '%s') AND `id` = `parent` LIMIT 1",
dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA);
if (!$item) {
$r = q("SELECT `author-link`
FROM `item` WHERE `uid` = 0 AND `guid` = '%s' AND `network` IN ('%s', '%s') AND `id` = `parent` LIMIT 1",
dbesc($guid), NETWORK_DFRN, NETWORK_DIASPORA);
if ($r) {
$parts = parse_url($r[0]["author-link"]);
$host = $parts["scheme"]."://".$parts["host"];
if (normalise_link($host) != normalise_link(System::baseUrl())) {
$location = $host."/p/".urlencode($guid).".xml";
header("HTTP/1.1 301 Moved Permanently");
header("Location:".$location);
killme();
}
}
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
// Fetch some data from the author (We could combine both queries - but I think this is more readable)
$r = q("SELECT `user`.`prvkey`, `contact`.`addr`, `user`.`nickname`, `contact`.`nick` FROM `user`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
WHERE `user`.`uid` = %d", intval($item[0]["uid"]));
if (!DBM::is_result($r)) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.L10n::t('Not Found'));
killme();
}
$user = $r[0];
$status = Diaspora::buildStatus($item[0], $user);
$xml = Diaspora::buildPostXml($status["type"], $status["message"]);
header("Content-Type: application/xml; charset=utf-8");
echo $xml;
killme();
}

View File

@ -1231,11 +1231,9 @@ function photos_content(App $a)
$prevlink = '';
$nextlink = '';
/*
* @todo This query is totally bad, the whole functionality has to be changed
* The query leads to a really intense used index.
* By now we hide it if someone wants to.
*/
/// @todo This query is totally bad, the whole functionality has to be changed
// The query leads to a really intense used index.
// By now we hide it if someone wants to.
if (!Config::get('system', 'no_count', false)) {
$order_field = defaults($_GET, 'order', '');
if ($order_field === 'posted') {
@ -1270,10 +1268,8 @@ function photos_content(App $a)
}
}
if (count($ph) == 1) {
if (count($ph) == 1)
$hires = $lores = $ph[0];
}
if (count($ph) > 1) {
if ($ph[1]['scale'] == 2) {
// original is 640 or less, we can display it directly
@ -1285,7 +1281,6 @@ function photos_content(App $a)
}
$album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']);
$tools = null;
$lock = null;
@ -1312,9 +1307,8 @@ function photos_content(App $a)
]);
}
if ($prevlink) {
if ($prevlink)
$prevlink = [$prevlink, '<div class="icon prev"></div>'] ;
}
$photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
@ -1538,10 +1532,14 @@ function photos_content(App $a)
continue;
}
$profile_url = Contact::MagicLinkById($item['cid']);
if (strpos($profile_url, 'redir/') === 0) {
$redirect_url = 'redir/' . $item['cid'];
if (local_user() && ($item['contact-uid'] == local_user())
&& ($item['network'] == NETWORK_DFRN) && !$item['self']) {
$profile_url = $redirect_url;
$sparkle = ' sparkle';
} else {
$profile_url = $item['url'];
$sparkle = '';
}
@ -1671,9 +1669,8 @@ function photos_content(App $a)
$twist = false;
foreach ($r as $rr) {
//hide profile photos to others
if (!$is_owner && !remote_user() && ($rr['album'] == L10n::t('Profile Photos'))) {
if (!$is_owner && !remote_user() && ($rr['album'] == L10n::t('Profile Photos')))
continue;
}
$twist = !$twist;

View File

@ -442,7 +442,7 @@ function ping_get_notifications($uid)
do {
$r = q(
"SELECT `notify`.*, `item`.`visible`, `item`.`deleted`
"SELECT `notify`.*, `item`.`visible`, `item`.`spam`, `item`.`deleted`
FROM `notify` LEFT JOIN `item` ON `item`.`id` = `notify`.`iid`
WHERE `notify`.`uid` = %d AND `notify`.`msg` != ''
AND NOT (`notify`.`type` IN (%d, %d))
@ -469,6 +469,10 @@ function ping_get_notifications($uid)
$notification["visible"] = true;
}
if (is_null($notification["spam"])) {
$notification["spam"] = 0;
}
if (is_null($notification["deleted"])) {
$notification["deleted"] = 0;
}
@ -491,6 +495,7 @@ function ping_get_notifications($uid)
$notification["href"] = System::baseUrl() . "/notify/view/" . $notification["id"];
if ($notification["visible"]
&& !$notification["spam"]
&& !$notification["deleted"]
&& !(x($result, $notification["parent"]) && is_array($result[$notification["parent"]]))
) {

View File

@ -43,7 +43,6 @@ function poco_init(App $a) {
echo json_encode($ret);
killme();
}
if ($a->argc > 1 && $a->argv[1] === '@global') {
// List of all profiles that this server recently had data from
$global = true;

View File

@ -4,7 +4,6 @@
*/
use Friendica\App;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
@ -13,7 +12,7 @@ function randprof_init(App $a)
$x = GContact::getRandomUrl();
if ($x) {
goaway(Contact::magicLink($x));
goaway(Profile::zrl($x));
}
goaway(System::baseUrl() . '/profile');

View File

@ -1,94 +1,89 @@
<?php
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
function redir_init(App $a) {
$url = defaults($_GET, 'url', '');
$quiet = !empty($_GET['quiet']) ? '&quiet=1' : '';
$con_url = defaults($_GET, 'conurl', '');
$url = ((x($_GET,'url')) ? $_GET['url'] : '');
$quiet = ((x($_GET,'quiet')) ? '&quiet=1' : '');
$con_url = ((x($_GET,'conurl')) ? $_GET['conurl'] : '');
if (local_user() && ($a->argc > 1) && intval($a->argv[1])) {
$cid = intval($a->argv[1]);
} elseif (local_user() && !empty($con_url)) {
$cid = Contact::getIdForURL($con_url, local_user());
} else {
$cid = 0;
}
// traditional DFRN
if (!empty($cid)) {
$fields = ['id', 'uid', 'nurl', 'url', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex'];
$contact = dba::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
if (!DBM::is_result($contact)) {
notice(L10n::t('Contact not found.'));
goaway(System::baseUrl());
}
if ($con_url || (local_user() && $a->argc > 1 && intval($a->argv[1]))) {
if ($contact['network'] !== NETWORK_DFRN) {
goaway(($url != '' ? $url : $contact['url']));
}
if ($con_url) {
$con_url = str_replace('https', 'http', $con_url);
if ($contact['uid'] == 0) {
$contact_url = $contact['url'];
$contact = dba::selectFirst('contact', $fields, ['nurl' => $contact['nurl'], 'uid' => local_user()]);
if (!DBM::is_result($contact)) {
$target_url = ($url != '' ? $url : $contact_url);
$r = q("SELECT * FROM `contact` WHERE `nurl` = '%s' AND `uid` = %d LIMIT 1",
dbesc($con_url),
intval(local_user())
);
$my_profile = Profile::getMyURL();
if (!DBM::is_result($r)) {
goaway(System::baseUrl());
}
if ($r[0]['network'] !== NETWORK_DFRN) {
goaway(($url != '' ? $url : $r[0]['url']));
}
$cid = $r[0]['id'];
} else {
$cid = $a->argv[1];
if (!empty($my_profile) && !link_compare($my_profile, $target_url)) {
$separator = strpos($target_url, '?') ? '&' : '?';
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval(local_user())
);
$target_url .= $separator . 'zrl=' . urlencode($my_profile);
}
goaway($target_url);
} else {
$cid = $contact['id'];
if (!DBM::is_result($r)) {
goaway(System::baseUrl());
}
if ($r[0]['network'] !== NETWORK_DFRN) {
goaway(($url != '' ? $url : $r[0]['url']));
}
}
$dfrn_id = $orig_id = (($contact['issued-id']) ? $contact['issued-id'] : $contact['dfrn-id']);
$dfrn_id = $orig_id = (($r[0]['issued-id']) ? $r[0]['issued-id'] : $r[0]['dfrn-id']);
if ($contact['duplex'] && $contact['issued-id']) {
$orig_id = $contact['issued-id'];
if ($r[0]['duplex'] && $r[0]['issued-id']) {
$orig_id = $r[0]['issued-id'];
$dfrn_id = '1:' . $orig_id;
}
if ($contact['duplex'] && $contact['dfrn-id']) {
$orig_id = $contact['dfrn-id'];
if ($r[0]['duplex'] && $r[0]['dfrn-id']) {
$orig_id = $r[0]['dfrn-id'];
$dfrn_id = '0:' . $orig_id;
}
$sec = random_string();
$fields = ['uid' => local_user(), 'cid' => $cid, 'dfrn_id' => $dfrn_id,
'sec' => $sec, 'expire' => time() + 45];
dba::insert('profile_check', $fields);
q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)
VALUES( %d, %s, '%s', '%s', %d )",
intval(local_user()),
intval($cid),
dbesc($dfrn_id),
dbesc($sec),
intval(time() + 45)
);
logger('mod_redir: ' . $contact['name'] . ' ' . $sec, LOGGER_DEBUG);
$dest = (!empty($url) ? '&destination_url=' . $url : '');
goaway($contact['poll'] . '?dfrn_id=' . $dfrn_id
logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
$dest = (($url) ? '&destination_url=' . $url : '');
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet);
}
if (local_user()) {
$handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
$handle = $a->user['nickname'] . '@' . substr(System::baseUrl(),strpos(System::baseUrl(),'://')+3);
}
if (remote_user()) {
$handle = $_SESSION['handle'];
}
if (!empty($url)) {
$url = str_replace('{zid}', '&zid=' . $handle, $url);
if ($url) {
$url = str_replace('{zid}','&zid=' . $handle,$url);
goaway($url);
}
notice(L10n::t('Contact not found.'));
goaway(System::baseUrl());
}

View File

@ -5,7 +5,6 @@ use Friendica\Database\DBM;
function share_init(App $a) {
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if (!$post_id || !local_user()) {
killme();
}
@ -15,44 +14,37 @@ function share_init(App $a) {
WHERE `item`.`id` = %d LIMIT 1",
intval($post_id)
);
if (!DBM::is_result($r) || ($r[0]['private'] == 1)) {
killme();
}
if (strpos($r[0]['body'], "[/share]") !== false) {
$pos = strpos($r[0]['body'], "[share");
$o = substr($r[0]['body'], $pos);
} else {
$o = share_header($r[0]['author-name'], $r[0]['author-link'], $r[0]['author-avatar'], $r[0]['guid'], $r[0]['created'], $r[0]['plink']);
if ($r[0]['title']) {
if ($r[0]['title'])
$o .= '[b]'.$r[0]['title'].'[/b]'."\n";
}
$o .= $r[0]['body'];
$o .= "[/share]";
$o.= "[/share]";
}
echo $o;
killme();
}
/// @TODO Rewrite to handle over whole record array
function share_header($author, $profile, $avatar, $guid, $posted, $link) {
$header = "[share author='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $author).
"' profile='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $profile).
"' avatar='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $avatar);
$header = "[share author='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $author).
"' profile='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $profile).
"' avatar='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $avatar);
if ($guid) {
$header .= "' guid='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $guid);
$header .= "' guid='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $guid);
}
if ($posted) {
$header .= "' posted='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $posted);
$header .= "' posted='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $posted);
}
$header .= "' link='" . str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $link)."']";
$header .= "' link='".str_replace(["'", "[", "]"], ["&#x27;", "&#x5B;", "&#x5D;"], $link)."']";
return $header;
}

View File

@ -63,19 +63,17 @@ function subthread_content(App $a) {
WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
intval($owner_uid)
);
if (DBM::is_result($r)) {
if (DBM::is_result($r))
$owner = $r[0];
}
if (! $owner) {
logger('like: no owner');
return;
}
if (! $remote_owner) {
if (! $remote_owner)
$remote_owner = $owner;
}
$contact = null;
// This represents the person posting
@ -87,10 +85,8 @@ function subthread_content(App $a) {
intval($_SESSION['visitor_id']),
intval($owner_uid)
);
if (DBM::is_result($r)) {
if (DBM::is_result($r))
$contact = $r[0];
}
}
if (! $contact) {
return;

View File

@ -79,7 +79,7 @@ function suggest_content(App $a) {
$connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($rr["url"])],
'profile' => [L10n::t("View Profile"), Profile::zrl($rr["url"])],
'follow' => [L10n::t("Connect/Follow"), $connlnk],
'hide' => [L10n::t('Ignore/Hide'), $ignlnk]
];
@ -87,7 +87,7 @@ function suggest_content(App $a) {
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
$entry = [
'url' => Contact::magicLink($rr['url']),
'url' => Profile::zrl($rr['url']),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'img_hover' => $rr['url'],
'name' => $contact_details['name'],

View File

@ -159,13 +159,11 @@ EOT;
}
$term_objtype = ($item['resource-id'] ? TERM_OBJ_PHOTO : TERM_OBJ_POST);
$t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'",
intval($item['id']),
dbesc($term)
);
if ((!$blocktags) && $t[0]['tcount'] == 0 ) {
$t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'",
intval($item['id']),
dbesc($term)
);
if((! $blocktags) && $t[0]['tcount']==0 ) {
q("INSERT INTO term (oid, otype, type, term, url, uid) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($item['id']),
$term_objtype,
@ -178,28 +176,26 @@ EOT;
// if the original post is on this site, update it.
$r = q("SELECT `tag`,`id`,`uid` FROM `item` WHERE `origin`=1 AND `uri`='%s' LIMIT 1",
$r = q("select `tag`,`id`,`uid` from item where `origin` = 1 AND `uri` = '%s' LIMIT 1",
dbesc($item['uri'])
);
if (DBM::is_result($r)) {
$x = q("SELECT `blocktags` FROM `user` WHERE `uid`=%d LIMIT 1",
$x = q("SELECT `blocktags` FROM `user` WHERE `uid` = %d limit 1",
intval($r[0]['uid'])
);
$t = q("SELECT COUNT(`tid`) AS `tcount` FROM `term` WHERE `oid`=%d AND `term`='%s'",
$t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'",
intval($r[0]['id']),
dbesc($term)
);
if (DBM::is_result($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($r[0]['id']),
$term_objtype,
TERM_HASHTAG,
dbesc($term),
dbesc(System::baseUrl() . '/search?tag=' . $term),
intval($owner_uid)
);
if(count($x) && !$x[0]['blocktags'] && $t[0]['tcount']==0){
q("INSERT INTO term (oid, otype, type, term, url, uid) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($r[0]['id']),
$term_objtype,
TERM_HASHTAG,
dbesc($term),
dbesc(System::baseUrl() . '/search?tag=' . $term),
intval($owner_uid)
);
}
}

View File

@ -118,7 +118,7 @@ function unfollow_content(App $a)
'$nickname' => "",
'$name' => $contact["name"],
'$url' => $contact["url"],
'$zrl' => Contact::magicLink($contact["url"]),
'$zrl' => Profile::zrl($contact["url"]),
'$url_label' => L10n::t("Profile URL"),
'$myaddr' => $myaddr,
'$request' => $request,

View File

@ -96,6 +96,15 @@ function viewcontacts_content(App $a)
continue;
}
$url = $rr['url'];
// route DFRN profiles through the redirect
if ($is_owner && ($rr['network'] === NETWORK_DFRN) && ($rr['rel'])) {
$url = 'redir/' . $rr['id'];
} else {
$url = Profile::zrl($url);
}
$contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);
$contacts[] = [
@ -109,7 +118,7 @@ function viewcontacts_content(App $a)
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => Contact::getAccountType($contact_details),
'url' => Contact::magicLink($rr['url']),
'url' => $url,
'sparkle' => '',
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),

View File

@ -16,15 +16,15 @@ use Friendica\Database\DBM;
use Friendica\Model\Photo;
use Friendica\Object\Image;
function wall_upload_post(App $a, $desktopmode = true)
{
function wall_upload_post(App $a, $desktopmode = true) {
logger("wall upload: starting new upload", LOGGER_DEBUG);
$r_json = (x($_GET, 'response') && $_GET['response'] == 'json');
$album = (x($_GET, 'album') ? notags(trim($_GET['album'])) : '');
if ($a->argc > 1) {
if (!x($_FILES, 'media')) {
if (! x($_FILES, 'media')) {
$nick = $a->argv[1];
$r = q("SELECT `user`.*, `contact`.`id` FROM `user`
INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
@ -33,9 +33,9 @@ function wall_upload_post(App $a, $desktopmode = true)
dbesc($nick)
);
if (!DBM::is_result($r)) {
if (! DBM::is_result($r)) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@ -51,7 +51,7 @@ function wall_upload_post(App $a, $desktopmode = true)
}
} else {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
return;
@ -98,18 +98,18 @@ function wall_upload_post(App $a, $desktopmode = true)
}
if (!$can_post) {
if (! $can_post) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Permission denied.')]);
echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme();
}
notice(L10n::t('Permission denied.') . EOL);
killme();
}
if (!x($_FILES, 'userfile') && !x($_FILES, 'media')) {
if (! x($_FILES, 'userfile') && ! x($_FILES, 'media')) {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
echo json_encode(['error'=>L10n::t('Invalid request.')]);
}
killme();
}
@ -150,9 +150,9 @@ function wall_upload_post(App $a, $desktopmode = true)
}
}
if ($src == "") {
if ($src=="") {
if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]);
echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme();
}
notice(L10n::t('Invalid request.').EOL);
@ -185,7 +185,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (($maximagesize) && ($filesize > $maximagesize)) {
$msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize));
if ($r_json) {
echo json_encode(['error' => $msg]);
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
@ -196,10 +196,10 @@ function wall_upload_post(App $a, $desktopmode = true)
$imagedata = @file_get_contents($src);
$Image = new Image($imagedata, $filetype);
if (!$Image->isValid()) {
if (! $Image->isValid()) {
$msg = L10n::t('Unable to process image.');
if ($r_json) {
echo json_encode(['error' => $msg]);
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
@ -211,7 +211,7 @@ function wall_upload_post(App $a, $desktopmode = true)
@unlink($src);
$max_length = Config::get('system', 'max_image_length');
if (!$max_length) {
if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH;
}
if ($max_length > 0) {
@ -227,7 +227,7 @@ function wall_upload_post(App $a, $desktopmode = true)
$smallest = 0;
// If we don't have an album name use the Wall Photos album
if (!strlen($album)) {
if (! strlen($album)) {
$album = L10n::t('Wall Photos');
}
@ -235,10 +235,10 @@ function wall_upload_post(App $a, $desktopmode = true)
$r = Photo::store($Image, $page_owner_uid, $visitor, $hash, $filename, $album, 0, 0, $defperm);
if (!$r) {
if (! $r) {
$msg = L10n::t('Image upload failed.');
if ($r_json) {
echo json_encode(['error' => $msg]);
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
@ -271,7 +271,7 @@ function wall_upload_post(App $a, $desktopmode = true)
);
if (!$r) {
if ($r_json) {
echo json_encode(['error' => '']);
echo json_encode(['error'=>'']);
killme();
}
return false;
@ -288,21 +288,28 @@ function wall_upload_post(App $a, $desktopmode = true)
$picture["preview"] = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $Image->getExt();
if ($r_json) {
echo json_encode(['picture' => $picture]);
echo json_encode(['picture'=>$picture]);
killme();
}
logger("upload done", LOGGER_DEBUG);
return $picture;
}
logger("upload done", LOGGER_DEBUG);
if ($r_json) {
echo json_encode(['ok' => true]);
echo json_encode(['ok'=>true]);
killme();
}
echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
/* mod Waitman Gobble NO WARRANTY */
// if we get the signal then return the image url info in BBCODE
if ($_REQUEST['hush']!='yeah') {
echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]\n\n";
} else {
$m = '[url='.System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.System::baseUrl()."/photo/{$hash}-{$smallest}.".$Image->getExt()."[/img][/url]";
return($m);
}
/* mod Waitman Gobble NO WARRANTY */
killme();
// NOTREACHED
}

View File

@ -40,9 +40,7 @@ function worker_init(){
// But since it doesn't destroy anything, we just try to get more execution time in any way.
set_time_limit(0);
$fields = ['executed' => DateTimeFormat::utcNow(), 'pid' => getmypid(), 'done' => false];
$condition = ['id' => $r[0]["id"], 'pid' => 0];
if (dba::update('workerqueue', $fields, $condition)) {
if (poller_claim_process($r[0])) {
Worker::execute($r[0]);
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<phpunit bootstrap="tests/bootstrap.php">
<phpunit bootstrap="boot.php">
<testsuites>
<testsuite>
<directory>tests/</directory>

View File

@ -9,7 +9,6 @@ use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Database\DBM;
use dba;
@ -108,7 +107,7 @@ class ForumManager
$entry = [
'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => Contact::magicLink($contact['url']),
'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'],
'cid' => $contact['id'],
'selected' => $selected,

View File

@ -91,13 +91,11 @@ class TagCloud
// Fetch tags
$r = dba::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term`
LEFT JOIN `item` ON `term`.`oid` = `item`.`id`
LEFT JOIN `user-item` ON `user-item`.`iid` = `item`.`id` AND `user-item`.`uid` = ?
WHERE `term`.`uid` = ? AND `term`.`type` = ?
AND `term`.`otype` = ?
AND $item_condition $sql_options
GROUP BY `term` ORDER BY `total` DESC $limit",
$uid,
$uid,
$type,
TERM_OBJ_POST
);

View File

@ -40,12 +40,6 @@ class Cache extends \Friendica\BaseObject
self::$driver = new Cache\MemcachedCacheDriver($memcached_hosts);
break;
case 'redis':
$redis_host = Config::get('system', 'redis_host', '127.0.0.1');
$redis_port = Config::get('system', 'redis_port', 6379);
self::$driver = new Cache\RedisCacheDriver($redis_host, $redis_port);
break;
default:
self::$driver = new Cache\DatabaseCacheDriver();
}

View File

@ -1,77 +0,0 @@
<?php
namespace Friendica\Core\Cache;
use Friendica\BaseObject;
use Friendica\Core\Cache;
/**
* Redis Cache Driver. This driver is based on Memcache driver
*
* @author Hypolite Petovan <mrpetovan@gmail.com>
* @author Roland Haeder <roland@mxchange.org>
*/
class RedisCacheDriver extends BaseObject implements ICacheDriver
{
/**
* @var Redis
*/
private $redis;
public function __construct($redis_host, $redis_port)
{
if (!class_exists('Redis', false)) {
throw new \Exception('Redis class isn\'t available');
}
$this->redis = new \Redis();
if (!$this->redis->connect($redis_host, $redis_port)) {
throw new \Exception('Expected Redis server at ' . $redis_host . ':' . $redis_port . ' isn\'t available');
}
}
public function get($key)
{
$return = null;
// We fetch with the hostname as key to avoid problems with other applications
$cached = $this->redis->get(self::getApp()->get_hostname() . ':' . $key);
// @see http://php.net/manual/en/redis.get.php#84275
if (is_bool($cached) || is_double($cached) || is_long($cached)) {
return $return;
}
$value = @unserialize($cached);
// Only return a value if the serialized value is valid.
// We also check if the db entry is a serialized
// boolean 'false' value (which we want to return).
if ($cached === serialize(false) || $value !== false) {
$return = $value;
}
return $return;
}
public function set($key, $value, $duration = Cache::MONTH)
{
// We store with the hostname as key to avoid problems with other applications
return $this->redis->set(
self::getApp()->get_hostname() . ":" . $key,
serialize($value),
time() + $duration
);
}
public function delete($key)
{
return $this->redis->delete($key);
}
public function clear()
{
return true;
}
}

View File

@ -828,7 +828,7 @@ class NotificationsManager extends BaseObject
'contact_id' => $it['contact-id'],
'photo' => ((x($it, 'fphoto')) ? proxy_url($it['fphoto'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"),
'name' => $it['fname'],
'url' => Contact::magicLink($it['furl']),
'url' => Profile::zrl($it['furl']),
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'knowyou' => $knowyou,
@ -862,7 +862,7 @@ class NotificationsManager extends BaseObject
'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'url' => $it['url'],
'zrl' => Contact::magicLink($it['url']),
'zrl' => Profile::zrl($it['url']),
'addr' => $it['gaddr'],
'network' => $it['gnetwork'],
'knowyou' => $it['knowyou'],

View File

@ -29,7 +29,9 @@ class PConfig extends BaseObject
public static function init($uid)
{
if (Config::get('system', 'config_adapter') == 'preload') {
$a = self::getApp();
if (isset($a->config['system']['config_adapter']) && $a->config['system']['config_adapter'] == 'preload') {
self::$adapter = new Config\PreloadPConfigAdapter($uid);
} else {
self::$adapter = new Config\JITPConfigAdapter($uid);

View File

@ -53,15 +53,10 @@ class Worker
// We now start the process. This is done after the load check since this could increase the load.
self::startProcess();
// The daemon doesn't need to fork new workers anymore, since we started a process
if (Config::get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false);
}
// Kill stale processes every 5 minutes
$last_cleanup = Config::get('system', 'worker_last_cleaned', 0);
$last_cleanup = Config::get('system', 'poller_last_cleaned', 0);
if (time() > ($last_cleanup + 300)) {
Config::set('system', 'worker_last_cleaned', time());
Config::set('system', 'poller_last_cleaned', time());
self::killStaleWorkers();
}
@ -113,16 +108,16 @@ class Worker
}
// If possible we will fetch new jobs for this worker
if (!$refetched && Lock::set('worker_process', 0)) {
if (!$refetched && Lock::set('poller_worker_process', 0)) {
$stamp = (float)microtime(true);
$refetched = self::findWorkerProcesses($passing_slow);
self::$db_duration += (microtime(true) - $stamp);
Lock::remove('worker_process');
Lock::remove('poller_worker_process');
}
}
// To avoid the quitting of multiple workers only one worker at a time will execute the check
if (Lock::set('worker', 0)) {
if (Lock::set('poller_worker', 0)) {
$stamp = (float)microtime(true);
// Count active workers and compare them with a maximum value that depends on the load
if (self::tooMuchWorkers()) {
@ -135,7 +130,7 @@ class Worker
logger('Memory limit reached, quitting.', LOGGER_DEBUG);
return;
}
Lock::remove('worker');
Lock::remove('poller_worker');
self::$db_duration += (microtime(true) - $stamp);
}
@ -145,9 +140,6 @@ class Worker
return;
}
}
if (Config::get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false);
}
logger("Couldn't select a workerqueue entry, quitting.", LOGGER_DEBUG);
}
@ -252,7 +244,7 @@ class Worker
$stamp = (float)microtime(true);
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
Config::set('system', 'last_worker_execution', DateTimeFormat::utcNow());
Config::set('system', 'last_poller_execution', DateTimeFormat::utcNow());
}
self::$db_duration = (microtime(true) - $stamp);
@ -293,7 +285,7 @@ class Worker
$stamp = (float)microtime(true);
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
Config::set('system', 'last_worker_execution', DateTimeFormat::utcNow());
Config::set('system', 'last_poller_execution', DateTimeFormat::utcNow());
}
self::$db_duration = (microtime(true) - $stamp);
} else {
@ -696,7 +688,7 @@ class Worker
logger("Load: ".$load."/".$maxsysload." - processes: ".$active."/".$entries.$processlist." - maximum: ".$queues."/".$maxqueues, LOGGER_DEBUG);
// Are there fewer workers running as possible? Then fork a new one.
if (!Config::get("system", "worker_dont_fork", false) && ($queues > ($active + 1)) && ($entries > 1)) {
if (!Config::get("system", "worker_dont_fork") && ($queues > ($active + 1)) && ($entries > 1)) {
logger("Active workers: ".$active."/".$queues." Fork a new worker.", LOGGER_DEBUG);
self::spawnWorker();
}
@ -859,11 +851,6 @@ class Worker
dba::update('workerqueue', ['executed' => DateTimeFormat::utcNow(), 'pid' => $mypid], $ids);
}
// The daemon doesn't need to fork new workers anymore, since we are inside the worker
if (Config::get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false);
}
return $found;
}
@ -886,7 +873,7 @@ class Worker
dba::close($r);
$stamp = (float)microtime(true);
if (!Lock::set('worker_process')) {
if (!Lock::set('poller_worker_process')) {
return false;
}
self::$lock_duration = (microtime(true) - $stamp);
@ -895,7 +882,7 @@ class Worker
$found = self::findWorkerProcesses($passing_slow);
self::$db_duration += (microtime(true) - $stamp);
Lock::remove('worker_process');
Lock::remove('poller_worker_process');
if ($found) {
$r = dba::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]);
@ -1015,14 +1002,9 @@ class Worker
* @brief Spawns a new worker
* @return void
*/
public static function spawnWorker($do_cron = false)
public static function spawnWorker()
{
$args = ["bin/worker.php"];
if (!$do_cron) {
$args[] = "no_cron";
}
$args = ["bin/worker.php", "no_cron"];
get_app()->proc_run($args);
}
@ -1058,7 +1040,7 @@ class Worker
}
$priority = PRIORITY_MEDIUM;
$dont_fork = Config::get("system", "worker_dont_fork", false);
$dont_fork = Config::get("system", "worker_dont_fork");
$created = DateTimeFormat::utcNow();
$run_parameter = array_shift($args);
@ -1094,20 +1076,14 @@ class Worker
return true;
}
// We tell the daemon that a new job entry exists
if (Config::get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(true);
return true;
}
// If there is a lock then we don't have to check for too much worker
if (!Lock::set('worker', 0)) {
if (!Lock::set('poller_worker', 0)) {
return true;
}
// If there are already enough workers running, don't fork another one
$quit = self::tooMuchWorkers();
Lock::remove('worker');
Lock::remove('poller_worker');
if ($quit) {
return true;
@ -1145,33 +1121,4 @@ class Worker
{
return Process::deleteByPid();
}
/**
* Set the flag if some job is waiting
*
* @brief Set the flag if some job is waiting
* @param boolean $jobs Is there a waiting job?
*/
public static function IPCSetJobState($jobs)
{
dba::update('worker-ipc', ['jobs' => $jobs], ['key' => 1], true);
}
/**
* Checks if some worker job waits to be executed
*
* @brief Checks if some worker job waits to be executed
* @return bool
*/
public static function IPCJobsExists()
{
$row = dba::selectFirst('worker-ipc', ['jobs'], ['key' => 1]);
// When we don't have a row, no job is running
if (!DBM::is_result($row)) {
return false;
}
return (bool)$row['jobs'];
}
}

View File

@ -174,7 +174,7 @@ class DBStructure
echo "--\n";
echo "-- TABLE $name\n";
echo "--\n";
self::createTable($name, $structure, true, false);
self::createTable($name, $structure['fields'], true, false, $structure["indexes"]);
echo "\n";
}
@ -251,7 +251,7 @@ class DBStructure
$is_unique = false;
$temp_name = $name;
if (!isset($database[$name])) {
$r = self::createTable($name, $structure, $verbose, $action);
$r = self::createTable($name, $structure["fields"], $verbose, $action, $structure['indexes']);
if (!DBM::is_result($r)) {
$errors .= self::printUpdateError($name);
}
@ -378,18 +378,6 @@ class DBStructure
}
}
if (isset($database[$name]["table_status"]["Engine"]) && isset($structure['engine'])) {
if ($database[$name]["table_status"]["Engine"] != $structure['engine']) {
$sql2 = "ENGINE = '".dbesc($structure['engine'])."'";
if ($sql3 == "") {
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
} else {
$sql3 .= ", ".$sql2;
}
}
}
if (isset($database[$name]["table_status"]["Collation"])) {
if ($database[$name]["table_status"]["Collation"] != 'utf8mb4_general_ci') {
$sql2 = "DEFAULT COLLATE utf8mb4_general_ci";
@ -566,22 +554,20 @@ class DBStructure
return($fieldstruct);
}
private static function createTable($name, $structure, $verbose, $action) {
private static function createTable($name, $fields, $verbose, $action, $indexes=null) {
$r = true;
$engine = "";
$comment = "";
$sql_rows = [];
$primary_keys = [];
foreach ($structure["fields"] AS $fieldname => $field) {
foreach ($fields AS $fieldname => $field) {
$sql_rows[] = "`".dbesc($fieldname)."` ".self::FieldCommand($field);
if (x($field,'primary') && $field['primary']!='') {
$primary_keys[] = $fieldname;
}
}
if (!is_null($structure["indexes"])) {
foreach ($structure["indexes"] AS $indexname => $fieldnames) {
if (!is_null($indexes)) {
foreach ($indexes AS $indexname => $fieldnames) {
$sql_index = self::createIndex($indexname, $fieldnames, "");
if (!is_null($sql_index)) {
$sql_rows[] = $sql_index;
@ -589,18 +575,9 @@ class DBStructure
}
}
if (!is_null($structure["engine"])) {
$engine = " ENGINE=" . $structure["engine"];
}
if (!is_null($structure["comment"])) {
$comment = " COMMENT='" . dbesc($structure["comment"]) . "'";
}
$sql = implode(",\n\t", $sql_rows);
$sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql.
"\n)" . $engine . " DEFAULT COLLATE utf8mb4_general_ci" . $comment;
$sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT COLLATE utf8mb4_general_ci";
if ($verbose) {
echo $sql.";\n";
}
@ -691,12 +668,12 @@ class DBStructure
"comment" => "registered addons",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
"version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
"installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
"hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
"timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
"plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
"name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
"version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
"installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -706,19 +683,19 @@ class DBStructure
$database["attach"] = [
"comment" => "file attachments",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
"filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
"filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
"filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
"data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"data" => ["type" => "longblob", "not null" => "1", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -753,7 +730,7 @@ class DBStructure
$database["challenge"] = [
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -794,26 +771,26 @@ class DBStructure
$database["contact"] = [
"comment" => "contact table",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
"self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
"rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"about" => ["type" => "text", "comment" => ""],
"keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
"keywords" => ["type" => "text", "comment" => ""],
"gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
"thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
"micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
"photo" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"thumb" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"micro" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"site-pubkey" => ["type" => "text", "comment" => ""],
"issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -821,8 +798,8 @@ class DBStructure
"nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
"prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
"pubkey" => ["type" => "text", "comment" => ""],
"prvkey" => ["type" => "text", "comment" => ""],
"batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"request" => ["type" => "varchar(255)", "comment" => ""],
"notify" => ["type" => "varchar(255)", "comment" => ""],
@ -834,20 +811,20 @@ class DBStructure
"usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last try to update the contact info"],
"success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last successful contact update"],
"failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last failed update"],
"last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"name-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"uri-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"avatar-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"term-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"last-item" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "date of the last post"],
"last-item" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
"readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
"readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
"prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
"forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
"hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@ -882,14 +859,14 @@ class DBStructure
$database["conv"] = [
"comment" => "private messages",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
"recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation timestamp"],
"updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "edited timestamp"],
"subject" => ["type" => "text", "comment" => "subject of initial message"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"recips" => ["type" => "text", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"subject" => ["type" => "text", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -899,13 +876,13 @@ class DBStructure
$database["conversation"] = [
"comment" => "Raw data and structure information for messages",
"fields" => [
"item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URI of the item"],
"reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
"conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
"conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
"protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The protocol of the item"],
"source" => ["type" => "mediumtext", "comment" => "Original source"],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Receiving date"],
"item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"source" => ["type" => "mediumtext", "comment" => ""],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["item-uri"],
@ -916,26 +893,26 @@ class DBStructure
$database["event"] = [
"comment" => "Events",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"],
"start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event start time"],
"finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event end time"],
"summary" => ["type" => "text", "comment" => "short description or title of the event"],
"desc" => ["type" => "text", "comment" => "event description"],
"location" => ["type" => "text", "comment" => "event location"],
"type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
"nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
"adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
"ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"summary" => ["type" => "text", "comment" => ""],
"desc" => ["type" => "text", "comment" => ""],
"location" => ["type" => "text", "comment" => ""],
"type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
"nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
"ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -945,8 +922,8 @@ class DBStructure
$database["fcontact"] = [
"comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -989,9 +966,9 @@ class DBStructure
$database["gcign"] = [
"comment" => "contacts ignored by friend suggestions",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
"gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1002,12 +979,12 @@ class DBStructure
$database["gcontact"] = [
"comment" => "global contacts",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
"url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"updated" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
@ -1015,19 +992,19 @@ class DBStructure
"last_failure" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"about" => ["type" => "text", "comment" => ""],
"keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
"keywords" => ["type" => "text", "comment" => ""],
"gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
"community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
"community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
"hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
"nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
"hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"notify" => ["type" => "varchar(255)", "comment" => ""],
"alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
"server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1042,7 +1019,7 @@ class DBStructure
$database["glink"] = [
"comment" => "'friends of friends' linkages derived from poco",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
@ -1058,11 +1035,11 @@ class DBStructure
$database["group"] = [
"comment" => "privacy groups, group info",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1072,9 +1049,9 @@ class DBStructure
$database["group_member"] = [
"comment" => "privacy groups, member info",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => ""],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1085,14 +1062,14 @@ class DBStructure
$database["gserver"] = [
"comment" => "Global servers",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"info" => ["type" => "text", "comment" => ""],
"register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
"registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
"registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
@ -1123,11 +1100,11 @@ class DBStructure
$database["hook"] = [
"comment" => "addon hook registry",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
"file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
"function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
"priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
"file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
"function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
"priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1137,7 +1114,7 @@ class DBStructure
$database["intro"] = [
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
@ -1157,67 +1134,68 @@ class DBStructure
"comment" => "All posts",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
"wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
"wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"],
"parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
"parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation timestamp."],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last edit (default is created)"],
"commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last comment/reply to this item"],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime"],
"changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
"owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
"owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the owner of this item"],
"owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the owner of this item"],
"owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the owner of this item"],
"author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
"author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the author of this item"],
"author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the author of this item"],
"author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the author of this item"],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
"thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"body" => ["type" => "mediumtext", "comment" => "item body content"],
"app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
"verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"],
"object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
"object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
"target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
"target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
"postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
"plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
"resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"],
"event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
"body" => ["type" => "mediumtext", "comment" => ""],
"app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"object" => ["type" => "text", "comment" => ""],
"target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"target" => ["type" => "text", "comment" => ""],
"postopts" => ["type" => "text", "comment" => ""],
"plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => ""],
"tag" => ["type" => "mediumtext", "comment" => ""],
"attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
"attach" => ["type" => "mediumtext", "comment" => ""],
"inform" => ["type" => "mediumtext", "comment" => ""],
"file" => ["type" => "mediumtext", "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
"coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
"private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => ""],
"private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been bookmarked"],
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
"origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
"spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
"mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
"rendered-html" => ["type" => "mediumtext", "comment" => ""],
"global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
@ -1254,10 +1232,10 @@ class DBStructure
$database["locks"] = [
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
"locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
"pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1266,23 +1244,23 @@ class DBStructure
$database["mail"] = [
"comment" => "private messages",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
"from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
"from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
"from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
"contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
"convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => ""],
"convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"body" => ["type" => "mediumtext", "comment" => ""],
"seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
"seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
"unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time of the private message"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1296,7 +1274,7 @@ class DBStructure
$database["mailacct"] = [
"comment" => "Mail account data for fetching mails",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1317,7 +1295,7 @@ class DBStructure
$database["manage"] = [
"comment" => "table of accounts that can manage each other",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
],
@ -1329,7 +1307,7 @@ class DBStructure
$database["notify"] = [
"comment" => "notifications",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1337,15 +1315,15 @@ class DBStructure
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"msg" => ["type" => "mediumtext", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
"name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
"msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
"name_cache" => ["type" => "tinytext", "comment" => ""],
"msg_cache" => ["type" => "mediumtext", "comment" => ""]
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1358,7 +1336,7 @@ class DBStructure
$database["notify-threads"] = [
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
"master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1371,10 +1349,10 @@ class DBStructure
$database["oembed"] = [
"comment" => "cache for OEmbed queries",
"fields" => [
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
"maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
"content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"],
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
"content" => ["type" => "mediumtext", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["url", "maxwidth"],
@ -1384,11 +1362,11 @@ class DBStructure
$database["parsed_url"] = [
"comment" => "cache for 'parse_url' queries",
"fields" => [
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
"guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
"oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
"content" => ["type" => "mediumtext", "comment" => "page data"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"],
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
"oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
"content" => ["type" => "mediumtext", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["url", "guessing", "oembed"],
@ -1424,16 +1402,16 @@ class DBStructure
$database["photo"] = [
"comment" => "photo storage",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
"guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => ""],
"resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation date"],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edited date"],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"desc" => ["type" => "text", "comment" => ""],
"album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
"album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
"height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1442,10 +1420,10 @@ class DBStructure
"data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
"scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
"allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1481,7 +1459,7 @@ class DBStructure
$database["poll_result"] = [
"comment" => "data for polls - currently unused",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
"choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
],
@ -1505,14 +1483,14 @@ class DBStructure
$database["profile"] = [
"comment" => "user profiles data",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
"profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
"is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
"hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
"dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
"pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => ""],
"address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1545,8 +1523,8 @@ class DBStructure
"xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
"net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
"publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
@ -1556,9 +1534,9 @@ class DBStructure
$database["profile_check"] = [
"comment" => "DFRN remote auth use",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1570,7 +1548,7 @@ class DBStructure
$database["push_subscriber"] = [
"comment" => "Used for OStatus: Contains feed subscribers",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1589,7 +1567,7 @@ class DBStructure
$database["queue"] = [
"comment" => "Queue for messages that couldn't be delivered",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
@ -1609,7 +1587,7 @@ class DBStructure
$database["register"] = [
"comment" => "registrations requiring admin approval",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
@ -1624,7 +1602,7 @@ class DBStructure
$database["search"] = [
"comment" => "",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
],
@ -1636,7 +1614,7 @@ class DBStructure
$database["session"] = [
"comment" => "web session storage",
"fields" => [
"id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"data" => ["type" => "text", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1650,8 +1628,8 @@ class DBStructure
$database["sign"] = [
"comment" => "Diaspora signatures",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"signed_text" => ["type" => "mediumtext", "comment" => ""],
"signature" => ["type" => "text", "comment" => ""],
"signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1688,11 +1666,11 @@ class DBStructure
$database["thread"] = [
"comment" => "Thread related data",
"fields" => [
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "sequential ID"],
"iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
"author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
"owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
@ -1703,6 +1681,7 @@ class DBStructure
"pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@ -1745,50 +1724,50 @@ class DBStructure
$database["user"] = [
"comment" => "The local users",
"fields" => [
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "The parent user that has full control about this user"],
"guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
"username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
"password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
"guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
"nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
"email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
"nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
"language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
"register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of registration"],
"login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last login"],
"default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
"allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
"theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
"pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
"prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
"timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
"language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => ""],
"register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pubkey" => ["type" => "text", "comment" => ""],
"prvkey" => ["type" => "text", "comment" => ""],
"spubkey" => ["type" => "text", "comment" => ""],
"sprvkey" => ["type" => "text", "comment" => ""],
"verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
"blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
"blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
"hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
"blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
"unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
"verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
"notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
"page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
"notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => ""],
"page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
"pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
"maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
"account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp when account expires and will be deleted"],
"expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last warning of account expiration"],
"account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
"allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
"deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
"deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
"allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => ""],
"openidserver" => ["type" => "text", "comment" => ""],
],
"indexes" => [
@ -1799,7 +1778,7 @@ class DBStructure
$database["userd"] = [
"comment" => "Deleted usernames",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
],
"indexes" => [
@ -1818,18 +1797,6 @@ class DBStructure
"PRIMARY" => ["uid", "iid"],
]
];
$database["worker-ipc"] = [
"comment" => "Inter process communication between the frontend and the worker",
"fields" => [
"key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
"jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
],
"indexes" => [
"PRIMARY" => ["key"],
],
"engine" => "MEMORY",
];
$database["workerqueue"] = [
"comment" => "Background tasks queue entries",
"fields" => [
@ -1839,7 +1806,7 @@ class DBStructure
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation date"],
"pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
"executed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Execution date"],
"done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
"done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked when the task was done, will be deleted later"],
],
"indexes" => [
"PRIMARY" => ["id"],

View File

@ -598,7 +598,7 @@ class Contact extends BaseObject
if ($contact['uid'] != $uid) {
if ($uid == 0) {
$profile_link = self::magicLink($contact['url']);
$profile_link = Profile::zrl($contact['url']);
$menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
return $menu;
@ -609,7 +609,7 @@ class Contact extends BaseObject
if (DBM::is_result($contact_own)) {
return self::photoMenu($contact_own, $uid);
} else {
$profile_link = self::magicLink($contact['url']);
$profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url'];
$menu = [
'profile' => [L10n::t('View Profile'), $profile_link, true],
@ -944,36 +944,21 @@ class Contact extends BaseObject
'name' => $data['name'],
'nick' => $data['nick']];
// Only fill the pubkey if it was empty before. We have to prevent identity theft.
if (!empty($contact['pubkey'])) {
unset($contact['pubkey']);
} else {
$updated['pubkey'] = $data['pubkey'];
}
if ($data['keywords'] != '') {
$updated['keywords'] = $data['keywords'];
}
if ($data['location'] != '') {
$updated['location'] = $data['location'];
}
// Update the technical stuff as well - if filled
if ($data['notify'] != '') {
$updated['notify'] = $data['notify'];
}
if ($data['poll'] != '') {
$updated['poll'] = $data['poll'];
}
if ($data['batch'] != '') {
$updated['batch'] = $data['batch'];
}
if ($data['request'] != '') {
$updated['request'] = $data['request'];
}
if ($data['confirm'] != '') {
$updated['confirm'] = $data['confirm'];
}
if ($data['poco'] != '') {
$updated['poco'] = $data['poco'];
}
// Only fill the pubkey if it had been empty before. We have to prevent identity theft.
if (empty($contact['pubkey'])) {
$updated['pubkey'] = $data['pubkey'];
if ($data['about'] != '') {
$updated['about'] = $data['about'];
}
if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
@ -1701,56 +1686,4 @@ class Contact extends BaseObject
$contact_ids = $return;
}
/**
* @brief Returns a magic link to authenticate remote visitors
*
* @param string $contact_url The address of the target contact profile
* @param integer $url An url that we will be redirected to after the authentication
*
* @return string with "redir" link
*/
public static function magicLink($contact_url, $url = '')
{
$cid = self::getIdForURL($contact_url, 0, true);
if (empty($cid)) {
return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
}
return self::magicLinkbyId($cid, $url);
}
/**
* @brief Returns a magic link to authenticate remote visitors
*
* @param integer $cid The contact id of the target contact profile
* @param integer $url An url that we will be redirected to after the authentication
*
* @return string with "redir" link
*/
public static function magicLinkbyId($cid, $url = '')
{
$contact = dba::selectFirst('contact', ['network', 'url', 'uid'], ['id' => $cid]);
if ($contact['network'] != NETWORK_DFRN) {
return $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
}
// Only redirections to the same host do make sense
if (($url != '') && (parse_url($url, PHP_URL_HOST) != parse_url($contact['url'], PHP_URL_HOST))) {
return $url;
}
if ($contact['uid'] != 0) {
return self::magicLink($contact['url'], $url);
}
$redirect = 'redir/' . $cid;
if ($url != '') {
$redirect .= '?url=' . $url;
}
return $redirect;
}
}

View File

@ -803,10 +803,10 @@ class Event extends BaseObject
/**
* @brief Format an item array with event data to HTML.
*
* @param array $item Array with item and event data.
* @param arr $item Array with item and event data.
* @return string HTML output.
*/
public static function getItemHTML(array $item) {
public static function getItemHTML($item) {
$same_date = false;
$finish = false;
@ -868,7 +868,12 @@ class Event extends BaseObject
$location = self::locationToArray($item['event-location']);
// Construct the profile link (magic-auth).
$profile_link = Contact::magicLinkById($item['author-id']);
$sp = false;
$profile_link = best_link_url($item, $sp);
if (!$sp) {
$profile_link = Profile::zrl($profile_link);
}
$tpl = get_markup_template('event_stream_item.tpl');
$return = replace_macros($tpl, [

View File

@ -566,14 +566,6 @@ class Item extends BaseObject
return 0;
}
//unset($item['author-link']);
//unset($item['author-name']);
//unset($item['author-avatar']);
//unset($item['owner-link']);
unset($item['owner-name']);
unset($item['owner-avatar']);
if ($item['network'] == NETWORK_PHANTOM) {
logger('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG);
@ -1130,9 +1122,8 @@ class Item extends BaseObject
}
// Is this a shadow entry?
if ($item['uid'] == 0) {
if ($item['uid'] == 0)
return;
}
// Is there a shadow parent?
if (!dba::exists('item', ['uri' => $item['parent-uri'], 'uid' => 0])) {
@ -1172,8 +1163,10 @@ class Item extends BaseObject
// If this was a comment to a Diaspora post we don't get our comment back.
// This means that we have to distribute the comment by ourselves.
if ($origin && dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
self::distribute($public_shadow);
if ($origin) {
if (dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) {
self::distribute($public_shadow);
}
}
}
@ -1184,14 +1177,14 @@ class Item extends BaseObject
*/
private static function addLanguageInPostopts(&$item)
{
$postopts = "";
if (!empty($item['postopts'])) {
if (strstr($item['postopts'], 'lang=')) {
// do not override
return;
}
$postopts = $item['postopts'];
} else {
$postopts = "";
}
$naked_body = Text\BBCode::toPlaintext($item['body'], false);
@ -1491,7 +1484,8 @@ class Item extends BaseObject
$forum_mode = ($prvgroup ? 2 : 1);
$fields = ['wall' => true, 'origin' => true, 'forum_mode' => $forum_mode, 'contact-id' => $self['id'],
'owner-id' => $owner_id, 'owner-link' => $self['url'], 'private' => $private, 'allow_cid' => $user['allow_cid'],
'owner-id' => $owner_id, 'owner-name' => $self['name'], 'owner-link' => $self['url'],
'owner-avatar' => $self['thumb'], 'private' => $private, 'allow_cid' => $user['allow_cid'],
'allow_gid' => $user['allow_gid'], 'deny_cid' => $user['deny_cid'], 'deny_gid' => $user['deny_gid']];
dba::update('item', $fields, ['id' => $item_id]);
@ -2082,7 +2076,7 @@ EOT;
private static function addThread($itemid, $onlyshadow = false)
{
$fields = ['uid', 'created', 'edited', 'commented', 'received', 'changed', 'wall', 'private', 'pubmail',
'moderated', 'visible', 'starred', 'bookmark', 'contact-id',
'moderated', 'visible', 'spam', 'starred', 'bookmark', 'contact-id',
'deleted', 'origin', 'forum_mode', 'mention', 'network', 'author-id', 'owner-id'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$item = dba::selectFirst('item', $fields, $condition);
@ -2103,7 +2097,7 @@ EOT;
private static function updateThread($itemid, $setmention = false)
{
$fields = ['uid', 'guid', 'title', 'body', 'created', 'edited', 'commented', 'received', 'changed',
'wall', 'private', 'pubmail', 'moderated', 'visible', 'starred', 'bookmark', 'contact-id',
'wall', 'private', 'pubmail', 'moderated', 'visible', 'spam', 'starred', 'bookmark', 'contact-id',
'deleted', 'origin', 'forum_mode', 'network', 'author-id', 'owner-id', 'rendered-html', 'rendered-hash'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];

View File

@ -496,7 +496,7 @@ class Profile
$p['photo'] = proxy_url($p['photo'], false, PROXY_SIZE_SMALL);
}
$p['url'] = Contact::magicLink($p['url']);
$p['url'] = self::magicLink($p['url']);
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, [
@ -594,8 +594,12 @@ class Profile
$cids[] = $rr['cid'];
$today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false);
$url = $rr['url'];
if ($rr['network'] === NETWORK_DFRN) {
$url = System::baseUrl() . '/redir/' . $rr['cid'];
}
$rr['link'] = Contact::magicLink($rr['url']);
$rr['link'] = $url;
$rr['title'] = $rr['name'];
$rr['date'] = day_translate(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null;
@ -999,6 +1003,29 @@ class Profile
}
}
/**
* @brief Returns a magic link to authenticate remote visitors
*
* @param string $contact_url The address of the contact profile
* @param integer $uid The user id, "local_user" is the default
*
* @return string with "redir" link
*/
public static function magicLink($contact_url, $uid = -1)
{
if ($uid == -1) {
$uid = local_user();
}
$condition = ['pending' => false, 'uid' => $uid,
'nurl' => normalise_link($contact_url),
'network' => NETWORK_DFRN, 'self' => false];
$contact = dba::selectFirst('contact', ['id'], $condition);
if (DBM::is_result($contact)) {
return System::baseUrl() . '/redir/' . $contact['id'];
}
return self::zrl($contact_url);
}
public static function zrl($s, $force = false)
{
if (!strlen($s)) {

View File

@ -196,7 +196,7 @@ class Term
$orig_tag = $tag["url"];
$tag["url"] = Contact::magicLinkById($item['author-id'], $tag['url']);
$tag["url"] = best_link_url($item, $sp, $tag["url"]);
if ($tag["type"] == TERM_HASHTAG) {
if ($orig_tag != $tag["url"]) {

View File

@ -13,6 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
use dba;
@ -70,7 +71,7 @@ class Post extends BaseObject
}
$this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
$this->redirect_url = Contact::magicLinkById($this->getDataValue('cid'));
$this->redirect_url = 'redir/' . $this->getDataValue('cid');
if (!$this->isToplevel()) {
$this->threaded = true;
@ -183,7 +184,7 @@ class Post extends BaseObject
}
// Showing the one or the other text, depending upon if we can only hide it or really delete it.
$delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
$delete = $origin ? L10n::t('Delete') : L10n::t('Remove from your stream');
$drop = [
'dropping' => $dropping,
@ -198,22 +199,30 @@ class Post extends BaseObject
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
if ($item['network'] == NETWORK_FEED) {
$item['author-avatar'] = $item['contact-avatar'];
$item['author-name'] = $item['contact-name'];
$item['owner-avatar'] = $item['contact-avatar'];
$item['owner-name'] = $item['contact-name'];
}
$diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && (!$item['author-name'])) {
$profile_name = $item['author-link'];
}
$profile_link = Contact::magicLinkById($item['author-id']);
if (strpos($profile_link, 'redir/') === 0) {
$sp = false;
$profile_link = best_link_url($item, $sp);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
if ($sp) {
$sparkle = ' sparkle';
} else {
$profile_link = Profile::zrl($profile_link);
}
if (($item['network'] == NETWORK_FEED) || empty($item['author-thumb'])) {
$item['author-thumb'] = $item['author-avatar'];
}
if (($item['network'] == NETWORK_FEED) || empty($item['owner-thumb'])) {
$item['owner-thumb'] = $item['owner-avatar'];
}
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
@ -368,7 +377,7 @@ class Post extends BaseObject
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
'thumb' => $a->remove_baseurl(proxy_url($item['author-avatar'], false, PROXY_SIZE_THUMB)),
'thumb' => $a->remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $title_e,
@ -381,7 +390,7 @@ class Post extends BaseObject
'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $this->getOwnerUrl(),
'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-avatar'], false, PROXY_SIZE_THUMB)),
'owner_photo' => $a->remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
'owner_name' => htmlentities($owner_name_e),
'plink' => get_plink($item),
'edpost' => Feature::isEnabled($conv->getProfileOwner(), 'edit_posts') ? $edpost : '',
@ -838,7 +847,7 @@ class Post extends BaseObject
// This will have been stored in $a->page_contact by our calling page.
// Put this person as the wall owner of the wall-to-wall notice.
$this->owner_url = Contact::magicLink($a->page_contact['url']);
$this->owner_url = Profile::zrl($a->page_contact['url']);
$this->owner_photo = $a->page_contact['thumb'];
$this->owner_name = $a->page_contact['name'];
$this->wall_to_wall = true;
@ -860,7 +869,14 @@ class Post extends BaseObject
$this->owner_photo = $this->getDataValue('owner-avatar');
$this->owner_name = $this->getDataValue('owner-name');
$this->wall_to_wall = true;
$this->owner_url = Contact::magicLinkById($this->getDataValue('owner-id'));
// If it is our contact, use a friendly redirect link
if ($this->getDataValue('network') === NETWORK_DFRN
&& link_compare($this->getDataValue('owner-link'), $this->getDataValue('url'))
) {
$this->owner_url = $this->getRedirectUrl();
} else {
$this->owner_url = Profile::zrl($this->getDataValue('owner-link'));
}
}
}
}

View File

@ -63,7 +63,7 @@ class DFRN
* @param array $owner Owner record
*
* @return string DFRN entries
* @todo Find proper type-hints
* @todo Add type-hints
*/
public static function entries($items, $owner)
{
@ -81,7 +81,7 @@ class DFRN
$root->appendChild($entry);
}
return trim($doc->saveXML());
return(trim($doc->saveXML()));
}
/**
@ -120,6 +120,8 @@ class DFRN
}
}
// default permissions - anonymous user
$sql_extra = " AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' ";
@ -132,7 +134,6 @@ class DFRN
);
if (! DBM::is_result($r)) {
logger(sprintf('No contact found for nickname=%d', $owner_nick), LOGGER_WARNING);
killme();
}
@ -168,7 +169,6 @@ class DFRN
);
if (! DBM::is_result($r)) {
logger(sprintf('No contact found for uid=%d', $owner_id), LOGGER_WARNING);
killme();
}
@ -177,10 +177,8 @@ class DFRN
$groups = Group::getIdsByContactId($contact['id']);
if (count($groups)) {
for ($x = 0; $x < count($groups); $x ++) {
for ($x = 0; $x < count($groups); $x ++)
$groups[$x] = '<' . intval($groups[$x]) . '>' ;
}
$gs = implode('|', $groups);
} else {
$gs = '<<>>' ; // Impossible to match
@ -221,8 +219,10 @@ class DFRN
//$sql_extra .= file_tag_file_query('item',$category,'category');
}
if ($public_feed && ! $converse) {
$sql_extra .= " AND `contact`.`self` = 1 ";
if ($public_feed) {
if (! $converse) {
$sql_extra .= " AND `contact`.`self` = 1 ";
}
}
$check_date = DateTimeFormat::utc($last_update);
@ -397,7 +397,7 @@ class DFRN
* @param array $owner Owner record
*
* @return string DFRN mail
* @todo Find proper type-hints
* @todo Add type-hints
*/
public static function mail($item, $owner)
{
@ -423,7 +423,7 @@ class DFRN
$root->appendChild($mail);
return trim($doc->saveXML());
return(trim($doc->saveXML()));
}
/**
@ -433,7 +433,7 @@ class DFRN
* @param array $owner Owner record
*
* @return string DFRN suggestions
* @todo Find proper type-hints
* @todo Add type-hints
*/
public static function fsuggest($item, $owner)
{
@ -452,7 +452,7 @@ class DFRN
$root->appendChild($suggest);
return trim($doc->saveXML());
return(trim($doc->saveXML()));
}
/**
@ -462,7 +462,7 @@ class DFRN
* @param int $uid User ID
*
* @return string DFRN relocations
* @todo Find proper type-hints
* @todo Add type-hints
*/
public static function relocate($owner, $uid)
{
@ -487,6 +487,7 @@ class DFRN
$photos[$p['scale']] = System::baseUrl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
}
unset($rp, $ext);
$doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true;
@ -510,7 +511,7 @@ class DFRN
$root->appendChild($relocate);
return trim($doc->saveXML());
return(trim($doc->saveXML()));
}
/**
@ -523,7 +524,7 @@ class DFRN
* @param bool $public Is it a header for public posts?
*
* @return object XML root object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function addHeader($doc, $owner, $authorelement, $alternatelink = "", $public = false)
{
@ -599,7 +600,7 @@ class DFRN
* @param boolean $public boolean
*
* @return object XML author object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function addAuthor($doc, $owner, $authorelement, $public)
{
@ -743,7 +744,7 @@ class DFRN
* @param array $item Item elements
*
* @return object XML author object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function addEntryAuthor($doc, $element, $contact_url, $item)
{
@ -784,7 +785,7 @@ class DFRN
* @param string $activity activity value
*
* @return object XML activity object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function createActivity($doc, $element, $activity)
{
@ -795,15 +796,12 @@ class DFRN
if (!$r) {
return false;
}
if ($r->type) {
XML::addElement($doc, $entry, "activity:object-type", $r->type);
}
if ($r->id) {
XML::addElement($doc, $entry, "id", $r->id);
}
if ($r->title) {
XML::addElement($doc, $entry, "title", $r->title);
}
@ -850,7 +848,7 @@ class DFRN
* @param array $item Item element
*
* @return object XML attachment object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function getAttachment($doc, $root, $item)
{
@ -890,9 +888,9 @@ class DFRN
* @param bool $single If set, the entry is created as an XML document with a single "entry" element
*
* @return object XML entry object
* @todo Find proper type-hints
* @todo Add type-hints
*/
private static function entry($doc, $type, array $item, array $owner, $comment = false, $cid = 0, $single = false)
private static function entry($doc, $type, $item, $owner, $comment = false, $cid = 0, $single = false)
{
$mentioned = [];
@ -936,7 +934,7 @@ class DFRN
$htmlbody = $body;
if ($item['title'] != "") {
$htmlbody = "[b]" . $item['title'] . "[/b]\n\n" . $htmlbody;
$htmlbody = "[b]".$item['title']."[/b]\n\n".$htmlbody;
}
$htmlbody = BBCode::convert($htmlbody, false, 7);
@ -1063,7 +1061,6 @@ class DFRN
$tags = Item::getFeedTags($item);
/// @TODO Combine this with similar below if() block?
if (count($tags)) {
foreach ($tags as $t) {
if (($type != 'html') || ($t[0] != "@")) {
@ -1292,6 +1289,7 @@ class DFRN
$postvars['dissolve'] = '1';
}
if ((($contact['rel']) && ($contact['rel'] != CONTACT_IS_SHARING) && (! $contact['blocked'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) {
$postvars['data'] = $atom;
$postvars['perm'] = 'rw';
@ -1573,12 +1571,12 @@ class DFRN
// Until now we aren't serving different sizes - but maybe later
$avatarlist = [];
/// @todo check if "avatar" or "photo" would be the best field in the specification
$avatars = $xpath->query($element . "/atom:link[@rel='avatar']", $context);
$avatars = $xpath->query($element."/atom:link[@rel='avatar']", $context);
foreach ($avatars as $avatar) {
$href = "";
$width = 0;
foreach ($avatar->attributes as $attributes) {
/// @TODO Rewrite these similar if() to one switch
/// @TODO Rewrite these similar if () to one switch
if ($attributes->name == "href") {
$href = $attributes->textContent;
}
@ -1593,7 +1591,6 @@ class DFRN
$avatarlist[$width] = $href;
}
}
if (count($avatarlist) > 0) {
krsort($avatarlist);
$author["avatar"] = current($avatarlist);
@ -2096,9 +2093,6 @@ class DFRN
$condition = ["(`id` = ?) OR (`nurl` = ?)", $importer["id"], normalise_link($old["url"])];
dba::update('contact', $fields, $condition);
// @TODO No dba:update here?
dba::update('contact', $fields, $condition);
Contact::updateAvatar($relocate["avatar"], $importer["importer_uid"], $importer["id"], true);
logger('Contacts are updated.');
@ -2705,7 +2699,7 @@ class DFRN
if (self::updateContent($current, $item, $importer, $entrytype)) {
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
} else {
logger("Item " . $item["uri"] . " already existed.", LOGGER_DEBUG);
logger("Item ".$item["uri"]." already existed.", LOGGER_DEBUG);
}
return;
}
@ -2781,7 +2775,6 @@ class DFRN
{
logger("Processing deletions");
$uri = null;
foreach ($deletion->attributes as $attributes) {
if ($attributes->name == "ref") {
$uri = $attributes->textContent;

View File

@ -1947,7 +1947,7 @@ class OStatus
* @param bool $complete default true
* @return void
*/
private static function entryFooter($doc, $entry, array $item, array $owner, $complete = true)
private static function entryFooter($doc, $entry, $item, $owner, $complete = true)
{
$mentioned = [];
@ -1987,7 +1987,6 @@ class OStatus
if (isset($parent_item)) {
$r = dba::fetch_first("SELECT `conversation-uri`, `conversation-href` FROM `conversation` WHERE `item-uri` = ?", $parent_item);
if (DBM::is_result($r)) {
if ($r['conversation-uri'] != '') {
$conversation_uri = $r['conversation-uri'];
@ -2048,11 +2047,9 @@ class OStatus
}
if ($owner['account-type'] == ACCOUNT_TYPE_COMMUNITY) {
XML::addElement($doc, $entry, "link", "", [
"rel" => "mentioned",
"ostatus:object-type" => "http://activitystrea.ms/schema/1.0/group",
"href" => $owner['url']
]);
XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned",
"ostatus:object-type" => "http://activitystrea.ms/schema/1.0/group",
"href" => $owner['url']]);
}
if (!$item["private"]) {

View File

@ -1321,8 +1321,20 @@ class PortableContact
$version = $data->version;
$site_name = $data->site_name;
$info = $data->info;
$register_policy = constant($data->register_policy);
$register_policy_str = $data->register_policy;
$platform = $data->platform;
switch ($register_policy_str) {
case "REGISTER_CLOSED":
$register_policy = REGISTER_CLOSED;
break;
case "REGISTER_APPROVE":
$register_policy = REGISTER_APPROVE;
break;
case "REGISTER_OPEN":
$register_policy = REGISTER_OPEN;
break;
}
}
}
}

View File

@ -164,11 +164,10 @@ class Notifier {
if (!in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION, Delivery::RELOCATION])) {
$parent = $items[0];
$fields = ['network', 'author-id', 'owner-id'];
$condition = ['uri' => $target_item["thr-parent"], 'uid' => $target_item["uid"]];
$thr_parent = dba::selectFirst('item', $fields, $condition);
$thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent['network'], LOGGER_DEBUG);
logger('GUID: '.$target_item["guid"].': Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
// This is IMPORTANT!!!!
@ -214,7 +213,7 @@ class Notifier {
}
// Special treatment for forum posts
if (($target_item['author-id'] != $target_item['owner-id']) &&
if (($target_item['author-link'] != $target_item['owner-link']) &&
($owner['id'] != $target_item['contact-id']) &&
($target_item['uri'] === $target_item['parent-uri'])) {
@ -248,7 +247,7 @@ class Notifier {
$target_item['deny_cid'].$target_item['deny_gid']) == 0))
$push_notify = true;
if (($thr_parent && ($thr_parent['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
if (($thr_parent && ($thr_parent[0]['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
$push_notify = true;
if ($parent["network"] == NETWORK_OSTATUS) {
@ -334,21 +333,37 @@ class Notifier {
// If the thread parent is OStatus then do some magic to distribute the messages.
// We have not only to look at the parent, since it could be a Friendica thread.
if (($thr_parent && ($thr_parent['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
if (($thr_parent && ($thr_parent[0]['network'] == NETWORK_OSTATUS)) || ($parent['network'] == NETWORK_OSTATUS)) {
$diaspora_delivery = false;
logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent['author-id']." - Owner: ".$thr_parent['owner-id'], LOGGER_DEBUG);
logger('Some parent is OStatus for '.$target_item["guid"]." - Author: ".$thr_parent[0]['author-link']." - Owner: ".$thr_parent[0]['owner-link'], LOGGER_DEBUG);
// Send a salmon to the parent author
$probed_contact = dba::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]);
if (DBM::is_result($probed_contact) && !empty($probed_contact["notify"])) {
$r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
dbesc(normalise_link($thr_parent[0]['author-link'])),
intval($uid));
if (DBM::is_result($r)) {
$probed_contact = $r[0];
} else {
$probed_contact = Probe::uri($thr_parent[0]['author-link']);
}
if ($probed_contact["notify"] != "") {
logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
}
// Send a salmon to the parent owner
$probed_contact = dba::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['owner-id']]);
if (DBM::is_result($probed_contact) && !empty($probed_contact["notify"])) {
$r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
dbesc(normalise_link($thr_parent[0]['owner-link'])),
intval($uid));
if (DBM::is_result($r)) {
$probed_contact = $r[0];
} else {
$probed_contact = Probe::uri($thr_parent[0]['owner-link']);
}
if ($probed_contact["notify"] != "") {
logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
}

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,14 @@ namespace Friendica\Test;
use Friendica\App;
use Friendica\BaseObject;
use PHPUnit\Framework\TestCase;
// backward compatibility
if (!class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}
/**
* Tests for the BaseObject class.
*/
class BaseObjectTest extends TestCase
class BaseObjectTest extends \PHPUnit\Framework\TestCase
{
/**

View File

@ -1,63 +0,0 @@
<?php
/**
* DatabaseTest class.
*/
namespace Friendica\Test;
use dba;
use Friendica\Database\DBStructure;
use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase;
/**
* Abstract class used by tests that need a database.
*/
abstract class DatabaseTest extends TestCase
{
use TestCaseTrait;
/**
* Get database connection.
*
* This function is executed before each test in order to get a database connection that can be used by tests.
* If no prior connection is available, it tries to create one using the USER, PASS and DB environment variables.
*
* If it could not connect to the database, the test is skipped.
*
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
* @see https://phpunit.de/manual/5.7/en/database.html
*/
protected function getConnection()
{
if (!dba::$connected) {
dba::connect('localhost', getenv('USER'), getenv('PASS'), getenv('DB'));
if (dba::$connected) {
$app = get_app();
// We need to do this in order to disable logging
$app->module = 'install';
// Create database structure
DBStructure::update(false, true, true);
} else {
$this->markTestSkipped('Could not connect to the database.');
}
}
return $this->createDefaultDBConnection(dba::get_db(), getenv('DB'));
}
/**
* Get dataset to populate the database with.
* @return YamlDataSet
* @see https://phpunit.de/manual/5.7/en/database.html
*/
protected function getDataSet()
{
return new YamlDataSet(__DIR__ . '/datasets/api.yml');
}
}

View File

@ -5,12 +5,15 @@
namespace Friendica\Test;
use PHPUnit\Framework\TestCase;
// backward compatibility
if (!class_exists('\PHPUnit\Framework\TestCase')) {
class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase');
}
/**
* Tests for text functions.
*/
class TextTest extends TestCase
class TextTest extends \PHPUnit\Framework\TestCase
{
/**

View File

@ -1,22 +0,0 @@
<?php
/**
* This file is loaded by PHPUnit before any test.
*/
use PHPUnit\DbUnit\DataSet\YamlDataSet;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase;
require_once __DIR__.'/../boot.php';
require_once __DIR__.'/../include/api.php';
// Backward compatibility
if (!class_exists(TestCase::class)) {
class_alias(PHPUnit_Framework_TestCase::class, TestCase::class);
}
if (!trait_exists(TestCaseTrait::class)) {
class_alias(PHPUnit_Extensions_Database_TestCase_Trait::class, TestCaseTrait::class);
}
if (!class_exists(YamlDataSet::class)) {
class_alias(PHPUnit_Extensions_Database_DataSet_YamlDataSet::class, YamlDataSet::class);
}

View File

@ -1,192 +0,0 @@
---
# Empty these tables
cache:
config:
conversation:
pconfig:
photo:
workerqueue:
mail:
# Populate tables with test data
user:
-
uid: 42
username: Test user
nickname: selfcontact
verified: true
password: $2y$10$DLRNTRmJgKe1cSrFJ5Jb0edCqvXlA9sh/RHdSnfxjbR.04yZRm4Qm
theme: frio
contact:
-
id: 42
uid: 42
name: Self contact
nick: selfcontact
self: true
nurl: http://localhost/profile/selfcontact
url: http://localhost/profile/selfcontact
about: User used in tests
pending: false
blocked: false
rel: 1
network: dfrn
-
id: 43
uid: 0
# Having the same name and nick allows us to test
# the fallback to api_get_nick() in api_get_user()
name: othercontact
nick: othercontact
self: false
nurl: http://localhost/profile/othercontact
url: http://localhost/profile/othercontact
pending: false
blocked: false
rel: 0
network: dfrn
-
id: 44
uid: 42
name: Friend contact
nick: friendcontact
self: false
nurl: http://localhost/profile/friendcontact
url: http://localhost/profile/friendcontact
pending: false
blocked: false
rel: 2
network: dfrn
item:
-
id: 1
visible: true
contact-id: 42
author-id: 42
owner-id: 45
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: true
body: Parent status
parent: 1
author-link: http://localhost/profile/selfcontact
wall: true
starred: true
allow_cid: ''
allow_gid: ''
deny_cid: ''
deny_gid: ''
-
id: 2
visible: true
contact-id: 42
author-id: 42
owner-id: 45
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: false
body: Reply
parent: 1
author-link: http://localhost/profile/selfcontact
wall: true
starred: false
-
id: 3
visible: true
contact-id: 43
author-id: 43
owner-id: 42
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: false
body: Other user status
parent: 3
author-link: http://localhost/profile/othercontact
wall: true
starred: false
-
id: 4
visible: true
contact-id: 43
author-id: 43
owner-id: 42
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: false
body: Other user reply
parent: 1
author-link: http://localhost/profile/othercontact
wall: true
starred: false
-
id: 5
visible: true
contact-id: 42
author-id: 42
owner-id: 42
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: false
body: '[share]Shared status[/share]'
parent: 1
author-link: http://localhost/profile/othercontact
wall: true
starred: false
allow_cid: ''
allow_gid: ''
deny_cid: ''
deny_gid: ''
-
id: 6
visible: true
contact-id: 44
author-id: 44
owner-id: 42
uid: 42
verb: http://activitystrea.ms/schema/1.0/post
unseen: false
body: Friend user status
parent: 6
author-link: http://localhost/profile/othercontact
wall: true
starred: false
thread:
-
iid: 1
visible: true
contact-id: 42
uid: 42
wall: true
-
iid: 3
visible: true
contact-id: 43
uid: 0
wall: true
-
iid: 6
visible: true
contact-id: 44
uid: 0
wall: true
group:
-
id: 1
uid: 42
visible: true
name: Visible list
-
id: 2
uid: 42
visible: false
name: Private list
search:
-
id: 1
term: Saved search
uid: 42

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -65,6 +65,96 @@ $a->strings["You've received a registration request from '%1\$s' at %2\$s"] = "D
$a->strings["You've received a [url=%1\$s]registration request[/url] from %2\$s."] = "Du hast eine [url=%1\$s]Registrierungsanfrage[/url] von %2\$s erhalten.";
$a->strings["Full Name:\t%1\$s\\nSite Location:\t%2\$s\\nLogin Name:\t%3\$s (%4\$s)"] = "Kompletter Name:\t%1\$s\\nURL der Seite:\t%2\$s\\nLogin Name:\t%3\$s (%4\$s)";
$a->strings["Please visit %s to approve or reject the request."] = "Bitte besuche %s um die Anfrage zu bearbeiten.";
$a->strings["Welcome "] = "Willkommen ";
$a->strings["Please upload a profile photo."] = "Bitte lade ein Profilbild hoch.";
$a->strings["Welcome back "] = "Willkommen zurück ";
$a->strings["The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it."] = "Das Sicherheitsmerkmal war nicht korrekt. Das passiert meistens wenn das Formular vor dem Absenden zu lange geöffnet war (länger als 3 Stunden).";
$a->strings["newer"] = "neuer";
$a->strings["older"] = "älter";
$a->strings["first"] = "erste";
$a->strings["prev"] = "vorige";
$a->strings["next"] = "nächste";
$a->strings["last"] = "letzte";
$a->strings["Loading more entries..."] = "lade weitere Einträge...";
$a->strings["The end"] = "Das Ende";
$a->strings["No contacts"] = "Keine Kontakte";
$a->strings["%d Contact"] = [
0 => "%d Kontakt",
1 => "%d Kontakte",
];
$a->strings["View Contacts"] = "Kontakte anzeigen";
$a->strings["Save"] = "Speichern";
$a->strings["Follow"] = "Folge";
$a->strings["Search"] = "Suche";
$a->strings["@name, !forum, #tags, content"] = "@name, !forum, #tags, content";
$a->strings["Full Text"] = "Volltext";
$a->strings["Tags"] = "Tags";
$a->strings["Contacts"] = "Kontakte";
$a->strings["Forums"] = "Foren";
$a->strings["poke"] = "anstupsen";
$a->strings["poked"] = "stupste";
$a->strings["ping"] = "anpingen";
$a->strings["pinged"] = "pingte";
$a->strings["prod"] = "knuffen";
$a->strings["prodded"] = "knuffte";
$a->strings["slap"] = "ohrfeigen";
$a->strings["slapped"] = "ohrfeigte";
$a->strings["finger"] = "befummeln";
$a->strings["fingered"] = "befummelte";
$a->strings["rebuff"] = "eine Abfuhr erteilen";
$a->strings["rebuffed"] = "abfuhrerteilte";
$a->strings["Monday"] = "Montag";
$a->strings["Tuesday"] = "Dienstag";
$a->strings["Wednesday"] = "Mittwoch";
$a->strings["Thursday"] = "Donnerstag";
$a->strings["Friday"] = "Freitag";
$a->strings["Saturday"] = "Samstag";
$a->strings["Sunday"] = "Sonntag";
$a->strings["January"] = "Januar";
$a->strings["February"] = "Februar";
$a->strings["March"] = "März";
$a->strings["April"] = "April";
$a->strings["May"] = "Mai";
$a->strings["June"] = "Juni";
$a->strings["July"] = "Juli";
$a->strings["August"] = "August";
$a->strings["September"] = "September";
$a->strings["October"] = "Oktober";
$a->strings["November"] = "November";
$a->strings["December"] = "Dezember";
$a->strings["Mon"] = "Mo";
$a->strings["Tue"] = "Di";
$a->strings["Wed"] = "Mi";
$a->strings["Thu"] = "Do";
$a->strings["Fri"] = "Fr";
$a->strings["Sat"] = "Sa";
$a->strings["Sun"] = "So";
$a->strings["Jan"] = "Jan";
$a->strings["Feb"] = "Feb";
$a->strings["Mar"] = "März";
$a->strings["Apr"] = "Apr";
$a->strings["Jul"] = "Juli";
$a->strings["Aug"] = "Aug";
$a->strings["Sep"] = "Sep";
$a->strings["Oct"] = "Okt";
$a->strings["Nov"] = "Nov";
$a->strings["Dec"] = "Dez";
$a->strings["Content warning: %s"] = "Inhaltswarnung: %s";
$a->strings["View Video"] = "Video ansehen";
$a->strings["bytes"] = "Byte";
$a->strings["Click to open/close"] = "Zum öffnen/schließen klicken";
$a->strings["View on separate page"] = "Auf separater Seite ansehen";
$a->strings["view on separate page"] = "auf separater Seite ansehen";
$a->strings["link to source"] = "Link zum Originalbeitrag";
$a->strings["event"] = "Event";
$a->strings["photo"] = "Foto";
$a->strings["activity"] = "Aktivität";
$a->strings["comment"] = [
0 => "Kommentar",
1 => "Kommentare",
];
$a->strings["post"] = "Beitrag";
$a->strings["Item filed"] = "Beitrag abgelegt";
$a->strings["Daily posting limit of %d post reached. The post was rejected."] = [
0 => "Das tägliche Limit von %d Beitrag wurde erreicht. Die Nachricht wurde verworfen.",
1 => "Das tägliche Limit von %d Beiträgen wurde erreicht. Der Beitrag wurde verworfen.",
@ -75,9 +165,7 @@ $a->strings["Weekly posting limit of %d post reached. The post was rejected."] =
];
$a->strings["Monthly posting limit of %d post reached. The post was rejected."] = "Das monatliche Limit von %d Beiträgen wurde erreicht. Der Beitrag wurde verworfen.";
$a->strings["Profile Photos"] = "Profilbilder";
$a->strings["event"] = "Event";
$a->strings["status"] = "Status";
$a->strings["photo"] = "Foto";
$a->strings["%1\$s likes %2\$s's %3\$s"] = "%1\$s mag %2\$ss %3\$s";
$a->strings["%1\$s doesn't like %2\$s's %3\$s"] = "%1\$s mag %2\$ss %3\$s nicht";
$a->strings["%1\$s attends %2\$s's %3\$s"] = "%1\$s nimmt an %2\$ss %3\$s teil.";
@ -191,94 +279,6 @@ $a->strings["Yes"] = "Ja";
$a->strings["Permission denied."] = "Zugriff verweigert.";
$a->strings["Archives"] = "Archiv";
$a->strings["show more"] = "mehr anzeigen";
$a->strings["Welcome "] = "Willkommen ";
$a->strings["Please upload a profile photo."] = "Bitte lade ein Profilbild hoch.";
$a->strings["Welcome back "] = "Willkommen zurück ";
$a->strings["The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it."] = "Das Sicherheitsmerkmal war nicht korrekt. Das passiert meistens wenn das Formular vor dem Absenden zu lange geöffnet war (länger als 3 Stunden).";
$a->strings["newer"] = "neuer";
$a->strings["older"] = "älter";
$a->strings["first"] = "erste";
$a->strings["prev"] = "vorige";
$a->strings["next"] = "nächste";
$a->strings["last"] = "letzte";
$a->strings["Loading more entries..."] = "lade weitere Einträge...";
$a->strings["The end"] = "Das Ende";
$a->strings["No contacts"] = "Keine Kontakte";
$a->strings["%d Contact"] = [
0 => "%d Kontakt",
1 => "%d Kontakte",
];
$a->strings["View Contacts"] = "Kontakte anzeigen";
$a->strings["Save"] = "Speichern";
$a->strings["Follow"] = "Folge";
$a->strings["Search"] = "Suche";
$a->strings["@name, !forum, #tags, content"] = "@name, !forum, #tags, content";
$a->strings["Full Text"] = "Volltext";
$a->strings["Tags"] = "Tags";
$a->strings["Contacts"] = "Kontakte";
$a->strings["Forums"] = "Foren";
$a->strings["poke"] = "anstupsen";
$a->strings["poked"] = "stupste";
$a->strings["ping"] = "anpingen";
$a->strings["pinged"] = "pingte";
$a->strings["prod"] = "knuffen";
$a->strings["prodded"] = "knuffte";
$a->strings["slap"] = "ohrfeigen";
$a->strings["slapped"] = "ohrfeigte";
$a->strings["finger"] = "befummeln";
$a->strings["fingered"] = "befummelte";
$a->strings["rebuff"] = "eine Abfuhr erteilen";
$a->strings["rebuffed"] = "abfuhrerteilte";
$a->strings["Monday"] = "Montag";
$a->strings["Tuesday"] = "Dienstag";
$a->strings["Wednesday"] = "Mittwoch";
$a->strings["Thursday"] = "Donnerstag";
$a->strings["Friday"] = "Freitag";
$a->strings["Saturday"] = "Samstag";
$a->strings["Sunday"] = "Sonntag";
$a->strings["January"] = "Januar";
$a->strings["February"] = "Februar";
$a->strings["March"] = "März";
$a->strings["April"] = "April";
$a->strings["May"] = "Mai";
$a->strings["June"] = "Juni";
$a->strings["July"] = "Juli";
$a->strings["August"] = "August";
$a->strings["September"] = "September";
$a->strings["October"] = "Oktober";
$a->strings["November"] = "November";
$a->strings["December"] = "Dezember";
$a->strings["Mon"] = "Mo";
$a->strings["Tue"] = "Di";
$a->strings["Wed"] = "Mi";
$a->strings["Thu"] = "Do";
$a->strings["Fri"] = "Fr";
$a->strings["Sat"] = "Sa";
$a->strings["Sun"] = "So";
$a->strings["Jan"] = "Jan";
$a->strings["Feb"] = "Feb";
$a->strings["Mar"] = "März";
$a->strings["Apr"] = "Apr";
$a->strings["Jul"] = "Juli";
$a->strings["Aug"] = "Aug";
$a->strings["Sep"] = "Sep";
$a->strings["Oct"] = "Okt";
$a->strings["Nov"] = "Nov";
$a->strings["Dec"] = "Dez";
$a->strings["Content warning: %s"] = "Inhaltswarnung: %s";
$a->strings["View Video"] = "Video ansehen";
$a->strings["bytes"] = "Byte";
$a->strings["Click to open/close"] = "Zum öffnen/schließen klicken";
$a->strings["View on separate page"] = "Auf separater Seite ansehen";
$a->strings["view on separate page"] = "auf separater Seite ansehen";
$a->strings["link to source"] = "Link zum Originalbeitrag";
$a->strings["activity"] = "Aktivität";
$a->strings["comment"] = [
0 => "Kommentar",
1 => "Kommentare",
];
$a->strings["post"] = "Beitrag";
$a->strings["Item filed"] = "Beitrag abgelegt";
$a->strings["No friends to display."] = "Keine Kontakte zum Anzeigen.";
$a->strings["Connect"] = "Verbinden";
$a->strings["Authorize application connection"] = "Verbindung der Applikation autorisieren";
@ -351,6 +351,7 @@ $a->strings["Do you really want to delete this suggestion?"] = "Möchtest Du wir
$a->strings["No suggestions available. If this is a new site, please try again in 24 hours."] = "Keine Vorschläge verfügbar. Falls der Server frisch aufgesetzt wurde, versuche es bitte in 24 Stunden noch einmal.";
$a->strings["Ignore/Hide"] = "Ignorieren/Verbergen";
$a->strings["Friend Suggestions"] = "Kontaktvorschläge";
$a->strings["[Embedded content - reload page to view]"] = "[Eingebetteter Inhalt - Seite neu laden zum Betrachten]";
$a->strings["This site has exceeded the number of allowed daily account registrations. Please try again tomorrow."] = "Die maximale Anzahl täglicher Registrierungen auf dieser Seite wurde überschritten. Bitte versuche es morgen noch einmal.";
$a->strings["Import"] = "Import";
$a->strings["Move account"] = "Account umziehen";
@ -401,6 +402,7 @@ $a->strings["All Contacts (with secure profile access)"] = "Alle Kontakte (mit g
$a->strings["Account approved."] = "Konto freigegeben.";
$a->strings["Registration revoked for %s"] = "Registrierung für %s wurde zurückgezogen";
$a->strings["Please login."] = "Bitte melde Dich an.";
$a->strings["%1\$s is following %2\$s's %3\$s"] = "%1\$s folgt %2\$s %3\$s";
$a->strings["Tag removed"] = "Tag entfernt";
$a->strings["Remove Item Tag"] = "Gegenstands-Tag entfernen";
$a->strings["Select a tag to remove: "] = "Wähle ein Tag zum Entfernen aus: ";
@ -764,6 +766,185 @@ $a->strings["%d message"] = [
0 => "%d Nachricht",
1 => "%d Nachrichten",
];
$a->strings["Group created."] = "Gruppe erstellt.";
$a->strings["Could not create group."] = "Konnte die Gruppe nicht erstellen.";
$a->strings["Group not found."] = "Gruppe nicht gefunden.";
$a->strings["Group name changed."] = "Gruppenname geändert.";
$a->strings["Save Group"] = "Gruppe speichern";
$a->strings["Create a group of contacts/friends."] = "Eine Kontaktgruppe anlegen.";
$a->strings["Group Name: "] = "Gruppenname:";
$a->strings["Group removed."] = "Gruppe entfernt.";
$a->strings["Unable to remove group."] = "Konnte die Gruppe nicht entfernen.";
$a->strings["Delete Group"] = "Gruppe löschen";
$a->strings["Group Editor"] = "Gruppeneditor";
$a->strings["Edit Group Name"] = "Gruppen Name bearbeiten";
$a->strings["Members"] = "Mitglieder";
$a->strings["Group is empty"] = "Gruppe ist leer";
$a->strings["Remove contact from group"] = "Entferne den Kontakt aus der Gruppe";
$a->strings["Add contact to group"] = "Füge den Kontakt zur Gruppe hinzu";
$a->strings["OpenID protocol error. No ID returned."] = "OpenID Protokollfehler. Keine ID zurückgegeben.";
$a->strings["Account not found and OpenID registration is not permitted on this site."] = "Nutzerkonto wurde nicht gefunden und OpenID-Registrierung ist auf diesem Server nicht gestattet.";
$a->strings["Login failed."] = "Anmeldung fehlgeschlagen.";
$a->strings["Profile not found."] = "Profil nicht gefunden.";
$a->strings["This may occasionally happen if contact was requested by both persons and it has already been approved."] = "Das kann passieren, wenn sich zwei Kontakte gegenseitig eingeladen haben und bereits einer angenommen wurde.";
$a->strings["Response from remote site was not understood."] = "Antwort der Gegenstelle unverständlich.";
$a->strings["Unexpected response from remote site: "] = "Unerwartete Antwort der Gegenstelle: ";
$a->strings["Confirmation completed successfully."] = "Bestätigung erfolgreich abgeschlossen.";
$a->strings["Temporary failure. Please wait and try again."] = "Zeitweiser Fehler. Bitte warte einige Momente und versuche es dann noch einmal.";
$a->strings["Introduction failed or was revoked."] = "Kontaktanfrage schlug fehl oder wurde zurückgezogen.";
$a->strings["Remote site reported: "] = "Gegenstelle meldet: ";
$a->strings["Unable to set contact photo."] = "Konnte das Bild des Kontakts nicht speichern.";
$a->strings["No user record found for '%s' "] = "Für '%s' wurde kein Nutzer gefunden";
$a->strings["Our site encryption key is apparently messed up."] = "Der Verschlüsselungsschlüssel unserer Seite ist anscheinend nicht in Ordnung.";
$a->strings["Empty site URL was provided or URL could not be decrypted by us."] = "Leere URL für die Seite erhalten oder die URL konnte nicht entschlüsselt werden.";
$a->strings["Contact record was not found for you on our site."] = "Für diesen Kontakt wurde auf unserer Seite kein Eintrag gefunden.";
$a->strings["Site public key not available in contact record for URL %s."] = "Die Kontaktdaten für URL %s enthalten keinen Public Key für den Server.";
$a->strings["The ID provided by your system is a duplicate on our system. It should work if you try again."] = "Die ID, die uns Dein System angeboten hat, ist hier bereits vergeben. Bitte versuche es noch einmal.";
$a->strings["Unable to set your contact credentials on our system."] = "Deine Kontaktreferenzen konnten nicht in unserem System gespeichert werden.";
$a->strings["Unable to update your contact profile details on our system"] = "Die Updates für Dein Profil konnten nicht gespeichert werden";
$a->strings["[Name Withheld]"] = "[Name unterdrückt]";
$a->strings["This introduction has already been accepted."] = "Diese Kontaktanfrage wurde bereits akzeptiert.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profiladresse ist ungültig oder stellt keine Profildaten zur Verfügung.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Warnung: Es konnte kein Name des Besitzers von der angegebenen Profiladresse gefunden werden.";
$a->strings["Warning: profile location has no profile photo."] = "Warnung: Es gibt kein Profilbild bei der angegebenen Profiladresse.";
$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d benötigter Parameter wurde an der angegebenen Stelle nicht gefunden",
1 => "%d benötigte Parameter wurden an der angegebenen Stelle nicht gefunden",
];
$a->strings["Introduction complete."] = "Kontaktanfrage abgeschlossen.";
$a->strings["Unrecoverable protocol error."] = "Nicht behebbarer Protokollfehler.";
$a->strings["Profile unavailable."] = "Profil nicht verfügbar.";
$a->strings["%s has received too many connection requests today."] = "%s hat heute zu viele Kontaktanfragen erhalten.";
$a->strings["Spam protection measures have been invoked."] = "Maßnahmen zum Spamschutz wurden ergriffen.";
$a->strings["Friends are advised to please try again in 24 hours."] = "Freunde sind angehalten, es in 24 Stunden erneut zu versuchen.";
$a->strings["Invalid locator"] = "Ungültiger Locator";
$a->strings["You have already introduced yourself here."] = "Du hast Dich hier bereits vorgestellt.";
$a->strings["Apparently you are already friends with %s."] = "Es scheint so, als ob Du bereits mit %s in Kontakt stehst.";
$a->strings["Invalid profile URL."] = "Ungültige Profil-URL.";
$a->strings["Disallowed profile URL."] = "Nicht erlaubte Profil-URL.";
$a->strings["Your introduction has been sent."] = "Deine Kontaktanfrage wurde gesendet.";
$a->strings["Remote subscription can't be done for your network. Please subscribe directly on your system."] = "Entferntes abon­nie­ren kann für dein Netzwerk nicht durchgeführt werden. Bitte nutze direkt die Abonnieren-Funktion deines Systems. ";
$a->strings["Please login to confirm introduction."] = "Bitte melde Dich an, um die Kontaktanfrage zu bestätigen.";
$a->strings["Incorrect identity currently logged in. Please login to <strong>this</strong> profile."] = "Momentan bist Du mit einer anderen Identität angemeldet. Bitte melde Dich mit <strong>diesem</strong> Profil an.";
$a->strings["Confirm"] = "Bestätigen";
$a->strings["Hide this contact"] = "Verberge diesen Kontakt";
$a->strings["Welcome home %s."] = "Willkommen zurück %s.";
$a->strings["Please confirm your introduction/connection request to %s."] = "Bitte bestätige Deine Kontaktanfrage bei %s.";
$a->strings["Please enter your 'Identity Address' from one of the following supported communications networks:"] = "Bitte gib die Adresse Deines Profils in einem der unterstützten sozialen Netzwerke an:";
$a->strings["If you are not yet a member of the free social web, <a href=\"%s\">follow this link to find a public Friendica site and join us today</a>."] = "Wenn du noch kein Mitglied dieses freien sozialen Netzwerks bist, <a href=\"%s\">folge diesem Link</a> um einen öffentlichen Friendica Server zu finden und beizutreten.";
$a->strings["Friend/Connection Request"] = "Kontaktanfrage";
$a->strings["Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de"] = "Beispiele: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de";
$a->strings["Friendica"] = "Friendica";
$a->strings["GNU Social (Pleroma, Mastodon)"] = "GNU Social (Pleroma, Mastodon)";
$a->strings["Diaspora (Socialhome, Hubzilla)"] = "Diaspora (Socialhome, Hubzilla)";
$a->strings[" - please do not use this form. Instead, enter %s into your Diaspora search bar."] = " - bitte verwende dieses Formular nicht. Stattdessen suche nach %s in Deiner Diaspora Suchleiste.";
$a->strings["Invalid request identifier."] = "Invalid request identifier.";
$a->strings["Discard"] = "Verwerfen";
$a->strings["Notifications"] = "Benachrichtigungen";
$a->strings["Network Notifications"] = "Netzwerk Benachrichtigungen";
$a->strings["Personal Notifications"] = "Persönliche Benachrichtigungen";
$a->strings["Home Notifications"] = "Pinnwand Benachrichtigungen";
$a->strings["Show Ignored Requests"] = "Zeige ignorierte Anfragen";
$a->strings["Hide Ignored Requests"] = "Verberge ignorierte Anfragen";
$a->strings["Notification type: "] = "Benachrichtigungstyp: ";
$a->strings["suggested by %s"] = "vorgeschlagen von %s";
$a->strings["Approve"] = "Genehmigen";
$a->strings["Claims to be known to you: "] = "Behauptet Dich zu kennen: ";
$a->strings["yes"] = "ja";
$a->strings["no"] = "nein";
$a->strings["Shall your connection be bidirectional or not?"] = "Soll die Verbindung beidseitig sein oder nicht?";
$a->strings["Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed."] = "Akzeptierst du %s als Kontakt, erlaubst du damit das Lesen deiner Beiträge und abonnierst selbst auch die Beiträge von %s.";
$a->strings["Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "Wenn du %s als Abonnent akzeptierst, erlaubst du damit das Lesen deiner Beiträge, wirst aber selbst die Beiträge der anderen Seite nicht erhalten.";
$a->strings["Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "Wenn du %s als Teilenden akzeptierst, erlaubst du damit das Lesen deiner Beiträge, wirst aber selbst die Beiträge der anderen Seite nicht erhalten.";
$a->strings["Friend"] = "Kontakt";
$a->strings["Sharer"] = "Teilenden";
$a->strings["Subscriber"] = "Abonnent";
$a->strings["No introductions."] = "Keine Kontaktanfragen.";
$a->strings["Show unread"] = "Ungelesene anzeigen";
$a->strings["Show all"] = "Alle anzeigen";
$a->strings["No more %s notifications."] = "Keine weiteren %s Benachrichtigungen";
$a->strings["Profile deleted."] = "Profil gelöscht.";
$a->strings["Profile-"] = "Profil-";
$a->strings["New profile created."] = "Neues Profil angelegt.";
$a->strings["Profile unavailable to clone."] = "Profil nicht zum Duplizieren verfügbar.";
$a->strings["Profile Name is required."] = "Profilname ist erforderlich.";
$a->strings["Marital Status"] = "Familienstand";
$a->strings["Romantic Partner"] = "Romanze";
$a->strings["Work/Employment"] = "Arbeit / Beschäftigung";
$a->strings["Religion"] = "Religion";
$a->strings["Political Views"] = "Politische Ansichten";
$a->strings["Gender"] = "Geschlecht";
$a->strings["Sexual Preference"] = "Sexuelle Vorlieben";
$a->strings["XMPP"] = "XMPP";
$a->strings["Homepage"] = "Webseite";
$a->strings["Interests"] = "Interessen";
$a->strings["Address"] = "Adresse";
$a->strings["Location"] = "Wohnort";
$a->strings["Profile updated."] = "Profil aktualisiert.";
$a->strings["Hide contacts and friends:"] = "Kontakte und Freunde verbergen";
$a->strings["Hide your contact/friend list from viewers of this profile?"] = "Liste der Kontakte vor Betrachtern dieses Profils verbergen?";
$a->strings["Show more profile fields:"] = "Zeige mehr Profil-Felder:";
$a->strings["Profile Actions"] = "Profilaktionen";
$a->strings["Edit Profile Details"] = "Profil bearbeiten";
$a->strings["Change Profile Photo"] = "Profilbild ändern";
$a->strings["View this profile"] = "Dieses Profil anzeigen";
$a->strings["Edit visibility"] = "Sichtbarkeit bearbeiten";
$a->strings["Create a new profile using these settings"] = "Neues Profil anlegen und diese Einstellungen verwenden";
$a->strings["Clone this profile"] = "Dieses Profil duplizieren";
$a->strings["Delete this profile"] = "Dieses Profil löschen";
$a->strings["Basic information"] = "Grundinformationen";
$a->strings["Profile picture"] = "Profilbild";
$a->strings["Preferences"] = "Vorlieben";
$a->strings["Status information"] = "Status Informationen";
$a->strings["Additional information"] = "Zusätzliche Informationen";
$a->strings["Personal"] = "Persönlich";
$a->strings["Relation"] = "Beziehung";
$a->strings["Miscellaneous"] = "Verschiedenes";
$a->strings["Your Gender:"] = "Dein Geschlecht:";
$a->strings["<span class=\"heart\">&hearts;</span> Marital Status:"] = "<span class=\"heart\">&hearts;</span> Beziehungsstatus:";
$a->strings["Sexual Preference:"] = "Sexuelle Vorlieben:";
$a->strings["Example: fishing photography software"] = "Beispiel: Fischen Fotografie Software";
$a->strings["Profile Name:"] = "Profilname:";
$a->strings["Required"] = "Benötigt";
$a->strings["This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet."] = "Dies ist Dein <strong>öffentliches</strong> Profil.<br />Es <strong>könnte</strong> für jeden Nutzer des Internets sichtbar sein.";
$a->strings["Your Full Name:"] = "Dein kompletter Name:";
$a->strings["Title/Description:"] = "Titel/Beschreibung:";
$a->strings["Street Address:"] = "Adresse:";
$a->strings["Locality/City:"] = "Wohnort:";
$a->strings["Region/State:"] = "Region/Bundesstaat:";
$a->strings["Postal/Zip Code:"] = "Postleitzahl:";
$a->strings["Country:"] = "Land:";
$a->strings["Age: "] = "Alter: ";
$a->strings["Who: (if applicable)"] = "Wer: (falls anwendbar)";
$a->strings["Examples: cathy123, Cathy Williams, cathy@example.com"] = "Beispiele: cathy123, Cathy Williams, cathy@example.com";
$a->strings["Since [date]:"] = "Seit [Datum]:";
$a->strings["Tell us about yourself..."] = "Erzähle uns ein bisschen von Dir …";
$a->strings["XMPP (Jabber) address:"] = "XMPP (Jabber) Adresse";
$a->strings["The XMPP address will be propagated to your contacts so that they can follow you."] = "Die XMPP Adresse wird an deine Kontakte verteilt werden, so dass sie auch über XMPP mit dir in Kontakt treten können.";
$a->strings["Homepage URL:"] = "Adresse der Homepage:";
$a->strings["Hometown:"] = "Heimatort:";
$a->strings["Political Views:"] = "Politische Ansichten:";
$a->strings["Religious Views:"] = "Religiöse Ansichten:";
$a->strings["Public Keywords:"] = "Öffentliche Schlüsselwörter:";
$a->strings["(Used for suggesting potential friends, can be seen by others)"] = "(Wird verwendet, um potentielle Kontakte zu finden, kann von Kontakten eingesehen werden)";
$a->strings["Private Keywords:"] = "Private Schlüsselwörter:";
$a->strings["(Used for searching profiles, never shown to others)"] = "(Wird für die Suche nach Profilen verwendet und niemals veröffentlicht)";
$a->strings["Likes:"] = "Likes:";
$a->strings["Dislikes:"] = "Dislikes:";
$a->strings["Musical interests"] = "Musikalische Interessen";
$a->strings["Books, literature"] = "Bücher, Literatur";
$a->strings["Television"] = "Fernsehen";
$a->strings["Film/dance/culture/entertainment"] = "Filme/Tänze/Kultur/Unterhaltung";
$a->strings["Hobbies/Interests"] = "Hobbies/Interessen";
$a->strings["Love/romance"] = "Liebe/Romantik";
$a->strings["Work/employment"] = "Arbeit/Anstellung";
$a->strings["School/education"] = "Schule/Ausbildung";
$a->strings["Contact information and Social Networks"] = "Kontaktinformationen und Soziale Netzwerke";
$a->strings["Profile Image"] = "Profilbild";
$a->strings["visible to everybody"] = "sichtbar für jeden";
$a->strings["Edit/Manage Profiles"] = "Bearbeite/Verwalte Profile";
$a->strings["Change profile photo"] = "Profilbild ändern";
$a->strings["Create New Profile"] = "Neues Profil anlegen";
$a->strings["Theme settings updated."] = "Themeneinstellungen aktualisiert.";
$a->strings["Information"] = "Information";
$a->strings["Overview"] = "Übersicht";
@ -831,7 +1012,6 @@ $a->strings["No remote contact is blocked from this node."] = "Derzeit werden ke
$a->strings["Blocked Remote Contacts"] = "Blockierte Kontakte von anderen Knoten";
$a->strings["Block New Remote Contact"] = "Blockieren von weiteren Kontakten";
$a->strings["Photo"] = "Foto:";
$a->strings["Address"] = "Adresse";
$a->strings["%s total blocked contact"] = [
0 => "Insgesamt %s blockierter Kontakt",
1 => "Insgesamt %s blockierte Kontakte",
@ -1035,7 +1215,7 @@ $a->strings["If you have a restricted system where the webserver can't access th
$a->strings["Base path to installation"] = "Basis-Pfad zur Installation";
$a->strings["If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."] = "Falls das System nicht den korrekten Pfad zu deiner Installation gefunden hat, gib den richtigen Pfad bitte hier ein. Du solltest hier den Pfad nur auf einem eingeschränkten System angeben müssen, bei dem du mit symbolischen Links auf dein Webverzeichnis verweist.";
$a->strings["Disable picture proxy"] = "Bilder Proxy deaktivieren";
$a->strings["The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwidth."] = "Der Proxy für Bilder verbessert die Leistung und Privatsphäre der Nutzer. Er sollte nicht auf Systemen verwendet werden, die nur über begrenzte Bandbreite verfügen.";
$a->strings["The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith."] = "Der Proxy für Bilder verbessert die Leistung und Privatsphäre der Nutzer. Er sollte nicht auf Systemen verwendet werden, die nur über begrenzte Bandbreite verfügen.";
$a->strings["Only search in tags"] = "Nur in Tags suchen";
$a->strings["On large systems the text search can slow down the system extremely."] = "Auf großen Knoten kann die Volltext-Suche das System ausbremsen.";
$a->strings["New base url"] = "Neue Basis-URL";
@ -1112,7 +1292,6 @@ $a->strings["User waiting for permanent deletion"] = "Nutzer wartet auf permanen
$a->strings["Request date"] = "Anfragedatum";
$a->strings["No registrations."] = "Keine Neuanmeldungen.";
$a->strings["Note from the user"] = "Hinweis vom Nutzer";
$a->strings["Approve"] = "Genehmigen";
$a->strings["Deny"] = "Verwehren";
$a->strings["Site admin"] = "Seitenadministrator";
$a->strings["Account expired"] = "Account ist abgelaufen";
@ -1163,66 +1342,12 @@ $a->strings["Global Community"] = "Globale Gemeinschaft";
$a->strings["Posts from users of the whole federated network"] = "Beiträge von Nutzern des gesamten föderalen Netzwerks";
$a->strings["No results."] = "Keine Ergebnisse.";
$a->strings["This community stream shows all public posts received by this node. They may not reflect the opinions of this nodes users."] = "Diese Gemeinschaftsseite zeigt alle öffentlichen Beiträge, die auf diesem Knoten eingegangen sind. Der Inhalt entspricht nicht zwingend der Meinung der Nutzer dieses Servers.";
$a->strings["Profile not found."] = "Profil nicht gefunden.";
$a->strings["This may occasionally happen if contact was requested by both persons and it has already been approved."] = "Das kann passieren, wenn sich zwei Kontakte gegenseitig eingeladen haben und bereits einer angenommen wurde.";
$a->strings["Response from remote site was not understood."] = "Antwort der Gegenstelle unverständlich.";
$a->strings["Unexpected response from remote site: "] = "Unerwartete Antwort der Gegenstelle: ";
$a->strings["Confirmation completed successfully."] = "Bestätigung erfolgreich abgeschlossen.";
$a->strings["Temporary failure. Please wait and try again."] = "Zeitweiser Fehler. Bitte warte einige Momente und versuche es dann noch einmal.";
$a->strings["Introduction failed or was revoked."] = "Kontaktanfrage schlug fehl oder wurde zurückgezogen.";
$a->strings["Remote site reported: "] = "Gegenstelle meldet: ";
$a->strings["Unable to set contact photo."] = "Konnte das Bild des Kontakts nicht speichern.";
$a->strings["No user record found for '%s' "] = "Für '%s' wurde kein Nutzer gefunden";
$a->strings["Our site encryption key is apparently messed up."] = "Der Verschlüsselungsschlüssel unserer Seite ist anscheinend nicht in Ordnung.";
$a->strings["Empty site URL was provided or URL could not be decrypted by us."] = "Leere URL für die Seite erhalten oder die URL konnte nicht entschlüsselt werden.";
$a->strings["Contact record was not found for you on our site."] = "Für diesen Kontakt wurde auf unserer Seite kein Eintrag gefunden.";
$a->strings["Site public key not available in contact record for URL %s."] = "Die Kontaktdaten für URL %s enthalten keinen Public Key für den Server.";
$a->strings["The ID provided by your system is a duplicate on our system. It should work if you try again."] = "Die ID, die uns Dein System angeboten hat, ist hier bereits vergeben. Bitte versuche es noch einmal.";
$a->strings["Unable to set your contact credentials on our system."] = "Deine Kontaktreferenzen konnten nicht in unserem System gespeichert werden.";
$a->strings["Unable to update your contact profile details on our system"] = "Die Updates für Dein Profil konnten nicht gespeichert werden";
$a->strings["[Name Withheld]"] = "[Name unterdrückt]";
$a->strings["This introduction has already been accepted."] = "Diese Kontaktanfrage wurde bereits akzeptiert.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profiladresse ist ungültig oder stellt keine Profildaten zur Verfügung.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Warnung: Es konnte kein Name des Besitzers von der angegebenen Profiladresse gefunden werden.";
$a->strings["Warning: profile location has no profile photo."] = "Warnung: Es gibt kein Profilbild bei der angegebenen Profiladresse.";
$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d benötigter Parameter wurde an der angegebenen Stelle nicht gefunden",
1 => "%d benötigte Parameter wurden an der angegebenen Stelle nicht gefunden",
];
$a->strings["Introduction complete."] = "Kontaktanfrage abgeschlossen.";
$a->strings["Unrecoverable protocol error."] = "Nicht behebbarer Protokollfehler.";
$a->strings["Profile unavailable."] = "Profil nicht verfügbar.";
$a->strings["%s has received too many connection requests today."] = "%s hat heute zu viele Kontaktanfragen erhalten.";
$a->strings["Spam protection measures have been invoked."] = "Maßnahmen zum Spamschutz wurden ergriffen.";
$a->strings["Friends are advised to please try again in 24 hours."] = "Freunde sind angehalten, es in 24 Stunden erneut zu versuchen.";
$a->strings["Invalid locator"] = "Ungültiger Locator";
$a->strings["You have already introduced yourself here."] = "Du hast Dich hier bereits vorgestellt.";
$a->strings["Apparently you are already friends with %s."] = "Es scheint so, als ob Du bereits mit %s in Kontakt stehst.";
$a->strings["Invalid profile URL."] = "Ungültige Profil-URL.";
$a->strings["Disallowed profile URL."] = "Nicht erlaubte Profil-URL.";
$a->strings["Your introduction has been sent."] = "Deine Kontaktanfrage wurde gesendet.";
$a->strings["Remote subscription can't be done for your network. Please subscribe directly on your system."] = "Entferntes abon­nie­ren kann für dein Netzwerk nicht durchgeführt werden. Bitte nutze direkt die Abonnieren-Funktion deines Systems. ";
$a->strings["Please login to confirm introduction."] = "Bitte melde Dich an, um die Kontaktanfrage zu bestätigen.";
$a->strings["Incorrect identity currently logged in. Please login to <strong>this</strong> profile."] = "Momentan bist Du mit einer anderen Identität angemeldet. Bitte melde Dich mit <strong>diesem</strong> Profil an.";
$a->strings["Confirm"] = "Bestätigen";
$a->strings["Hide this contact"] = "Verberge diesen Kontakt";
$a->strings["Welcome home %s."] = "Willkommen zurück %s.";
$a->strings["Please confirm your introduction/connection request to %s."] = "Bitte bestätige Deine Kontaktanfrage bei %s.";
$a->strings["Please enter your 'Identity Address' from one of the following supported communications networks:"] = "Bitte gib die Adresse Deines Profils in einem der unterstützten sozialen Netzwerke an:";
$a->strings["If you are not yet a member of the free social web, <a href=\"%s\">follow this link to find a public Friendica site and join us today</a>."] = "Wenn du noch kein Mitglied dieses freien sozialen Netzwerks bist, <a href=\"%s\">folge diesem Link</a> um einen öffentlichen Friendica Server zu finden und beizutreten.";
$a->strings["Friend/Connection Request"] = "Kontaktanfrage";
$a->strings["Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de"] = "Beispiele: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de";
$a->strings["Friendica"] = "Friendica";
$a->strings["GNU Social (Pleroma, Mastodon)"] = "GNU Social (Pleroma, Mastodon)";
$a->strings["Diaspora (Socialhome, Hubzilla)"] = "Diaspora (Socialhome, Hubzilla)";
$a->strings[" - please do not use this form. Instead, enter %s into your Diaspora search bar."] = " - bitte verwende dieses Formular nicht. Stattdessen suche nach %s in Deiner Diaspora Suchleiste.";
$a->strings["Event can not end before it has started."] = "Die Veranstaltung kann nicht enden bevor sie beginnt.";
$a->strings["Event title and start time are required."] = "Der Veranstaltungstitel und die Anfangszeit müssen angegeben werden.";
$a->strings["Create New Event"] = "Neue Veranstaltung erstellen";
$a->strings["Event details"] = "Veranstaltungsdetails";
$a->strings["Starting date and Title are required."] = "Anfangszeitpunkt und Titel werden benötigt";
$a->strings["Event Starts:"] = "Veranstaltungsbeginn:";
$a->strings["Required"] = "Benötigt";
$a->strings["Finish date/time is not known or not relevant"] = "Enddatum/-zeit ist nicht bekannt oder nicht relevant";
$a->strings["Event Finishes:"] = "Veranstaltungsende:";
$a->strings["Adjust for viewer timezone"] = "An Zeitzone des Betrachters anpassen";
@ -1233,22 +1358,6 @@ $a->strings["Basic"] = "Allgemein";
$a->strings["Permissions"] = "Berechtigungen";
$a->strings["Failed to remove event"] = "Entfernen der Veranstaltung fehlgeschlagen";
$a->strings["Event removed"] = "Veranstaltung enfternt";
$a->strings["Group created."] = "Gruppe erstellt.";
$a->strings["Could not create group."] = "Konnte die Gruppe nicht erstellen.";
$a->strings["Group not found."] = "Gruppe nicht gefunden.";
$a->strings["Group name changed."] = "Gruppenname geändert.";
$a->strings["Save Group"] = "Gruppe speichern";
$a->strings["Create a group of contacts/friends."] = "Eine Kontaktgruppe anlegen.";
$a->strings["Group Name: "] = "Gruppenname:";
$a->strings["Group removed."] = "Gruppe entfernt.";
$a->strings["Unable to remove group."] = "Konnte die Gruppe nicht entfernen.";
$a->strings["Delete Group"] = "Gruppe löschen";
$a->strings["Group Editor"] = "Gruppeneditor";
$a->strings["Edit Group Name"] = "Gruppen Name bearbeiten";
$a->strings["Members"] = "Mitglieder";
$a->strings["Group is empty"] = "Gruppe ist leer";
$a->strings["Remove contact from group"] = "Entferne den Kontakt aus der Gruppe";
$a->strings["Add contact to group"] = "Füge den Kontakt zur Gruppe hinzu";
$a->strings["Unable to locate original post."] = "Konnte den Originalbeitrag nicht finden.";
$a->strings["Empty post discarded."] = "Leerer Beitrag wurde verworfen.";
$a->strings["This message was sent to you by %s, a member of the Friendica social network."] = "Diese Nachricht wurde dir von %s geschickt, einem Mitglied des Sozialen Netzwerks Friendica.";
@ -1271,7 +1380,6 @@ $a->strings["Commented Order"] = "Neueste Kommentare";
$a->strings["Sort by Comment Date"] = "Nach Kommentardatum sortieren";
$a->strings["Posted Order"] = "Neueste Beiträge";
$a->strings["Sort by Post Date"] = "Nach Beitragsdatum sortieren";
$a->strings["Personal"] = "Persönlich";
$a->strings["Posts that mention or involve you"] = "Beiträge, in denen es um Dich geht";
$a->strings["New"] = "Neue";
$a->strings["Activity Stream - by date"] = "Aktivitäten-Stream - nach Datum";
@ -1280,33 +1388,6 @@ $a->strings["Interesting Links"] = "Interessante Links";
$a->strings["Starred"] = "Markierte";
$a->strings["Favourite Posts"] = "Favorisierte Beiträge";
$a->strings["Personal Notes"] = "Persönliche Notizen";
$a->strings["Invalid request identifier."] = "Invalid request identifier.";
$a->strings["Discard"] = "Verwerfen";
$a->strings["Notifications"] = "Benachrichtigungen";
$a->strings["Network Notifications"] = "Netzwerk Benachrichtigungen";
$a->strings["Personal Notifications"] = "Persönliche Benachrichtigungen";
$a->strings["Home Notifications"] = "Pinnwand Benachrichtigungen";
$a->strings["Show Ignored Requests"] = "Zeige ignorierte Anfragen";
$a->strings["Hide Ignored Requests"] = "Verberge ignorierte Anfragen";
$a->strings["Notification type: "] = "Benachrichtigungstyp: ";
$a->strings["suggested by %s"] = "vorgeschlagen von %s";
$a->strings["Claims to be known to you: "] = "Behauptet Dich zu kennen: ";
$a->strings["yes"] = "ja";
$a->strings["no"] = "nein";
$a->strings["Shall your connection be bidirectional or not?"] = "Soll die Verbindung beidseitig sein oder nicht?";
$a->strings["Accepting %s as a friend allows %s to subscribe to your posts, and you will also receive updates from them in your news feed."] = "Akzeptierst du %s als Kontakt, erlaubst du damit das Lesen deiner Beiträge und abonnierst selbst auch die Beiträge von %s.";
$a->strings["Accepting %s as a subscriber allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "Wenn du %s als Abonnent akzeptierst, erlaubst du damit das Lesen deiner Beiträge, wirst aber selbst die Beiträge der anderen Seite nicht erhalten.";
$a->strings["Accepting %s as a sharer allows them to subscribe to your posts, but you will not receive updates from them in your news feed."] = "Wenn du %s als Teilenden akzeptierst, erlaubst du damit das Lesen deiner Beiträge, wirst aber selbst die Beiträge der anderen Seite nicht erhalten.";
$a->strings["Friend"] = "Kontakt";
$a->strings["Sharer"] = "Teilenden";
$a->strings["Subscriber"] = "Abonnent";
$a->strings["No introductions."] = "Keine Kontaktanfragen.";
$a->strings["Show unread"] = "Ungelesene anzeigen";
$a->strings["Show all"] = "Alle anzeigen";
$a->strings["No more %s notifications."] = "Keine weiteren %s Benachrichtigungen";
$a->strings["OpenID protocol error. No ID returned."] = "OpenID Protokollfehler. Keine ID zurückgegeben.";
$a->strings["Account not found and OpenID registration is not permitted on this site."] = "Nutzerkonto wurde nicht gefunden und OpenID-Registrierung ist auf diesem Server nicht gestattet.";
$a->strings["Login failed."] = "Anmeldung fehlgeschlagen.";
$a->strings["Photo Albums"] = "Fotoalben";
$a->strings["Recent Photos"] = "Neueste Fotos";
$a->strings["Upload New Photos"] = "Neue Fotos hochladen";
@ -1361,85 +1442,6 @@ $a->strings["%s's timeline"] = "Timeline von %s";
$a->strings["%s's posts"] = "Beiträge von %s";
$a->strings["%s's comments"] = "Kommentare von %s";
$a->strings["Tips for New Members"] = "Tipps für neue Nutzer";
$a->strings["Profile deleted."] = "Profil gelöscht.";
$a->strings["Profile-"] = "Profil-";
$a->strings["New profile created."] = "Neues Profil angelegt.";
$a->strings["Profile unavailable to clone."] = "Profil nicht zum Duplizieren verfügbar.";
$a->strings["Profile Name is required."] = "Profilname ist erforderlich.";
$a->strings["Marital Status"] = "Familienstand";
$a->strings["Romantic Partner"] = "Romanze";
$a->strings["Work/Employment"] = "Arbeit / Beschäftigung";
$a->strings["Religion"] = "Religion";
$a->strings["Political Views"] = "Politische Ansichten";
$a->strings["Gender"] = "Geschlecht";
$a->strings["Sexual Preference"] = "Sexuelle Vorlieben";
$a->strings["XMPP"] = "XMPP";
$a->strings["Homepage"] = "Webseite";
$a->strings["Interests"] = "Interessen";
$a->strings["Location"] = "Wohnort";
$a->strings["Profile updated."] = "Profil aktualisiert.";
$a->strings["Hide contacts and friends:"] = "Kontakte und Freunde verbergen";
$a->strings["Hide your contact/friend list from viewers of this profile?"] = "Liste der Kontakte vor Betrachtern dieses Profils verbergen?";
$a->strings["Show more profile fields:"] = "Zeige mehr Profil-Felder:";
$a->strings["Profile Actions"] = "Profilaktionen";
$a->strings["Edit Profile Details"] = "Profil bearbeiten";
$a->strings["Change Profile Photo"] = "Profilbild ändern";
$a->strings["View this profile"] = "Dieses Profil anzeigen";
$a->strings["Edit visibility"] = "Sichtbarkeit bearbeiten";
$a->strings["Create a new profile using these settings"] = "Neues Profil anlegen und diese Einstellungen verwenden";
$a->strings["Clone this profile"] = "Dieses Profil duplizieren";
$a->strings["Delete this profile"] = "Dieses Profil löschen";
$a->strings["Basic information"] = "Grundinformationen";
$a->strings["Profile picture"] = "Profilbild";
$a->strings["Preferences"] = "Vorlieben";
$a->strings["Status information"] = "Status Informationen";
$a->strings["Additional information"] = "Zusätzliche Informationen";
$a->strings["Relation"] = "Beziehung";
$a->strings["Miscellaneous"] = "Verschiedenes";
$a->strings["Your Gender:"] = "Dein Geschlecht:";
$a->strings["<span class=\"heart\">&hearts;</span> Marital Status:"] = "<span class=\"heart\">&hearts;</span> Beziehungsstatus:";
$a->strings["Sexual Preference:"] = "Sexuelle Vorlieben:";
$a->strings["Example: fishing photography software"] = "Beispiel: Fischen Fotografie Software";
$a->strings["Profile Name:"] = "Profilname:";
$a->strings["This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet."] = "Dies ist Dein <strong>öffentliches</strong> Profil.<br />Es <strong>könnte</strong> für jeden Nutzer des Internets sichtbar sein.";
$a->strings["Your Full Name:"] = "Dein kompletter Name:";
$a->strings["Title/Description:"] = "Titel/Beschreibung:";
$a->strings["Street Address:"] = "Adresse:";
$a->strings["Locality/City:"] = "Wohnort:";
$a->strings["Region/State:"] = "Region/Bundesstaat:";
$a->strings["Postal/Zip Code:"] = "Postleitzahl:";
$a->strings["Country:"] = "Land:";
$a->strings["Age: "] = "Alter: ";
$a->strings["Who: (if applicable)"] = "Wer: (falls anwendbar)";
$a->strings["Examples: cathy123, Cathy Williams, cathy@example.com"] = "Beispiele: cathy123, Cathy Williams, cathy@example.com";
$a->strings["Since [date]:"] = "Seit [Datum]:";
$a->strings["Tell us about yourself..."] = "Erzähle uns ein bisschen von Dir …";
$a->strings["XMPP (Jabber) address:"] = "XMPP (Jabber) Adresse";
$a->strings["The XMPP address will be propagated to your contacts so that they can follow you."] = "Die XMPP Adresse wird an deine Kontakte verteilt werden, so dass sie auch über XMPP mit dir in Kontakt treten können.";
$a->strings["Homepage URL:"] = "Adresse der Homepage:";
$a->strings["Hometown:"] = "Heimatort:";
$a->strings["Political Views:"] = "Politische Ansichten:";
$a->strings["Religious Views:"] = "Religiöse Ansichten:";
$a->strings["Public Keywords:"] = "Öffentliche Schlüsselwörter:";
$a->strings["(Used for suggesting potential friends, can be seen by others)"] = "(Wird verwendet, um potentielle Kontakte zu finden, kann von Kontakten eingesehen werden)";
$a->strings["Private Keywords:"] = "Private Schlüsselwörter:";
$a->strings["(Used for searching profiles, never shown to others)"] = "(Wird für die Suche nach Profilen verwendet und niemals veröffentlicht)";
$a->strings["Likes:"] = "Likes:";
$a->strings["Dislikes:"] = "Dislikes:";
$a->strings["Musical interests"] = "Musikalische Interessen";
$a->strings["Books, literature"] = "Bücher, Literatur";
$a->strings["Television"] = "Fernsehen";
$a->strings["Film/dance/culture/entertainment"] = "Filme/Tänze/Kultur/Unterhaltung";
$a->strings["Hobbies/Interests"] = "Hobbies/Interessen";
$a->strings["Love/romance"] = "Liebe/Romantik";
$a->strings["Work/employment"] = "Arbeit/Anstellung";
$a->strings["School/education"] = "Schule/Ausbildung";
$a->strings["Contact information and Social Networks"] = "Kontaktinformationen und Soziale Netzwerke";
$a->strings["Profile Image"] = "Profilbild";
$a->strings["visible to everybody"] = "sichtbar für jeden";
$a->strings["Edit/Manage Profiles"] = "Bearbeite/Verwalte Profile";
$a->strings["Change profile photo"] = "Profilbild ändern";
$a->strings["Create New Profile"] = "Neues Profil anlegen";
$a->strings["Registration successful. Please check your email for further instructions."] = "Registrierung erfolgreich. Eine E-Mail mit weiteren Anweisungen wurde an Dich gesendet.";
$a->strings["Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login."] = "Versenden der E-Mail fehlgeschlagen. Hier sind Deine Account Details:\n\nLogin: %s\nPasswort: %s\n\nDu kannst das Passwort nach dem Anmelden ändern.";
$a->strings["Registration successful."] = "Registrierung erfolgreich.";
@ -1562,7 +1564,7 @@ $a->strings["Don't show notices"] = "Info-Popups nicht anzeigen";
$a->strings["Infinite scroll"] = "Endloses Scrollen";
$a->strings["Automatic updates only at the top of the network page"] = "Automatische Updates nur, wenn Du oben auf der Netzwerkseite bist.";
$a->strings["When disabled, the network page is updated all the time, which could be confusing while reading."] = "Wenn dies deaktiviert ist, wird die Netzwerk Seite aktualisiert, wann immer neue Beiträge eintreffen, egal an welcher Stelle gerade gelesen wird.";
$a->strings["Bandwidth Saver Mode"] = "Bandbreiten-Spar-Modus";
$a->strings["Bandwith Saver Mode"] = "Bandbreiten-Spar-Modus";
$a->strings["When enabled, embedded content is not displayed on automatic updates, they only show on page reload."] = "Wenn aktiviert, wird der eingebettete Inhalt nicht automatisch aktualisiert. In diesem Fall Seite bitte neu laden.";
$a->strings["Smart Threading"] = "Intelligentes Threading";
$a->strings["When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled."] = "Ist dies aktiviert, werden Einrückungen in Unterhaltungen unterdrückt wo sie nicht benötigt werden. Werden sie benötigt, werden die Threads weiterhin eingerückt.";
@ -1657,8 +1659,6 @@ $a->strings["Change the behaviour of this account for special situations"] = "Ve
$a->strings["Relocate"] = "Umziehen";
$a->strings["If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."] = "Wenn Du Dein Profil von einem anderen Server umgezogen hast und einige Deiner Kontakte Deine Beiträge nicht erhalten, verwende diesen Button.";
$a->strings["Resend relocate message to contacts"] = "Umzugsbenachrichtigung erneut an Kontakte senden";
$a->strings["%1\$s is following %2\$s's %3\$s"] = "%1\$s folgt %2\$s %3\$s";
$a->strings["[Embedded content - reload page to view]"] = "[Eingebetteter Inhalt - Seite neu laden zum Betrachten]";
$a->strings["Do you really want to delete this video?"] = "Möchtest Du dieses Video wirklich löschen?";
$a->strings["Delete Video"] = "Video Löschen";
$a->strings["No videos selected"] = "Keine Videos ausgewählt";
@ -2026,6 +2026,20 @@ $a->strings["Errors encountered performing database changes: "] = "Fehler beim
$a->strings["%s: Database update"] = "%s: Datenbank Aktualisierung";
$a->strings["%s: updating %s table."] = "%s: aktualisiere Tabelle %s";
$a->strings["[no subject]"] = "[kein Betreff]";
$a->strings["Starts:"] = "Beginnt:";
$a->strings["Finishes:"] = "Endet:";
$a->strings["all-day"] = "ganztägig";
$a->strings["Jun"] = "Jun";
$a->strings["Sept"] = "Sep";
$a->strings["No events to display"] = "Keine Veranstaltung zum Anzeigen";
$a->strings["l, F j"] = "l, F j";
$a->strings["Edit event"] = "Veranstaltung bearbeiten";
$a->strings["Duplicate event"] = "Veranstaltung kopieren";
$a->strings["Delete event"] = "Veranstaltung löschen";
$a->strings["D g:i A"] = "D H:i";
$a->strings["g:i A"] = "H:i";
$a->strings["Show map"] = "Karte anzeigen";
$a->strings["Hide map"] = "Karte verbergen";
$a->strings["A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name."] = "Eine gelöschte Gruppe mit diesem Namen wurde wiederbelebt. Bestehende Berechtigungseinstellungen <strong>könnten</strong> auf diese Gruppe oder zukünftige Mitglieder angewandt werden. Falls Du dies nicht möchtest, erstelle bitte eine andere Gruppe mit einem anderen Namen.";
$a->strings["Default privacy group for new contacts"] = "Voreingestellte Gruppe für neue Kontakte";
$a->strings["Everybody"] = "Alle Kontakte";
@ -2034,6 +2048,31 @@ $a->strings["Edit group"] = "Gruppe bearbeiten";
$a->strings["Contacts not in any group"] = "Kontakte in keiner Gruppe";
$a->strings["Create a new group"] = "Neue Gruppe erstellen";
$a->strings["Edit groups"] = "Gruppen bearbeiten";
$a->strings["Login failed"] = "Anmeldung fehlgeschlagen";
$a->strings["Not enough information to authenticate"] = "Nicht genügend Informationen für die Authentifizierung";
$a->strings["An invitation is required."] = "Du benötigst eine Einladung.";
$a->strings["Invitation could not be verified."] = "Die Einladung konnte nicht überprüft werden.";
$a->strings["Invalid OpenID url"] = "Ungültige OpenID URL";
$a->strings["We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."] = "Beim Versuch Dich mit der von Dir angegebenen OpenID anzumelden trat ein Problem auf. Bitte überprüfe, dass Du die OpenID richtig geschrieben hast.";
$a->strings["The error message was:"] = "Die Fehlermeldung lautete:";
$a->strings["Please enter the required information."] = "Bitte trage die erforderlichen Informationen ein.";
$a->strings["Please use a shorter name."] = "Bitte verwende einen kürzeren Namen.";
$a->strings["Name too short."] = "Der Name ist zu kurz.";
$a->strings["That doesn't appear to be your full (First Last) name."] = "Das scheint nicht Dein kompletter Name (Vor- und Nachname) zu sein.";
$a->strings["Your email domain is not among those allowed on this site."] = "Die Domain Deiner E-Mail Adresse ist auf dieser Seite nicht erlaubt.";
$a->strings["Not a valid email address."] = "Keine gültige E-Mail-Adresse.";
$a->strings["Cannot use that email."] = "Konnte diese E-Mail-Adresse nicht verwenden.";
$a->strings["Your nickname can only contain a-z, 0-9 and _."] = "Dein Spitzname darf nur aus Buchstaben und Zahlen (\"a-z\",\"0-9\" und \"_\") bestehen.";
$a->strings["Nickname is already registered. Please choose another."] = "Dieser Spitzname ist bereits vergeben. Bitte wähle einen anderen.";
$a->strings["SERIOUS ERROR: Generation of security keys failed."] = "FATALER FEHLER: Sicherheitsschlüssel konnten nicht erzeugt werden.";
$a->strings["An error occurred during registration. Please try again."] = "Während der Anmeldung ist ein Fehler aufgetreten. Bitte versuche es noch einmal.";
$a->strings["An error occurred creating your default profile. Please try again."] = "Bei der Erstellung des Standardprofils ist ein Fehler aufgetreten. Bitte versuche es noch einmal.";
$a->strings["An error occurred creating your self contact. Please try again."] = "Bei der Erstellung deines self Kontakts ist ein Fehler aufgetreten. Bitte versuche es erneut.";
$a->strings["An error occurred creating your default contact group. Please try again."] = "Bei der Erstellung deiner Standardgruppe für Kontakte ist ein Fehler aufgetreten. Bitte versuche es erneut.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tThank you for registering at %2\$s. Your account is pending for approval by the administrator.\n\t\t"] = "\nHallo %1\$s,\n\ndanke für Deine Registrierung auf %2\$s. Dein Account muss noch vom Admin des Knotens geprüft werden.";
$a->strings["Registration at %s"] = "Registrierung als %s";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tThank you for registering at %2\$s. Your account has been created.\n\t\t"] = "\nHallo %1\$s,\n\ndanke für Deine Registrierung auf %2\$s. Dein Account wurde eingerichtet.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%3\$s\n\t\t\tLogin Name:\t\t%1\$s\n\t\t\tPassword:\t\t%5\$s\n\n\t\t\tYou may change your password from your account \"Settings\" page after logging\n\t\t\tin.\n\n\t\t\tPlease take a few moments to review the other account settings on that page.\n\n\t\t\tYou may also wish to add some basic information to your default profile\n\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n\n\t\t\tWe recommend setting your full name, adding a profile photo,\n\t\t\tadding some profile \"keywords\" (very useful in making new friends) - and\n\t\t\tperhaps what country you live in; if you do not wish to be more specific\n\t\t\tthan that.\n\n\t\t\tWe fully respect your right to privacy, and none of these items are necessary.\n\t\t\tIf you are new and do not know anybody here, they may help\n\t\t\tyou to make some new and interesting friends.\n\n\t\t\tIf you ever want to delete your account, you can do so at %3\$s/removeme\n\n\t\t\tThank you and welcome to %2\$s."] = "\nDie Anmelde-Details sind die folgenden:\n\tAdresse der Seite:\t%3\$s\n\tBenutzernamename:\t%1\$s\n\tPasswort:\t%5\$s\n\nDu kannst Dein Passwort unter \"Einstellungen\" ändern, sobald Du Dich\nangemeldet hast.\n\nBitte nimm Dir ein paar Minuten um die anderen Einstellungen auf dieser\nSeite zu kontrollieren.\n\nEventuell magst Du ja auch einige Informationen über Dich in Deinem\nProfil veröffentlichen, damit andere Leute Dich einfacher finden können.\nBearbeite hierfür einfach Dein Standard-Profil (über die Profil-Seite).\n\nWir empfehlen Dir, Deinen kompletten Namen anzugeben und ein zu Dir\npassendes Profilbild zu wählen, damit Dich alte Bekannte wieder finden.\nAußerdem ist es nützlich, wenn Du auf Deinem Profil Schlüsselwörter\nangibst. Das erleichtert es, Leute zu finden, die Deine Interessen teilen.\n\nWir respektieren Deine Privatsphäre - keine dieser Angaben ist nötig.\nWenn Du neu im Netzwerk bist und noch niemanden kennst, dann können sie\nallerdings dabei helfen, neue und interessante Kontakte zu knüpfen.\n\nSolltest du dein Nutzerkonto löschen wollen, kannst du dies unter %3\$s/removeme jederzeit tun.\n\nDanke für Deine Aufmerksamkeit und willkommen auf %2\$s.";
$a->strings["Drop Contact"] = "Kontakt löschen";
$a->strings["Organisation"] = "Organisation";
$a->strings["News"] = "Nachrichten";
@ -2052,20 +2091,6 @@ $a->strings["Limited profile. This person will be unable to receive direct/perso
$a->strings["Unable to retrieve contact information."] = "Konnte die Kontaktinformationen nicht empfangen.";
$a->strings["%s's birthday"] = "%ss Geburtstag";
$a->strings["Happy Birthday %s"] = "Herzlichen Glückwunsch %s";
$a->strings["Starts:"] = "Beginnt:";
$a->strings["Finishes:"] = "Endet:";
$a->strings["all-day"] = "ganztägig";
$a->strings["Jun"] = "Jun";
$a->strings["Sept"] = "Sep";
$a->strings["No events to display"] = "Keine Veranstaltung zum Anzeigen";
$a->strings["l, F j"] = "l, F j";
$a->strings["Edit event"] = "Veranstaltung bearbeiten";
$a->strings["Duplicate event"] = "Veranstaltung kopieren";
$a->strings["Delete event"] = "Veranstaltung löschen";
$a->strings["D g:i A"] = "D H:i";
$a->strings["g:i A"] = "H:i";
$a->strings["Show map"] = "Karte anzeigen";
$a->strings["Hide map"] = "Karte verbergen";
$a->strings["%1\$s is attending %2\$s's %3\$s"] = "%1\$s nimmt an %2\$ss %3\$s teil.";
$a->strings["%1\$s is not attending %2\$s's %3\$s"] = "%1\$s nimmt nicht an %2\$ss %3\$s teil.";
$a->strings["%1\$s may attend %2\$s's %3\$s"] = "%1\$s nimmt eventuell an %2\$ss %3\$s teil.";
@ -2098,31 +2123,6 @@ $a->strings["Work/employment:"] = "Arbeit/Beschäftigung:";
$a->strings["School/education:"] = "Schule/Ausbildung:";
$a->strings["Forums:"] = "Foren:";
$a->strings["Only You Can See This"] = "Nur Du kannst das sehen";
$a->strings["Login failed"] = "Anmeldung fehlgeschlagen";
$a->strings["Not enough information to authenticate"] = "Nicht genügend Informationen für die Authentifizierung";
$a->strings["An invitation is required."] = "Du benötigst eine Einladung.";
$a->strings["Invitation could not be verified."] = "Die Einladung konnte nicht überprüft werden.";
$a->strings["Invalid OpenID url"] = "Ungültige OpenID URL";
$a->strings["We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."] = "Beim Versuch Dich mit der von Dir angegebenen OpenID anzumelden trat ein Problem auf. Bitte überprüfe, dass Du die OpenID richtig geschrieben hast.";
$a->strings["The error message was:"] = "Die Fehlermeldung lautete:";
$a->strings["Please enter the required information."] = "Bitte trage die erforderlichen Informationen ein.";
$a->strings["Please use a shorter name."] = "Bitte verwende einen kürzeren Namen.";
$a->strings["Name too short."] = "Der Name ist zu kurz.";
$a->strings["That doesn't appear to be your full (First Last) name."] = "Das scheint nicht Dein kompletter Name (Vor- und Nachname) zu sein.";
$a->strings["Your email domain is not among those allowed on this site."] = "Die Domain Deiner E-Mail Adresse ist auf dieser Seite nicht erlaubt.";
$a->strings["Not a valid email address."] = "Keine gültige E-Mail-Adresse.";
$a->strings["Cannot use that email."] = "Konnte diese E-Mail-Adresse nicht verwenden.";
$a->strings["Your nickname can only contain a-z, 0-9 and _."] = "Dein Spitzname darf nur aus Buchstaben und Zahlen (\"a-z\",\"0-9\" und \"_\") bestehen.";
$a->strings["Nickname is already registered. Please choose another."] = "Dieser Spitzname ist bereits vergeben. Bitte wähle einen anderen.";
$a->strings["SERIOUS ERROR: Generation of security keys failed."] = "FATALER FEHLER: Sicherheitsschlüssel konnten nicht erzeugt werden.";
$a->strings["An error occurred during registration. Please try again."] = "Während der Anmeldung ist ein Fehler aufgetreten. Bitte versuche es noch einmal.";
$a->strings["An error occurred creating your default profile. Please try again."] = "Bei der Erstellung des Standardprofils ist ein Fehler aufgetreten. Bitte versuche es noch einmal.";
$a->strings["An error occurred creating your self contact. Please try again."] = "Bei der Erstellung deines self Kontakts ist ein Fehler aufgetreten. Bitte versuche es erneut.";
$a->strings["An error occurred creating your default contact group. Please try again."] = "Bei der Erstellung deiner Standardgruppe für Kontakte ist ein Fehler aufgetreten. Bitte versuche es erneut.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tThank you for registering at %2\$s. Your account is pending for approval by the administrator.\n\t\t"] = "\nHallo %1\$s,\n\ndanke für Deine Registrierung auf %2\$s. Dein Account muss noch vom Admin des Knotens geprüft werden.";
$a->strings["Registration at %s"] = "Registrierung als %s";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tThank you for registering at %2\$s. Your account has been created.\n\t\t"] = "\nHallo %1\$s,\n\ndanke für Deine Registrierung auf %2\$s. Dein Account wurde eingerichtet.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%3\$s\n\t\t\tLogin Name:\t\t%1\$s\n\t\t\tPassword:\t\t%5\$s\n\n\t\t\tYou may change your password from your account \"Settings\" page after logging\n\t\t\tin.\n\n\t\t\tPlease take a few moments to review the other account settings on that page.\n\n\t\t\tYou may also wish to add some basic information to your default profile\n\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n\n\t\t\tWe recommend setting your full name, adding a profile photo,\n\t\t\tadding some profile \"keywords\" (very useful in making new friends) - and\n\t\t\tperhaps what country you live in; if you do not wish to be more specific\n\t\t\tthan that.\n\n\t\t\tWe fully respect your right to privacy, and none of these items are necessary.\n\t\t\tIf you are new and do not know anybody here, they may help\n\t\t\tyou to make some new and interesting friends.\n\n\t\t\tIf you ever want to delete your account, you can do so at %3\$s/removeme\n\n\t\t\tThank you and welcome to %2\$s."] = "\nDie Anmelde-Details sind die folgenden:\n\tAdresse der Seite:\t%3\$s\n\tBenutzernamename:\t%1\$s\n\tPasswort:\t%5\$s\n\nDu kannst Dein Passwort unter \"Einstellungen\" ändern, sobald Du Dich\nangemeldet hast.\n\nBitte nimm Dir ein paar Minuten um die anderen Einstellungen auf dieser\nSeite zu kontrollieren.\n\nEventuell magst Du ja auch einige Informationen über Dich in Deinem\nProfil veröffentlichen, damit andere Leute Dich einfacher finden können.\nBearbeite hierfür einfach Dein Standard-Profil (über die Profil-Seite).\n\nWir empfehlen Dir, Deinen kompletten Namen anzugeben und ein zu Dir\npassendes Profilbild zu wählen, damit Dich alte Bekannte wieder finden.\nAußerdem ist es nützlich, wenn Du auf Deinem Profil Schlüsselwörter\nangibst. Das erleichtert es, Leute zu finden, die Deine Interessen teilen.\n\nWir respektieren Deine Privatsphäre - keine dieser Angaben ist nötig.\nWenn Du neu im Netzwerk bist und noch niemanden kennst, dann können sie\nallerdings dabei helfen, neue und interessante Kontakte zu knüpfen.\n\nSolltest du dein Nutzerkonto löschen wollen, kannst du dies unter %3\$s/removeme jederzeit tun.\n\nDanke für Deine Aufmerksamkeit und willkommen auf %2\$s.";
$a->strings["Sharing notification from Diaspora network"] = "Freigabe-Benachrichtigung von Diaspora";
$a->strings["Attachments:"] = "Anhänge:";
$a->strings["%s is now following %s."] = "%s folgt nun %s";
@ -2145,8 +2145,7 @@ $a->strings["This data is required for communication and is passed on to the nod
$a->strings["At any point in time a logged in user can export their account data from the <a href=\"%1\$s/settings/uexport\">account settings</a>. If the user wants to delete their account they can do so at <a href=\"%1\$s/removeme\">%1\$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners."] = "Angemeldete Nutzer können ihre Nutzerdaten jederzeit von den <a href=\"%1\$s/settings/uexport\">Kontoeinstellungen</a> aus exportieren. Wenn ein Nutzer wünscht das Nutzerkonto zu löschen, so ist dies jederzeit unter <a href=\"%1\$s/removeme\">%1\$s/removeme</a> möglich. Die Löschung des Nutzerkontos ist permanent. Die Löschung der Daten wird auch von den Knoten der Kommunikationspartner angefordert.";
$a->strings["Privacy Statement"] = "Datenschutzerklärung";
$a->strings["This entry was edited"] = "Dieser Beitrag wurde bearbeitet.";
$a->strings["Delete globally"] = "Global löschen";
$a->strings["Remove locally"] = "Lokal entfernen";
$a->strings["Remove from your stream"] = "Aus deinem Netzwerkstrom entfernen";
$a->strings["save to folder"] = "In Ordner speichern";
$a->strings["I will attend"] = "Ich werde teilnehmen";
$a->strings["I will not attend"] = "Ich werde nicht teilnehmen";
@ -2183,5 +2182,5 @@ $a->strings["Delete this item?"] = "Diesen Beitrag löschen?";
$a->strings["show fewer"] = "weniger anzeigen";
$a->strings["No system theme config value set."] = "Es wurde kein Konfigurationswert für das Systemweite Theme gesetzt.";
$a->strings["toggle mobile"] = "auf/von Mobile Ansicht wechseln";
$a->strings["Update %s failed. See error logs."] = "Update %s fehlgeschlagen. Bitte Fehlerprotokoll überprüfen.";
$a->strings["%s: Updating author-id and owner-id in item and thread table. "] = "%s: Aktualisiere die author-id und owner-id in der Thread Tabelle";
$a->strings["Update %s failed. See error logs."] = "Update %s fehlgeschlagen. Bitte Fehlerprotokoll überprüfen.";

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,6 @@ use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
@ -154,6 +153,7 @@ function vier_community_info()
foreach ($r as $rr) {
$entry = replace_macros($tpl, [
'$id' => $rr['id'],
//'$profile_link' => Profile::zrl($rr['url']),
'$profile_link' => 'follow/?url='.urlencode($rr['url']),
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
'$alt_text' => $rr['name'],
@ -234,7 +234,7 @@ function vier_community_info()
$entry = [
'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => Contact::magicLink($contact['url']),
'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'],
'cid' => $contact['id'],
'selected' => $selected,
@ -285,7 +285,7 @@ function vier_community_info()
}
foreach ($r as $index => $helper) {
$r[$index]["url"] = Contact::magicLink($helper["url"]);
$r[$index]["url"] = Profile::zrl($helper["url"]);
}
$r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];