Compare commits

..

1 commit

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 # Disable LF normalization for all files
* -text * -text

126
.gitignore vendored
View file

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

View file

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

View file

@ -7,14 +7,4 @@ php:
- 7.1 - 7.1
- 7.2 - 7.2
services: install: composer install
- 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

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 * This script was taken from http://php.net/manual/en/function.pcntl-fork.php
*/ */
function shutdown() {
use Friendica\App; posix_kill(posix_getpid(), SIGHUP);
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");
} }
if (in_array("start", $_SERVER["argv"])) { 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"); 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"])) { if (substr($directory, 0, 1) != "/") {
Config::set('system', 'worker_daemon_mode', false); $directory = $_SERVER["PWD"]."/".$directory;
die("Pidfile wasn't found. Is the daemon running?\n"); }
$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") { if ($mode == "status") {
@ -74,7 +60,6 @@ if ($mode == "status") {
unlink($pidfile); unlink($pidfile);
Config::set('system', 'worker_daemon_mode', false);
die("Daemon process $pid isn't running.\n"); die("Daemon process $pid isn't running.\n");
} }
@ -83,19 +68,17 @@ if ($mode == "stop") {
unlink($pidfile); 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"); 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"; echo "Starting worker daemon.\n";
if (isset($a->config['php_path'])) {
$php = $a->config['php_path'];
} else {
$php = "php";
}
// Switch over to daemon mode. // Switch over to daemon mode.
if ($pid = pcntl_fork()) if ($pid = pcntl_fork())
return; // Parent return; // Parent
@ -112,51 +95,32 @@ if (posix_setsid() < 0)
if ($pid = pcntl_fork()) if ($pid = pcntl_fork())
return; // Parent 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(); $pid = getmypid();
file_put_contents($pidfile, $pid); 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. // Now running as a daemon.
while (true) { while (true) {
if (!$do_cron && ($last_cron + $wait_interval) < time()) { // Just to be sure that this script really runs endlessly
logger('Forcing cron worker call.', LOGGER_DEBUG); set_time_limit(0);
$do_cron = true;
// 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 (!$executed) {
exec($cmdline.' spawn');
if ($do_cron) {
$last_cron = time();
} }
logger("Sleeping", LOGGER_DEBUG); // Now sleep for 5 minutes
$i = 0; sleep(300);
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);
} }

View file

@ -39,9 +39,9 @@ require_once 'include/text.php';
define('FRIENDICA_PLATFORM', 'Friendica'); define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily'); 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('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1268); define('DB_UPDATE_VERSION', 1266);
define('NEW_UPDATE_ROUTINE_VERSION', 1170); define('NEW_UPDATE_ROUTINE_VERSION', 1170);
/** /**
@ -1076,7 +1076,6 @@ function is_site_admin()
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email'])); $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'])) //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)) { if (local_user() && x($a->user, 'email') && x($a->config, 'admin_email') && in_array($a->user['email'], $adminlist)) {
return true; return true;
} }
@ -1174,7 +1173,7 @@ function random_digits($digits)
{ {
$rn = ''; $rn = '';
for ($i = 0; $i < $digits; $i++) { 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); $rn .= rand(0, 9);
} }
return $rn; return $rn;
@ -1188,7 +1187,7 @@ function get_server()
$server = "https://dir.friendica.social"; $server = "https://dir.friendica.social";
} }
return $server; return($server);
} }
function get_temppath() function get_temppath()
@ -1237,7 +1236,7 @@ function get_cachefile($file, $writemode = true)
$cache = get_itemcachepath(); $cache = get_itemcachepath();
if ((!$cache) || (!is_dir($cache))) { if ((!$cache) || (!is_dir($cache))) {
return ""; return("");
} }
$subfolder = $cache . "/" . substr($file, 0, 2); $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; return $cachepath;
} }
@ -1357,6 +1357,7 @@ function get_spoolpath()
return ""; return "";
} }
if (!function_exists('exif_imagetype')) { if (!function_exists('exif_imagetype')) {
function exif_imagetype($file) function exif_imagetype($file)
{ {
@ -1394,7 +1395,7 @@ function validate_include(&$file)
} }
// Simply return flag // Simply return flag
return $valid; return ($valid);
} }
function current_load() function current_load()

View file

@ -47,8 +47,7 @@
], ],
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Friendica\\": "src/", "Friendica\\": "src/"
"Friendica\\Test\\": "tests/"
}, },
"psr-0": { "psr-0": {
"": "library/" "": "library/"
@ -69,13 +68,5 @@
"exclude": [ "exclude": [
"log", "cache", "/photo", "/proxy" "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) * [Translate Friendica](help/translations)
* [Use Composer](help/Composer) * [Use Composer](help/Composer)
* [Move classes to `src`](help/Developer-How-To-Move-Classes-to-src) * [Move classes to `src`](help/Developer-How-To-Move-Classes-to-src)
* [Run tests](help/Tests)
* Reference * Reference
* [Twitter/GNU Social API Functions](help/api) * [Twitter/GNU Social API Functions](help/api)
* [Code (Doxygen generated - sets cookies)](doc/html/) * [Code (Doxygen generated - sets cookies)](doc/html/)
@ -73,3 +72,4 @@ Friendica Documentation and Resources
* [Site/Version Info](friendica) * [Site/Version Info](friendica)
* [Friendica Credits](credits) * [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/) * [Code-Referenz (mit doxygen generiert - setzt Cookies)](doc/html/)
* [Twitter/GNU Social API Functions](help/api) (EN) * [Twitter/GNU Social API Functions](help/api) (EN)
* [Translation of Friendica](help/translations) (EN) * [Translation of Friendica](help/translations) (EN)
* [Run tests](help/Tests) (EN)
**Externe Ressourcen** **Externe Ressourcen**
@ -73,3 +72,4 @@ Friendica - Dokumentation und Ressourcen
* [Seite/Friendica-Version](friendica) * [Seite/Friendica-Version](friendica)
* [Mitwirkenden bei Friendica](credits) * [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_pass = 'db_password';
$db_data = 'database_name'; $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 ## Administratoren
Du kannst einen, oder mehrere Accounts, zu Administratoren machen. 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. 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'; $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'); define('API_METHOD_DELETE', 'POST,DELETE');
$API = []; $API = [];
$called_api = []; $called_api = null;
/** /**
* It is not sufficient to use local_user() to check whether someone is allowed to use the API, * 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) 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)) { if (DBM::is_result($r)) {
return $r["nurl"]; 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))); $user = dbesc(api_unique_id_to_nurl(intval($contact_id)));
if ($user == "") { if ($user == "") {
throw new BadRequestException("User ID ".$contact_id." not found."); throw new BadRequestException("User not found.");
} }
$url = $user; $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'])); $user = dbesc(api_unique_id_to_nurl($_GET['user_id']));
if ($user == "") { if ($user == "") {
throw new BadRequestException("User ID ".$_GET['user_id']." not found."); throw new BadRequestException("User not found.");
} }
$url = $user; $url = $user;
@ -670,14 +670,13 @@ function api_get_user(App $a, $contact_id = null)
'statusnet_profile_url' => $r[0]["url"], 'statusnet_profile_url' => $r[0]["url"],
'uid' => 0, 'uid' => 0,
'cid' => Contact::getIdForURL($r[0]["url"], api_user(), true), 'cid' => Contact::getIdForURL($r[0]["url"], api_user(), true),
'pid' => Contact::getIdForURL($r[0]["url"], 0, true),
'self' => 0, 'self' => 0,
'network' => $r[0]["network"], 'network' => $r[0]["network"],
]; ];
return $ret; return $ret;
} else { } 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'], 'statusnet_profile_url' => $uinfo[0]['url'],
'uid' => intval($uinfo[0]['uid']), 'uid' => intval($uinfo[0]['uid']),
'cid' => intval($uinfo[0]['cid']), 'cid' => intval($uinfo[0]['cid']),
'pid' => Contact::getIdForURL($uinfo[0]["url"], 0, true),
'self' => $uinfo[0]['self'], 'self' => $uinfo[0]['self'],
'network' => $uinfo[0]['network'], '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) 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']) { 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 { } else {
$owner_user = $status_user; $owner_user = $status_user;
} }
@ -933,7 +935,7 @@ function api_reformat_xml(&$item, &$key)
* *
* @return string The XML data * @return string The XML data
*/ */
function api_create_xml(array $data, $root_element) function api_create_xml($data, $root_element)
{ {
$childname = key($data); $childname = key($data);
$data2 = array_pop($data); $data2 = array_pop($data);
@ -958,7 +960,7 @@ function api_create_xml(array $data, $root_element)
$i = 1; $i = 1;
foreach ($data2 as $item) { foreach ($data2 as $item) {
$data4[$i++ . ":" . $childname] = $item; $data4[$i++.":".$childname] = $item;
} }
$data2 = $data4; $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) * @param string $type Return type (atom, rss, xml, json)
* *
@ -1098,12 +1100,14 @@ function api_statuses_mediap($type)
} }
$txt = HTML::toBBCode($txt); $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. // 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); item_post($a);
// this should output the last post (the one we just posted). // this should output the last post (the one we just posted).
@ -1252,9 +1256,10 @@ function api_statuses_update($type)
if (x($_FILES, 'media')) { if (x($_FILES, 'media')) {
// upload the image if we have one // upload the image if we have one
$picture = wall_upload_post($a, false); $_REQUEST['hush'] = 'yeah'; //tell wall_upload function to return img info instead of echo
if (is_array($picture)) { $media = wall_upload_post($a);
$_REQUEST['body'] .= "\n\n" . '[url=' . $picture["albumpage"] . '][img]' . $picture["preview"] . "[/img][/url]"; 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); logger('api_status_show: user_info: '.print_r($user_info, true), LOGGER_DEBUG);
if ($type == "raw") { 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 { } else {
$privacy_sql = ""; $privacy_sql = "";
} }
// get last public wall message // get last public wall message
$condition = ["`owner-id` = ? AND `uid` = ? AND `type` != 'activity' ".$privacy_sql, $lastwall = q(
$user_info['pid'], api_user()]; "SELECT `item`.*
$lastwall = dba::selectFirst('item', [], $condition, ['order' => ['id' => true]]); 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)) { if (DBM::is_result($lastwall)) {
$lastwall = $lastwall[0];
$in_reply_to = api_in_reply_to($lastwall); $in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall); $converted = api_convert_item($lastwall);
@ -1409,10 +1428,10 @@ function api_status_show($type)
$status_info["entities"] = $converted["entities"]; $status_info["entities"] = $converted["entities"];
} }
if ($status_info["source"] == 'web') { if (($lastwall['item_network'] != "") && ($status_info["source"] == 'web')) {
$status_info["source"] = ContactSelector::networkToName($lastwall['network'], $user_info['url']); $status_info["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
} elseif (ContactSelector::networkToName($lastwall['network'], $user_info['url']) != $status_info["source"]) { } 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['network'], $user_info['url']).')'); $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 // "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(); $a = get_app();
$user_info = api_get_user($a); $user_info = api_get_user($a);
$lastwall = q(
$condition = ["`owner-id` = ? AND `uid` = ? AND `verb` = ? AND `type` != 'activity' AND NOT `private`", "SELECT `item`.*
$user_info['pid'], api_user(), ACTIVITY_POST]; FROM `item`
$lastwall = dba::selectFirst('item', [], $condition, ['order' => ['id' => true]]); 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)) { if (DBM::is_result($lastwall)) {
$lastwall = $lastwall[0];
$in_reply_to = api_in_reply_to($lastwall); $in_reply_to = api_in_reply_to($lastwall);
$converted = api_convert_item($lastwall); $converted = api_convert_item($lastwall);
@ -1484,12 +1519,12 @@ function api_users_show($type)
$user_info["status"]["entities"] = $converted["entities"]; $user_info["status"]["entities"] = $converted["entities"];
} }
if ($user_info["status"]["source"] == 'web') { if (($lastwall['item_network'] != "") && ($user_info["status"]["source"] == 'web')) {
$user_info["status"]["source"] = ContactSelector::networkToName($lastwall['network'], $user_info['url']); $user_info["status"]["source"] = ContactSelector::networkToName($lastwall['item_network'], $user_info['url']);
} }
if (ContactSelector::networkToName($lastwall['network'], $user_info['url']) != $user_info["status"]["source"]) { 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['network'], $user_info['url']) . ')'); $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]; $userlist = ["users" => $userlist];
} else { } else {
throw new BadRequestException("User ".$_GET["q"]." not found."); throw new BadRequestException("User not found.");
} }
} else { } else {
throw new BadRequestException("No user specified."); throw new BadRequestException("User not found.");
} }
return api_format_data("users", $type, $userlist); 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); $sql_extra .= ' AND `item`.`parent` = ' . intval($conversation_id);
} }
$r = q("SELECT `item`.* FROM `item` $r = q(
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`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `verb` = '%s' WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
$sql_extra $sql_extra
AND `item`.`id` > %d AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d", ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()), intval(api_user()),
dbesc(ACTIVITY_POST), dbesc(ACTIVITY_POST),
intval($since_id), intval($since_id),
@ -1976,8 +2016,12 @@ function api_statuses_show($type)
$id = $item['id']; $id = $item['id'];
$r = q( $r = q(
"SELECT `item`.* FROM `item` "SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` `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`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
AND `item`.`uid` IN (0, %d) AND `item`.`verb` = '%s' 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); $sql_extra = ' AND `item`.`id` <= ' . intval($max_id);
} }
$r = q("SELECT `item`.* FROM `item` $r = q(
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`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`parent` = %d AND `item`.`visible` WHERE `item`.`parent` = %d AND `item`.`visible`
AND NOT `item`.`moderated` AND NOT `item`.`deleted` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
@ -2126,11 +2175,17 @@ function api_statuses_repeat($type)
logger('API: api_statuses_repeat: '.$id); logger('API: api_statuses_repeat: '.$id);
$r = q("SELECT `item`.* FROM `item` $r = q(
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` "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`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` 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", AND `item`.`id`=%d",
intval($id) intval($id)
); );
@ -2161,7 +2216,7 @@ function api_statuses_repeat($type)
} }
// this should output the last post (the one we just posted). // this should output the last post (the one we just posted).
$called_api = []; $called_api = null;
return api_status_show($type); return api_status_show($type);
} }
@ -2244,25 +2299,36 @@ function api_statuses_mentions($type)
$start = ($page - 1) * $count; $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 = ''; $sql_extra = '';
if ($max_id > 0) { 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`) $r = q(
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` 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`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `item`.`verb` = '%s' WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`author-id` != %d AND NOT (`item`.`author-link` IN ('https://%s', 'http://%s'))
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` 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 $sql_extra
AND `item`.`id` > %d AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d", ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()), intval(api_user()),
dbesc(ACTIVITY_POST), dbesc(ACTIVITY_POST),
intval($user_info['pid']), dbesc(protect_sprintf($myurl)),
dbesc(protect_sprintf($myurl)),
intval(api_user()), intval(api_user()),
intval($since_id), intval($since_id),
intval($start), intval($start),
@ -2342,15 +2408,20 @@ function api_statuses_user_timeline($type)
$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_contactid_id`) $r = q(
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` 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`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`uid` = %d AND `verb` = '%s' WHERE `item`.`uid` = %d AND `verb` = '%s'
AND `item`.`contact-id` = %d AND `item`.`contact-id` = %d
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
$sql_extra $sql_extra
AND `item`.`id` > %d AND `item`.`id` > %d
ORDER BY `item`.`id` DESC LIMIT %d ,%d", ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()), intval(api_user()),
dbesc(ACTIVITY_POST), dbesc(ACTIVITY_POST),
intval($user_info['cid']), intval($user_info['cid']),
@ -2495,15 +2566,20 @@ function api_favorites($type)
$sql_extra .= ' AND `item`.`id` <= ' . intval($max_id); $sql_extra .= ' AND `item`.`id` <= ' . intval($max_id);
} }
$r = q("SELECT `item`.* FROM `item` $r = q(
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` "SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
AND (NOT `contact`.`blocked` OR `contact`.`pending`) `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 WHERE `item`.`uid` = %d
AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted` AND `item`.`visible` = 1 AND `item`.`moderated` = 0 AND `item`.`deleted` = 0
AND `item`.`starred` AND `item`.`starred` = 1
AND `contact`.`id` = `item`.`contact-id`
AND (NOT `contact`.`blocked` OR `contact`.`pending`)
$sql_extra $sql_extra
AND `item`.`id`>%d AND `item`.`id`>%d
ORDER BY `item`.`id` DESC LIMIT %d ,%d", ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
intval(api_user()), intval(api_user()),
intval($since_id), intval($since_id),
intval($start), intval($start),
@ -2656,7 +2732,7 @@ function api_convert_item($item)
* *
* @param string $body * @param string $body
* *
* @return array * @return array|false
*/ */
function api_get_attachments(&$body) function api_get_attachments(&$body)
{ {
@ -2667,7 +2743,7 @@ function api_get_attachments(&$body)
$ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images); $ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images);
if (!$ret) { if (!$ret) {
return []; return false;
} }
$attachments = []; $attachments = [];
@ -2925,8 +3001,8 @@ function api_format_items_activities(&$item, $type = "json")
]; ];
$items = q( $items = q(
'SELECT * FROM `item` 'SELECT * FROM item
WHERE `uid` = %d AND `thr-parent` = "%s" AND `visible` AND NOT `deleted`', WHERE uid=%d AND `thr-parent`="%s" AND visible AND NOT deleted',
intval($item['uid']), intval($item['uid']),
dbesc($item['uri']) dbesc($item['uri'])
); );
@ -2936,7 +3012,7 @@ function api_format_items_activities(&$item, $type = "json")
//builtin_activity_puller($i, $activities); //builtin_activity_puller($i, $activities);
// get user data and add it to the array of the activity // 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']) { switch ($i['verb']) {
case ACTIVITY_LIKE: case ACTIVITY_LIKE:
$activities['like'][] = $user; $activities['like'][] = $user;
@ -3092,18 +3168,26 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json")
$status["entities"] = $converted["entities"]; $status["entities"] = $converted["entities"];
} }
if ($status["source"] == 'web') { if (($item['item_network'] != "") && ($status["source"] == 'web')) {
$status["source"] = ContactSelector::networkToName($item['network'], $user_info['url']); $status["source"] = ContactSelector::networkToName($item['item_network'], $user_info['url']);
} elseif (ContactSelector::networkToName($item['network'], $user_info['url']) != $status["source"]) { } elseif (($item['item_network'] != "") && (ContactSelector::networkToName($item['item_network'], $user_info['url']) != $status["source"])) {
$status["source"] = trim($status["source"].' ('.ContactSelector::networkToName($item['network'], $user_info['url']).')'); $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"]) { if ($item["id"] == $item["parent"]) {
$retweeted_item = api_share_as_retweet($item); $retweeted_item = api_share_as_retweet($item);
if ($retweeted_item !== false) { if ($retweeted_item !== false) {
$retweeted_status = $status; $retweeted_status = $status;
try { 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) { } catch (BadRequestException $e) {
// user not found. should be found? // user not found. should be found?
/// @todo check if the user should be always 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); $sql_extra .= ' AND `item`.`parent` = ' . intval($conversation_id);
} }
$statuses = dba::p("SELECT `item`.* FROM `item` $statuses = dba::p(
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`, `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`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
STRAIGHT_JOIN `group_member` ON `group_member`.`contact-id` = `item`.`contact-id` STRAIGHT_JOIN `group_member` ON `group_member`.`contact-id` = `item`.`contact-id`
WHERE `item`.`uid` = ? AND `verb` = ? 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"); 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 * @brief delete a single photo from the database through api
* *
@ -4444,7 +4534,6 @@ function api_account_update_profile_image($type)
} else { } else {
throw new InternalServerErrorException('Unsupported filetype'); throw new InternalServerErrorException('Unsupported filetype');
} }
// change specified profile or all profiles to the new resource-id // change specified profile or all profiles to the new resource-id
if ($is_default_profile) { if ($is_default_profile) {
$condition = ["`profile` AND `resource-id` != ? AND `uid` = ?", $data['photo']['id'], api_user()]; $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); Contact::updateSelfFromUserID(api_user(), true);
// Update global directory in background // Update global directory in background
//$user = api_get_user(get_app());
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname']; $url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
if ($url && strlen(Config::get('system', 'directory'))) { if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url); 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); $data['photo']['friendica_activities'] = api_format_items_activities($item[0], $type);
// retrieve comments on photo // retrieve comments on photo
$r = q("SELECT `item`.* FROM `item` $r = q(
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`
STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
AND (NOT `contact`.`blocked` OR `contact`.`pending`) AND (NOT `contact`.`blocked` OR `contact`.`pending`)
WHERE `item`.`parent` = %d AND `item`.`visible` WHERE `item`.`parent` = %d AND `item`.`visible`
AND NOT `item`.`moderated` AND NOT `item`.`deleted` 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']); $in_reply_to['status_id_str'] = (string) intval($in_reply_to['status_id']);
$r = q( $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` STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`author-id`
WHERE `item`.`id` = %d LIMIT 1", WHERE `item`.`id` = %d LIMIT 1",
intval($in_reply_to['status_id']) intval($in_reply_to['status_id'])
@ -5194,27 +5289,27 @@ function api_in_reply_to($item)
/** /**
* *
* @param string $text * @param string $Text
* *
* @return string * @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"); $include_entities = strtolower(x($_REQUEST, 'include_entities') ? $_REQUEST['include_entities'] : "false");
$text = BBCode::cleanPictureLinks($text); $Text = BBCode::cleanPictureLinks($Text);
$URLSearchString = "^\[\]"; $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") { 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 // 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']); $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' ?" . ">"; $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
if (activity_match($item['verb'], ACTIVITY_LIKE) if (activity_match($item['verb'], ACTIVITY_LIKE)
|| activity_match($item['verb'], ACTIVITY_DISLIKE) || activity_match($item['verb'], ACTIVITY_DISLIKE)
@ -162,19 +162,22 @@ function localize_item(&$item) {
if (activity_match($item['verb'], ACTIVITY_LIKE)) { if (activity_match($item['verb'], ACTIVITY_LIKE)) {
$bodyverb = L10n::t('%1$s likes %2$s\'s %3$s'); $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'); $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'); $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'); $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'); $bodyverb = L10n::t('%1$s attends maybe %2$s\'s %3$s');
} }
$item['body'] = sprintf($bodyverb, $author, $objauthor, $plink); $item['body'] = sprintf($bodyverb, $author, $objauthor, $plink);
}
}
if (activity_match($item['verb'], ACTIVITY_FRIEND)) { if (activity_match($item['verb'], ACTIVITY_FRIEND)) {
if ($item['object-type']=="" || $item['object-type']!== ACTIVITY_OBJ_PERSON) return; 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]'; $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]'; $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") { 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; $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]'; $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]'; $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
if ($Bphoto != "") { 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]; $obj = $r[0];
$author = '[url=' . Contact::magicLinkById($item['author-id']) . ']' . $item['author-name'] . '[/url]'; $author = '[url=' . Profile::zrl($item['author-link']) . ']' . $item['author-name'] . '[/url]';
$objauthor = '[url=' . Contact::magicLinkById($obj['author-id']) . ']' . $obj['author-name'] . '[/url]'; $objauthor = '[url=' . Profile::zrl($obj['author-link']) . ']' . $obj['author-name'] . '[/url]';
switch ($obj['verb']) { switch ($obj['verb']) {
case ACTIVITY_POST: 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 ); $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 (activity_match($item['verb'], ACTIVITY_FAVORITE)) {
if ($item['object-type'] == "") { if ($item['object-type'] == "") {
return; return;
} }
@ -323,8 +326,8 @@ function localize_item(&$item) {
$target = $r[0]; $target = $r[0];
$Bname = $target['author-name']; $Bname = $target['author-name'];
$Blink = $target['author-link']; $Blink = $target['author-link'];
$A = '[url=' . Contact::magicLink($Alink) . ']' . $Aname . '[/url]'; $A = '[url=' . Profile::zrl($Alink) . ']' . $Aname . '[/url]';
$B = '[url=' . Contact::magicLink($Blink) . ']' . $Bname . '[/url]'; $B = '[url=' . Profile::zrl($Blink) . ']' . $Bname . '[/url]';
$P = '[url=' . $target['plink'] . ']' . L10n::t('post/item') . '[/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"; $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)) { if (preg_match_all('/@\[url=(.*?)\]/is', $item['body'], $matches, PREG_SET_ORDER)) {
foreach ($matches as $mtch) { foreach ($matches as $mtch) {
if (!strpos($mtch[1], 'zrl=')) { 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 // 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) {
if (activity_match($item['verb'], ACTIVITY_FOLLOW) && $item['object-type'] === ACTIVITY_OBJ_NOTE && empty($item['self']) && $item['uid'] == local_user()) { if (!($item['self'] && ($item['uid'] == local_user()))) {
return false; return false;
}
} }
return true; return true;
@ -418,6 +431,7 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`inform`, `item`.`inform`,
`item`.`pubmail`, `item`.`pubmail`,
`item`.`visible`, `item`.`visible`,
`item`.`spam`,
`item`.`bookmark`, `item`.`bookmark`,
`item`.`unseen`, `item`.`unseen`,
`item`.`deleted`, `item`.`deleted`,
@ -425,12 +439,10 @@ These Fields are not added below (yet). They are here to for bug search.
`item`.`mention`, `item`.`mention`,
`item`.`global`, `item`.`global`,
`item`.`shadow`, `item`.`shadow`,
`item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
`item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
*/ */
return "`item`.`author-id`, return "`item`.`author-id`, `item`.`author-link`, `item`.`author-name`, `item`.`author-avatar`,
`item`.`owner-id`, `item`.`owner-id`, `item`.`owner-link`, `item`.`owner-name`, `item`.`owner-avatar`,
`item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`, `item`.`contact-id`, `item`.`uid`, `item`.`id`, `item`.`parent`,
`item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`, `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
`item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`, `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`.`allow_cid`, `item`.`allow_gid`, `item`.`deny_cid`, `item`.`deny_gid`,
`item`.`id` AS `item_id`, `item`.`network` AS `item_network`, `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`, `author`.`thumb` AS `author-thumb`, `owner`.`thumb` AS `owner-thumb`,
`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`,
`contact`.`network`, `contact`.`url`, `contact`.`name`, `contact`.`writable`, `contact`.`network`, `contact`.`url`, `contact`.`name`, `contact`.`writable`,
`contact`.`self`, `contact`.`id` AS `cid`, `contact`.`alias`, `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, 'bmark')) ? '&bmark=' . $_GET['bmark'] : '')
. ((x($_GET, 'liked')) ? '&liked=' . $_GET['liked'] : '') . ((x($_GET, 'liked')) ? '&liked=' . $_GET['liked'] : '')
. ((x($_GET, 'conv')) ? '&conv=' . $_GET['conv'] : '') . ((x($_GET, 'conv')) ? '&conv=' . $_GET['conv'] : '')
. ((x($_GET, 'spam')) ? '&spam=' . $_GET['spam'] : '')
. ((x($_GET, 'nets')) ? '&nets=' . $_GET['nets'] : '') . ((x($_GET, 'nets')) ? '&nets=' . $_GET['nets'] : '')
. ((x($_GET, 'cmin')) ? '&cmin=' . $_GET['cmin'] : '') . ((x($_GET, 'cmin')) ? '&cmin=' . $_GET['cmin'] : '')
. ((x($_GET, 'cmax')) ? '&cmax=' . $_GET['cmax'] : '') . ((x($_GET, 'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
@ -660,13 +671,6 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
continue; 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']); $profile_name = (strlen($item['author-name']) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && !$item['author-name']) { if ($item['author-link'] && !$item['author-name']) {
$profile_name = $item['author-link']; $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); $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'; $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' => '']; $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, 'name' => $profile_name_e,
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'lock' => $lock, '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, 'title' => $title_e,
'body' => $body_e, 'body' => $body_e,
'tags' => $tags_e, 'tags' => $tags_e,
@ -759,7 +787,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
'indent' => '', 'indent' => '',
'owner_name' => $owner_name_e, 'owner_name' => $owner_name_e,
'owner_url' => $owner_url, '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), 'plink' => get_plink($item),
'edpost' => false, 'edpost' => false,
'isstarred' => $isstarred, 'isstarred' => $isstarred,
@ -899,6 +927,48 @@ function conversation_add_children($parents, $block_authors, $order, $uid) {
return $items; 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) { function item_photo_menu($item) {
$sub_link = ''; $sub_link = '';
$poke_link = ''; $poke_link = '';
@ -912,8 +982,11 @@ function item_photo_menu($item) {
$sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;'; $sub_link = 'javascript:dosubthread(' . $item['id'] . '); return false;';
} }
$profile_link = Contact::magicLinkById($item['author-id']); $sparkle = false;
$sparkle = (strpos($profile_link, 'redir/') === 0); $profile_link = best_link_url($item, $sparkle);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
$cid = 0; $cid = 0;
$network = ''; $network = '';
@ -931,7 +1004,7 @@ function item_photo_menu($item) {
$photos_link = $profile_link . '?url=photos'; $photos_link = $profile_link . '?url=photos';
$profile_link = $profile_link . '?url=profile'; $profile_link = $profile_link . '?url=profile';
} else { } else {
$profile_link = Contact::magicLink($profile_link); $profile_link = Profile::zrl($profile_link);
} }
if ($cid && !$item['self']) { 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'])) { if (activity_match($item['verb'], $verb) && ($item['id'] != $item['parent'])) {
$url = Contact::MagicLinkbyId($item['author-id']); $url = $item['author-link'];
if (strpos($url, 'redir/') === 0) { 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" '; $sparkle = ' class="sparkle" ';
} else {
$url = Profile::zrl($url);
} }
$url = '<a href="'. $url . '"'. $sparkle .'>' . htmlentities($item['author-name']) . '</a>'; $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']; $item['thr-parent'] = $item['parent-uri'];
} }
@ -1514,17 +1590,19 @@ function sort_thr_commented(array $a, array $b)
return strcmp($b['commented'], $a['commented']); return strcmp($b['commented'], $a['commented']);
} }
function render_location_dummy(array $item) { /// @TODO Add type-hint
if (x($item, 'location') && !empty($item['location'])) { function render_location_dummy($item) {
if ($item['location'] != "") {
return $item['location']; return $item['location'];
} }
if (x($item, 'coord') && !empty($item['coord'])) { if ($item['coord'] != "") {
return $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 = []; $ret = [];
foreach ($response_verbs as $v) { foreach ($response_verbs as $v) {
$ret[$v] = []; $ret[$v] = [];

View file

@ -26,7 +26,7 @@ class dba {
private static $relation = []; private static $relation = [];
public static function connect($serveraddr, $user, $pass, $db) { public static function connect($serveraddr, $user, $pass, $db) {
if (!is_null(self::$db) && self::connected()) { if (!is_null(self::$db)) {
return true; return true;
} }
@ -92,15 +92,6 @@ class dba {
return self::$connected; 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 * @brief Returns the MySQL server version string
* *

View file

@ -152,7 +152,7 @@ function notification($params)
} }
// "your post" // "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]', $dest_str = L10n::t('%1$s commented on [url=%2$s]your %3$s[/url]',
'[url='.$params['source_link'].']'.$params['source_name'].'[/url]', '[url='.$params['source_link'].']'.$params['source_name'].'[/url]',
$itemlink, $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') { function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
$a = get_app(); $a = get_app();
$r = null;
if (is_array($importer)) { if (is_array($importer)) {
$r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1", $r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1",

View file

@ -254,7 +254,6 @@ function can_write_wall($owner)
return false; return false;
} }
/// @TODO $groups should be array
function permissions_sql($owner_id, $remote_verified = false, $groups = null) function permissions_sql($owner_id, $remote_verified = false, $groups = null)
{ {
$local_user = local_user(); $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) { if ($local_user && $local_user == $owner_id) {
$sql = ''; $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) { } elseif ($remote_user) {
/* /*
* Authenticated visitor. Unless pre-verified, * Authenticated visitor. Unless pre-verified,
@ -306,10 +298,9 @@ function permissions_sql($owner_id, $remote_verified = false, $groups = null)
if ($remote_verified) { if ($remote_verified) {
$gs = '<<>>'; // should be impossible to match $gs = '<<>>'; // should be impossible to match
if (is_array($groups)) { if (is_array($groups) && count($groups)) {
foreach ($groups as $g) { foreach ($groups as $g)
$gs .= '|<' . intval($g) . '>'; $gs .= '|<' . intval($g) . '>';
}
} }
$sql = sprintf( $sql = sprintf(

View file

@ -152,7 +152,7 @@ function autoname($len) {
'nd','ng','nk','nt','rn','rp','rt']; 'nd','ng','nk','nt','rn','rp','rt'];
$noend = ['bl', 'br', 'cl','cr','dr','fl','fr','gl','gr', $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); $start = mt_rand(0,2);
if ($start == 0) { if ($start == 0) {
@ -178,13 +178,14 @@ function autoname($len) {
$word = substr($word,0,$len); $word = substr($word,0,$len);
foreach ($noend as $noe) { foreach ($noend as $noe) {
$noelen = strlen($noe); if ((strlen($word) > 2) && (substr($word, -2) == $noe)) {
if ((strlen($word) > $noelen) && (substr($word, -$noelen) == $noe)) { $word = substr($word, 0, -1);
$word = autoname($len);
break; break;
} }
} }
if (substr($word, -1) == 'q') {
$word = substr($word, 0, -1);
}
return $word; return $word;
} }
@ -452,7 +453,7 @@ function perms2str($p) {
if (is_array($p)) { if (is_array($p)) {
$tmp = $p; $tmp = $p;
} else { } else {
$tmp = explode(',', $p); $tmp = explode(',',$p);
} }
if (is_array($tmp)) { if (is_array($tmp)) {
@ -961,9 +962,13 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
$redir = false; $redir = false;
if ($redirect) { if ($redirect) {
$url = Contact::magicLink($contact['url']); $redirect_url = 'redir/' . $contact['id'];
if (strpos($url, 'redir/') === 0) { if (local_user() && ($contact['uid'] == local_user()) && ($contact['network'] === NETWORK_DFRN)) {
$redir = true;
$url = $redirect_url;
$sparkle = ' sparkle'; $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) { foreach ($matches as $mtch) {
$mime = $mtch[3]; $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 (strpos($mime, 'video') !== false) {
if (!$vhead) { if (!$vhead) {
@ -1652,11 +1661,10 @@ function bb_translate_video($s) {
$r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER); $r = preg_match_all("/\[video\](.*?)\[\/video\]/ism",$s,$matches,PREG_SET_ORDER);
if ($r) { if ($r) {
foreach ($matches as $mtch) { foreach ($matches as $mtch) {
if ((stristr($mtch[1], 'youtube')) || (stristr($mtch[1], 'youtu.be'))) { if ((stristr($mtch[1],'youtube')) || (stristr($mtch[1],'youtu.be')))
$s = str_replace($mtch[0], '[youtube]' . $mtch[1] . '[/youtube]', $s); $s = str_replace($mtch[0],'[youtube]' . $mtch[1] . '[/youtube]',$s);
} elseif (stristr($mtch[1], 'vimeo')) { elseif (stristr($mtch[1],'vimeo'))
$s = str_replace($mtch[0], '[vimeo]' . $mtch[1] . '[/vimeo]', $s); $s = str_replace($mtch[0],'[vimeo]' . $mtch[1] . '[/vimeo]',$s);
}
} }
} }
return $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] // 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 = ''; $tag_list = '';
if (strlen($list)) { if (strlen($list)) {
$list_array = explode(",",$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 // 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; $matches = false;
$list = ''; $list = '';
if ($type == 'file') { if ($type == 'file') {
@ -1822,7 +1830,8 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') {
if (!intval($uid)) { if (!intval($uid)) {
return false; return false;
} elseif ($file_old == $file_new) { }
if ($file_old == $file_new) {
return true; 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)); $check_new_tags = explode(",",file_tag_file_to_list($file_new,$type));
foreach ($check_new_tags as $tag) { 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; $new_tags[] = $tag;
}
} }
$filetags_updated .= file_tag_list_to_file(implode(",",$new_tags),$type); $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)); $check_deleted_tags = explode(",",file_tag_file_to_list($file_old,$type));
foreach ($check_deleted_tags as $tag) { 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; $deleted_tags[] = $tag;
}
} }
foreach ($deleted_tags as $key => $tag) { foreach ($deleted_tags as $key => $tag) {
@ -1973,22 +1980,17 @@ function protect_sprintf($s) {
return str_replace('%', '%%', $s); return str_replace('%', '%%', $s);
} }
/// @TODO Rewrite this
function is_a_date_arg($s) { function is_a_date_arg($s) {
$i = intval($s); $i = intval($s);
if ($i > 1900) { if ($i > 1900) {
$y = date('Y'); $y = date('Y');
if ($i <= $y + 1 && strpos($s, '-') == 4) { if ($i <= $y + 1 && strpos($s, '-') == 4) {
$m = intval(substr($s, 5)); $m = intval(substr($s,5));
if ($m > 0 && $m <= 12)
if ($m > 0 && $m <= 12) {
return true; return true;
}
} }
} }
return false; return false;
} }
@ -2006,7 +2008,6 @@ function deindent($text, $chr = "[\t ]", $count = NULL) {
preg_match("|^" . $chr . "*|", $lines[$k], $m); preg_match("|^" . $chr . "*|", $lines[$k], $m);
$count = strlen($m[0]); $count = strlen($m[0]);
} }
for ($k = 0; $k < count($lines); $k++) { for ($k = 0; $k < count($lines); $k++) {
$lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]); $lines[$k] = preg_replace("|^" . $chr . "{" . $count . "}|", "", $lines[$k]);
} }

View file

@ -65,7 +65,7 @@ function admin_post(App $a)
case 'addons': case 'addons':
if ($a->argc > 2 && if ($a->argc > 2 &&
is_file("addon/" . $a->argv[2] . "/" . $a->argv[2] . ".php")) { 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')) { if (function_exists($a->argv[2] . '_addon_admin_post')) {
$func = $a->argv[2] . '_addon_admin_post'; $func = $a->argv[2] . '_addon_admin_post';
$func($a); $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.'); $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) { if (!$last_worker_call) {
$showwarning = true; $showwarning = true;
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!'); $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); $upds = implode(", ", $upd);
$r = q("UPDATE %s SET %s;", $table_name, $upds); $r = q("UPDATE %s SET %s;", $table_name, $upds);
if (!DBM::is_result($r)) { if (!DBM::is_result($r)) {
notice("Failed updating '$table_name': " . dba::errorMessage()); notice("Failed updating '$table_name': " . dba::errorMessage());
goaway('admin/site'); goaway('admin/site');
@ -928,7 +927,7 @@ function admin_page_site_post(App $a)
update_table("term", ['url'], $old_url, $new_url); 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("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("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 profile addresses in the format "user@server.tld"
update_table("contact", ['addr'], $old_host, $new_host); update_table("contact", ['addr'], $old_host, $new_host);
@ -1298,18 +1297,15 @@ function admin_page_site(App $a)
$user_names = []; $user_names = [];
$user_names['---'] = L10n::t('Multi user instance'); $user_names['---'] = L10n::t('Multi user instance');
$users = q("SELECT `username`, `nickname` FROM `user`"); $users = q("SELECT `username`, `nickname` FROM `user`");
foreach ($users as $user) { foreach ($users as $user) {
$user_names[$user['nickname']] = $user['username']; $user_names[$user['nickname']] = $user['username'];
} }
/* Banner */ /* Banner */
$banner = Config::get('system', 'banner'); $banner = Config::get('system', 'banner');
if ($banner == false) { 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 = '<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); $banner = htmlspecialchars($banner);
$info = Config::get('config', 'info'); $info = Config::get('config', 'info');
$info = htmlspecialchars($info); $info = htmlspecialchars($info);
@ -1505,12 +1501,9 @@ function admin_page_dbsync(App $a)
if ($a->argc > 2 && intval($a->argv[2])) { if ($a->argc > 2 && intval($a->argv[2])) {
require_once 'update.php'; require_once 'update.php';
$func = 'update_' . intval($a->argv[2]); $func = 'update_' . intval($a->argv[2]);
if (function_exists($func)) { if (function_exists($func)) {
$retval = $func(); $retval = $func();
if ($retval === UPDATE_FAILED) { if ($retval === UPDATE_FAILED) {
$o .= L10n::t("Executing %s failed with error: %s", $func, $retval); $o .= L10n::t("Executing %s failed with error: %s", $func, $retval);
} elseif ($retval === UPDATE_SUCCESS) { } 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 />"; $o .= L10n::t('There was no additional update function %s that needed to be called.', $func) . "<br />";
Config::set('database', $func, 'success'); Config::set('database', $func, 'success');
} }
return $o; return $o;
} }
$failed = []; $failed = [];
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' "); $r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
foreach ($r as $rr) { foreach ($r as $rr) {
$upd = intval(substr($rr['k'], 7)); $upd = intval(substr($rr['k'], 7));
@ -1539,7 +1530,6 @@ function admin_page_dbsync(App $a)
$failed[] = $upd; $failed[] = $upd;
} }
} }
if (!count($failed)) { if (!count($failed)) {
$o = replace_macros(get_markup_template('structure_check.tpl'), [ $o = replace_macros(get_markup_template('structure_check.tpl'), [
'$base' => System::baseUrl(true), '$base' => System::baseUrl(true),
@ -1774,8 +1764,8 @@ function admin_page_users(App $a)
$e['page-flags-raw'] = $e['page-flags']; $e['page-flags-raw'] = $e['page-flags'];
$e['page-flags'] = $page_types[$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-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'] = ($e['page_flags_raw']==0) ? $account_types[$e['account-type']] : "";
$e['register_date'] = Temporal::getRelativeDate($e['register_date']); $e['register_date'] = Temporal::getRelativeDate($e['register_date']);
$e['login_date'] = Temporal::getRelativeDate($e['login_date']); $e['login_date'] = Temporal::getRelativeDate($e['login_date']);
@ -1926,7 +1916,7 @@ function admin_page_addons(App $a)
$admin_form = ""; $admin_form = "";
if (in_array($addon, $a->addons_admin)) { if (in_array($addon, $a->addons_admin)) {
require_once "addon/$addon/$addon.php"; @require_once("addon/$addon/$addon.php");
$func = $addon . '_addon_admin'; $func = $addon . '_addon_admin';
$func($a, $admin_form); $func($a, $admin_form);
} }
@ -2167,7 +2157,6 @@ function admin_page_themes(App $a)
} }
$readme = null; $readme = null;
if (is_file("view/theme/$theme/README.md")) { if (is_file("view/theme/$theme/README.md")) {
$readme = Markdown::convert(file_get_contents("view/theme/$theme/README.md"), false); $readme = Markdown::convert(file_get_contents("view/theme/$theme/README.md"), false);
} elseif (is_file("view/theme/$theme/README")) { } elseif (is_file("view/theme/$theme/README")) {

View file

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

View file

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

View file

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

View file

@ -11,6 +11,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Network\Probe; use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact; use Friendica\Protocol\PortableContact;
use Friendica\Util\Network; 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); $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = L10n::t('Connect'); $conntxt = L10n::t('Connect');
$photo_menu = [ $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] 'follow' => [L10n::t("Connect/Follow"), $connlnk]
]; ];
} }
@ -222,7 +223,7 @@ function dirfind_content(App $a, $prefix = "") {
$entry = [ $entry = [
'alt_text' => $alt_text, 'alt_text' => $alt_text,
'url' => Contact::magicLink($jj->url), 'url' => Profile::magicLink($jj->url),
'itemurl' => $itemurl, 'itemurl' => $itemurl,
'name' => htmlentities($jj->name), 'name' => htmlentities($jj->name),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), '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? // Does the local user have this item?
if (local_user()) { 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` FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND `guid` = ? AND `uid` = ? LIMIT 1", $a->argv[1], local_user()); AND `guid` = ? AND `uid` = ? LIMIT 1", $a->argv[1], local_user());
if (DBM::is_result($r)) { if (DBM::is_result($r)) {
@ -59,7 +60,8 @@ function display_init(App $a)
// Is it an item with uid=0? // Is it an item with uid=0?
if (!DBM::is_result($r)) { 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` FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0 AND NOT `private` AND `uid` = 0
AND `guid` = ? LIMIT 1", $a->argv[1]); AND `guid` = ? LIMIT 1", $a->argv[1]);
@ -71,7 +73,8 @@ function display_init(App $a)
return; return;
} }
} elseif (($a->argc == 3) && ($nick == 'feed-item')) { } 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` FROM `item` WHERE `visible` AND NOT `deleted` AND NOT `moderated`
AND NOT `private` AND `uid` = 0 AND NOT `private` AND `uid` = 0
AND `id` = ? LIMIT 1", $a->argv[2]); AND `id` = ? LIMIT 1", $a->argv[2]);
@ -84,7 +87,7 @@ function display_init(App $a)
} }
if ($r["id"] != $r["parent"]) { 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` WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
AND `id` = ?", $r["parent"]); AND `id` = ?", $r["parent"]);
} }
@ -114,16 +117,14 @@ function display_init(App $a)
} }
function display_fetchauthor($a, $item) { function display_fetchauthor($a, $item) {
$author = dba::selectFirst('contact', ['name', 'nick', 'photo', 'network', 'url'], ['id' => $item['author-id']]);
$profiledata = []; $profiledata = [];
$profiledata['uid'] = -1; $profiledata["uid"] = -1;
$profiledata['nickname'] = $author['nick']; $profiledata["nickname"] = $item["author-name"];
$profiledata['name'] = $author['name']; $profiledata["name"] = $item["author-name"];
$profiledata['picdate'] = ''; $profiledata["picdate"] = "";
$profiledata['photo'] = $author['photo']; $profiledata["photo"] = $item["author-avatar"];
$profiledata['url'] = $author['url']; $profiledata["url"] = $item["author-link"];
$profiledata['network'] = $author['network']; $profiledata["network"] = $item["network"];
// Check for a repeated message // Check for a repeated message
$skip = false; $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, 'location')) {$orig_event['location'] = $_REQUEST['location'];}
if (x($_REQUEST, 'start')) {$orig_event['start'] = $_REQUEST['start'];} 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'];}
if (x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : ''); $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : ''); $a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');

View file

@ -72,7 +72,7 @@ function hovercard_content()
'nick' => $contact['nick'], 'nick' => $contact['nick'],
'addr' => defaults($contact, 'addr', $contact['url']), 'addr' => defaults($contact, 'addr', $contact['url']),
'thumb' => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB), '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 'nurl' => $contact['nurl'], // We additionally store the nurl as identifier
'location' => $contact['location'], 'location' => $contact['location'],
'gender' => $contact['gender'], '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); $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url; $connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
$photo_menu = [ $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] 'follow' => [L10n::t("Connect/Follow"), $connlnk]
]; ];
$contact_details = Contact::getDetailsByURL($jj->url, local_user()); $contact_details = Contact::getDetailsByURL($jj->url, local_user());
$entry = [ $entry = [
'url' => Contact::magicLink($jj->url), 'url' => Profile::zrl($jj->url),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url), 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url),
'name' => $jj->name, 'name' => $jj->name,
'details' => $contact_details['location'], 'details' => $contact_details['location'],

View file

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

View file

@ -103,6 +103,7 @@ function network_init(App $a)
'/new', //new '/new', //new
'', //starred '', //starred
'', //bookmarked '', //bookmarked
'', //spam
]; ];
$tab_args = [ $tab_args = [
'f=&order=comment', //all 'f=&order=comment', //all
@ -111,6 +112,7 @@ function network_init(App $a)
'', //new '', //new
'f=&star=1', //starred 'f=&star=1', //starred
'f=&bmark=1', //bookmarked 'f=&bmark=1', //bookmarked
'f=&spam=1', //spam
]; ];
$k = array_search('active', $last_sel_tabs); $k = array_search('active', $last_sel_tabs);
@ -216,8 +218,9 @@ function saved_searches($search)
* '/network/new', => $new_active = 'active' * '/network/new', => $new_active = 'active'
* '/network?f=&star=1', => $starred_active = 'active' * '/network?f=&star=1', => $starred_active = 'active'
* '/network?f=&bmark=1', => $bookmarked_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) function network_query_get_sel_tab(App $a)
{ {
@ -227,6 +230,7 @@ function network_query_get_sel_tab(App $a)
$bookmarked_active = ''; $bookmarked_active = '';
$all_active = ''; $all_active = '';
$conv_active = ''; $conv_active = '';
$spam_active = '';
$postord_active = ''; $postord_active = '';
if (($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new')) { 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'; $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'; $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) function network_query_get_sel_group(App $a)
@ -920,7 +928,7 @@ function network_tabs(App $a)
// item filter tabs // item filter tabs
/// @TODO fix this logic, reduce duplication /// @TODO fix this logic, reduce duplication
/// $a->page['content'] .= '<div class="tabs-wrapper">'; /// $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 tabs are selected, defaults to comments
if ($no_active == 'active') { if ($no_active == 'active') {
@ -996,7 +1004,7 @@ function network_tabs(App $a)
// save selected tab, but only if not in file mode // save selected tab, but only if not in file mode
if (!x($_GET, 'file')) { if (!x($_GET, 'file')) {
PConfig::set(local_user(), 'network.view', 'tab.selected', [ 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 = ''; $prevlink = '';
$nextlink = ''; $nextlink = '';
/* /// @todo This query is totally bad, the whole functionality has to be changed
* @todo This query is totally bad, the whole functionality has to be changed // The query leads to a really intense used index.
* The query leads to a really intense used index. // By now we hide it if someone wants to.
* By now we hide it if someone wants to.
*/
if (!Config::get('system', 'no_count', false)) { if (!Config::get('system', 'no_count', false)) {
$order_field = defaults($_GET, 'order', ''); $order_field = defaults($_GET, 'order', '');
if ($order_field === 'posted') { 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]; $hires = $lores = $ph[0];
}
if (count($ph) > 1) { if (count($ph) > 1) {
if ($ph[1]['scale'] == 2) { if ($ph[1]['scale'] == 2) {
// original is 640 or less, we can display it directly // 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']); $album_link = 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($ph[0]['album']);
$tools = null; $tools = null;
$lock = null; $lock = null;
@ -1312,9 +1307,8 @@ function photos_content(App $a)
]); ]);
} }
if ($prevlink) { if ($prevlink)
$prevlink = [$prevlink, '<div class="icon prev"></div>'] ; $prevlink = [$prevlink, '<div class="icon prev"></div>'] ;
}
$photo = [ $photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']], 'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
@ -1538,10 +1532,14 @@ function photos_content(App $a)
continue; continue;
} }
$profile_url = Contact::MagicLinkById($item['cid']); $redirect_url = 'redir/' . $item['cid'];
if (strpos($profile_url, 'redir/') === 0) {
if (local_user() && ($item['contact-uid'] == local_user())
&& ($item['network'] == NETWORK_DFRN) && !$item['self']) {
$profile_url = $redirect_url;
$sparkle = ' sparkle'; $sparkle = ' sparkle';
} else { } else {
$profile_url = $item['url'];
$sparkle = ''; $sparkle = '';
} }
@ -1671,9 +1669,8 @@ function photos_content(App $a)
$twist = false; $twist = false;
foreach ($r as $rr) { foreach ($r as $rr) {
//hide profile photos to others //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; continue;
}
$twist = !$twist; $twist = !$twist;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -96,6 +96,15 @@ function viewcontacts_content(App $a)
continue; 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); $contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);
$contacts[] = [ $contacts[] = [
@ -109,7 +118,7 @@ function viewcontacts_content(App $a)
'tags' => $contact_details['keywords'], 'tags' => $contact_details['keywords'],
'about' => $contact_details['about'], 'about' => $contact_details['about'],
'account_type' => Contact::getAccountType($contact_details), 'account_type' => Contact::getAccountType($contact_details),
'url' => Contact::magicLink($rr['url']), 'url' => $url,
'sparkle' => '', 'sparkle' => '',
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']), 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'network' => ContactSelector::networkToName($rr['network'], $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\Model\Photo;
use Friendica\Object\Image; 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); logger("wall upload: starting new upload", LOGGER_DEBUG);
$r_json = (x($_GET, 'response') && $_GET['response'] == 'json'); $r_json = (x($_GET, 'response') && $_GET['response'] == 'json');
$album = (x($_GET, 'album') ? notags(trim($_GET['album'])) : ''); $album = (x($_GET, 'album') ? notags(trim($_GET['album'])) : '');
if ($a->argc > 1) { if ($a->argc > 1) {
if (!x($_FILES, 'media')) { if (! x($_FILES, 'media')) {
$nick = $a->argv[1]; $nick = $a->argv[1];
$r = q("SELECT `user`.*, `contact`.`id` FROM `user` $r = q("SELECT `user`.*, `contact`.`id` FROM `user`
INNER JOIN `contact` on `user`.`uid` = `contact`.`uid` INNER JOIN `contact` on `user`.`uid` = `contact`.`uid`
@ -33,9 +33,9 @@ function wall_upload_post(App $a, $desktopmode = true)
dbesc($nick) dbesc($nick)
); );
if (!DBM::is_result($r)) { if (! DBM::is_result($r)) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme(); killme();
} }
return; return;
@ -51,7 +51,7 @@ function wall_upload_post(App $a, $desktopmode = true)
} }
} else { } else {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme(); killme();
} }
return; return;
@ -98,18 +98,18 @@ function wall_upload_post(App $a, $desktopmode = true)
} }
if (!$can_post) { if (! $can_post) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Permission denied.')]); echo json_encode(['error'=>L10n::t('Permission denied.')]);
killme(); killme();
} }
notice(L10n::t('Permission denied.') . EOL); notice(L10n::t('Permission denied.') . EOL);
killme(); killme();
} }
if (!x($_FILES, 'userfile') && !x($_FILES, 'media')) { if (! x($_FILES, 'userfile') && ! x($_FILES, 'media')) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error'=>L10n::t('Invalid request.')]);
} }
killme(); killme();
} }
@ -150,9 +150,9 @@ function wall_upload_post(App $a, $desktopmode = true)
} }
} }
if ($src == "") { if ($src=="") {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => L10n::t('Invalid request.')]); echo json_encode(['error'=>L10n::t('Invalid request.')]);
killme(); killme();
} }
notice(L10n::t('Invalid request.').EOL); notice(L10n::t('Invalid request.').EOL);
@ -185,7 +185,7 @@ function wall_upload_post(App $a, $desktopmode = true)
if (($maximagesize) && ($filesize > $maximagesize)) { if (($maximagesize) && ($filesize > $maximagesize)) {
$msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize)); $msg = L10n::t('Image exceeds size limit of %s', formatBytes($maximagesize));
if ($r_json) { if ($r_json) {
echo json_encode(['error' => $msg]); echo json_encode(['error'=>$msg]);
} else { } else {
echo $msg. EOL; echo $msg. EOL;
} }
@ -196,10 +196,10 @@ function wall_upload_post(App $a, $desktopmode = true)
$imagedata = @file_get_contents($src); $imagedata = @file_get_contents($src);
$Image = new Image($imagedata, $filetype); $Image = new Image($imagedata, $filetype);
if (!$Image->isValid()) { if (! $Image->isValid()) {
$msg = L10n::t('Unable to process image.'); $msg = L10n::t('Unable to process image.');
if ($r_json) { if ($r_json) {
echo json_encode(['error' => $msg]); echo json_encode(['error'=>$msg]);
} else { } else {
echo $msg. EOL; echo $msg. EOL;
} }
@ -211,7 +211,7 @@ function wall_upload_post(App $a, $desktopmode = true)
@unlink($src); @unlink($src);
$max_length = Config::get('system', 'max_image_length'); $max_length = Config::get('system', 'max_image_length');
if (!$max_length) { if (! $max_length) {
$max_length = MAX_IMAGE_LENGTH; $max_length = MAX_IMAGE_LENGTH;
} }
if ($max_length > 0) { if ($max_length > 0) {
@ -227,7 +227,7 @@ function wall_upload_post(App $a, $desktopmode = true)
$smallest = 0; $smallest = 0;
// If we don't have an album name use the Wall Photos album // If we don't have an album name use the Wall Photos album
if (!strlen($album)) { if (! strlen($album)) {
$album = L10n::t('Wall Photos'); $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); $r = Photo::store($Image, $page_owner_uid, $visitor, $hash, $filename, $album, 0, 0, $defperm);
if (!$r) { if (! $r) {
$msg = L10n::t('Image upload failed.'); $msg = L10n::t('Image upload failed.');
if ($r_json) { if ($r_json) {
echo json_encode(['error' => $msg]); echo json_encode(['error'=>$msg]);
} else { } else {
echo $msg. EOL; echo $msg. EOL;
} }
@ -271,7 +271,7 @@ function wall_upload_post(App $a, $desktopmode = true)
); );
if (!$r) { if (!$r) {
if ($r_json) { if ($r_json) {
echo json_encode(['error' => '']); echo json_encode(['error'=>'']);
killme(); killme();
} }
return false; return false;
@ -288,21 +288,28 @@ function wall_upload_post(App $a, $desktopmode = true)
$picture["preview"] = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $Image->getExt(); $picture["preview"] = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $Image->getExt();
if ($r_json) { if ($r_json) {
echo json_encode(['picture' => $picture]); echo json_encode(['picture'=>$picture]);
killme(); killme();
} }
logger("upload done", LOGGER_DEBUG);
return $picture; return $picture;
} }
logger("upload done", LOGGER_DEBUG);
if ($r_json) { if ($r_json) {
echo json_encode(['ok' => true]); echo json_encode(['ok'=>true]);
killme(); 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(); killme();
// NOTREACHED // 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. // But since it doesn't destroy anything, we just try to get more execution time in any way.
set_time_limit(0); set_time_limit(0);
$fields = ['executed' => DateTimeFormat::utcNow(), 'pid' => getmypid(), 'done' => false]; if (poller_claim_process($r[0])) {
$condition = ['id' => $r[0]["id"], 'pid' => 0];
if (dba::update('workerqueue', $fields, $condition)) {
Worker::execute($r[0]); Worker::execute($r[0]);
} }
} }

View file

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

View file

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

View file

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

View file

@ -40,12 +40,6 @@ class Cache extends \Friendica\BaseObject
self::$driver = new Cache\MemcachedCacheDriver($memcached_hosts); self::$driver = new Cache\MemcachedCacheDriver($memcached_hosts);
break; 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: default:
self::$driver = new Cache\DatabaseCacheDriver(); 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'], 'contact_id' => $it['contact-id'],
'photo' => ((x($it, 'fphoto')) ? proxy_url($it['fphoto'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"), 'photo' => ((x($it, 'fphoto')) ? proxy_url($it['fphoto'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"),
'name' => $it['fname'], 'name' => $it['fname'],
'url' => Contact::magicLink($it['furl']), 'url' => Profile::zrl($it['furl']),
'hidden' => $it['hidden'] == 1, 'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0), 'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'knowyou' => $knowyou, 'knowyou' => $knowyou,
@ -862,7 +862,7 @@ class NotificationsManager extends BaseObject
'hidden' => $it['hidden'] == 1, 'hidden' => $it['hidden'] == 1,
'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0), 'post_newfriend' => (intval(PConfig::get(local_user(), 'system', 'post_newfriend')) ? '1' : 0),
'url' => $it['url'], 'url' => $it['url'],
'zrl' => Contact::magicLink($it['url']), 'zrl' => Profile::zrl($it['url']),
'addr' => $it['gaddr'], 'addr' => $it['gaddr'],
'network' => $it['gnetwork'], 'network' => $it['gnetwork'],
'knowyou' => $it['knowyou'], 'knowyou' => $it['knowyou'],

View file

@ -29,7 +29,9 @@ class PConfig extends BaseObject
public static function init($uid) 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); self::$adapter = new Config\PreloadPConfigAdapter($uid);
} else { } else {
self::$adapter = new Config\JITPConfigAdapter($uid); 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. // We now start the process. This is done after the load check since this could increase the load.
self::startProcess(); 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 // 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)) { if (time() > ($last_cleanup + 300)) {
Config::set('system', 'worker_last_cleaned', time()); Config::set('system', 'poller_last_cleaned', time());
self::killStaleWorkers(); self::killStaleWorkers();
} }
@ -113,16 +108,16 @@ class Worker
} }
// If possible we will fetch new jobs for this 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); $stamp = (float)microtime(true);
$refetched = self::findWorkerProcesses($passing_slow); $refetched = self::findWorkerProcesses($passing_slow);
self::$db_duration += (microtime(true) - $stamp); 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 // 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); $stamp = (float)microtime(true);
// Count active workers and compare them with a maximum value that depends on the load // Count active workers and compare them with a maximum value that depends on the load
if (self::tooMuchWorkers()) { if (self::tooMuchWorkers()) {
@ -135,7 +130,7 @@ class Worker
logger('Memory limit reached, quitting.', LOGGER_DEBUG); logger('Memory limit reached, quitting.', LOGGER_DEBUG);
return; return;
} }
Lock::remove('worker'); Lock::remove('poller_worker');
self::$db_duration += (microtime(true) - $stamp); self::$db_duration += (microtime(true) - $stamp);
} }
@ -145,9 +140,6 @@ class Worker
return; return;
} }
} }
if (Config::get('system', 'worker_daemon_mode', false)) {
self::IPCSetJobState(false);
}
logger("Couldn't select a workerqueue entry, quitting.", LOGGER_DEBUG); logger("Couldn't select a workerqueue entry, quitting.", LOGGER_DEBUG);
} }
@ -252,7 +244,7 @@ class Worker
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) { 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); self::$db_duration = (microtime(true) - $stamp);
@ -293,7 +285,7 @@ class Worker
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) { 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); self::$db_duration = (microtime(true) - $stamp);
} else { } else {
@ -696,7 +688,7 @@ class Worker
logger("Load: ".$load."/".$maxsysload." - processes: ".$active."/".$entries.$processlist." - maximum: ".$queues."/".$maxqueues, LOGGER_DEBUG); 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. // 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); logger("Active workers: ".$active."/".$queues." Fork a new worker.", LOGGER_DEBUG);
self::spawnWorker(); self::spawnWorker();
} }
@ -859,11 +851,6 @@ class Worker
dba::update('workerqueue', ['executed' => DateTimeFormat::utcNow(), 'pid' => $mypid], $ids); 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; return $found;
} }
@ -886,7 +873,7 @@ class Worker
dba::close($r); dba::close($r);
$stamp = (float)microtime(true); $stamp = (float)microtime(true);
if (!Lock::set('worker_process')) { if (!Lock::set('poller_worker_process')) {
return false; return false;
} }
self::$lock_duration = (microtime(true) - $stamp); self::$lock_duration = (microtime(true) - $stamp);
@ -895,7 +882,7 @@ class Worker
$found = self::findWorkerProcesses($passing_slow); $found = self::findWorkerProcesses($passing_slow);
self::$db_duration += (microtime(true) - $stamp); self::$db_duration += (microtime(true) - $stamp);
Lock::remove('worker_process'); Lock::remove('poller_worker_process');
if ($found) { if ($found) {
$r = dba::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]); $r = dba::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]);
@ -1015,14 +1002,9 @@ class Worker
* @brief Spawns a new worker * @brief Spawns a new worker
* @return void * @return void
*/ */
public static function spawnWorker($do_cron = false) public static function spawnWorker()
{ {
$args = ["bin/worker.php"]; $args = ["bin/worker.php", "no_cron"];
if (!$do_cron) {
$args[] = "no_cron";
}
get_app()->proc_run($args); get_app()->proc_run($args);
} }
@ -1058,7 +1040,7 @@ class Worker
} }
$priority = PRIORITY_MEDIUM; $priority = PRIORITY_MEDIUM;
$dont_fork = Config::get("system", "worker_dont_fork", false); $dont_fork = Config::get("system", "worker_dont_fork");
$created = DateTimeFormat::utcNow(); $created = DateTimeFormat::utcNow();
$run_parameter = array_shift($args); $run_parameter = array_shift($args);
@ -1094,20 +1076,14 @@ class Worker
return true; 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 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; return true;
} }
// If there are already enough workers running, don't fork another one // If there are already enough workers running, don't fork another one
$quit = self::tooMuchWorkers(); $quit = self::tooMuchWorkers();
Lock::remove('worker'); Lock::remove('poller_worker');
if ($quit) { if ($quit) {
return true; return true;
@ -1145,33 +1121,4 @@ class Worker
{ {
return Process::deleteByPid(); 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 "--\n";
echo "-- TABLE $name\n"; echo "-- TABLE $name\n";
echo "--\n"; echo "--\n";
self::createTable($name, $structure, true, false); self::createTable($name, $structure['fields'], true, false, $structure["indexes"]);
echo "\n"; echo "\n";
} }
@ -251,7 +251,7 @@ class DBStructure
$is_unique = false; $is_unique = false;
$temp_name = $name; $temp_name = $name;
if (!isset($database[$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)) { if (!DBM::is_result($r)) {
$errors .= self::printUpdateError($name); $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 (isset($database[$name]["table_status"]["Collation"])) {
if ($database[$name]["table_status"]["Collation"] != 'utf8mb4_general_ci') { if ($database[$name]["table_status"]["Collation"] != 'utf8mb4_general_ci') {
$sql2 = "DEFAULT COLLATE utf8mb4_general_ci"; $sql2 = "DEFAULT COLLATE utf8mb4_general_ci";
@ -566,22 +554,20 @@ class DBStructure
return($fieldstruct); return($fieldstruct);
} }
private static function createTable($name, $structure, $verbose, $action) { private static function createTable($name, $fields, $verbose, $action, $indexes=null) {
$r = true; $r = true;
$engine = "";
$comment = "";
$sql_rows = []; $sql_rows = [];
$primary_keys = []; $primary_keys = [];
foreach ($structure["fields"] AS $fieldname => $field) { foreach ($fields AS $fieldname => $field) {
$sql_rows[] = "`".dbesc($fieldname)."` ".self::FieldCommand($field); $sql_rows[] = "`".dbesc($fieldname)."` ".self::FieldCommand($field);
if (x($field,'primary') && $field['primary']!='') { if (x($field,'primary') && $field['primary']!='') {
$primary_keys[] = $fieldname; $primary_keys[] = $fieldname;
} }
} }
if (!is_null($structure["indexes"])) { if (!is_null($indexes)) {
foreach ($structure["indexes"] AS $indexname => $fieldnames) { foreach ($indexes AS $indexname => $fieldnames) {
$sql_index = self::createIndex($indexname, $fieldnames, ""); $sql_index = self::createIndex($indexname, $fieldnames, "");
if (!is_null($sql_index)) { if (!is_null($sql_index)) {
$sql_rows[] = $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 = implode(",\n\t", $sql_rows);
$sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql. $sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT COLLATE utf8mb4_general_ci";
"\n)" . $engine . " DEFAULT COLLATE utf8mb4_general_ci" . $comment;
if ($verbose) { if ($verbose) {
echo $sql.";\n"; echo $sql.";\n";
} }
@ -691,12 +668,12 @@ class DBStructure
"comment" => "registered addons", "comment" => "registered addons",
"fields" => [ "fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], "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"], "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
"version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"], "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => ""],
"installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"], "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"], "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"], "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -706,19 +683,19 @@ class DBStructure
$database["attach"] = [ $database["attach"] = [
"comment" => "file attachments", "comment" => "file attachments",
"fields" => [ "fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"], "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" => "Owner User id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"], "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"], "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"], "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"], "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"], "data" => ["type" => "longblob", "not null" => "1", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"], "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"], "allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], "allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], "deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], "deny_gid" => ["type" => "mediumtext", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -753,7 +730,7 @@ class DBStructure
$database["challenge"] = [ $database["challenge"] = [
"comment" => "", "comment" => "",
"fields" => [ "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" => ""], "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dfrn-id" => ["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" => ""], "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -794,26 +771,26 @@ class DBStructure
$database["contact"] = [ $database["contact"] = [
"comment" => "contact table", "comment" => "contact table",
"fields" => [ "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" => "Owner User id"], "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" => ""], "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" => ""], "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" => ""], "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"], "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"about" => ["type" => "text", "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" => ""], "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"attag" => ["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" => ""], "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"], "photo" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"], "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"], "micro" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
"site-pubkey" => ["type" => "text", "comment" => ""], "site-pubkey" => ["type" => "text", "comment" => ""],
"issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dfrn-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" => ""], "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"addr" => ["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" => ""], "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], "pubkey" => ["type" => "text", "comment" => ""],
"prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], "prvkey" => ["type" => "text", "comment" => ""],
"batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"request" => ["type" => "varchar(255)", "comment" => ""], "request" => ["type" => "varchar(255)", "comment" => ""],
"notify" => ["type" => "varchar(255)", "comment" => ""], "notify" => ["type" => "varchar(255)", "comment" => ""],
@ -834,20 +811,20 @@ class DBStructure
"usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"subhub" => ["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" => ""], "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"], "last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last successful contact update"], "success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of the last failed update"], "failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"name-date" => ["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" => ""], "uri-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"avatar-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" => ""], "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" => ""], "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "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" => ""], "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"], "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"], "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"contact-type" => ["type" => "tinyint", "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" => ""], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"archive" => ["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"] = [ $database["conv"] = [
"comment" => "private messages", "comment" => "private messages",
"fields" => [ "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" => "A unique identifier for this conversation"], "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"], "recips" => ["type" => "text", "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"],
"creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"], "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation timestamp"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "edited timestamp"], "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"subject" => ["type" => "text", "comment" => "subject of initial message"], "subject" => ["type" => "text", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -899,13 +876,13 @@ class DBStructure
$database["conversation"] = [ $database["conversation"] = [
"comment" => "Raw data and structure information for messages", "comment" => "Raw data and structure information for messages",
"fields" => [ "fields" => [
"item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URI of the item"], "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"], "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"], "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"], "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The protocol of the item"], "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"source" => ["type" => "mediumtext", "comment" => "Original source"], "source" => ["type" => "mediumtext", "comment" => ""],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Receiving date"], "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["item-uri"], "PRIMARY" => ["item-uri"],
@ -916,26 +893,26 @@ class DBStructure
$database["event"] = [ $database["event"] = [
"comment" => "Events", "comment" => "Events",
"fields" => [ "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" => ""], "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"], "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 (ID of the contact in contact table)"], "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "creation time"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edit time"], "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event start time"], "start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "event end time"], "finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"summary" => ["type" => "text", "comment" => "short description or title of the event"], "summary" => ["type" => "text", "comment" => ""],
"desc" => ["type" => "text", "comment" => "event description"], "desc" => ["type" => "text", "comment" => ""],
"location" => ["type" => "text", "comment" => "event location"], "location" => ["type" => "text", "comment" => ""],
"type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"], "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
"nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"], "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"], "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
"ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"], "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], "allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], "allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], "deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], "deny_gid" => ["type" => "mediumtext", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -945,8 +922,8 @@ class DBStructure
$database["fcontact"] = [ $database["fcontact"] = [
"comment" => "Diaspora compatible contacts - used in the Diaspora implementation", "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
"fields" => [ "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" => "unique id"], "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"url" => ["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" => ""], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["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"] = [ $database["gcign"] = [
"comment" => "contacts ignored by friend suggestions", "comment" => "contacts ignored by friend suggestions",
"fields" => [ "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" => "Local User id"], "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" => "gcontact.id of ignored contact"], "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1002,12 +979,12 @@ class DBStructure
$database["gcontact"] = [ $database["gcontact"] = [
"comment" => "global contacts", "comment" => "global contacts",
"fields" => [ "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(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"], "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nurl" => ["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" => ""], "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"updated" => ["type" => "datetime", "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" => ""], "last_failure" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"about" => ["type" => "text", "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" => ""], "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "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" => ""], "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"], "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"], "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"], "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"notify" => ["type" => "varchar(255)", "comment" => ""], "notify" => ["type" => "varchar(255)", "comment" => ""],
"alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "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" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1042,7 +1019,7 @@ class DBStructure
$database["glink"] = [ $database["glink"] = [
"comment" => "'friends of friends' linkages derived from poco", "comment" => "'friends of friends' linkages derived from poco",
"fields" => [ "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" => ""], "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"], "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" => ""], "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
@ -1058,11 +1035,11 @@ class DBStructure
$database["group"] = [ $database["group"] = [
"comment" => "privacy groups, group info", "comment" => "privacy groups, group info",
"fields" => [ "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" => "Owner User id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"], "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"], "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1072,9 +1049,9 @@ class DBStructure
$database["group_member"] = [ $database["group_member"] = [
"comment" => "privacy groups, member info", "comment" => "privacy groups, member info",
"fields" => [ "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" => ""],
"gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"], "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" => "contact.id of the member assigned to the associated group"], "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1085,14 +1062,14 @@ class DBStructure
$database["gserver"] = [ $database["gserver"] = [
"comment" => "Global servers", "comment" => "Global servers",
"fields" => [ "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" => ""], "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"nurl" => ["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" => ""], "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"info" => ["type" => "text", "comment" => ""], "info" => ["type" => "text", "comment" => ""],
"register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "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" => ""], "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"noscrape" => ["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" => ""], "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
@ -1123,11 +1100,11 @@ class DBStructure
$database["hook"] = [ $database["hook"] = [
"comment" => "addon hook registry", "comment" => "addon hook registry",
"fields" => [ "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" => ""],
"hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"], "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
"file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"], "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
"function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"], "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => ""],
"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"], "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1137,7 +1114,7 @@ class DBStructure
$database["intro"] = [ $database["intro"] = [
"comment" => "", "comment" => "",
"fields" => [ "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"], "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" => ""], "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" => ""], "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
@ -1157,67 +1134,68 @@ class DBStructure
"comment" => "All posts", "comment" => "All posts",
"fields" => [ "fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], "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" => ""], "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"], "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" => "contact.id"], "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "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" => ""], "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" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"], "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"extid" => ["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"], "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation timestamp."], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last edit (default is created)"], "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date of last comment/reply to this item"], "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime"], "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"], "changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"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-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the owner of this item"], "owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the owner of this item"], "owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the owner of this item"], "owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"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-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the author of this item"], "author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile page of the author of this item"], "author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the avatar picture of the author of this item"], "author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"], "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"content-warning" => ["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"], "body" => ["type" => "mediumtext", "comment" => ""],
"app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"], "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"], "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"], "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"], "object" => ["type" => "text", "comment" => ""],
"target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"], "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"target" => ["type" => "text", "comment" => "JSON encoded target structure if used"], "target" => ["type" => "text", "comment" => ""],
"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"], "postopts" => ["type" => "text", "comment" => ""],
"plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"], "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"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"], "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
"event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"], "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => ""],
"tag" => ["type" => "mediumtext", "comment" => ""], "tag" => ["type" => "mediumtext", "comment" => ""],
"attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"], "attach" => ["type" => "mediumtext", "comment" => ""],
"inform" => ["type" => "mediumtext", "comment" => ""], "inform" => ["type" => "mediumtext", "comment" => ""],
"file" => ["type" => "mediumtext", "comment" => ""], "file" => ["type" => "mediumtext", "comment" => ""],
"location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"], "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"], "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], "allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], "allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], "deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], "deny_gid" => ["type" => "mediumtext", "comment" => ""],
"private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"], "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"pubmail" => ["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" => ""], "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"visible" => ["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"], "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been bookmarked"], "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"], "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"], "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
"origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"], "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" => ""], "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"], "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"], "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
"rendered-hash" => ["type" => "varchar(32)", "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" => ""], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
@ -1254,10 +1232,10 @@ class DBStructure
$database["locks"] = [ $database["locks"] = [
"comment" => "", "comment" => "",
"fields" => [ "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" => ""], "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
"locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "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" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1266,23 +1244,23 @@ class DBStructure
$database["mail"] = [ $database["mail"] = [
"comment" => "private messages", "comment" => "private messages",
"fields" => [ "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" => "Owner User id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"], "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"], "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"], "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"], "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"], "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" => "conv.id"], "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"body" => ["type" => "mediumtext", "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" => ""], "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"replied" => ["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" => ""], "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"parent-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" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1296,7 +1274,7 @@ class DBStructure
$database["mailacct"] = [ $database["mailacct"] = [
"comment" => "Mail account data for fetching mails", "comment" => "Mail account data for fetching mails",
"fields" => [ "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"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1317,7 +1295,7 @@ class DBStructure
$database["manage"] = [ $database["manage"] = [
"comment" => "table of accounts that can manage each other", "comment" => "table of accounts that can manage each other",
"fields" => [ "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"], "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"], "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
], ],
@ -1329,7 +1307,7 @@ class DBStructure
$database["notify"] = [ $database["notify"] = [
"comment" => "notifications", "comment" => "notifications",
"fields" => [ "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" => ""], "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "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" => ""], "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""], "date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"msg" => ["type" => "mediumtext", "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" => ""], "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" => ""], "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
"seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""], "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
"otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""], "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
"name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"], "name_cache" => ["type" => "tinytext", "comment" => ""],
"msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"] "msg_cache" => ["type" => "mediumtext", "comment" => ""]
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1358,7 +1336,7 @@ class DBStructure
$database["notify-threads"] = [ $database["notify-threads"] = [
"comment" => "", "comment" => "",
"fields" => [ "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" => ""], "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" => ""], "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" => ""], "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1371,10 +1349,10 @@ class DBStructure
$database["oembed"] = [ $database["oembed"] = [
"comment" => "cache for OEmbed queries", "comment" => "cache for OEmbed queries",
"fields" => [ "fields" => [
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"], "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
"content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"], "content" => ["type" => "mediumtext", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["url", "maxwidth"], "PRIMARY" => ["url", "maxwidth"],
@ -1384,11 +1362,11 @@ class DBStructure
$database["parsed_url"] = [ $database["parsed_url"] = [
"comment" => "cache for 'parse_url' queries", "comment" => "cache for 'parse_url' queries",
"fields" => [ "fields" => [
"url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
"guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"], "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
"oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"], "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
"content" => ["type" => "mediumtext", "comment" => "page data"], "content" => ["type" => "mediumtext", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "datetime of creation"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["url", "guessing", "oembed"], "PRIMARY" => ["url", "guessing", "oembed"],
@ -1424,16 +1402,16 @@ class DBStructure
$database["photo"] = [ $database["photo"] = [
"comment" => "photo storage", "comment" => "photo storage",
"fields" => [ "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" => "Owner User 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" => "contact.id"], "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"], "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => ""],
"resource-id" => ["type" => "char(32)", "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"], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "last edited date"], "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"desc" => ["type" => "text", "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" => ""], "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"], "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
"height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1442,10 +1420,10 @@ class DBStructure
"data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""], "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
"scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"profile" => ["type" => "boolean", "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_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], "allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], "deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], "deny_gid" => ["type" => "mediumtext", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1481,7 +1459,7 @@ class DBStructure
$database["poll_result"] = [ $database["poll_result"] = [
"comment" => "data for polls - currently unused", "comment" => "data for polls - currently unused",
"fields" => [ "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"]], "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
"choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
], ],
@ -1505,14 +1483,14 @@ class DBStructure
$database["profile"] = [ $database["profile"] = [
"comment" => "user profiles data", "comment" => "user profiles data",
"fields" => [ "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" => "Owner User id"], "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" => "Name of the profile"], "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"], "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"], "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"], "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"], "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => ""],
"address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"locality" => ["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" => ""], "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1545,8 +1523,8 @@ class DBStructure
"xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"photo" => ["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" => ""], "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"], "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"], "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],
@ -1556,9 +1534,9 @@ class DBStructure
$database["profile_check"] = [ $database["profile_check"] = [
"comment" => "DFRN remote auth use", "comment" => "DFRN remote auth use",
"fields" => [ "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"], "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" => ""], "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"sec" => ["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" => ""], "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1570,7 +1548,7 @@ class DBStructure
$database["push_subscriber"] = [ $database["push_subscriber"] = [
"comment" => "Used for OStatus: Contains feed subscribers", "comment" => "Used for OStatus: Contains feed subscribers",
"fields" => [ "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"], "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" => ""], "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"topic" => ["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"] = [ $database["queue"] = [
"comment" => "Queue for messages that couldn't be delivered", "comment" => "Queue for messages that couldn't be delivered",
"fields" => [ "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"], "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"], "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"], "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
@ -1609,7 +1587,7 @@ class DBStructure
$database["register"] = [ $database["register"] = [
"comment" => "registrations requiring admin approval", "comment" => "registrations requiring admin approval",
"fields" => [ "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" => ""], "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "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"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
@ -1624,7 +1602,7 @@ class DBStructure
$database["search"] = [ $database["search"] = [
"comment" => "", "comment" => "",
"fields" => [ "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"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
"term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
], ],
@ -1636,7 +1614,7 @@ class DBStructure
$database["session"] = [ $database["session"] = [
"comment" => "web session storage", "comment" => "web session storage",
"fields" => [ "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" => ""], "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
"data" => ["type" => "text", "comment" => ""], "data" => ["type" => "text", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@ -1650,8 +1628,8 @@ class DBStructure
$database["sign"] = [ $database["sign"] = [
"comment" => "Diaspora signatures", "comment" => "Diaspora signatures",
"fields" => [ "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" => ""],
"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" => ""],
"signed_text" => ["type" => "mediumtext", "comment" => ""], "signed_text" => ["type" => "mediumtext", "comment" => ""],
"signature" => ["type" => "text", "comment" => ""], "signature" => ["type" => "text", "comment" => ""],
"signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@ -1688,11 +1666,11 @@ class DBStructure
$database["thread"] = [ $database["thread"] = [
"comment" => "Thread related data", "comment" => "Thread related data",
"fields" => [ "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"], "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" => ""], "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"], "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" => "Item author"], "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""], "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"edited" => ["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" => ""], "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" => ""], "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"moderated" => ["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" => ""], "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" => ""], "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"ignored" => ["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" => ""], "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@ -1745,50 +1724,50 @@ class DBStructure
$database["user"] = [ $database["user"] = [
"comment" => "The local users", "comment" => "The local users",
"fields" => [ "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"], "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"], "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
"username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"], "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"], "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?"], "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"], "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"], "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"openid" => ["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"], "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
"language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"], "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => ""],
"register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of registration"], "register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last login"], "login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"], "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"], "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"], "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], "pubkey" => ["type" => "text", "comment" => ""],
"prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], "prvkey" => ["type" => "text", "comment" => ""],
"spubkey" => ["type" => "text", "comment" => ""], "spubkey" => ["type" => "text", "comment" => ""],
"sprvkey" => ["type" => "text", "comment" => ""], "sprvkey" => ["type" => "text", "comment" => ""],
"verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"], "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"], "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"], "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"], "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"], "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"], "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "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"], "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => ""],
"page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"], "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"account-type" => ["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" => ""], "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
"pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"], "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
"pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"], "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
"maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""], "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
"expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "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_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"], "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "timestamp of last warning of account expiration"], "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
"def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
"allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], "allow_cid" => ["type" => "mediumtext", "comment" => ""],
"allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], "allow_gid" => ["type" => "mediumtext", "comment" => ""],
"deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], "deny_cid" => ["type" => "mediumtext", "comment" => ""],
"deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], "deny_gid" => ["type" => "mediumtext", "comment" => ""],
"openidserver" => ["type" => "text", "comment" => ""], "openidserver" => ["type" => "text", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
@ -1799,7 +1778,7 @@ class DBStructure
$database["userd"] = [ $database["userd"] = [
"comment" => "Deleted usernames", "comment" => "Deleted usernames",
"fields" => [ "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" => ""], "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
], ],
"indexes" => [ "indexes" => [
@ -1818,18 +1797,6 @@ class DBStructure
"PRIMARY" => ["uid", "iid"], "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"] = [ $database["workerqueue"] = [
"comment" => "Background tasks queue entries", "comment" => "Background tasks queue entries",
"fields" => [ "fields" => [
@ -1839,7 +1806,7 @@ class DBStructure
"created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation date"], "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"], "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"], "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" => [ "indexes" => [
"PRIMARY" => ["id"], "PRIMARY" => ["id"],

View file

@ -598,7 +598,7 @@ class Contact extends BaseObject
if ($contact['uid'] != $uid) { if ($contact['uid'] != $uid) {
if ($uid == 0) { if ($uid == 0) {
$profile_link = self::magicLink($contact['url']); $profile_link = Profile::zrl($contact['url']);
$menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]]; $menu = ['profile' => [L10n::t('View Profile'), $profile_link, true]];
return $menu; return $menu;
@ -609,7 +609,7 @@ class Contact extends BaseObject
if (DBM::is_result($contact_own)) { if (DBM::is_result($contact_own)) {
return self::photoMenu($contact_own, $uid); return self::photoMenu($contact_own, $uid);
} else { } else {
$profile_link = self::magicLink($contact['url']); $profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url']; $connlnk = 'follow/?url=' . $contact['url'];
$menu = [ $menu = [
'profile' => [L10n::t('View Profile'), $profile_link, true], 'profile' => [L10n::t('View Profile'), $profile_link, true],
@ -944,36 +944,21 @@ class Contact extends BaseObject
'name' => $data['name'], 'name' => $data['name'],
'nick' => $data['nick']]; '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'] != '') { if ($data['keywords'] != '') {
$updated['keywords'] = $data['keywords']; $updated['keywords'] = $data['keywords'];
} }
if ($data['location'] != '') { if ($data['location'] != '') {
$updated['location'] = $data['location']; $updated['location'] = $data['location'];
} }
if ($data['about'] != '') {
// Update the technical stuff as well - if filled $updated['about'] = $data['about'];
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["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) { if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) {
@ -1701,56 +1686,4 @@ class Contact extends BaseObject
$contact_ids = $return; $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. * @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. * @return string HTML output.
*/ */
public static function getItemHTML(array $item) { public static function getItemHTML($item) {
$same_date = false; $same_date = false;
$finish = false; $finish = false;
@ -868,7 +868,12 @@ class Event extends BaseObject
$location = self::locationToArray($item['event-location']); $location = self::locationToArray($item['event-location']);
// Construct the profile link (magic-auth). // 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'); $tpl = get_markup_template('event_stream_item.tpl');
$return = replace_macros($tpl, [ $return = replace_macros($tpl, [

View file

@ -566,14 +566,6 @@ class Item extends BaseObject
return 0; 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) { if ($item['network'] == NETWORK_PHANTOM) {
logger('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG); logger('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG);
@ -1130,9 +1122,8 @@ class Item extends BaseObject
} }
// Is this a shadow entry? // Is this a shadow entry?
if ($item['uid'] == 0) { if ($item['uid'] == 0)
return; return;
}
// Is there a shadow parent? // Is there a shadow parent?
if (!dba::exists('item', ['uri' => $item['parent-uri'], 'uid' => 0])) { 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. // 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. // This means that we have to distribute the comment by ourselves.
if ($origin && dba::exists('item', ['id' => $parent, 'network' => NETWORK_DIASPORA])) { if ($origin) {
self::distribute($public_shadow); 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) private static function addLanguageInPostopts(&$item)
{ {
$postopts = "";
if (!empty($item['postopts'])) { if (!empty($item['postopts'])) {
if (strstr($item['postopts'], 'lang=')) { if (strstr($item['postopts'], 'lang=')) {
// do not override // do not override
return; return;
} }
$postopts = $item['postopts']; $postopts = $item['postopts'];
} else {
$postopts = "";
} }
$naked_body = Text\BBCode::toPlaintext($item['body'], false); $naked_body = Text\BBCode::toPlaintext($item['body'], false);
@ -1491,7 +1484,8 @@ class Item extends BaseObject
$forum_mode = ($prvgroup ? 2 : 1); $forum_mode = ($prvgroup ? 2 : 1);
$fields = ['wall' => true, 'origin' => true, 'forum_mode' => $forum_mode, 'contact-id' => $self['id'], $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']]; 'allow_gid' => $user['allow_gid'], 'deny_cid' => $user['deny_cid'], 'deny_gid' => $user['deny_gid']];
dba::update('item', $fields, ['id' => $item_id]); dba::update('item', $fields, ['id' => $item_id]);
@ -2082,7 +2076,7 @@ EOT;
private static function addThread($itemid, $onlyshadow = false) private static function addThread($itemid, $onlyshadow = false)
{ {
$fields = ['uid', 'created', 'edited', 'commented', 'received', 'changed', 'wall', 'private', 'pubmail', $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']; 'deleted', 'origin', 'forum_mode', 'mention', 'network', 'author-id', 'owner-id'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid]; $condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid];
$item = dba::selectFirst('item', $fields, $condition); $item = dba::selectFirst('item', $fields, $condition);
@ -2103,7 +2097,7 @@ EOT;
private static function updateThread($itemid, $setmention = false) private static function updateThread($itemid, $setmention = false)
{ {
$fields = ['uid', 'guid', 'title', 'body', 'created', 'edited', 'commented', 'received', 'changed', $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']; 'deleted', 'origin', 'forum_mode', 'network', 'author-id', 'owner-id', 'rendered-html', 'rendered-hash'];
$condition = ["`id` = ? AND (`parent` = ? OR `parent` = 0)", $itemid, $itemid]; $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['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'); $tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, [ $o .= replace_macros($tpl, [
@ -594,8 +594,12 @@ class Profile
$cids[] = $rr['cid']; $cids[] = $rr['cid'];
$today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); $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['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['date'] = day_translate(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : '');
$rr['startime'] = null; $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) public static function zrl($s, $force = false)
{ {
if (!strlen($s)) { if (!strlen($s)) {

View file

@ -196,7 +196,7 @@ class Term
$orig_tag = $tag["url"]; $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 ($tag["type"] == TERM_HASHTAG) {
if ($orig_tag != $tag["url"]) { if ($orig_tag != $tag["url"]) {

View file

@ -13,6 +13,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal; use Friendica\Util\Temporal;
use dba; use dba;
@ -70,7 +71,7 @@ class Post extends BaseObject
} }
$this->writable = $this->getDataValue('writable') || $this->getDataValue('self'); $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()) { if (!$this->isToplevel()) {
$this->threaded = true; $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. // 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 = [ $drop = [
'dropping' => $dropping, 'dropping' => $dropping,
@ -198,22 +199,30 @@ class Post extends BaseObject
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false); $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']); $diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); $profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && (!$item['author-name'])) { if ($item['author-link'] && (!$item['author-name'])) {
$profile_name = $item['author-link']; $profile_name = $item['author-link'];
} }
$profile_link = Contact::magicLinkById($item['author-id']); $sp = false;
if (strpos($profile_link, 'redir/') === 0) { $profile_link = best_link_url($item, $sp);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
if ($sp) {
$sparkle = ' sparkle'; $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' => '']; $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
@ -368,7 +377,7 @@ class Post extends BaseObject
'profile_url' => $profile_link, 'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item), 'item_photo_menu' => item_photo_menu($item),
'name' => $name_e, '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, 'osparkle' => $osparkle,
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'title' => $title_e, 'title' => $title_e,
@ -381,7 +390,7 @@ class Post extends BaseObject
'indent' => $indent, 'indent' => $indent,
'shiny' => $shiny, 'shiny' => $shiny,
'owner_url' => $this->getOwnerUrl(), '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), 'owner_name' => htmlentities($owner_name_e),
'plink' => get_plink($item), 'plink' => get_plink($item),
'edpost' => Feature::isEnabled($conv->getProfileOwner(), 'edit_posts') ? $edpost : '', '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. // 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. // 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_photo = $a->page_contact['thumb'];
$this->owner_name = $a->page_contact['name']; $this->owner_name = $a->page_contact['name'];
$this->wall_to_wall = true; $this->wall_to_wall = true;
@ -860,7 +869,14 @@ class Post extends BaseObject
$this->owner_photo = $this->getDataValue('owner-avatar'); $this->owner_photo = $this->getDataValue('owner-avatar');
$this->owner_name = $this->getDataValue('owner-name'); $this->owner_name = $this->getDataValue('owner-name');
$this->wall_to_wall = true; $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 * @param array $owner Owner record
* *
* @return string DFRN entries * @return string DFRN entries
* @todo Find proper type-hints * @todo Add type-hints
*/ */
public static function entries($items, $owner) public static function entries($items, $owner)
{ {
@ -81,7 +81,7 @@ class DFRN
$root->appendChild($entry); $root->appendChild($entry);
} }
return trim($doc->saveXML()); return(trim($doc->saveXML()));
} }
/** /**
@ -120,6 +120,8 @@ class DFRN
} }
} }
// default permissions - anonymous user // default permissions - anonymous user
$sql_extra = " AND `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' "; $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)) { if (! DBM::is_result($r)) {
logger(sprintf('No contact found for nickname=%d', $owner_nick), LOGGER_WARNING);
killme(); killme();
} }
@ -168,7 +169,6 @@ class DFRN
); );
if (! DBM::is_result($r)) { if (! DBM::is_result($r)) {
logger(sprintf('No contact found for uid=%d', $owner_id), LOGGER_WARNING);
killme(); killme();
} }
@ -177,10 +177,8 @@ class DFRN
$groups = Group::getIdsByContactId($contact['id']); $groups = Group::getIdsByContactId($contact['id']);
if (count($groups)) { if (count($groups)) {
for ($x = 0; $x < count($groups); $x ++) { for ($x = 0; $x < count($groups); $x ++)
$groups[$x] = '<' . intval($groups[$x]) . '>' ; $groups[$x] = '<' . intval($groups[$x]) . '>' ;
}
$gs = implode('|', $groups); $gs = implode('|', $groups);
} else { } else {
$gs = '<<>>' ; // Impossible to match $gs = '<<>>' ; // Impossible to match
@ -221,8 +219,10 @@ class DFRN
//$sql_extra .= file_tag_file_query('item',$category,'category'); //$sql_extra .= file_tag_file_query('item',$category,'category');
} }
if ($public_feed && ! $converse) { if ($public_feed) {
$sql_extra .= " AND `contact`.`self` = 1 "; if (! $converse) {
$sql_extra .= " AND `contact`.`self` = 1 ";
}
} }
$check_date = DateTimeFormat::utc($last_update); $check_date = DateTimeFormat::utc($last_update);
@ -397,7 +397,7 @@ class DFRN
* @param array $owner Owner record * @param array $owner Owner record
* *
* @return string DFRN mail * @return string DFRN mail
* @todo Find proper type-hints * @todo Add type-hints
*/ */
public static function mail($item, $owner) public static function mail($item, $owner)
{ {
@ -423,7 +423,7 @@ class DFRN
$root->appendChild($mail); $root->appendChild($mail);
return trim($doc->saveXML()); return(trim($doc->saveXML()));
} }
/** /**
@ -433,7 +433,7 @@ class DFRN
* @param array $owner Owner record * @param array $owner Owner record
* *
* @return string DFRN suggestions * @return string DFRN suggestions
* @todo Find proper type-hints * @todo Add type-hints
*/ */
public static function fsuggest($item, $owner) public static function fsuggest($item, $owner)
{ {
@ -452,7 +452,7 @@ class DFRN
$root->appendChild($suggest); $root->appendChild($suggest);
return trim($doc->saveXML()); return(trim($doc->saveXML()));
} }
/** /**
@ -462,7 +462,7 @@ class DFRN
* @param int $uid User ID * @param int $uid User ID
* *
* @return string DFRN relocations * @return string DFRN relocations
* @todo Find proper type-hints * @todo Add type-hints
*/ */
public static function relocate($owner, $uid) 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']]; $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 = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true; $doc->formatOutput = true;
@ -510,7 +511,7 @@ class DFRN
$root->appendChild($relocate); $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? * @param bool $public Is it a header for public posts?
* *
* @return object XML root object * @return object XML root object
* @todo Find proper type-hints * @todo Add type-hints
*/ */
private static function addHeader($doc, $owner, $authorelement, $alternatelink = "", $public = false) private static function addHeader($doc, $owner, $authorelement, $alternatelink = "", $public = false)
{ {
@ -599,7 +600,7 @@ class DFRN
* @param boolean $public boolean * @param boolean $public boolean
* *
* @return object XML author object * @return object XML author object
* @todo Find proper type-hints * @todo Add type-hints
*/ */
private static function addAuthor($doc, $owner, $authorelement, $public) private static function addAuthor($doc, $owner, $authorelement, $public)
{ {
@ -743,7 +744,7 @@ class DFRN
* @param array $item Item elements * @param array $item Item elements
* *
* @return object XML author object * @return object XML author object
* @todo Find proper type-hints * @todo Add type-hints
*/ */
private static function addEntryAuthor($doc, $element, $contact_url, $item) private static function addEntryAuthor($doc, $element, $contact_url, $item)
{ {
@ -784,7 +785,7 @@ class DFRN
* @param string $activity activity value * @param string $activity activity value
* *
* @return object XML activity object * @return object XML activity object
* @todo Find proper type-hints * @todo Add type-hints
*/ */
private static function createActivity($doc, $element, $activity) private static function createActivity($doc, $element, $activity)
{ {
@ -795,15 +796,12 @@ class DFRN
if (!$r) { if (!$r) {
return false; return false;
} }
if ($r->type) { if ($r->type) {
XML::addElement($doc, $entry, "activity:object-type", $r->type); XML::addElement($doc, $entry, "activity:object-type", $r->type);
} }
if ($r->id) { if ($r->id) {
XML::addElement($doc, $entry, "id", $r->id); XML::addElement($doc, $entry, "id", $r->id);
} }
if ($r->title) { if ($r->title) {
XML::addElement($doc, $entry, "title", $r->title); XML::addElement($doc, $entry, "title", $r->title);
} }
@ -850,7 +848,7 @@ class DFRN
* @param array $item Item element * @param array $item Item element
* *
* @return object XML attachment object * @return object XML attachment object
* @todo Find proper type-hints * @todo Add type-hints
*/ */
private static function getAttachment($doc, $root, $item) 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 * @param bool $single If set, the entry is created as an XML document with a single "entry" element
* *
* @return object XML entry object * @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 = []; $mentioned = [];
@ -936,7 +934,7 @@ class DFRN
$htmlbody = $body; $htmlbody = $body;
if ($item['title'] != "") { 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); $htmlbody = BBCode::convert($htmlbody, false, 7);
@ -1063,7 +1061,6 @@ class DFRN
$tags = Item::getFeedTags($item); $tags = Item::getFeedTags($item);
/// @TODO Combine this with similar below if() block?
if (count($tags)) { if (count($tags)) {
foreach ($tags as $t) { foreach ($tags as $t) {
if (($type != 'html') || ($t[0] != "@")) { if (($type != 'html') || ($t[0] != "@")) {
@ -1292,6 +1289,7 @@ class DFRN
$postvars['dissolve'] = '1'; $postvars['dissolve'] = '1';
} }
if ((($contact['rel']) && ($contact['rel'] != CONTACT_IS_SHARING) && (! $contact['blocked'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) { if ((($contact['rel']) && ($contact['rel'] != CONTACT_IS_SHARING) && (! $contact['blocked'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) {
$postvars['data'] = $atom; $postvars['data'] = $atom;
$postvars['perm'] = 'rw'; $postvars['perm'] = 'rw';
@ -1573,12 +1571,12 @@ class DFRN
// Until now we aren't serving different sizes - but maybe later // Until now we aren't serving different sizes - but maybe later
$avatarlist = []; $avatarlist = [];
/// @todo check if "avatar" or "photo" would be the best field in the specification /// @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) { foreach ($avatars as $avatar) {
$href = ""; $href = "";
$width = 0; $width = 0;
foreach ($avatar->attributes as $attributes) { 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") { if ($attributes->name == "href") {
$href = $attributes->textContent; $href = $attributes->textContent;
} }
@ -1593,7 +1591,6 @@ class DFRN
$avatarlist[$width] = $href; $avatarlist[$width] = $href;
} }
} }
if (count($avatarlist) > 0) { if (count($avatarlist) > 0) {
krsort($avatarlist); krsort($avatarlist);
$author["avatar"] = current($avatarlist); $author["avatar"] = current($avatarlist);
@ -2096,9 +2093,6 @@ class DFRN
$condition = ["(`id` = ?) OR (`nurl` = ?)", $importer["id"], normalise_link($old["url"])]; $condition = ["(`id` = ?) OR (`nurl` = ?)", $importer["id"], normalise_link($old["url"])];
dba::update('contact', $fields, $condition); 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); Contact::updateAvatar($relocate["avatar"], $importer["importer_uid"], $importer["id"], true);
logger('Contacts are updated.'); logger('Contacts are updated.');
@ -2705,7 +2699,7 @@ class DFRN
if (self::updateContent($current, $item, $importer, $entrytype)) { if (self::updateContent($current, $item, $importer, $entrytype)) {
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG); logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
} else { } else {
logger("Item " . $item["uri"] . " already existed.", LOGGER_DEBUG); logger("Item ".$item["uri"]." already existed.", LOGGER_DEBUG);
} }
return; return;
} }
@ -2781,7 +2775,6 @@ class DFRN
{ {
logger("Processing deletions"); logger("Processing deletions");
$uri = null; $uri = null;
foreach ($deletion->attributes as $attributes) { foreach ($deletion->attributes as $attributes) {
if ($attributes->name == "ref") { if ($attributes->name == "ref") {
$uri = $attributes->textContent; $uri = $attributes->textContent;

View file

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

View file

@ -1321,8 +1321,20 @@ class PortableContact
$version = $data->version; $version = $data->version;
$site_name = $data->site_name; $site_name = $data->site_name;
$info = $data->info; $info = $data->info;
$register_policy = constant($data->register_policy); $register_policy_str = $data->register_policy;
$platform = $data->platform; $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])) { if (!in_array($cmd, [Delivery::MAIL, Delivery::SUGGESTION, Delivery::RELOCATION])) {
$parent = $items[0]; $parent = $items[0];
$fields = ['network', 'author-id', 'owner-id']; $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
$condition = ['uri' => $target_item["thr-parent"], 'uid' => $target_item["uid"]]; dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
$thr_parent = dba::selectFirst('item', $fields, $condition);
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!!!! // This is IMPORTANT!!!!
@ -214,7 +213,7 @@ class Notifier {
} }
// Special treatment for forum posts // 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']) && ($owner['id'] != $target_item['contact-id']) &&
($target_item['uri'] === $target_item['parent-uri'])) { ($target_item['uri'] === $target_item['parent-uri'])) {
@ -248,7 +247,7 @@ class Notifier {
$target_item['deny_cid'].$target_item['deny_gid']) == 0)) $target_item['deny_cid'].$target_item['deny_gid']) == 0))
$push_notify = true; $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; $push_notify = true;
if ($parent["network"] == NETWORK_OSTATUS) { 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. // 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. // 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; $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 // Send a salmon to the parent author
$probed_contact = dba::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]); $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
if (DBM::is_result($probed_contact) && !empty($probed_contact["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"]); logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
$url_recipients[$probed_contact["notify"]] = $probed_contact["notify"]; $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
} }
// Send a salmon to the parent owner // Send a salmon to the parent owner
$probed_contact = dba::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['owner-id']]); $r = q("SELECT `url`, `notify` FROM `contact` WHERE `nurl`='%s' AND `uid` IN (0, %d) AND `notify` != ''",
if (DBM::is_result($probed_contact) && !empty($probed_contact["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"]); logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
$url_recipients[$probed_contact["notify"]] = $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\App;
use Friendica\BaseObject; 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. * 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; 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. * 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["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["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["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."] = [ $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.", 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.", 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["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["Profile Photos"] = "Profilbilder";
$a->strings["event"] = "Event";
$a->strings["status"] = "Status"; $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 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 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."; $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["Permission denied."] = "Zugriff verweigert.";
$a->strings["Archives"] = "Archiv"; $a->strings["Archives"] = "Archiv";
$a->strings["show more"] = "mehr anzeigen"; $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["No friends to display."] = "Keine Kontakte zum Anzeigen.";
$a->strings["Connect"] = "Verbinden"; $a->strings["Connect"] = "Verbinden";
$a->strings["Authorize application connection"] = "Verbindung der Applikation autorisieren"; $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["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["Ignore/Hide"] = "Ignorieren/Verbergen";
$a->strings["Friend Suggestions"] = "Kontaktvorschläge"; $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["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["Import"] = "Import";
$a->strings["Move account"] = "Account umziehen"; $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["Account approved."] = "Konto freigegeben.";
$a->strings["Registration revoked for %s"] = "Registrierung für %s wurde zurückgezogen"; $a->strings["Registration revoked for %s"] = "Registrierung für %s wurde zurückgezogen";
$a->strings["Please login."] = "Bitte melde Dich an."; $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["Tag removed"] = "Tag entfernt";
$a->strings["Remove Item Tag"] = "Gegenstands-Tag entfernen"; $a->strings["Remove Item Tag"] = "Gegenstands-Tag entfernen";
$a->strings["Select a tag to remove: "] = "Wähle ein Tag zum Entfernen aus: "; $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", 0 => "%d Nachricht",
1 => "%d Nachrichten", 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["Theme settings updated."] = "Themeneinstellungen aktualisiert.";
$a->strings["Information"] = "Information"; $a->strings["Information"] = "Information";
$a->strings["Overview"] = "Übersicht"; $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["Blocked Remote Contacts"] = "Blockierte Kontakte von anderen Knoten";
$a->strings["Block New Remote Contact"] = "Blockieren von weiteren Kontakten"; $a->strings["Block New Remote Contact"] = "Blockieren von weiteren Kontakten";
$a->strings["Photo"] = "Foto:"; $a->strings["Photo"] = "Foto:";
$a->strings["Address"] = "Adresse";
$a->strings["%s total blocked contact"] = [ $a->strings["%s total blocked contact"] = [
0 => "Insgesamt %s blockierter Kontakt", 0 => "Insgesamt %s blockierter Kontakt",
1 => "Insgesamt %s blockierte Kontakte", 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["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["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["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["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["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"; $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["Request date"] = "Anfragedatum";
$a->strings["No registrations."] = "Keine Neuanmeldungen."; $a->strings["No registrations."] = "Keine Neuanmeldungen.";
$a->strings["Note from the user"] = "Hinweis vom Nutzer"; $a->strings["Note from the user"] = "Hinweis vom Nutzer";
$a->strings["Approve"] = "Genehmigen";
$a->strings["Deny"] = "Verwehren"; $a->strings["Deny"] = "Verwehren";
$a->strings["Site admin"] = "Seitenadministrator"; $a->strings["Site admin"] = "Seitenadministrator";
$a->strings["Account expired"] = "Account ist abgelaufen"; $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["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["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["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 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["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["Create New Event"] = "Neue Veranstaltung erstellen";
$a->strings["Event details"] = "Veranstaltungsdetails"; $a->strings["Event details"] = "Veranstaltungsdetails";
$a->strings["Starting date and Title are required."] = "Anfangszeitpunkt und Titel werden benötigt"; $a->strings["Starting date and Title are required."] = "Anfangszeitpunkt und Titel werden benötigt";
$a->strings["Event Starts:"] = "Veranstaltungsbeginn:"; $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["Finish date/time is not known or not relevant"] = "Enddatum/-zeit ist nicht bekannt oder nicht relevant";
$a->strings["Event Finishes:"] = "Veranstaltungsende:"; $a->strings["Event Finishes:"] = "Veranstaltungsende:";
$a->strings["Adjust for viewer timezone"] = "An Zeitzone des Betrachters anpassen"; $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["Permissions"] = "Berechtigungen";
$a->strings["Failed to remove event"] = "Entfernen der Veranstaltung fehlgeschlagen"; $a->strings["Failed to remove event"] = "Entfernen der Veranstaltung fehlgeschlagen";
$a->strings["Event removed"] = "Veranstaltung enfternt"; $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["Unable to locate original post."] = "Konnte den Originalbeitrag nicht finden.";
$a->strings["Empty post discarded."] = "Leerer Beitrag wurde verworfen."; $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."; $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["Sort by Comment Date"] = "Nach Kommentardatum sortieren";
$a->strings["Posted Order"] = "Neueste Beiträge"; $a->strings["Posted Order"] = "Neueste Beiträge";
$a->strings["Sort by Post Date"] = "Nach Beitragsdatum sortieren"; $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["Posts that mention or involve you"] = "Beiträge, in denen es um Dich geht";
$a->strings["New"] = "Neue"; $a->strings["New"] = "Neue";
$a->strings["Activity Stream - by date"] = "Aktivitäten-Stream - nach Datum"; $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["Starred"] = "Markierte";
$a->strings["Favourite Posts"] = "Favorisierte Beiträge"; $a->strings["Favourite Posts"] = "Favorisierte Beiträge";
$a->strings["Personal Notes"] = "Persönliche Notizen"; $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["Photo Albums"] = "Fotoalben";
$a->strings["Recent Photos"] = "Neueste Fotos"; $a->strings["Recent Photos"] = "Neueste Fotos";
$a->strings["Upload New Photos"] = "Neue Fotos hochladen"; $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 posts"] = "Beiträge von %s";
$a->strings["%s's comments"] = "Kommentare von %s"; $a->strings["%s's comments"] = "Kommentare von %s";
$a->strings["Tips for New Members"] = "Tipps für neue Nutzer"; $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["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["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."; $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["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["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["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["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["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."; $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["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["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["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["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["Delete Video"] = "Video Löschen";
$a->strings["No videos selected"] = "Keine Videos ausgewählt"; $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: Database update"] = "%s: Datenbank Aktualisierung";
$a->strings["%s: updating %s table."] = "%s: aktualisiere Tabelle %s"; $a->strings["%s: updating %s table."] = "%s: aktualisiere Tabelle %s";
$a->strings["[no subject]"] = "[kein Betreff]"; $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["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["Default privacy group for new contacts"] = "Voreingestellte Gruppe für neue Kontakte";
$a->strings["Everybody"] = "Alle 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["Contacts not in any group"] = "Kontakte in keiner Gruppe";
$a->strings["Create a new group"] = "Neue Gruppe erstellen"; $a->strings["Create a new group"] = "Neue Gruppe erstellen";
$a->strings["Edit groups"] = "Gruppen bearbeiten"; $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["Drop Contact"] = "Kontakt löschen";
$a->strings["Organisation"] = "Organisation"; $a->strings["Organisation"] = "Organisation";
$a->strings["News"] = "Nachrichten"; $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["Unable to retrieve contact information."] = "Konnte die Kontaktinformationen nicht empfangen.";
$a->strings["%s's birthday"] = "%ss Geburtstag"; $a->strings["%s's birthday"] = "%ss Geburtstag";
$a->strings["Happy Birthday %s"] = "Herzlichen Glückwunsch %s"; $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 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 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."; $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["School/education:"] = "Schule/Ausbildung:";
$a->strings["Forums:"] = "Foren:"; $a->strings["Forums:"] = "Foren:";
$a->strings["Only You Can See This"] = "Nur Du kannst das sehen"; $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["Sharing notification from Diaspora network"] = "Freigabe-Benachrichtigung von Diaspora";
$a->strings["Attachments:"] = "Anhänge:"; $a->strings["Attachments:"] = "Anhänge:";
$a->strings["%s is now following %s."] = "%s folgt nun %s"; $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["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["Privacy Statement"] = "Datenschutzerklärung";
$a->strings["This entry was edited"] = "Dieser Beitrag wurde bearbeitet."; $a->strings["This entry was edited"] = "Dieser Beitrag wurde bearbeitet.";
$a->strings["Delete globally"] = "Global löschen"; $a->strings["Remove from your stream"] = "Aus deinem Netzwerkstrom entfernen";
$a->strings["Remove locally"] = "Lokal entfernen";
$a->strings["save to folder"] = "In Ordner speichern"; $a->strings["save to folder"] = "In Ordner speichern";
$a->strings["I will attend"] = "Ich werde teilnehmen"; $a->strings["I will attend"] = "Ich werde teilnehmen";
$a->strings["I will not attend"] = "Ich werde nicht 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["show fewer"] = "weniger anzeigen";
$a->strings["No system theme config value set."] = "Es wurde kein Konfigurationswert für das Systemweite Theme gesetzt."; $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["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["%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\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Profile; use Friendica\Model\Profile;
@ -154,6 +153,7 @@ function vier_community_info()
foreach ($r as $rr) { foreach ($r as $rr) {
$entry = replace_macros($tpl, [ $entry = replace_macros($tpl, [
'$id' => $rr['id'], '$id' => $rr['id'],
//'$profile_link' => Profile::zrl($rr['url']),
'$profile_link' => 'follow/?url='.urlencode($rr['url']), '$profile_link' => 'follow/?url='.urlencode($rr['url']),
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO), '$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
'$alt_text' => $rr['name'], '$alt_text' => $rr['name'],
@ -234,7 +234,7 @@ function vier_community_info()
$entry = [ $entry = [
'url' => 'network?f=&cid=' . $contact['id'], 'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => Contact::magicLink($contact['url']), 'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'], 'name' => $contact['name'],
'cid' => $contact['id'], 'cid' => $contact['id'],
'selected' => $selected, 'selected' => $selected,
@ -285,7 +285,7 @@ function vier_community_info()
} }
foreach ($r as $index => $helper) { 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")]; $r[] = ["url" => "help/Quick-Start-guide", "name" => L10n::t("Quick Start")];