* and existing allocations MUST NEVER BE CHANGED
* OR RE-ASSIGNED! You may only add to them.
*/
-$netgroup_ids = array(
+$netgroup_ids = [
NETWORK_DFRN => (-1),
NETWORK_ZOT => (-2),
NETWORK_OSTATUS => (-3),
NETWORK_PNUT => (-20),
NETWORK_PHANTOM => (-127),
-);
+];
/**
* Maximum number of "people who like (or don't like) this" that we will list by name
ini_set('pcre.backtrack_limit', 500000);
if (get_magic_quotes_gpc()) {
- $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
+ $process = [&$_GET, &$_POST, &$_COOKIE, &$_REQUEST];
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (DBM::is_result($r)) {
$installed = $r;
} else {
- $installed = array();
+ $installed = [];
}
$plugins = Config::get('system', 'addon');
- $plugins_arr = array();
+ $plugins_arr = [];
if ($plugins) {
$plugins_arr = explode(',', str_replace(' ', '', $plugins));
$a->plugins = $plugins_arr;
- $installed_arr = array();
+ $installed_arr = [];
if (count($installed)) {
foreach ($installed as $i) {
{
$a = get_app();
if (!x($_SESSION, 'sysmsg')) {
- $_SESSION['sysmsg'] = array();
+ $_SESSION['sysmsg'] = [];
}
if ($a->interactive) {
$_SESSION['sysmsg'][] = $s;
}
if (!x($_SESSION, 'sysmsg_info')) {
- $_SESSION['sysmsg_info'] = array();
+ $_SESSION['sysmsg_info'] = [];
}
if ($a->interactive) {
$_SESSION['sysmsg_info'][] = $s;
function current_theme()
{
- $app_base_themes = array('duepuntozero', 'dispy', 'quattro');
+ $app_base_themes = ['duepuntozero', 'dispy', 'quattro'];
$a = get_app();
$args = array_values($args);
}
- return array(
+ return [
'base' => $base,
'args' => $args,
- );
+ ];
}
/**
$reload_uri .= "&offset=" . urlencode($a->page_offset);
}
- $arr = array("pageno" => $pageno, "reload_uri" => $reload_uri);
+ $arr = ["pageno" => $pageno, "reload_uri" => $reload_uri];
return $arr;
}
$a->config['system']['directory'] = 'https://dir.friendica.social';
// Allowed protocols in link URLs; HTTP protocols always are accepted
-$a->config['system']['allowed_link_protocols'] = array('ftp', 'ftps', 'mailto', 'cid', 'gopher');
+$a->config['system']['allowed_link_protocols'] = ['ftp', 'ftps', 'mailto', 'cid', 'gopher'];
// Authentication cookie lifetime, in days
$a->config['system']['auth_cookie_lifetime'] = 7;
);
- $arr = array('group' => $r, 'entry' => $o);
+ $arr = ['group' => $r, 'entry' => $o];
// e.g. 'network_pre_group_deny', 'profile_pre_group_allow'
if (x($options, 'networks')) {
switch ($options['networks']) {
case 'DFRN_ONLY':
- $networks = array(NETWORK_DFRN);
+ $networks = [NETWORK_DFRN];
break;
case 'PRIVATE':
if (is_array($a->user) && $a->user['prvnets']) {
- $networks = array(NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA);
+ $networks = [NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA];
} else {
- $networks = array(NETWORK_DFRN, NETWORK_FACEBOOK, NETWORK_MAIL, NETWORK_DIASPORA);
+ $networks = [NETWORK_DFRN, NETWORK_FACEBOOK, NETWORK_MAIL, NETWORK_DIASPORA];
}
break;
case 'TWO_WAY':
if (is_array($a->user) && $a->user['prvnets']) {
- $networks = array(NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA);
+ $networks = [NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA];
} else {
- $networks = array(NETWORK_DFRN, NETWORK_FACEBOOK, NETWORK_MAIL, NETWORK_DIASPORA, NETWORK_OSTATUS);
+ $networks = [NETWORK_DFRN, NETWORK_FACEBOOK, NETWORK_MAIL, NETWORK_DIASPORA, NETWORK_OSTATUS];
}
break;
default: /// @TODO Maybe log this call?
}
}
- $x = array('options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks);
+ $x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks];
call_hooks('contact_select_options', $x);
);
- $arr = array('contact' => $r, 'entry' => $o);
+ $arr = ['contact' => $r, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
);
- $arr = array('contact' => $r, 'entry' => $o);
+ $arr = ['contact' => $r, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
call_hooks($a->module . '_pre_' . $selname, $arr);
- $receiverlist = array();
+ $receiverlist = [];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
function fixacl(&$item) {
- $item = intval(str_replace(array('<', '>'), array('', ''), $item));
+ $item = intval(str_replace(['<', '>'], ['', ''], $item));
}
function prune_deadguys($arr) {
$r = q("SELECT `id` FROM `contact` WHERE `id` IN ( " . $str . ") AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 ");
if (DBM::is_result($r)) {
- $ret = array();
+ $ret = [];
foreach ($r as $rr) {
$ret[] = intval($rr['id']);
}
return $ret;
}
- return array();
+ return [];
}
if (is_array($user)) {
$allow_cid = ((strlen($user['allow_cid']))
- ? explode('><', $user['allow_cid']) : array() );
+ ? explode('><', $user['allow_cid']) : [] );
$allow_gid = ((strlen($user['allow_gid']))
- ? explode('><', $user['allow_gid']) : array() );
+ ? explode('><', $user['allow_gid']) : [] );
$deny_cid = ((strlen($user['deny_cid']))
- ? explode('><', $user['deny_cid']) : array() );
+ ? explode('><', $user['deny_cid']) : [] );
$deny_gid = ((strlen($user['deny_gid']))
- ? explode('><', $user['deny_gid']) : array() );
+ ? explode('><', $user['deny_gid']) : [] );
array_walk($allow_cid,'fixacl');
array_walk($allow_gid,'fixacl');
array_walk($deny_cid,'fixacl');
$allow_cid = prune_deadguys($allow_cid);
- return array(
+ return [
'allow_cid' => $allow_cid,
'allow_gid' => $allow_gid,
'deny_cid' => $deny_cid,
'deny_gid' => $deny_gid,
- );
+ ];
}
}
$tpl = get_markup_template("acl_selector.tpl");
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$showall'=> t("Visible to everybody"),
'$show' => t("show"),
'$hide' => t("don't show"),
'$jotnets' => $jotnets,
'$aclModalTitle' => t('Permissions'),
'$aclModalDismiss' => t('Close'),
- '$features' => array(
+ '$features' => [
'aclautomention' => (Feature::isEnabled($user['uid'], "aclautomention") ? "true" : "false")
- ),
- ));
+ ],
+ ]);
return $o;
$tot = $group_count + $contact_count;
- $groups = array();
- $contacts = array();
+ $groups = [];
+ $contacts = [];
if ($type == '' || $type == 'g') {
/// @todo We should cache this query.
);
foreach ($r as $g) {
- $groups[] = array(
+ $groups[] = [
"type" => "g",
"photo" => "images/twopeople.png",
"name" => htmlentities($g['name']),
"uids" => array_map("intval", explode(",",$g['uids'])),
"link" => '',
"forum" => '0'
- );
+ ];
}
if ((count($groups) > 0) && ($search == "")) {
- $groups[] = array("separator" => true);
+ $groups[] = ["separator" => true];
}
}
} elseif ($type == 'x') {
// autocomplete for global contact search (e.g. navbar search)
$r = navbar_complete($a);
- $contacts = array();
+ $contacts = [];
if ($r) {
foreach ($r as $g) {
- $contacts[] = array(
+ $contacts[] = [
'photo' => proxy_url($g['photo'], false, PROXY_SIZE_MICRO),
'name' => $g['name'],
'nick' => (x($g['addr']) ? $g['addr'] : $g['url']),
'network' => $g['network'],
'link' => $g['url'],
'forum' => (x($g['community']) ? 1 : 0),
- );
+ ];
}
}
- $o = array(
+ $o = [
'start' => $start,
'count' => $count,
'items' => $contacts,
- );
+ ];
echo json_encode($o);
killme();
} else {
- $r = array();
+ $r = [];
}
if (DBM::is_result($r)) {
- $forums = array();
+ $forums = [];
foreach ($r as $g) {
- $entry = array(
+ $entry = [
'type' => 'c',
'photo' => proxy_url($g['micro'], false, PROXY_SIZE_MICRO),
'name' => htmlentities($g['name']),
'nick' => htmlentities(($g['attag']) ? $g['attag'] : $g['nick']),
'addr' => htmlentities(($g['addr']) ? $g['addr'] : $g['url']),
'forum' => ((x($g, 'forum') || x($g, 'prv')) ? 1 : 0),
- );
+ ];
if ($entry['forum']) {
$forums[] = $entry;
} else {
}
if (count($forums) > 0) {
if ($search == "") {
- $forums[] = array("separator" => true);
+ $forums[] = ["separator" => true];
}
$contacts = array_merge($forums, $contacts);
}
}
, $contacts);
- $unknown_contacts = array();
+ $unknown_contacts = [];
$r = q("SELECT `author-link`
FROM `item` WHERE `parent` = %d
AND (`author-name` LIKE '%%%s%%' OR `author-link` LIKE '%%%s%%')
$contact = Contact::getDetailsByURL($row['author-link']);
if (count($contact) > 0) {
- $unknown_contacts[] = array(
+ $unknown_contacts[] = [
'type' => 'c',
'photo' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO),
'name' => htmlentities($contact['name']),
'nick' => htmlentities($contact['nick'] ? : $contact['addr']),
'addr' => htmlentities(($contact['addr']) ? $contact['addr'] : $contact['url']),
'forum' => $contact['forum']
- );
+ ];
}
}
}
$tot += count($unknown_contacts);
}
- $results = array(
+ $results = [
'tot' => $tot,
'start' => $start,
'count' => $count,
'items' => $items,
'type' => $type,
'search' => $search,
- );
+ ];
call_hooks('acl_lookup_end', $results);
if ($out_type === 'html') {
- $o = array(
+ $o = [
'tot' => $results['tot'],
'start' => $results['start'],
'count' => $results['count'],
'groups' => $results['groups'],
'contacts' => $results['contacts'],
- );
+ ];
return $o;
}
- $o = array(
+ $o = [
'tot' => $results['tot'],
'start' => $results['start'],
'count' => $results['count'],
'items' => $results['items'],
- );
+ ];
echo json_encode($o);
// don't search if search term has less than 2 characters
if (! $search || mb_strlen($search) < 2) {
- return array();
+ return [];
}
if (substr($search,0,1) === '@') {
define('API_METHOD_POST', 'POST,PUT');
define('API_METHOD_DELETE', 'POST,DELETE');
-$API = array();
+$API = [];
$called_api = null;
/**
{
global $API;
- $API[$path] = array(
+ $API[$path] = [
'func' => $func,
'auth' => $auth,
'method' => $method,
- );
+ ];
// Workaround for hotot
$path = str_replace("api/", "api/1.1/", $path);
- $API[$path] = array(
+ $API[$path] = [
'func' => $func,
'auth' => $auth,
'method' => $method,
- );
+ ];
}
/**
// next code from mod/auth.php. needs better solution
$record = null;
- $addon_auth = array(
+ $addon_auth = [
'username' => trim($user),
'password' => trim($password),
'authenticated' => 0,
'user_record' => null,
- );
+ ];
/*
* A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record
$error = ($e->getMessage() !== "" ? $e->getMessage() : $e->httpdesc);
/// @TODO: https://dev.twitter.com/overview/api/response-codes
- $error = array("error" => $error,
+ $error = ["error" => $error,
"code" => $e->httpcode . " " . $e->httpdesc,
- "request" => $a->query_string);
+ "request" => $a->query_string];
- $return = api_format_data('status', $type, array('status' => $error));
+ $return = api_format_data('status', $type, ['status' => $error]);
switch ($type) {
case "xml":
}
$arr['$user'] = $user_info;
- $arr['$rss'] = array(
+ $arr['$rss'] = [
'alternate' => $user_info['url'],
'self' => System::baseUrl() . "/" . $a->query_string,
'base' => System::baseUrl(),
'atom_updated' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME),
'language' => $user_info['language'],
'logo' => System::baseUrl() . "/images/friendica-32.png",
- );
+ ];
return $arr;
}
*/
function api_unique_id_to_nurl($id)
{
- $r = dba::selectFirst('contact', array('nurl'), array('uid' => 0, 'id' => $id));
+ $r = dba::selectFirst('contact', ['nurl'], ['uid' => 0, 'id' => $id]);
if (DBM::is_result($r)) {
return $r["nurl"];
// if the contact wasn't found, fetch it from the contacts with uid = 0
if (!DBM::is_result($uinfo)) {
- $r = array();
+ $r = [];
if ($url != "") {
$r = q("SELECT * FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s' LIMIT 1", dbesc(normalise_link($url)));
$r[0]['nick'] = api_get_nick($r[0]["url"]);
}
- $ret = array(
+ $ret = [
'id' => $r[0]["id"],
'id_str' => (string) $r[0]["id"],
'name' => $r[0]["name"],
'cid' => Contact::getIdForURL($r[0]["url"], api_user(), true),
'self' => 0,
'network' => $r[0]["network"],
- );
+ ];
return $ret;
} else {
$location = $network_name;
}
- $ret = array(
+ $ret = [
'id' => intval($pcontact_id),
'id_str' => (string) intval($pcontact_id),
'name' => (($uinfo[0]['name']) ? $uinfo[0]['name'] : $uinfo[0]['nick']),
'cid' => intval($uinfo[0]['cid']),
'self' => $uinfo[0]['self'],
'network' => $uinfo[0]['network'],
- );
+ ];
// If this is a local user and it uses Frio, we can get its color preferences.
if ($ret['self']) {
$owner_user = $status_user;
}
- return (array($status_user, $owner_user));
+ return ([$status_user, $owner_user]);
}
/**
*/
function api_walk_recursive(array &$array, callable $callback)
{
- $new_array = array();
+ $new_array = [];
foreach ($array as $k => $v) {
if (is_array($v)) {
$data2 = array_pop($data);
$key = key($data2);
- $namespaces = array("" => "http://api.twitter.com",
+ $namespaces = ["" => "http://api.twitter.com",
"statusnet" => "http://status.net/schema/api/1/",
"friendica" => "http://friendi.ca/schema/api/1/",
- "georss" => "http://www.georss.org/georss");
+ "georss" => "http://www.georss.org/georss"];
/// @todo Auto detection of needed namespaces
- if (in_array($root_element, array("ok", "hash", "config", "version", "ids", "notes", "photos"))) {
- $namespaces = array();
+ if (in_array($root_element, ["ok", "hash", "config", "version", "ids", "notes", "photos"])) {
+ $namespaces = [];
}
if (is_array($data2)) {
}
if ($key == "0") {
- $data4 = array();
+ $data4 = [];
$i = 1;
foreach ($data2 as $item) {
$data2 = $data4;
}
- $data3 = array($root_element => $data2);
+ $data3 = [$root_element => $data2];
$ret = XML::fromArray($data3, $xml, false, $namespaces);
return $ret;
unset($user_info["uid"]);
unset($user_info["self"]);
- return api_format_data("user", $type, array('user' => $user_info));
+ return api_format_data("user", $type, ['user' => $user_info]);
}
/// @TODO move to top of file or somewhere better
throw new InternalServerErrorException();
}
- $returndata = array();
+ $returndata = [];
$returndata["media_id"] = $media["id"];
$returndata["media_id_string"] = (string)$media["id"];
$returndata["size"] = $media["size"];
- $returndata["image"] = array("w" => $media["width"],
+ $returndata["image"] = ["w" => $media["width"],
"h" => $media["height"],
- "image_type" => $media["type"]);
+ "image_type" => $media["type"]];
logger("Media uploaded: " . print_r($returndata, true), LOGGER_DEBUG);
- return array("media" => $returndata);
+ return ["media" => $returndata];
}
/// @TODO move to top of file or somewhere better
$geo = "geo";
}
- $status_info = array(
+ $status_info = [
'created_at' => api_date($lastwall['created']),
'id' => intval($lastwall['id']),
'id_str' => (string) $lastwall['id'],
'statusnet_html' => $converted["html"],
'statusnet_conversation_id' => $lastwall['parent'],
'external_url' => System::baseUrl() . "/display/" . $lastwall['guid'],
- );
+ ];
if (count($converted["attachments"]) > 0) {
$status_info["attachments"] = $converted["attachments"];
return $status_info;
}
- return api_format_data("statuses", $type, array('status' => $status_info));
+ return api_format_data("statuses", $type, ['status' => $status_info]);
}
/**
$geo = "geo";
}
- $user_info['status'] = array(
+ $user_info['status'] = [
'text' => $converted["text"],
'truncated' => false,
'created_at' => api_date($lastwall['created']),
'statusnet_html' => $converted["html"],
'statusnet_conversation_id' => $lastwall['parent'],
'external_url' => System::baseUrl() . "/display/" . $lastwall['guid'],
- );
+ ];
if (count($converted["attachments"]) > 0) {
$user_info["status"]["attachments"] = $converted["attachments"];
unset($user_info["uid"]);
unset($user_info["self"]);
- return api_format_data("user", $type, array('user' => $user_info));
+ return api_format_data("user", $type, ['user' => $user_info]);
}
/// @TODO move to top of file or somewhere better
{
$a = get_app();
- $userlist = array();
+ $userlist = [];
if (x($_GET, 'q')) {
$r = q("SELECT id FROM `contact` WHERE `uid` = 0 AND `name` = '%s'", dbesc($_GET["q"]));
$userlist[] = $user_info;
}
}
- $userlist = array("users" => $userlist);
+ $userlist = ["users" => $userlist];
} else {
throw new BadRequestException("User not found.");
}
*/
function api_users_lookup($type)
{
- $users = array();
+ $users = [];
if (x($_REQUEST['user_id'])) {
foreach (explode(',', $_REQUEST['user_id']) as $id) {
throw new NotFoundException;
}
- return api_format_data("users", $type, array('users' => $users));
+ return api_format_data("users", $type, ['users' => $users]);
}
/// @TODO move to top of file or somewhere better
*/
function api_search($type)
{
- $data = array();
+ $data = [];
if (!x($_REQUEST, 'q')) {
throw new BadRequestException("q parameter is required.");
$ret = api_format_items($r, $user_info, false, $type);
// Set all posts from the query above to seen
- $idarray = array();
+ $idarray = [];
foreach ($r as $item) {
$idarray[] = intval($item["id"]);
}
}
}
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
$ret = api_format_items($r, $user_info, false, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
$ret = api_format_items($r, $user_info, false, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
$ret = api_format_items($r, $user_info, false, $type);
if ($conversation) {
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
return api_format_data("statuses", $type, $data);
} else {
- $data = array('status' => $ret[0]);
+ $data = ['status' => $ret[0]];
return api_format_data("status", $type, $data);
}
}
$ret = api_format_items($r, $user_info, false, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
return api_format_data("statuses", $type, $data);
}
$ret = api_format_items($r, $user_info, false, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
$ret = api_format_items($r, $user_info, true, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
$rets = api_format_items($item, $user_info, false, $type);
$ret = $rets[0];
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
throw new ForbiddenException();
}
- $called_api = array();
+ $called_api = [];
$user_info = api_get_user($a);
logger('api_favorites: self:' . $user_info['self']);
if ($user_info['self'] == 0) {
- $ret = array();
+ $ret = [];
} else {
$sql_extra = "";
$ret = api_format_items($r, $user_info, false, $type);
}
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
switch ($type) {
case "atom":
case "rss":
function api_format_messages($item, $recipient, $sender)
{
// standard meta information
- $ret = array(
+ $ret = [
'id' => $item['id'],
'sender_id' => $sender['id'] ,
'text' => "",
'title' => "",
'friendica_seen' => $item['seen'],
'friendica_parent_uri' => $item['parent-uri'],
- );
+ ];
// "uid" and "self" are only needed for some internal stuff, so remove it from here
unset($ret["sender"]["uid"]);
$statushtml = trim(bbcode($body, false, false));
// Workaround for clients with limited HTML parser functionality
- $search = array("<br>", "<blockquote>", "</blockquote>",
+ $search = ["<br>", "<blockquote>", "</blockquote>",
"<h1>", "</h1>", "<h2>", "</h2>",
"<h3>", "</h3>", "<h4>", "</h4>",
- "<h5>", "</h5>", "<h6>", "</h6>");
- $replace = array("<br>", "<br><blockquote>", "</blockquote><br>",
+ "<h5>", "</h5>", "<h6>", "</h6>"];
+ $replace = ["<br>", "<br><blockquote>", "</blockquote><br>",
"<br><h1>", "</h1><br>", "<br><h2>", "</h2><br>",
"<br><h3>", "</h3><br>", "<br><h4>", "</h4><br>",
- "<br><h5>", "</h5><br>", "<br><h6>", "</h6><br>");
+ "<br><h5>", "</h5><br>", "<br><h6>", "</h6><br>"];
$statushtml = str_replace($search, $replace, $statushtml);
if ($item['title'] != "") {
$entities = api_get_entitities($statustext, $body);
- return array(
+ return [
"text" => $statustext,
"html" => $statushtml,
"attachments" => $attachments,
"entities" => $entities
- );
+ ];
}
/**
return false;
}
- $attachments = array();
+ $attachments = [];
foreach ($images[1] as $image) {
$imagedata = Image::getInfoFromURL($image);
if ($imagedata) {
- $attachments[] = array("url" => $image, "mimetype" => $imagedata["mime"], "size" => $imagedata["size"]);
+ $attachments[] = ["url" => $image, "mimetype" => $imagedata["mime"], "size" => $imagedata["size"]];
}
}
$replace = proxy_url($image);
$text = str_replace($image, $replace, $text);
}
- return array();
+ return [];
}
$bbcode = bb_CleanPictureLinks($bbcode);
// Change pure links in text to bbcode uris
$bbcode = preg_replace("/([^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2]$2[/url]', $bbcode);
- $entities = array();
- $entities["hashtags"] = array();
- $entities["symbols"] = array();
- $entities["urls"] = array();
- $entities["user_mentions"] = array();
+ $entities = [];
+ $entities["hashtags"] = [];
+ $entities["symbols"] = [];
+ $entities["urls"] = [];
+ $entities["user_mentions"] = [];
$URLSearchString = "^\[\]";
//preg_match_all("/\[url\]([$URLSearchString]*)\[\/url\]/ism", $bbcode, $urls1);
preg_match_all("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $bbcode, $urls);
- $ordered_urls = array();
+ $ordered_urls = [];
foreach ($urls[1] as $id => $url) {
//$start = strpos($text, $url, $offset);
$start = iconv_strpos($text, $url, 0, "UTF-8");
if (!($start === false)) {
- $ordered_urls[$start] = array("url" => $url, "title" => $urls[2][$id]);
+ $ordered_urls[$start] = ["url" => $url, "title" => $urls[2][$id]];
}
}
) {
$display_url = $url["title"];
} else {
- $display_url = str_replace(array("http://www.", "https://www."), array("", ""), $url["url"]);
- $display_url = str_replace(array("http://", "https://"), array("", ""), $display_url);
+ $display_url = str_replace(["http://www.", "https://www."], ["", ""], $url["url"]);
+ $display_url = str_replace(["http://", "https://"], ["", ""], $display_url);
if (strlen($display_url) > 26) {
$display_url = substr($display_url, 0, 25)."…";
//$start = strpos($text, $url, $offset);
$start = iconv_strpos($text, $url["url"], $offset, "UTF-8");
if (!($start === false)) {
- $entities["urls"][] = array("url" => $url["url"],
+ $entities["urls"][] = ["url" => $url["url"],
"expanded_url" => $url["url"],
"display_url" => $display_url,
- "indices" => array($start, $start+strlen($url["url"])));
+ "indices" => [$start, $start+strlen($url["url"])]];
$offset = $start + 1;
}
}
preg_match_all("/\[img](.*?)\[\/img\]/ism", $bbcode, $images);
- $ordered_images = array();
+ $ordered_images = [];
foreach ($images[1] as $image) {
//$start = strpos($text, $url, $offset);
$start = iconv_strpos($text, $image, 0, "UTF-8");
$offset = 0;
foreach ($ordered_images as $url) {
- $display_url = str_replace(array("http://www.", "https://www."), array("", ""), $url);
- $display_url = str_replace(array("http://", "https://"), array("", ""), $display_url);
+ $display_url = str_replace(["http://www.", "https://www."], ["", ""], $url);
+ $display_url = str_replace(["http://", "https://"], ["", ""], $display_url);
if (strlen($display_url) > 26) {
$display_url = substr($display_url, 0, 25)."…";
if (!Config::get("system", "proxy_disabled")) {
$media_url = proxy_url($url);
- $sizes = array();
+ $sizes = [];
$scale = Image::getScalingDimensions($image[0], $image[1], 150);
- $sizes["thumb"] = array("w" => $scale["width"], "h" => $scale["height"], "resize" => "fit");
+ $sizes["thumb"] = ["w" => $scale["width"], "h" => $scale["height"], "resize" => "fit"];
if (($image[0] > 150) || ($image[1] > 150)) {
$scale = Image::getScalingDimensions($image[0], $image[1], 340);
- $sizes["small"] = array("w" => $scale["width"], "h" => $scale["height"], "resize" => "fit");
+ $sizes["small"] = ["w" => $scale["width"], "h" => $scale["height"], "resize" => "fit"];
}
$scale = Image::getScalingDimensions($image[0], $image[1], 600);
- $sizes["medium"] = array("w" => $scale["width"], "h" => $scale["height"], "resize" => "fit");
+ $sizes["medium"] = ["w" => $scale["width"], "h" => $scale["height"], "resize" => "fit"];
if (($image[0] > 600) || ($image[1] > 600)) {
$scale = Image::getScalingDimensions($image[0], $image[1], 1024);
- $sizes["large"] = array("w" => $scale["width"], "h" => $scale["height"], "resize" => "fit");
+ $sizes["large"] = ["w" => $scale["width"], "h" => $scale["height"], "resize" => "fit"];
}
} else {
$media_url = $url;
- $sizes["medium"] = array("w" => $image[0], "h" => $image[1], "resize" => "fit");
+ $sizes["medium"] = ["w" => $image[0], "h" => $image[1], "resize" => "fit"];
}
- $entities["media"][] = array(
+ $entities["media"][] = [
"id" => $start+1,
"id_str" => (string)$start+1,
- "indices" => array($start, $start+strlen($url)),
+ "indices" => [$start, $start+strlen($url)],
"media_url" => normalise_link($media_url),
"media_url_https" => $media_url,
"url" => $url,
"display_url" => $display_url,
"expanded_url" => $url,
"type" => "photo",
- "sizes" => $sizes);
+ "sizes" => $sizes];
}
$offset = $start + 1;
}
*/
function api_contactlink_to_array($txt)
{
- $match = array();
+ $match = [];
$r = preg_match_all('|<a href="([^"]*)">([^<]*)</a>|', $txt, $match);
if ($r && count($match)==3) {
- $res = array(
+ $res = [
'name' => $match[2],
'url' => $match[1]
- );
+ ];
} else {
- $res = array(
+ $res = [
'name' => $text,
'url' => ""
- );
+ ];
}
return $res;
}
{
$a = get_app();
- $activities = array(
- 'like' => array(),
- 'dislike' => array(),
- 'attendyes' => array(),
- 'attendno' => array(),
- 'attendmaybe' => array(),
- );
+ $activities = [
+ 'like' => [],
+ 'dislike' => [],
+ 'attendyes' => [],
+ 'attendno' => [],
+ 'attendmaybe' => [],
+ ];
$items = q(
'SELECT * FROM item
}
if ($type == "xml") {
- $xml_activities = array();
+ $xml_activities = [];
foreach ($activities as $k => $v) {
// change xml element from "like" to "friendica:like"
$xml_activities["friendica:".$k] = $v;
*/
function api_format_items_profiles($profile_row)
{
- $profile = array(
+ $profile = [
'profile_id' => $profile_row['id'],
'profile_name' => $profile_row['profile-name'],
'is_default' => $profile_row['is-default'] ? true : false,
'social_networks' => bbcode(api_clean_plain_items($profile_row['contact']) , false, false, 2, false),
'homepage' => $profile_row['homepage'],
'users' => null
- );
+ ];
return $profile;
}
{
$a = get_app();
- $ret = array();
+ $ret = [];
foreach ($r as $item) {
localize_item($item);
$geo = "geo";
}
- $status = array(
+ $status = [
'text' => $converted["text"],
'truncated' => false,
'created_at'=> api_date($item['created']),
'statusnet_conversation_id' => $item['parent'],
'external_url' => System::baseUrl() . "/display/" . $item['guid'],
'friendica_activities' => api_format_items_activities($item, $type),
- );
+ ];
if (count($converted["attachments"]) > 0) {
$status["attachments"] = $converted["attachments"];
} catch (BadRequestException $e) {
// user not found. should be found?
/// @todo check if the user should be always found
- $retweeted_status["user"] = array();
+ $retweeted_status["user"] = [];
}
$rt_converted = api_convert_item($retweeted_item);
$coords = explode(' ', $item["coord"]);
if (count($coords) == 2) {
if ($type == "json") {
- $status["geo"] = array('type' => 'Point',
- 'coordinates' => array((float) $coords[0],
- (float) $coords[1]));
+ $status["geo"] = ['type' => 'Point',
+ 'coordinates' => [(float) $coords[0],
+ (float) $coords[1]]];
} else {// Not sure if this is the official format - if someone founds a documentation we can check
$status["georss:point"] = $item["coord"];
}
function api_account_rate_limit_status($type)
{
if ($type == "xml") {
- $hash = array(
+ $hash = [
'remaining-hits' => '150',
- '@attributes' => array("type" => "integer"),
+ '@attributes' => ["type" => "integer"],
'hourly-limit' => '150',
- '@attributes2' => array("type" => "integer"),
+ '@attributes2' => ["type" => "integer"],
'reset-time' => datetime_convert('UTC', 'UTC', 'now + 1 hour', ATOM_TIME),
- '@attributes3' => array("type" => "datetime"),
+ '@attributes3' => ["type" => "datetime"],
'reset_time_in_seconds' => strtotime('now + 1 hour'),
- '@attributes4' => array("type" => "integer"),
- );
+ '@attributes4' => ["type" => "integer"],
+ ];
} else {
- $hash = array(
+ $hash = [
'reset_time_in_seconds' => strtotime('now + 1 hour'),
'remaining_hits' => '150',
'hourly_limit' => '150',
'reset_time' => api_date(datetime_convert('UTC', 'UTC', 'now + 1 hour', ATOM_TIME)),
- );
+ ];
}
- return api_format_data('hash', $type, array('hash' => $hash));
+ return api_format_data('hash', $type, ['hash' => $hash]);
}
/// @TODO move to top of file or somewhere better
$ok = "ok";
}
- return api_format_data('ok', $type, array("ok" => $ok));
+ return api_format_data('ok', $type, ["ok" => $ok]);
}
/// @TODO move to top of file or somewhere better
*/
function api_lists($type)
{
- $ret = array();
+ $ret = [];
/// @TODO $ret is not filled here?
- return api_format_data('lists', $type, array("lists_list" => $ret));
+ return api_format_data('lists', $type, ["lists_list" => $ret]);
}
/// @TODO move to top of file or somewhere better
*/
function api_lists_list($type)
{
- $ret = array();
+ $ret = [];
/// @TODO $ret is not filled here?
- return api_format_data('lists', $type, array("lists_list" => $ret));
+ return api_format_data('lists', $type, ["lists_list" => $ret]);
}
/// @TODO move to top of file or somewhere better
intval($count)
);
- $ret = array();
+ $ret = [];
foreach ($r as $cid) {
$user = api_get_user($a, $cid['nurl']);
// "uid" and "self" are only needed for some internal stuff, so remove it from here
}
}
- return array('user' => $ret);
+ return ['user' => $ret];
}
return false;
}
- $ids = array();
+ $ids = [];
foreach ($data['user'] as $user) {
$ids[] = $user['id'];
}
- return api_format_data("ids", $type, array('id' => $ids));
+ return api_format_data("ids", $type, ['id' => $ids]);
}
/// @TODO move to top of file or somewhere better
$ssl = ((Config::get('system', 'have_ssl')) ? 'true' : 'false');
$sslserver = (($ssl === 'true') ? str_replace('http:', 'https:', System::baseUrl()) : '');
- $config = array(
- 'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '',
+ $config = [
+ 'site' => ['name' => $name,'server' => $server, 'theme' => 'default', 'path' => '',
'logo' => $logo, 'fancy' => true, 'language' => 'en', 'email' => $email, 'broughtby' => '',
'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => false,
'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl,
'shorturllength' => '30',
- 'friendica' => array(
+ 'friendica' => [
'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM,
'FRIENDICA_VERSION' => FRIENDICA_VERSION,
'DFRN_PROTOCOL_VERSION' => DFRN_PROTOCOL_VERSION,
'DB_UPDATE_VERSION' => DB_UPDATE_VERSION
- )
- ),
- );
+ ]
+ ],
+ ];
- return api_format_data('config', $type, array('config' => $config));
+ return api_format_data('config', $type, ['config' => $config]);
}
/// @TODO move to top of file or somewhere better
// liar
$fake_statusnet_version = "0.9.7";
- return api_format_data('version', $type, array('version' => $fake_statusnet_version));
+ return api_format_data('version', $type, ['version' => $fake_statusnet_version]);
}
/// @TODO move to top of file or somewhere better
return;
}
- $ids = array();
+ $ids = [];
foreach ($r as $rr) {
if ($stringify_ids) {
$ids[] = $rr['id'];
}
}
- return api_format_data("ids", $type, array('id' => $ids));
+ return api_format_data("ids", $type, ['id' => $ids]);
}
/**
$r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
$ret = api_format_messages($r[0], $recipient, $sender);
} else {
- $ret = array("error"=>$id);
+ $ret = ["error"=>$id];
}
- $data = array('direct_message'=>$ret);
+ $data = ['direct_message'=>$ret];
switch ($type) {
case "atom":
$uid = $user_info['uid'];
// error if no id or parenturi specified (for clients posting parent-uri as well)
if ($verbose == "true" && ($id == 0 || $parenturi == "")) {
- $answer = array('result' => 'error', 'message' => 'message id or parenturi not specified');
- return api_format_data("direct_messages_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'message id or parenturi not specified'];
+ return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
}
// BadRequestException if no id specified (for clients using Twitter API)
// error message if specified id is not in database
if (!DBM::is_result($r)) {
if ($verbose == "true") {
- $answer = array('result' => 'error', 'message' => 'message id not in database');
- return api_format_data("direct_messages_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'message id not in database'];
+ return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
}
/// @todo BadRequestException ok for Twitter API clients?
throw new BadRequestException('message id not in database');
if ($verbose == "true") {
if ($result) {
// return success
- $answer = array('result' => 'ok', 'message' => 'message deleted');
- return api_format_data("direct_message_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'ok', 'message' => 'message deleted'];
+ return api_format_data("direct_message_delete", $type, ['$result' => $answer]);
} else {
- $answer = array('result' => 'error', 'message' => 'unknown error');
- return api_format_data("direct_messages_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'unknown error'];
+ return api_format_data("direct_messages_delete", $type, ['$result' => $answer]);
}
}
/// @todo return JSON data like Twitter API not yet implemented
intval($count)
);
if ($verbose == "true" && !DBM::is_result($r)) {
- $answer = array('result' => 'error', 'message' => 'no mails available');
- return api_format_data("direct_messages_all", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'no mails available'];
+ return api_format_data("direct_messages_all", $type, ['$result' => $answer]);
}
- $ret = array();
+ $ret = [];
foreach ($r as $item) {
if ($box == "inbox" || $item['from-url'] != $profile_url) {
$recipient = $user_info;
}
- $data = array('direct_message' => $ret);
+ $data = ['direct_message' => $ret];
switch ($type) {
case "atom":
case "rss":
}
// now let's delete all photos from the album
- $result = dba::delete('photo', array('uid' => api_user(), 'album' => $album));
+ $result = dba::delete('photo', ['uid' => api_user(), 'album' => $album]);
// return success of deletion or error message
if ($result) {
- $answer = array('result' => 'deleted', 'message' => 'album `' . $album . '` with all containing photos has been deleted.');
- return api_format_data("photoalbum_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'deleted', 'message' => 'album `' . $album . '` with all containing photos has been deleted.'];
+ return api_format_data("photoalbum_delete", $type, ['$result' => $answer]);
} else {
throw new InternalServerErrorException("unknown error - deleting from database failed");
}
// return success of updating or error message
if ($result) {
- $answer = array('result' => 'updated', 'message' => 'album `' . $album . '` with all containing photos has been renamed to `' . $album_new . '`.');
- return api_format_data("photoalbum_update", $type, array('$result' => $answer));
+ $answer = ['result' => 'updated', 'message' => 'album `' . $album . '` with all containing photos has been renamed to `' . $album_new . '`.'];
+ return api_format_data("photoalbum_update", $type, ['$result' => $answer]);
} else {
throw new InternalServerErrorException("unknown error - updating in database failed");
}
WHERE `uid` = %d AND `album` != 'Contact Photos' GROUP BY `resource-id`",
intval(local_user())
);
- $typetoext = array(
+ $typetoext = [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif'
- );
- $data = array('photo'=>array());
+ ];
+ $data = ['photo'=>[]];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
- $photo = array();
+ $photo = [];
$photo['id'] = $rr['resource-id'];
$photo['album'] = $rr['album'];
$photo['filename'] = $rr['filename'];
$photo['desc'] = $rr['desc'];
if ($type == "xml") {
- $data['photo'][] = array("@attributes" => $photo, "1" => $thumb);
+ $data['photo'][] = ["@attributes" => $photo, "1" => $thumb];
} else {
$photo['thumb'] = $thumb;
$data['photo'][] = $photo;
// return success of updating or error message
if ($result) {
- $answer = array('result' => 'updated', 'message' => 'Image id `' . $photo_id . '` has been updated.');
- return api_format_data("photo_update", $type, array('$result' => $answer));
+ $answer = ['result' => 'updated', 'message' => 'Image id `' . $photo_id . '` has been updated.'];
+ return api_format_data("photo_update", $type, ['$result' => $answer]);
} else {
if ($nothingtodo) {
- $answer = array('result' => 'cancelled', 'message' => 'Nothing to update for image id `' . $photo_id . '`.');
- return api_format_data("photo_update", $type, array('$result' => $answer));
+ $answer = ['result' => 'cancelled', 'message' => 'Nothing to update for image id `' . $photo_id . '`.'];
+ return api_format_data("photo_update", $type, ['$result' => $answer]);
}
throw new InternalServerErrorException("unknown error - update photo entry in database failed");
}
throw new BadRequestException("photo not available");
}
// now we can perform on the deletion of the photo
- $result = dba::delete('photo', array('uid' => api_user(), 'resource-id' => $photo_id));
+ $result = dba::delete('photo', ['uid' => api_user(), 'resource-id' => $photo_id]);
// return success of deletion or error message
if ($result) {
// to the user and the contacts of the users (drop_items() do all the necessary magic to avoid orphans in database and federate deletion)
drop_item($photo_item[0]['id'], false);
- $answer = array('result' => 'deleted', 'message' => 'photo with id `' . $photo_id . '` has been deleted from server.');
- return api_format_data("photo_delete", $type, array('$result' => $answer));
+ $answer = ['result' => 'deleted', 'message' => 'photo with id `' . $photo_id . '` has been deleted from server.'];
+ return api_format_data("photo_delete", $type, ['$result' => $answer]);
} else {
throw new InternalServerErrorException("unknown error on deleting photo from database table");
}
$uri = item_new_uri(get_app()->get_hostname(), intval(api_user()));
$owner_record = q("SELECT * FROM `contact` WHERE `uid`= %d AND `self` LIMIT 1", intval(api_user()));
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uid'] = intval(api_user());
$arr['uri'] = $uri;
$arr['visible'] = $visibility;
$arr['origin'] = 1;
- $typetoext = array(
+ $typetoext = [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif'
- );
+ ];
// adds link to the thumbnail scale photo
$arr['body'] = '[url=' . System::baseUrl() . '/photos/' . $owner_record[0]['nick'] . '/image/' . $hash . ']'
$scale_sql
);
- $typetoext = array(
+ $typetoext = [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif'
- );
+ ];
// prepare output data for photo
if (DBM::is_result($r)) {
- $data = array('photo' => $r[0]);
+ $data = ['photo' => $r[0]];
$data['photo']['id'] = $data['photo']['resource-id'];
if ($scale !== false) {
$data['photo']['data'] = base64_encode($data['photo']['data']);
unset($data['photo']['datasize']); //needed only with scale param
}
if ($type == "xml") {
- $data['photo']['links'] = array();
+ $data['photo']['links'] = [];
for ($k = intval($data['photo']['minscale']); $k <= intval($data['photo']['maxscale']); $k++) {
- $data['photo']['links'][$k . ":link"]["@attributes"] = array("type" => $data['photo']['type'],
+ $data['photo']['links'][$k . ":link"]["@attributes"] = ["type" => $data['photo']['type'],
"scale" => $k,
- "href" => System::baseUrl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']]);
+ "href" => System::baseUrl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']]];
}
} else {
- $data['photo']['link'] = array();
+ $data['photo']['link'] = [];
// when we have profile images we could have only scales from 4 to 6, but index of array always needs to start with 0
$i = 0;
for ($k = intval($data['photo']['minscale']); $k <= intval($data['photo']['maxscale']); $k++) {
// prepare output of comments
$commentData = api_format_items($r, api_get_user(get_app()), false, $type);
- $comments = array();
+ $comments = [];
if ($type == "xml") {
$k = 0;
foreach ($commentData as $comment) {
*/
function api_in_reply_to($item)
{
- $in_reply_to = array();
+ $in_reply_to = [];
$in_reply_to['status_id'] = null;
$in_reply_to['user_id'] = null;
*/
function api_best_nickname(&$contacts)
{
- $best_contact = array();
+ $best_contact = [];
if (count($contact) == 0) {
return;
foreach ($contacts as $contact) {
if ($contact["network"] == "") {
$contact["network"] = "dfrn";
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
if (sizeof($best_contact) == 0) {
foreach ($contacts as $contact) {
if ($contact["network"] == "dfrn") {
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
}
if (sizeof($best_contact) == 0) {
foreach ($contacts as $contact) {
if ($contact["network"] == "dspr") {
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
}
if (sizeof($best_contact) == 0) {
foreach ($contacts as $contact) {
if ($contact["network"] == "stat") {
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
}
if (sizeof($best_contact) == 0) {
foreach ($contacts as $contact) {
if ($contact["network"] == "pump") {
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
}
if (sizeof($best_contact) == 0) {
foreach ($contacts as $contact) {
if ($contact["network"] == "twit") {
- $best_contact = array($contact);
+ $best_contact = [$contact];
}
}
}
if (sizeof($best_contact) == 1) {
$contacts = $best_contact;
} else {
- $contacts = array($contacts[0]);
+ $contacts = [$contacts[0]];
}
}
// loop through all groups and retrieve all members for adding data in the user array
foreach ($r as $rr) {
$members = Contact::getByGroupId($rr['id']);
- $users = array();
+ $users = [];
if ($type == "xml") {
$user_element = "users";
$users[] = $user;
}
}
- $grps[] = array('name' => $rr['name'], 'gid' => $rr['id'], $user_element => $users);
+ $grps[] = ['name' => $rr['name'], 'gid' => $rr['id'], $user_element => $users];
}
- return api_format_data("groups", $type, array('group' => $grps));
+ return api_format_data("groups", $type, ['group' => $grps]);
}
api_register_func('api/friendica/group_show', 'api_friendica_group_show', true);
$ret = Group::removeByName($uid, $name);
if ($ret) {
// return success
- $success = array('success' => $ret, 'gid' => $gid, 'name' => $name, 'status' => 'deleted', 'wrong users' => array());
- return api_format_data("group_delete", $type, array('result' => $success));
+ $success = ['success' => $ret, 'gid' => $gid, 'name' => $name, 'status' => 'deleted', 'wrong users' => []];
+ return api_format_data("group_delete", $type, ['result' => $success]);
} else {
throw new BadRequestException('other API error');
}
// add members
$erroraddinguser = false;
- $errorusers = array();
+ $errorusers = [];
foreach ($users as $user) {
$cid = $user['cid'];
// check if user really exists as contact
// return success message incl. missing users in array
$status = ($erroraddinguser ? "missing user" : ($reactivate_group ? "reactivated" : "ok"));
- $success = array('success' => true, 'gid' => $gid, 'name' => $name, 'status' => $status, 'wrong users' => $errorusers);
- return api_format_data("group_create", $type, array('result' => $success));
+ $success = ['success' => true, 'gid' => $gid, 'name' => $name, 'status' => $status, 'wrong users' => $errorusers];
+ return api_format_data("group_create", $type, ['result' => $success]);
}
api_register_func('api/friendica/group_create', 'api_friendica_group_create', true, API_METHOD_POST);
// add members
$erroraddinguser = false;
- $errorusers = array();
+ $errorusers = [];
foreach ($users as $user) {
$cid = $user['cid'];
// check if user really exists as contact
// return success message incl. missing users in array
$status = ($erroraddinguser ? "missing user" : "ok");
- $success = array('success' => true, 'gid' => $gid, 'name' => $name, 'status' => $status, 'wrong users' => $errorusers);
- return api_format_data("group_update", $type, array('result' => $success));
+ $success = ['success' => true, 'gid' => $gid, 'name' => $name, 'status' => $status, 'wrong users' => $errorusers];
+ return api_format_data("group_update", $type, ['result' => $success]);
}
api_register_func('api/friendica/group_update', 'api_friendica_group_update', true, API_METHOD_POST);
} else {
$ok = "ok";
}
- return api_format_data('ok', $type, array('ok' => $ok));
+ return api_format_data('ok', $type, ['ok' => $ok]);
} else {
throw new BadRequestException('Error adding activity');
}
}
$nm = new NotificationsManager();
- $notes = $nm->getAll(array(), "+seen -date", 50);
+ $notes = $nm->getAll([], "+seen -date", 50);
if ($type == "xml") {
- $xmlnotes = array();
+ $xmlnotes = [];
foreach ($notes as $note) {
- $xmlnotes[] = array("@attributes" => $note);
+ $xmlnotes[] = ["@attributes" => $note];
}
$notes = $xmlnotes;
}
- return api_format_data("notes", $type, array('note' => $notes));
+ return api_format_data("notes", $type, ['note' => $notes]);
}
/**
// we found the item, return it to the user
$user_info = api_get_user($a);
$ret = api_format_items($r, $user_info, false, $type);
- $data = array('status' => $ret);
+ $data = ['status' => $ret];
return api_format_data("status", $type, $data);
}
// the item can't be found, but we set the note as seen, so we count this as a success
}
- return api_format_data('result', $type, array('result' => "success"));
+ return api_format_data('result', $type, ['result' => "success"]);
}
/// @TODO move to top of file or somewhere better
// return error if id is zero
if ($id == "") {
- $answer = array('result' => 'error', 'message' => 'message id not specified');
- return api_format_data("direct_messages_setseen", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'message id not specified'];
+ return api_format_data("direct_messages_setseen", $type, ['$result' => $answer]);
}
// get data of the specified message id
// error message if specified id is not in database
if (!DBM::is_result($r)) {
- $answer = array('result' => 'error', 'message' => 'message id not in database');
- return api_format_data("direct_messages_setseen", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'message id not in database'];
+ return api_format_data("direct_messages_setseen", $type, ['$result' => $answer]);
}
// update seen indicator
if ($result) {
// return success
- $answer = array('result' => 'ok', 'message' => 'message set to seen');
- return api_format_data("direct_message_setseen", $type, array('$result' => $answer));
+ $answer = ['result' => 'ok', 'message' => 'message set to seen'];
+ return api_format_data("direct_message_setseen", $type, ['$result' => $answer]);
} else {
- $answer = array('result' => 'error', 'message' => 'unknown error');
- return api_format_data("direct_messages_setseen", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'unknown error'];
+ return api_format_data("direct_messages_setseen", $type, ['$result' => $answer]);
}
}
// error if no searchstring specified
if ($searchstring == "") {
- $answer = array('result' => 'error', 'message' => 'searchstring not specified');
- return api_format_data("direct_messages_search", $type, array('$result' => $answer));
+ $answer = ['result' => 'error', 'message' => 'searchstring not specified'];
+ return api_format_data("direct_messages_search", $type, ['$result' => $answer]);
}
// get data for the specified searchstring
// message if nothing was found
if (!DBM::is_result($r)) {
- $success = array('success' => false, 'search_results' => 'problem with query');
+ $success = ['success' => false, 'search_results' => 'problem with query'];
} elseif (count($r) == 0) {
- $success = array('success' => false, 'search_results' => 'nothing found');
+ $success = ['success' => false, 'search_results' => 'nothing found'];
} else {
- $ret = array();
+ $ret = [];
foreach ($r as $item) {
if ($box == "inbox" || $item['from-url'] != $profile_url) {
$recipient = $user_info;
$ret[] = api_format_messages($item, $recipient, $sender);
}
- $success = array('success' => true, 'search_results' => $ret);
+ $success = ['success' => true, 'search_results' => $ret];
}
- return api_format_data("direct_message_search", $type, array('$result' => $success));
+ return api_format_data("direct_message_search", $type, ['$result' => $success]);
}
/// @TODO move to top of file or somewhere better
$profile = api_format_items_profiles($rr);
// select all users from contact table, loop and prepare standard return for user data
- $users = array();
+ $users = [];
$r = q(
"SELECT `id`, `nurl` FROM `contact` WHERE `uid`= %d AND `profile-id` = %d",
intval(api_user()),
// return settings, authenticated user and profiles data
$self = q("SELECT `nurl` FROM `contact` WHERE `uid`= %d AND `self` LIMIT 1", intval(api_user()));
- $result = array('multi_profiles' => $multi_profiles ? true : false,
+ $result = ['multi_profiles' => $multi_profiles ? true : false,
'global_dir' => $directory,
'friendica_owner' => api_get_user($a, $self[0]['nurl']),
- 'profiles' => $profiles);
- return api_format_data("friendica_profiles", $type, array('$result' => $result));
+ 'profiles' => $profiles];
+ return api_format_data("friendica_profiles", $type, ['$result' => $result]);
}
api_register_func('api/friendica/profile/show', 'api_friendica_profile_show', true, API_METHOD_GET);
*/
function api_saved_searches_list($type)
{
- $terms = dba::select('search', array('id', 'term'), array('uid' => local_user()));
+ $terms = dba::select('search', ['id', 'term'], ['uid' => local_user()]);
- $result = array();
+ $result = [];
while ($term = $terms->fetch()) {
- $result[] = array(
+ $result[] = [
'name' => $term['term'],
'query' => $term['term'],
'id_str' => $term['id'],
'id' => intval($term['id'])
- );
+ ];
}
dba::close($terms);
- return api_format_data("terms", $type, array('terms' => $result));
+ return api_format_data("terms", $type, ['terms' => $result]);
}
/// @TODO move to top of file or somewhere better
$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
// The parser cannot handle paragraphs correctly
- $s = str_replace(array('</p>', '<p>', '<p dir="ltr">'), array('<br>', '<br>', '<br>'), $s);
+ $s = str_replace(['</p>', '<p>', '<p dir="ltr">'], ['<br>', '<br>', '<br>'], $s);
// Escaping the hash tags
$s = preg_replace('/\#([^\s\#])/', '#$1', $s);
}
// mask some special HTML chars from conversation to markdown
- $Text = str_replace(array('<', '>', '&'), array('&_lt_;', '&_gt_;', '&_amp_;'), $Text);
+ $Text = str_replace(['<', '>', '&'], ['&_lt_;', '&_gt_;', '&_amp_;'], $Text);
// If a link is followed by a quote then there should be a newline before it
// Maybe we should make this newline at every time before a quote.
- $Text = str_replace(array("</a><blockquote>"), array("</a><br><blockquote>"), $Text);
+ $Text = str_replace(["</a><blockquote>"], ["</a><br><blockquote>"], $Text);
$stamp1 = microtime(true);
$Text = $converter->convert($Text);
// unmask the special chars back to HTML
- $Text = str_replace(array('&\_lt\_;', '&\_gt\_;', '&\_amp\_;'), array('<', '>', '&'), $Text);
+ $Text = str_replace(['&\_lt\_;', '&\_gt\_;', '&\_amp\_;'], ['<', '>', '&'], $Text);
$a->save_timestamp($stamp1, "parser");
// Libertree has a problem with escaped hashtags.
- $Text = str_replace(array('\#'), array('#'), $Text);
+ $Text = str_replace(['\#'], ['#'], $Text);
// Remove any leading or trailing whitespace, as this will mess up
// the Diaspora signature verification and cause the item to disappear
if (isset($data["title"])) {
$data["title"] = strip_tags($data["title"]);
- $data["title"] = str_replace(array("http://", "https://"), "", $data["title"]);
+ $data["title"] = str_replace(["http://", "https://"], "", $data["title"]);
}
if (((strpos($data["text"], "[img=") !== false) || (strpos($data["text"], "[img]") !== false) || Config::get('system', 'always_show_preview')) && ($data["image"] != "")) {
return false;
}
- $res = array( 'start' => $start_pos, 'end' => $end_pos );
+ $res = [ 'start' => $start_pos, 'end' => $end_pos ];
return $res;
}
return false;
}
- $res = array(
- 'start' => array(
+ $res = [
+ 'start' => [
'open' => $start_open,
'close' => $start_close
- ),
- 'end' => array(
+ ],
+ 'end' => [
'open' => $end_open,
'close' => $end_open + strlen('[/' . $name . ']')
- ),
- );
+ ],
+ ];
if ($start_equal !== false) {
$res['start']['equal'] = $start_equal + 1;
function bb_extract_images($body) {
- $saved_image = array();
+ $saved_image = [];
$orig_body = $body;
$new_body = '';
$new_body = $new_body . $orig_body;
- return array('body' => $new_body, 'images' => $saved_image);
+ return ['body' => $new_body, 'images' => $saved_image];
}
function bb_replace_images($body, $images) {
$avatar = proxy_url($avatar, false, PROXY_SIZE_THUMB);
$tpl = get_markup_template('shared_content.tpl');
- $text .= replace_macros($tpl, array(
+ $text .= replace_macros($tpl, [
'$profile' => $profile,
'$avatar' => $avatar,
'$author' => $author,
'$link' => $link,
'$posted' => $posted,
'$content' => trim($share[3])
- ));
+ ]);
}
break;
}
$xpath = new DomXPath($doc);
$list = $xpath->query("//meta[@name]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length)
foreach ($node->attributes as $attribute)
$xpath = new DomXPath($doc);
$list = $xpath->query("//meta[@name]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length)
foreach ($node->attributes as $attribute)
// removing multiplicated newlines
if (Config::get("system", "remove_multiplicated_lines")) {
- $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
- "\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n");
- $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",
- "[h1]", "[/h1]", "[h2]", "[/h2]", "[h3]", "[/h3]", "[h4]", "[/h4]", "[h5]", "[/h5]", "[h6]", "[/h6]");
+ $search = ["\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
+ "\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n"];
+ $replace = ["\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",
+ "[h1]", "[/h1]", "[h2]", "[/h2]", "[h3]", "[/h3]", "[h4]", "[/h4]", "[h5]", "[/h5]", "[h6]", "[/h6]"];
do {
$oldtext = $Text;
$Text = str_replace($search, $replace, $Text);
// Handle attached links or videos
$Text = bb_attachment($Text, $simplehtml, $tryoembed);
- $Text = str_replace(array("\r","\n"), array('<br />', '<br />'), $Text);
+ $Text = str_replace(["\r","\n"], ['<br />', '<br />'], $Text);
if ($preserve_nl) {
- $Text = str_replace(array("\n", "\r"), array('', ''), $Text);
+ $Text = str_replace(["\n", "\r"], ['', ''], $Text);
}
// Remove all hashtag addresses
- if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, array(3, 7))) {
+ if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, [3, 7])) {
$Text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
} elseif ($simplehtml == 3) {
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
$Text = preg_replace("/#\[url\=[$URLSearchString]*\]\^\[\/url\]\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/i",
"[bookmark=$1]$2[/bookmark]", $Text);
- if (in_array($simplehtml, array(2, 6, 7, 8, 9))) {
+ if (in_array($simplehtml, [2, 6, 7, 8, 9])) {
$Text = preg_replace_callback("/([^#@!])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", "bb_expand_links", $Text);
//$Text = preg_replace("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $Text);
$Text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]',$Text);
$Text = preg_replace('/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism', '<$1$2=$3&$4>', $Text);
// sanitizes src attributes (http and redir URLs for displaying in a web page, cid used for inline images in emails)
- static $allowed_src_protocols = array('http', 'redir', 'cid');
+ static $allowed_src_protocols = ['http', 'redir', 'cid'];
$Text = preg_replace('#<([^>]*?)(src)="(?!' . implode('|', $allowed_src_protocols) . ')(.*?)"(.*?)>#ism',
'<$1$2=""$4 data-original-src="$3" class="invalid-src" title="' . t('Invalid source protocol') . '">', $Text);
// sanitize href attributes (only whitelisted protocols URLs)
// default value for backward compatibility
- $allowed_link_protocols = Config::get('system', 'allowed_link_protocols', array('ftp', 'mailto', 'gopher', 'cid'));
+ $allowed_link_protocols = Config::get('system', 'allowed_link_protocols', ['ftp', 'mailto', 'gopher', 'cid']);
// Always allowed protocol even if config isn't set or not including it
$allowed_link_protocols[] = 'http';
@$doc->loadHTML($encoding.$doctype."<html><body>".$Text."</body></html>");
$doc->encoding = 'UTF-8';
$Text = $doc->saveHTML();
- $Text = str_replace(array("<html><body>", "</body></html>", $doctype, $encoding), array("", "", "", ""), $Text);
+ $Text = str_replace(["<html><body>", "</body></html>", $doctype, $encoding], ["", "", "", ""], $Text);
$Text = str_replace('<br></li>', '</li>', $Text);
*/
function fetch_abstract($text, $addon = "") {
$abstract = "";
- $abstracts = array();
+ $abstracts = [];
$addon = strtolower($addon);
if (preg_match_all("/\[abstract=(.*?)\](.*?)\[\/abstract\]/ism",$text, $results, PREG_SET_ORDER))
function item_extract_images($body) {
- $saved_image = array();
+ $saved_image = [];
$orig_body = $body;
$new_body = '';
$new_body = $new_body . $orig_body;
- return array('body' => $new_body, 'images' => $saved_image);
+ return ['body' => $new_body, 'images' => $saved_image];
}
function item_redir_and_replace_images($body, $images, $cid) {
default:
if ($obj['resource-id']) {
$post_type = t('photo');
- $m = array();
+ $m = [];
preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
} else {
default:
if ($obj['resource-id']) {
$post_type = t('photo');
- $m=array(); preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
+ $m=[]; preg_match("/\[url=([^]]*)\]/", $obj['body'], $m);
$rr['plink'] = $m[1];
} else {
$post_type = t('status');
* likes (etc.) can apply to other things besides posts. Check if they are post children,
* in which case we handle them specially
*/
- $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE);
+ $hidden_activities = [ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE];
foreach ($hidden_activities as $act) {
if (activity_match($item['verb'], $act)) {
return false;
$_SESSION['return_url'] = $a->query_string;
}
- $cb = array('items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview);
+ $cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
call_hooks('conversation_start',$cb);
$items = $cb['items'];
- $conv_responses = array(
- 'like' => array('title' => t('Likes','title')), 'dislike' => array('title' => t('Dislikes','title')),
- 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title'))
- );
+ $conv_responses = [
+ 'like' => ['title' => t('Likes','title')], 'dislike' => ['title' => t('Dislikes','title')],
+ 'attendyes' => ['title' => t('Attending','title')], 'attendno' => ['title' => t('Not attending','title')], 'attendmaybe' => ['title' => t('Might attend','title')]
+ ];
// array with html for each thread (parent+comments)
- $threads = array();
+ $threads = [];
$threadsid = -1;
$page_template = get_markup_template("conversation.tpl");
$community_readonly = false;
$writable = true;
} else {
- $writable = ($items[0]['uid'] == 0) && in_array($items[0]['network'], array(NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN));
+ $writable = ($items[0]['uid'] == 0) && in_array($items[0]['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_DFRN]);
}
} else {
$writable = false;
$profile_name = $item['author-link'];
}
- $tags = array();
- $hashtags = array();
- $mentions = array();
+ $tags = [];
+ $hashtags = [];
+ $mentions = [];
$searchpath = System::baseUrl()."/search?tag=";
- $taglist = dba::select('term', array('type', 'term', 'url'),
- array("`otype` = ? AND `oid` = ? AND `type` IN (?, ?)", TERM_OBJ_POST, $item['id'], TERM_HASHTAG, TERM_MENTION),
- array('order' => array('tid')));
+ $taglist = dba::select('term', ['type', 'term', 'url'],
+ ["`otype` = ? AND `oid` = ? AND `type` IN (?, ?)", TERM_OBJ_POST, $item['id'], TERM_HASHTAG, TERM_MENTION],
+ ['order' => ['tid']]);
while ($tag = dba::fetch($taglist)) {
if ($tag["url"] == "") {
}
}
- $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
+ $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
call_hooks('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
$dropping = false;
}
- $drop = array(
+ $drop = [
'dropping' => $dropping,
'pagedrop' => $page_dropping,
'select' => t('Select'),
'delete' => t('Delete'),
- );
+ ];
$star = false;
$isstarred = "unstarred";
$item['item_network'] = $item['network'];
}
- $tmp_item = array(
+ $tmp_item = [
'template' => $tpl,
'id' => (($preview) ? 'P0' : $item['item_id']),
'guid' => (($preview) ? 'Q0' : $item['guid']),
'like' => '',
'dislike' => '',
'comment' => '',
- 'conv' => (($preview) ? '' : array('href'=> 'display/'.$item['guid'], 'title'=> t('View in context'))),
+ 'conv' => (($preview) ? '' : ['href'=> 'display/'.$item['guid'], 'title'=> t('View in context')]),
'previewing' => $previewing,
'wait' => t('Please wait'),
'thread_level' => 1,
- );
+ ];
- $arr = array('item' => $item, 'output' => $tmp_item);
+ $arr = ['item' => $item, 'output' => $tmp_item];
call_hooks('display_item', $arr);
$threads[$threadsid]['id'] = $item['item_id'];
$threads[$threadsid]['network'] = $item['item_network'];
- $threads[$threadsid]['items'] = array($arr['output']);
+ $threads[$threadsid]['items'] = [$arr['output']];
}
} else {
$threads = $conv->getTemplateData($conv_responses);
if (!$threads) {
logger('[ERROR] conversation : Failed to get template data.', LOGGER_DEBUG);
- $threads = array();
+ $threads = [];
}
}
}
- $o = replace_macros($page_template, array(
+ $o = replace_macros($page_template, [
'$baseurl' => System::baseUrl($ssl_state),
'$return_path' => $a->query_string,
'$live_update' => $live_update_div,
'$user' => $a->user,
'$threads' => $threads,
'$dropping' => ($page_dropping && Feature::isEnabled(local_user(), 'multi_delete') ? t('Delete Selected Items') : False),
- ));
+ ]);
return $o;
}
function community_add_items($parents) {
$max_comments = Config::get("system", "max_comments", 100);
- $items = array();
+ $items = [];
foreach ($parents AS $parent) {
$thread_items = dba::p(item_query()." AND `item`.`uid` = ?
}
}
if (!$parent_found) {
- $comments = array();
+ $comments = [];
}
}
$contact_url = 'contacts/' . $cid;
$posts_link = 'contacts/' . $cid . '/posts';
- if (in_array($network, array(NETWORK_DFRN, NETWORK_DIASPORA))) {
+ if (in_array($network, [NETWORK_DFRN, NETWORK_DIASPORA])) {
$pm_url = 'message/new/' . $cid;
}
}
if (local_user()) {
- $menu = array(
+ $menu = [
t('Follow Thread') => $sub_link,
t('View Status') => $status_link,
t('View Profile') => $profile_link,
t('Network Posts') => $posts_link,
t('View Contact') => $contact_url,
t('Send PM') => $pm_url
- );
+ ];
if ($network == NETWORK_DFRN) {
$menu[t("Poke")] = $poke_link;
}
if ((($cid == 0) || ($rel == CONTACT_IS_FOLLOWER)) &&
- in_array($item['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) {
+ in_array($item['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$menu[t('Connect/Follow')] = 'follow?url=' . urlencode($item['author-link']);
}
} else {
- $menu = array(t('View Profile') => $item['author-link']);
+ $menu = [t('View Profile') => $item['author-link']];
}
- $args = array('item' => $item, 'menu' => $menu);
+ $args = ['item' => $item, 'menu' => $menu];
call_hooks('item_photo_menu', $args);
if (! ((isset($conv_responses[$mode][$item['thr-parent'] . '-l']))
&& (is_array($conv_responses[$mode][$item['thr-parent'] . '-l'])))) {
- $conv_responses[$mode][$item['thr-parent'] . '-l'] = array();
+ $conv_responses[$mode][$item['thr-parent'] . '-l'] = [];
}
// only list each unique author once
}
$phrase .= EOL ;
- $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), array(
+ $o .= replace_macros(get_markup_template('voting_fakelink.tpl'), [
'$phrase' => $phrase,
'$type' => $type,
'$id' => $id
- ));
+ ]);
$o .= $expanded;
return $o;
{
$o = '';
- $geotag = x($x, 'allow_location') ? replace_macros(get_markup_template('jot_geotag.tpl'), array()) : '';
+ $geotag = x($x, 'allow_location') ? replace_macros(get_markup_template('jot_geotag.tpl'), []) : '';
$tpl = get_markup_template('jot-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$newpost' => 'true',
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$fileas' => t('Save to Folder:'),
'$whereareu' => t('Where are you right now?'),
'$delitems' => t('Delete item(s)?')
- ));
+ ]);
$tpl = get_markup_template('jot-end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$newpost' => 'true',
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$term' => t('Tag term:'),
'$fileas' => t('Save to Folder:'),
'$whereareu' => t('Where are you right now?')
- ));
+ ]);
$jotplugins = '';
call_hooks('jot_tool', $jotplugins);
$query_str = $a->query_string;
if (strpos($query_str, 'public=1') !== false) {
- $query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
+ $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
}
/*
// $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
$tpl = get_markup_template("jot.tpl");
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$return_path' => $query_str,
'$action' => 'item',
'$share' => defaults($x, 'button', t('Share')),
//jot nav tab (used in some themes)
'$message' => t('Message'),
'$browser' => t('Browser'),
- ));
+ ]);
if ($popup == true) {
/// @TODO Add type-hint
function get_responses($conv_responses, $response_verbs, $ob, $item) {
- $ret = array();
+ $ret = [];
foreach ($response_verbs as $v) {
- $ret[$v] = array();
+ $ret[$v] = [];
$ret[$v]['count'] = defaults($conv_responses[$v], $item['uri'], '');
$ret[$v]['list'] = defaults($conv_responses[$v], $item['uri'] . '-l', '');
$ret[$v]['self'] = defaults($conv_responses[$v], $item['uri'] . '-self', '0');
$options = str_replace('</select>','', $options);
$tpl = get_markup_template('field_select_raw.tpl');
- return replace_macros($tpl, array(
- '$field' => array($name, $label, $current, $help, $options),
- ));
+ return replace_macros($tpl, [
+ '$field' => [$name, $label, $current, $help, $options],
+ ]);
}
$age = ((intval($value)) ? age($value, $a->user["timezone"], $a->user["timezone"]) : "");
- $o = replace_macros(get_markup_template("field_input.tpl"), array(
- '$field' => array(
+ $o = replace_macros(get_markup_template("field_input.tpl"), [
+ '$field' => [
'dob',
t('Birthday:'),
$value,
(((intval($age)) > 0 ) ? t('Age: ') . $age : ""),
'',
'placeholder="' . t('YYYY-MM-DD or MM-DD') . '"'
- )
- ));
+ ]
+ ]);
/// @TODO Old-lost code?
// if ($dob && $dob > '0001-01-01')
$lang = substr(get_browser_language(), 0, 2);
// Check if the detected language is supported by the picker
- if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) {
+ if (!in_array($lang, ["ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"])) {
$lang = Config::get('system', 'language', 'en');
}
$readable_format = str_replace('i','MM',$readable_format);
$tpl = get_markup_template('field_input.tpl');
- $o .= replace_macros($tpl, array(
- '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'),
- ));
+ $o .= replace_macros($tpl, [
+ '$field' => [$id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'],
+ ]);
$o .= "<script type='text/javascript'>";
$o .= "\$(function () {var picker = \$('#id_$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
return t('less than a second ago');
}
- $a = array( 12 * 30 * 24 * 60 * 60 => array( t('year'), t('years')),
- 30 * 24 * 60 * 60 => array( t('month'), t('months')),
- 7 * 24 * 60 * 60 => array( t('week'), t('weeks')),
- 24 * 60 * 60 => array( t('day'), t('days')),
- 60 * 60 => array( t('hour'), t('hours')),
- 60 => array( t('minute'), t('minutes')),
- 1 => array( t('second'), t('seconds'))
- );
+ $a = [ 12 * 30 * 24 * 60 * 60 => [ t('year'), t('years')],
+ 30 * 24 * 60 * 60 => [ t('month'), t('months')],
+ 7 * 24 * 60 * 60 => [ t('week'), t('weeks')],
+ 24 * 60 * 60 => [ t('day'), t('days')],
+ 60 * 60 => [ t('hour'), t('hours')],
+ 60 => [ t('minute'), t('minutes')],
+ 1 => [ t('second'), t('seconds')]
+ ];
foreach ($a as $secs => $str) {
$d = $etime / $secs;
*/
function get_dim($y, $m) {
- $dim = array( 0,
+ $dim = [ 0,
31, 28, 31, 30, 31, 30,
- 31, 31, 30, 31, 30, 31);
+ 31, 31, 30, 31, 30, 31];
if ($m != 2) {
return $dim[$m];
function cal($y = 0, $m = 0, $links = null, $class = '')
{
// month table - start at 1 to match human usage.
- $mtab = array(' ',
+ $mtab = [' ',
'January', 'February', 'March',
'April' , 'May' , 'June',
'July' , 'August' , 'September',
'October', 'November', 'December'
- );
+ ];
$thisyear = datetime_convert('UTC', date_default_timezone_get(), 'now', 'Y');
$thismonth = datetime_convert('UTC', date_default_timezone_get(), 'now', 'm');
$m = intval($thismonth);
}
- $dn = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
+ $dn = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
$f = get_first_dim($y, $m);
$l = get_dim($y, $m);
$d = 1;
private static $errorno = 0;
private static $affected_rows = 0;
private static $in_transaction = false;
- private static $relation = array();
+ private static $relation = [];
public static function connect($serveraddr, $user, $pass, $db, $install = false) {
if (!is_null(self::$db)) {
}
// Only do the explain on "select", "update" and "delete"
- if (!in_array(strtolower(substr($query, 0, 6)), array("select", "update", "delete"))) {
+ if (!in_array(strtolower(substr($query, 0, 6)), ["select", "update", "delete"])) {
return;
}
* @return string The input SQL string modified if necessary.
*/
public static function clean_query($sql) {
- $search = array("\t", "\n", "\r", " ");
- $replace = array(' ', ' ', ' ', ' ');
+ $search = ["\t", "\n", "\r", " "];
+ $replace = [' ', ' ', ' ', ' '];
do {
$oldsql = $sql;
$sql = str_replace($search, $replace, $sql);
// Renumber the array keys to be sure that they fit
$i = 0;
- $args = array();
+ $args = [];
foreach ($params AS $param) {
// Avoid problems with some MySQL servers and boolean values. See issue #3645
if (is_bool($param)) {
// There are SQL statements that cannot be executed with a prepared statement
$parts = explode(' ', $orig_sql);
$command = strtolower($parts[0]);
- $can_be_prepared = in_array($command, array('select', 'update', 'insert', 'delete'));
+ $can_be_prepared = in_array($command, ['select', 'update', 'insert', 'delete']);
// The fallback routine is called as well when there are no arguments
if (!$can_be_prepared || (count($args) == 0)) {
}
$params = '';
- $values = array();
+ $values = [];
foreach ($args AS $param => $value) {
if (is_int($args[$param])) {
$params .= 'i';
if (count($values) > 0) {
array_unshift($values, $params);
- call_user_func_array(array($stmt, 'bind_param'), $values);
+ call_user_func_array([$stmt, 'bind_param'], $values);
}
if (!$stmt->execute()) {
return false;
}
- $fields = array();
+ $fields = [];
$array_element = each($condition);
$array_key = $array_element['key'];
if (!is_int($array_key)) {
- $fields = array($array_key);
+ $fields = [$array_key];
}
$stmt = self::select($table, $fields, $condition, ['limit' => 1]);
// This code works, but is slow
// Bind the result to a result array
- $cols = array();
+ $cols = [];
- $cols_num = array();
+ $cols_num = [];
for ($x = 0; $x < $stmt->field_count; $x++) {
$cols[] = &$cols_num[$x];
}
- call_user_func_array(array($stmt, 'bind_result'), $cols);
+ call_user_func_array([$stmt, 'bind_result'], $cols);
if (!$stmt->fetch()) {
return false;
$result = $stmt->result_metadata();
$fields = $result->fetch_fields();
- $columns = array();
+ $columns = [];
foreach ($cols_num AS $param => $col) {
$columns[$fields[$param]->name] = $col;
}
if ((count($conditions) == 1) && ($field == array_keys($conditions)[0])) {
foreach ($rel_def AS $rel_table => $rel_fields) {
foreach ($rel_fields AS $rel_field) {
- $retval = self::delete($rel_table, array($rel_field => array_values($conditions)[0]), true, $callstack);
+ $retval = self::delete($rel_table, [$rel_field => array_values($conditions)[0]], true, $callstack);
$commands = array_merge($commands, $retval);
}
}
$callstack[$qkey] = true;
// Fetch all rows that are to be deleted
- $data = self::select($table, array($field), $conditions);
+ $data = self::select($table, [$field], $conditions);
while ($row = self::fetch($data)) {
// Now we accumulate the delete commands
- $retval = self::delete($table, array($field => $row[$field]), true, $callstack);
+ $retval = self::delete($table, [$field => $row[$field]], true, $callstack);
$commands = array_merge($commands, $retval);
}
*
* @return boolean was the update successfull?
*/
- public static function update($table, $fields, $condition, $old_fields = array()) {
+ public static function update($table, $fields, $condition, $old_fields = []) {
if (empty($table) || empty($fields) || empty($condition)) {
logger('Table, fields and condition have to be set');
$values = array_merge($condition, $fields);
return self::insert($table, $values, $do_insert);
}
- $old_fields = array();
+ $old_fields = [];
}
}
return $stmt;
}
- $data = array();
+ $data = [];
while ($row = self::fetch($stmt)) {
$data[] = $row;
}
['uid' => $params['uid']]);
// There is no need to create notifications for forum accounts
- if (!DBM::is_result($user) || in_array($user["page-flags"], array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
+ if (!DBM::is_result($user) || in_array($user["page-flags"], [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
return;
}
}
$subject .= " (".$nickname."@".$hostname.")";
- $h = array(
+ $h = [
'params' => $params,
'subject' => $subject,
'preamble' => $preamble,
'tsitelink' => $tsitelink,
'hsitelink' => $hsitelink,
'itemlink' => $itemlink
- );
+ ];
call_hooks('enotify', $h);
} while ($dups == true);
/// @TODO One statement is enough
- $datarray = array();
+ $datarray = [];
$datarray['hash'] = $hash;
$datarray['name'] = $params['source_name'];
$datarray['name_cache'] = strip_tags(bbcode($params['source_name']));
);
if ($p && (count($p) > 1)) {
for ($d = 1; $d < count($p); $d ++) {
- dba::delete('notify', array('id' => $p[$d]['id']));
+ dba::delete('notify', ['id' => $p[$d]['id']]);
}
// only continue on if we stored the first one
}
$itemlink = System::baseUrl().'/notify/view/'.$notify_id;
- $msg = replace_macros($epreamble, array('$itemlink' => $itemlink));
+ $msg = replace_macros($epreamble, ['$itemlink' => $itemlink]);
$msg_cache = format_notification_message($datarray['name_cache'], strip_tags(bbcode($msg)));
q("UPDATE `notify` SET `msg` = '%s', `msg_cache` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc($msg),
}
// textversion keeps linebreaks
- $textversion = strip_tags(str_replace("<br>", "\n", html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n",
+ $textversion = strip_tags(str_replace("<br>", "\n", html_entity_decode(bbcode(stripslashes(str_replace(["\\r\\n", "\\r", "\\n"], "\n",
$body))),ENT_QUOTES, 'UTF-8')));
- $htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n\\n", "\\n"),
+ $htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(["\\r\\n", "\\r", "\\n\\n", "\\n"],
"<br />\n", $body))), ENT_QUOTES, 'UTF-8');
- $datarray = array();
+ $datarray = [];
$datarray['banner'] = $banner;
$datarray['product'] = $product;
$datarray['preamble'] = $preamble;
// load the template for private message notifications
$tpl = get_markup_template('email_notify_html.tpl');
- $email_html_body = replace_macros($tpl, array(
+ $email_html_body = replace_macros($tpl, [
'$banner' => $datarray['banner'],
'$product' => $datarray['product'],
'$preamble' => str_replace("\n", "<br>\n", $datarray['preamble']),
'$title' => $datarray['title'],
'$htmlversion' => $datarray['htmlversion'],
'$content_allowed' => $content_allowed,
- ));
+ ]);
// load the template for private message notifications
$tpl = get_markup_template('email_notify_text.tpl');
- $email_text_body = replace_macros($tpl, array(
+ $email_text_body = replace_macros($tpl, [
'$banner' => $datarray['banner'],
'$product' => $datarray['product'],
'$preamble' => $datarray['preamble'],
'$title' => $datarray['title'],
'$textversion' => $datarray['textversion'],
'$content_allowed' => $content_allowed,
- ));
+ ]);
// use the Emailer class to send the message
return Emailer::send(
- array(
+ [
'uid' => $params['uid'],
'fromName' => $sender_name,
'fromEmail' => $sender_email,
'messageSubject' => $datarray['subject'],
'htmlVersion' => $email_html_body,
'textVersion' => $email_text_body,
- 'additionalMailHeader' => $datarray['headers'])
+ 'additionalMailHeader' => $datarray['headers']]
);
}
* @param str $defaulttype (Optional) Forces a notification with this type.
*/
function check_item_notification($itemid, $uid, $defaulttype = "") {
- $notification_data = array("uid" => $uid, "profiles" => array());
+ $notification_data = ["uid" => $uid, "profiles" => []];
call_hooks('check_item_notification', $notification_data);
$profiles = $notification_data["profiles"];
// Notifications from Diaspora are often with an URL in the Diaspora format
$profiles[] = System::baseUrl()."/u/".$user["nickname"];
- $profiles2 = array();
+ $profiles2 = [];
foreach ($profiles AS $profile) {
// Check for invalid profile urls. 13 should be the shortest possible profile length:
return false;
// Generate the notification array
- $params = array();
+ $params = [];
$params["uid"] = $uid;
$params["notify_flags"] = $user["notify-flags"];
$params["language"] = $user["language"];
*/
function bbtoevent($s) {
- $ev = array();
+ $ev = [];
$match = '';
if (preg_match("/\[event\-summary\](.*?)\[\/event\-summary\]/is", $s, $match)) {
return;
}
- dba::delete('event', array('id' => $event_id));
+ dba::delete('event', ['id' => $event_id]);
logger("Deleted event ".$event_id, LOGGER_DEBUG);
}
$event = $r[0];
}
- $item_arr = array();
+ $item_arr = [];
$item_arr['uid'] = $arr['uid'];
$item_arr['contact-id'] = $arr['cid'];
// First day of the week (0 = Sunday).
$firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
- $i18n = array(
+ $i18n = [
"firstDay" => $firstDay,
"allday" => t("all-day"),
"dtstart_label" => t("Starts:"),
"dtend_label" => t("Finishes:"),
"location_label" => t("Location:")
- );
+ ];
return $i18n;
}
* @todo We should replace this with a separate update function if there is some time left.
*/
function event_remove_duplicates($dates) {
- $dates2 = array();
+ $dates2 = [];
foreach ($dates as $date) {
if ($date['type'] == 'birthday') {
* @return array Event array for the template.
*/
function process_events($arr) {
- $events=array();
+ $events=[];
$last_date = '';
$fmt = t('l, F j');
$copy = null;
$drop = null;
if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') {
- $edit = ((! $rr['cid']) ? array(System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', '') : null);
- $copy = ((! $rr['cid']) ? array(System::baseUrl() . '/events/copy/' . $rr['id'], t('Duplicate event'), '', '') : null);
- $drop = array(System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', '');
+ $edit = ((! $rr['cid']) ? [System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', ''] : null);
+ $copy = ((! $rr['cid']) ? [System::baseUrl() . '/events/copy/' . $rr['id'], t('Duplicate event'), '', ''] : null);
+ $drop = [System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', ''];
}
$title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8'));
$html = format_event_html($rr);
$rr['desc'] = bbcode($rr['desc']);
$rr['location'] = bbcode($rr['location']);
- $events[] = array(
+ $events[] = [
'id' => $rr['id'],
'start' => $start,
'end' => $end,
'is_first' => $is_first,
'item' => $rr,
'html' => $html,
- 'plink' => array($rr['plink'], t('link to source'), '', ''),
- );
+ 'plink' => [$rr['plink'], t('link to source'), '', ''],
+ ];
}
}
$file_ext = "";
}
- $arr = array(
+ $arr = [
'success' => $process,
'format' => $format,
'extension' => $file_ext,
'content' => $res,
- );
+ ];
return $arr;
}
return;
}
- return replace_macros(get_markup_template("events_aside.tpl"), array(
+ return replace_macros(get_markup_template("events_aside.tpl"), [
'$etitle' => t("Export"),
'$export_ical' => t("Export calendar as ical"),
'$export_csv' => t("Export calendar as csv"),
'$user' => $user
- ));
+ ]);
}
/**
// Format the event location.
$evloc = event_location2array($item['event-location']);
- $location = array();
+ $location = [];
if (isset($evloc['name'])) {
$location['name'] = prepare_text($evloc['name']);
$profile_link = Profile::zrl($profile_link);
}
- $event = replace_macros(get_markup_template('event_stream_item.tpl'), array(
+ $event = replace_macros(get_markup_template('event_stream_item.tpl'), [
'$id' => $item['event-id'],
'$title' => prepare_text($item['event-summary']),
'$dtstart_label' => t('Starts:'),
'$hide_map_label' => t('Hide map'),
'$map_btn_label' => t('Show map'),
'$location' => $location
- ));
+ ]);
return $event;
}
return;
}
- $location = array('name' => $s);
+ $location = ['name' => $s];
// Map tag with location name - e.g. [map]Paris[/map].
if (strpos($s, '[/map]') !== false) {
// setTemplateDir can be set to an array, which Smarty will parse in order.
// The order is thus very important here
- $template_dirs = array('theme' => "view/theme/$theme/" . SMARTY3_TEMPLATE_FOLDER . "/");
+ $template_dirs = ['theme' => "view/theme/$theme/" . SMARTY3_TEMPLATE_FOLDER . "/"];
if (x($a->theme_info, "extends"))
- $template_dirs = $template_dirs + array('extends' => "view/theme/" . $a->theme_info["extends"] . "/" . SMARTY3_TEMPLATE_FOLDER . "/");
- $template_dirs = $template_dirs + array('base' => "view/" . SMARTY3_TEMPLATE_FOLDER . "/");
+ $template_dirs = $template_dirs + ['extends' => "view/theme/" . $a->theme_info["extends"] . "/" . SMARTY3_TEMPLATE_FOLDER . "/"];
+ $template_dirs = $template_dirs + ['base' => "view/" . SMARTY3_TEMPLATE_FOLDER . "/"];
$this->setTemplateDir($template_dirs);
$this->setCompileDir('view/smarty3/compiled/');
$r['$APP'] = get_app();
// "middleware": inject variables into templates
- $arr = array(
+ $arr = [
"template" => basename($s->filename),
"vars" => $r
- );
+ ];
call_hooks("template_vars", $arr);
$r = $arr['vars'];
$list = $xpath->query("//".$oldnode);
foreach ($list as $oldNode) {
- $attr = array();
+ $attr = [];
if ($oldNode->attributes->length) {
foreach ($oldNode->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
);
$message = str_replace(
- array(
+ [
"<li><p>",
"</p></li>",
- ),
- array(
+ ],
+ [
"<li>",
"</li>",
- ),
+ ],
$message
);
}
$message = $doc->saveHTML();
- $message = str_replace(array("\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"), array("<", ">", "<br />", " ", ""), $message);
+ $message = str_replace(["\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"], ["<", ">", "<br />", " ", ""], $message);
$message = preg_replace('= [\s]*=i', " ", $message);
@$doc->loadHTML($message);
- node2bbcode($doc, 'html', array(), "", "");
- node2bbcode($doc, 'body', array(), "", "");
+ node2bbcode($doc, 'html', [], "", "");
+ node2bbcode($doc, 'body', [], "", "");
// Outlook-Quote - Variant 1
- node2bbcode($doc, 'p', array('class'=>'MsoNormal', 'style'=>'margin-left:35.4pt'), '[quote]', '[/quote]');
+ node2bbcode($doc, 'p', ['class'=>'MsoNormal', 'style'=>'margin-left:35.4pt'], '[quote]', '[/quote]');
// Outlook-Quote - Variant 2
- node2bbcode($doc, 'div', array('style'=>'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'), '[quote]', '[/quote]');
+ node2bbcode($doc, 'div', ['style'=>'border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'], '[quote]', '[/quote]');
// MyBB-Stuff
- node2bbcode($doc, 'span', array('style'=>'text-decoration: underline;'), '[u]', '[/u]');
- node2bbcode($doc, 'span', array('style'=>'font-style: italic;'), '[i]', '[/i]');
- node2bbcode($doc, 'span', array('style'=>'font-weight: bold;'), '[b]', '[/b]');
+ node2bbcode($doc, 'span', ['style'=>'text-decoration: underline;'], '[u]', '[/u]');
+ node2bbcode($doc, 'span', ['style'=>'font-style: italic;'], '[i]', '[/i]');
+ node2bbcode($doc, 'span', ['style'=>'font-weight: bold;'], '[b]', '[/b]');
/*node2bbcode($doc, 'font', array('face'=>'/([\w ]+)/', 'size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[font=$1][size=$2][color=$3]', '[/color][/size][/font]');
node2bbcode($doc, 'font', array('size'=>'/(\d+)/', 'color'=>'/(.+)/'), '[size=$1][color=$2]', '[/color][/size]');
//node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(\d+)[,;].*/'), '[size=$1]', '[/size]');
//node2bbcode($doc, 'span', array('style'=>'/.*font-size:\s*(.+?)[,;].*/'), '[size=$1]', '[/size]');
- node2bbcode($doc, 'span', array('style'=>'/.*color:\s*(.+?)[,;].*/'), '[color="$1"]', '[/color]');
+ node2bbcode($doc, 'span', ['style'=>'/.*color:\s*(.+?)[,;].*/'], '[color="$1"]', '[/color]');
//node2bbcode($doc, 'span', array('style'=>'/.*font-family:\s*(.+?)[,;].*/'), '[font=$1]', '[/font]');
// Importing the classes - interesting for importing of posts from third party networks that were exported from friendica
// Test
//node2bbcode($doc, 'span', array('class'=>'/([\w ]+)/'), '[class=$1]', '[/class]');
- node2bbcode($doc, 'span', array('class'=>'type-link'), '[class=type-link]', '[/class]');
- node2bbcode($doc, 'span', array('class'=>'type-video'), '[class=type-video]', '[/class]');
+ node2bbcode($doc, 'span', ['class'=>'type-link'], '[class=type-link]', '[/class]');
+ node2bbcode($doc, 'span', ['class'=>'type-video'], '[class=type-video]', '[/class]');
- node2bbcode($doc, 'strong', array(), '[b]', '[/b]');
- node2bbcode($doc, 'em', array(), '[i]', '[/i]');
- node2bbcode($doc, 'b', array(), '[b]', '[/b]');
- node2bbcode($doc, 'i', array(), '[i]', '[/i]');
- node2bbcode($doc, 'u', array(), '[u]', '[/u]');
+ node2bbcode($doc, 'strong', [], '[b]', '[/b]');
+ node2bbcode($doc, 'em', [], '[i]', '[/i]');
+ node2bbcode($doc, 'b', [], '[b]', '[/b]');
+ node2bbcode($doc, 'i', [], '[i]', '[/i]');
+ node2bbcode($doc, 'u', [], '[u]', '[/u]');
- node2bbcode($doc, 'big', array(), "[size=large]", "[/size]");
- node2bbcode($doc, 'small', array(), "[size=small]", "[/size]");
+ node2bbcode($doc, 'big', [], "[size=large]", "[/size]");
+ node2bbcode($doc, 'small', [], "[size=small]", "[/size]");
- node2bbcode($doc, 'blockquote', array(), '[quote]', '[/quote]');
+ node2bbcode($doc, 'blockquote', [], '[quote]', '[/quote]');
- node2bbcode($doc, 'br', array(), "\n", '');
+ node2bbcode($doc, 'br', [], "\n", '');
- node2bbcode($doc, 'p', array('class'=>'MsoNormal'), "\n", "");
- node2bbcode($doc, 'div', array('class'=>'MsoNormal'), "\r", "");
+ node2bbcode($doc, 'p', ['class'=>'MsoNormal'], "\n", "");
+ node2bbcode($doc, 'div', ['class'=>'MsoNormal'], "\r", "");
- node2bbcode($doc, 'span', array(), "", "");
+ node2bbcode($doc, 'span', [], "", "");
- node2bbcode($doc, 'span', array(), "", "");
- node2bbcode($doc, 'pre', array(), "", "");
+ node2bbcode($doc, 'span', [], "", "");
+ node2bbcode($doc, 'pre', [], "", "");
- node2bbcode($doc, 'div', array(), "\r", "\r");
- node2bbcode($doc, 'p', array(), "\n", "\n");
+ node2bbcode($doc, 'div', [], "\r", "\r");
+ node2bbcode($doc, 'p', [], "\n", "\n");
- node2bbcode($doc, 'ul', array(), "[list]", "[/list]");
- node2bbcode($doc, 'ol', array(), "[list=1]", "[/list]");
- node2bbcode($doc, 'li', array(), "[*]", "");
+ node2bbcode($doc, 'ul', [], "[list]", "[/list]");
+ node2bbcode($doc, 'ol', [], "[list=1]", "[/list]");
+ node2bbcode($doc, 'li', [], "[*]", "");
- node2bbcode($doc, 'hr', array(), "[hr]", "");
+ node2bbcode($doc, 'hr', [], "[hr]", "");
- node2bbcode($doc, 'table', array(), "", "");
- node2bbcode($doc, 'tr', array(), "\n", "");
- node2bbcode($doc, 'td', array(), "\t", "");
+ node2bbcode($doc, 'table', [], "", "");
+ node2bbcode($doc, 'tr', [], "\n", "");
+ node2bbcode($doc, 'td', [], "\t", "");
//node2bbcode($doc, 'table', array(), "[table]", "[/table]");
//node2bbcode($doc, 'th', array(), "[th]", "[/th]");
//node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
//node2bbcode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n");
//node2bbcode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h1', array(), "\n\n[h1]", "[/h1]\n");
- node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n");
- node2bbcode($doc, 'h3', array(), "\n\n[h3]", "[/h3]\n");
- node2bbcode($doc, 'h4', array(), "\n\n[h4]", "[/h4]\n");
- node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n");
- node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n");
+ node2bbcode($doc, 'h1', [], "\n\n[h1]", "[/h1]\n");
+ node2bbcode($doc, 'h2', [], "\n\n[h2]", "[/h2]\n");
+ node2bbcode($doc, 'h3', [], "\n\n[h3]", "[/h3]\n");
+ node2bbcode($doc, 'h4', [], "\n\n[h4]", "[/h4]\n");
+ node2bbcode($doc, 'h5', [], "\n\n[h5]", "[/h5]\n");
+ node2bbcode($doc, 'h6', [], "\n\n[h6]", "[/h6]\n");
- node2bbcode($doc, 'a', array('href'=>'/mailto:(.+)/'), '[mail=$1]', '[/mail]');
- node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]');
+ node2bbcode($doc, 'a', ['href'=>'/mailto:(.+)/'], '[mail=$1]', '[/mail]');
+ node2bbcode($doc, 'a', ['href'=>'/(.+)/'], '[url=$1]', '[/url]');
- node2bbcode($doc, 'img', array('src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'), '[img=$2x$3]$1', '[/img]');
- node2bbcode($doc, 'img', array('src'=>'/(.+)/'), '[img]$1', '[/img]');
+ node2bbcode($doc, 'img', ['src'=>'/(.+)/', 'width'=>'/(\d+)/', 'height'=>'/(\d+)/'], '[img=$2x$3]$1', '[/img]');
+ node2bbcode($doc, 'img', ['src'=>'/(.+)/'], '[img]$1', '[/img]');
- node2bbcode($doc, 'video', array('src'=>'/(.+)/'), '[video]$1', '[/video]');
- node2bbcode($doc, 'audio', array('src'=>'/(.+)/'), '[audio]$1', '[/audio]');
- node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
+ node2bbcode($doc, 'video', ['src'=>'/(.+)/'], '[video]$1', '[/video]');
+ node2bbcode($doc, 'audio', ['src'=>'/(.+)/'], '[audio]$1', '[/audio]');
+ node2bbcode($doc, 'iframe', ['src'=>'/(.+)/'], '[iframe]$1', '[/iframe]');
- node2bbcode($doc, 'key', array(), '[code]', '[/code]');
- node2bbcode($doc, 'code', array(), '[code]', '[/code]');
+ node2bbcode($doc, 'key', [], '[code]', '[/code]');
+ node2bbcode($doc, 'code', [], '[code]', '[/code]');
$message = $doc->saveHTML();
$message = html_entity_decode($message, ENT_QUOTES, 'UTF-8');
- $message = str_replace(array("<"), array("<"), $message);
+ $message = str_replace(["<"], ["<"], $message);
// remove quotes if they don't make sense
$message = preg_replace('=\[/quote\][\s]*\[quote\]=i', "\n", $message);
do {
$oldmessage = $message;
$message = str_replace(
- array(
+ [
"[/size]\n\n",
"\n[hr]",
"[hr]\n",
"\n[/",
"[list]\n",
"[list=1]\n",
- "\n[*]"),
- array(
+ "\n[*]"],
+ [
"[/size]\n",
"[hr]",
"[hr]",
"[/",
"[list]",
"[list=1]",
- "[*]"),
+ "[*]"],
$message
);
} while ($message != $oldmessage);
$message = str_replace(
- array('[b][b]', '[/b][/b]', '[i][i]', '[/i][/i]'),
- array('[b]', '[/b]', '[i]', '[/i]'),
+ ['[b][b]', '[/b][/b]', '[i][i]', '[/i][/i]'],
+ ['[b]', '[/b]', '[i]', '[/i]'],
$message
);
{
$URLSearchString = "^\[\]";
- $matches = array("/\[url\=([$URLSearchString]*)\].*?\[\/url\]/ism",
+ $matches = ["/\[url\=([$URLSearchString]*)\].*?\[\/url\]/ism",
"/\[url\]([$URLSearchString]*)\[\/url\]/ism",
"/\[img\=[0-9]*x[0-9]*\](.*?)\[\/img\]/ism",
"/\[img\](.*?)\[\/img\]/ism",
"/\[zmg\](.*?)\[\/zmg\]/ism",
"/\[video\](.*?)\[\/video\]/ism",
"/\[audio\](.*?)\[\/audio\]/ism",
- );
+ ];
foreach ($matches as $match) {
$body = preg_replace_callback(
$wraplen = $wraplength - $level;
- $newlines = array();
+ $newlines = [];
do {
$oldline = $line;
{
$lines = explode("\n", $message);
- $newlines = array();
+ $newlines = [];
$level = 0;
foreach ($lines as $line) {
$line = trim($line);
$pattern = '/<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
preg_match_all($pattern, $message, $result, PREG_SET_ORDER);
- $urls = array();
+ $urls = [];
foreach ($result as $treffer) {
$ignore = false;
// A list of some links that should be ignored
- $list = array("/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/",
- "//facebook.com/profile.php?id=", "//plus.google.com/", "//twitter.com/");
+ $list = ["/user/", "/tag/", "/group/", "/profile/", "/search?search=", "/search?tag=", "mailto:", "/u/", "/node/",
+ "//facebook.com/profile.php?id=", "//plus.google.com/", "//twitter.com/"];
foreach ($list as $listitem) {
if (strpos($treffer[1], $listitem) !== false) {
$ignore = true;
}
$message = $doc->saveHTML();
- $message = str_replace(array("\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"), array("<", ">", "<br>", " ", ""), $message);
+ $message = str_replace(["\n<", ">\n", "\r", "\n", "\xC3\x82\xC2\xA0"], ["<", ">", "<br>", " ", ""], $message);
$message = preg_replace('= [\s]*=i', " ", $message);
// Collecting all links
@$doc->loadHTML($message);
- node2bbcode($doc, 'html', array(), '', '');
- node2bbcode($doc, 'body', array(), '', '');
+ node2bbcode($doc, 'html', [], '', '');
+ node2bbcode($doc, 'body', [], '', '');
// MyBB-Auszeichnungen
/*
*/
if ($compact) {
- node2bbcode($doc, 'blockquote', array(), "»", "«");
+ node2bbcode($doc, 'blockquote', [], "»", "«");
} else {
- node2bbcode($doc, 'blockquote', array(), '[quote]', "[/quote]\n");
+ node2bbcode($doc, 'blockquote', [], '[quote]', "[/quote]\n");
}
- node2bbcode($doc, 'br', array(), "\n", '');
+ node2bbcode($doc, 'br', [], "\n", '');
- node2bbcode($doc, 'span', array(), "", "");
- node2bbcode($doc, 'pre', array(), "", "");
- node2bbcode($doc, 'div', array(), "\r", "\r");
- node2bbcode($doc, 'p', array(), "\n", "\n");
+ node2bbcode($doc, 'span', [], "", "");
+ node2bbcode($doc, 'pre', [], "", "");
+ node2bbcode($doc, 'div', [], "\r", "\r");
+ node2bbcode($doc, 'p', [], "\n", "\n");
//node2bbcode($doc, 'ul', array(), "\n[list]", "[/list]\n");
//node2bbcode($doc, 'ol', array(), "\n[list=1]", "[/list]\n");
- node2bbcode($doc, 'li', array(), "\n* ", "\n");
+ node2bbcode($doc, 'li', [], "\n* ", "\n");
- node2bbcode($doc, 'hr', array(), "\n" . str_repeat("-", 70) . "\n", "");
+ node2bbcode($doc, 'hr', [], "\n" . str_repeat("-", 70) . "\n", "");
- node2bbcode($doc, 'tr', array(), "\n", "");
- node2bbcode($doc, 'td', array(), "\t", "");
+ node2bbcode($doc, 'tr', [], "\n", "");
+ node2bbcode($doc, 'td', [], "\t", "");
- node2bbcode($doc, 'h1', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'h2', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'h3', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'h4', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'h5', array(), "\n\n*", "*\n");
- node2bbcode($doc, 'h6', array(), "\n\n*", "*\n");
+ node2bbcode($doc, 'h1', [], "\n\n*", "*\n");
+ node2bbcode($doc, 'h2', [], "\n\n*", "*\n");
+ node2bbcode($doc, 'h3', [], "\n\n*", "*\n");
+ node2bbcode($doc, 'h4', [], "\n\n*", "*\n");
+ node2bbcode($doc, 'h5', [], "\n\n*", "*\n");
+ node2bbcode($doc, 'h6', [], "\n\n*", "*\n");
// Problem: there is no reliable way to detect if it is a link to a tag or profile
//node2bbcode($doc, 'a', array('href'=>'/(.+)/'), ' $1 ', ' ', true);
//node2bbcode($doc, 'img', array('title'=>'/(.+)/'), '$1', '');
//node2bbcode($doc, 'img', array(), '', '');
if (!$compact) {
- node2bbcode($doc, 'img', array('src' => '/(.+)/'), ' [img]$1', '[/img] ');
+ node2bbcode($doc, 'img', ['src' => '/(.+)/'], ' [img]$1', '[/img] ');
} else {
- node2bbcode($doc, 'img', array('src' => '/(.+)/'), ' ', ' ');
+ node2bbcode($doc, 'img', ['src' => '/(.+)/'], ' ', ' ');
}
- node2bbcode($doc, 'iframe', array('src' => '/(.+)/'), ' $1 ', '');
+ node2bbcode($doc, 'iframe', ['src' => '/(.+)/'], ' $1 ', '');
$message = $doc->saveHTML();
$title = strip_tags($title);
$title = trim($title);
$title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
- $title = str_replace(array("\n", "\r", "\t", " "), array("", "", "", ""), $title);
+ $title = str_replace(["\n", "\r", "\t", " "], ["", "", "", ""], $title);
$body = strip_tags($body);
$body = trim($body);
$body = html_entity_decode($body, ENT_QUOTES, 'UTF-8');
- $body = str_replace(array("\n", "\r", "\t", " "), array("", "", "", ""), $body);
+ $body = str_replace(["\n", "\r", "\t", " "], ["", "", "", ""], $body);
if (strlen($title) < strlen($body)) {
$body = substr($body, 0, strlen($title));
}
// Escape some bad characters
- $data["url"] = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["url"], ENT_QUOTES, 'UTF-8', false));
- $data["title"] = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["title"], ENT_QUOTES, 'UTF-8', false));
+ $data["url"] = str_replace(["[", "]"], ["[", "]"], htmlentities($data["url"], ENT_QUOTES, 'UTF-8', false));
+ $data["title"] = str_replace(["[", "]"], ["[", "]"], htmlentities($data["title"], ENT_QUOTES, 'UTF-8', false));
$text = "[attachment type='".$data["type"]."'";
}
if (sizeof($data["images"]) > 0) {
- $preview = str_replace(array("[", "]"), array("[", "]"), htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
+ $preview = str_replace(["[", "]"], ["[", "]"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode
// But only, if the picture isn't higher than large (To prevent huge posts)
if (!Config::get('system', 'always_show_preview') && ($data["images"][0]["width"] >= 500)
$hashtags = "\n";
foreach ($data["keywords"] AS $keyword) {
/// @todo make a positive list of allowed characters
- $hashtag = str_replace(array(" ", "+", "/", ".", "#", "'", "’", "`", "(", ")", "„", "“"),
- array("", "", "", "", "", "", "", "", "", "", "", ""), $keyword);
+ $hashtag = str_replace([" ", "+", "/", ".", "#", "'", "’", "`", "(", ")", "„", "“"],
+ ["", "", "", "", "", "", "", "", "", "", "", ""], $keyword);
$hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] ";
}
}
$tags = "";
if (isset($data["keywords"]) && count($data["keywords"])) {
foreach ($data["keywords"] AS $keyword) {
- $hashtag = str_replace(array(" ", "+", "/", ".", "#", "'"),
- array("", "", "", "", "", ""), $keyword);
+ $hashtag = str_replace([" ", "+", "/", ".", "#", "'"],
+ ["", "", "", "", "", ""], $keyword);
if ($tags != "") {
$tags .= ", ";
$body = $removedlink;
}
- $url = str_replace(array('/', '.'), array('\/', '\.'), $matches[1]);
+ $url = str_replace(['/', '.'], ['\/', '\.'], $matches[1]);
$removedlink = preg_replace("/\[url\=" . $url . "\](.*?)\[\/url\]/ism", '', $body);
if (($removedlink == "") || strstr($body, $removedlink)) {
$body = $removedlink;
* @return array Item array with removed conversation data
*/
function store_conversation($arr) {
- if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS)) && !empty($arr['uri'])) {
- $conversation = array('item-uri' => $arr['uri'], 'received' => DBM::date());
+ if (in_array(defaults($arr, 'network', NETWORK_PHANTOM), [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]) && !empty($arr['uri'])) {
+ $conversation = ['item-uri' => $arr['uri'], 'received' => DBM::date()];
if (isset($arr['parent-uri']) && ($arr['parent-uri'] != $arr['uri'])) {
$conversation['reply-to-uri'] = $arr['parent-uri'];
unset($conversation['protocol']);
unset($conversation['source']);
}
- if (!dba::update('conversation', $conversation, array('item-uri' => $conversation['item-uri']), $old_conv)) {
+ if (!dba::update('conversation', $conversation, ['item-uri' => $conversation['item-uri']], $old_conv)) {
logger('Conversation: update for '.$conversation['item-uri'].' from '.$conv['protocol'].' to '.$conversation['protocol'].' failed', LOGGER_DEBUG);
}
} else {
* We have to check several networks since Friendica posts could be repeated
* via OStatus (maybe Diasporsa as well)
*/
- if (in_array($arr['network'], array(NETWORK_DIASPORA, NETWORK_DFRN, NETWORK_OSTATUS, ""))) {
+ if (in_array($arr['network'], [NETWORK_DIASPORA, NETWORK_DFRN, NETWORK_OSTATUS, ""])) {
$r = q("SELECT `id`, `network` FROM `item` WHERE `uri` = '%s' AND `uid` = %d AND `network` IN ('%s', '%s', '%s') LIMIT 1",
dbesc(trim($arr['uri'])),
intval($uid),
* On comments the author is the better choice.
*/
if ($arr['parent-uri'] === $arr['uri']) {
- $arr["gcontact-id"] = GContact::getId(array("url" => $arr['owner-link'], "network" => $arr['network'],
- "photo" => $arr['owner-avatar'], "name" => $arr['owner-name']));
+ $arr["gcontact-id"] = GContact::getId(["url" => $arr['owner-link'], "network" => $arr['network'],
+ "photo" => $arr['owner-avatar'], "name" => $arr['owner-name']]);
} else {
- $arr["gcontact-id"] = GContact::getId(array("url" => $arr['author-link'], "network" => $arr['network'],
- "photo" => $arr['author-avatar'], "name" => $arr['author-name']));
+ $arr["gcontact-id"] = GContact::getId(["url" => $arr['author-link'], "network" => $arr['network'],
+ "photo" => $arr['author-avatar'], "name" => $arr['author-name']]);
}
}
$self = normalise_link(System::baseUrl() . '/profile/' . $u[0]['nickname']);
logger("item_store: 'myself' is ".$self." for parent ".$parent_id." checking against ".$arr['author-link']." and ".$arr['owner-link'], LOGGER_DEBUG);
if ((normalise_link($arr['author-link']) == $self) || (normalise_link($arr['owner-link']) == $self)) {
- dba::update('thread', array('mention' => true), array('iid' => $parent_id));
+ dba::update('thread', ['mention' => true], ['iid' => $parent_id]);
logger("item_store: tagged thread ".$parent_id." as mention for user ".$self, LOGGER_DEBUG);
}
}
}
// On Friendica and Diaspora the GUID is unique
- if (in_array($arr['network'], array(NETWORK_DFRN, NETWORK_DIASPORA))) {
+ if (in_array($arr['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
$r = q("SELECT `id` FROM `item` WHERE `guid` = '%s' AND `uid` = %d LIMIT 1",
dbesc($arr['guid']),
intval($arr['uid'])
$arr["global"] = true;
// Set the global flag on all items if this was a global item entry
- dba::update('item', array('global' => true), array('uri' => $arr["uri"]));
+ dba::update('item', ['global' => true], ['uri' => $arr["uri"]]);
} else {
$isglobal = q("SELECT `global` FROM `item` WHERE `uid` = 0 AND `uri` = '%s'", dbesc($arr["uri"]));
logger('Duplicated post occurred. uri = ' . $arr['uri'] . ' uid = ' . $arr['uid']);
// Yes, we could do a rollback here - but we are having many users with MyISAM.
- dba::delete('item', array('id' => $current_post));
+ dba::delete('item', ['id' => $current_post]);
dba::commit();
return 0;
} elseif ($r[0]["entries"] == 0) {
}
// Set parent id
- dba::update('item', array('parent' => $parent_id), array('id' => $current_post));
+ dba::update('item', ['parent' => $parent_id], ['id' => $current_post]);
$arr['id'] = $current_post;
$arr['parent'] = $parent_id;
// update the commented timestamp on the parent
// Only update "commented" if it is really a comment
if (($arr['verb'] == ACTIVITY_POST) || !Config::get("system", "like_no_comment")) {
- dba::update('item', array('commented' => datetime_convert(), 'changed' => datetime_convert()), array('id' => $parent_id));
+ dba::update('item', ['commented' => datetime_convert(), 'changed' => datetime_convert()], ['id' => $parent_id]);
} else {
- dba::update('item', array('changed' => datetime_convert()), array('id' => $parent_id));
+ dba::update('item', ['changed' => datetime_convert()], ['id' => $parent_id]);
}
if ($dsprsig) {
logger("Repaired double encoded signature from handle ".$dsprsig->signer, LOGGER_DEBUG);
}
- dba::insert('sign', array('iid' => $current_post, 'signed_text' => $dsprsig->signed_text,
- 'signature' => $dsprsig->signature, 'signer' => $dsprsig->signer));
+ dba::insert('sign', ['iid' => $current_post, 'signed_text' => $dsprsig->signed_text,
+ 'signature' => $dsprsig->signature, 'signer' => $dsprsig->signer]);
}
$deleted = tag_deliver($arr['uid'], $current_post);
check_user_notification($current_post);
if ($notify) {
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "Notifier", $notify_type, $current_post);
+ Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "Notifier", $notify_type, $current_post);
}
return $current_post;
}
if ($update) {
- dba::update('contact', array('success_update' => $arr['received'], 'last-item' => $arr['received']),
- array('id' => $arr['contact-id']));
+ dba::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']],
+ ['id' => $arr['contact-id']]);
}
// Now do the same for the system wide contacts with uid=0
if (!$arr['private']) {
- dba::update('contact', array('success_update' => $arr['received'], 'last-item' => $arr['received']),
- array('id' => $arr['owner-id']));
+ dba::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']],
+ ['id' => $arr['owner-id']]);
if ($arr['owner-id'] != $arr['author-id']) {
- dba::update('contact', array('success_update' => $arr['received'], 'last-item' => $arr['received']),
- array('id' => $arr['author-id']));
+ dba::update('contact', ['success_update' => $arr['received'], 'last-item' => $arr['received']],
+ ['id' => $arr['author-id']]);
}
}
}
$nick = $r[0]["nickname"];
}
}
- return array("nick" => $nick, "id" => $id);
+ return ["nick" => $nick, "id" => $id];
}
// return - test
// mmh.. no mention.. community page or private group... no wall.. no origin.. top-post (not a comment)
// delete it!
logger("tag_deliver: no-mention top-level post to communuty or private group. delete.");
- dba::delete('item', array('id' => $item_id));
+ dba::delete('item', ['id' => $item_id]);
return true;
}
return;
}
- $arr = array('item' => $item, 'user' => $u[0], 'contact' => $r[0]);
+ $arr = ['item' => $item, 'user' => $u[0], 'contact' => $r[0]];
call_hooks('tagged', $arr);
);
update_thread($item_id);
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'Notifier', 'tgroup', $item_id);
+ Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', 'tgroup', $item_id);
}
if (is_array($contact)) {
if (($contact['network'] == NETWORK_OSTATUS && $contact['rel'] == CONTACT_IS_SHARING)
|| ($sharing && $contact['rel'] == CONTACT_IS_FOLLOWER)) {
- dba::update('contact', array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
- array('id' => $contact['id'], 'uid' => $importer['uid']));
+ dba::update('contact', ['rel' => CONTACT_IS_FRIEND, 'writable' => true],
+ ['id' => $contact['id'], 'uid' => $importer['uid']]);
}
// send email notification to owner?
} else {
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($importer['uid'])
);
- if (DBM::is_result($r) && !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY))) {
+ if (DBM::is_result($r) && !in_array($r[0]['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
// create notification
$hash = random_string();
if (is_array($contact_record)) {
- dba::insert('intro', array('uid' => $importer['uid'], 'contact-id' => $contact_record['id'],
+ dba::insert('intro', ['uid' => $importer['uid'], 'contact-id' => $contact_record['id'],
'blocked' => false, 'knowyou' => false,
- 'hash' => $hash, 'datetime' => datetime_convert()));
+ 'hash' => $hash, 'datetime' => datetime_convert()]);
}
Group::addMember(User::getDefaultGroup($importer['uid'], $contact_record["network"]), $contact_record['id']);
if (($r[0]['notify-flags'] & NOTIFY_INTRO) &&
- in_array($r[0]['page-flags'], array(PAGE_NORMAL))) {
+ in_array($r[0]['page-flags'], [PAGE_NORMAL])) {
- notification(array(
+ notification([
'type' => NOTIFY_INTRO,
'notify_flags' => $r[0]['notify-flags'],
'language' => $r[0]['language'],
'source_photo' => $contact_record['photo'],
'verb' => ($sharing ? ACTIVITY_FRIEND : ACTIVITY_FOLLOW),
'otype' => 'intro'
- ));
+ ]);
}
- } elseif (DBM::is_result($r) && in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY))) {
+ } elseif (DBM::is_result($r) && in_array($r[0]['page-flags'], [PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY])) {
q("UPDATE `contact` SET `pending` = 0 WHERE `uid` = %d AND `url` = '%s' AND `pending` LIMIT 1",
intval($importer['uid']),
dbesc($url)
}
}
-function lose_follower($importer, $contact, array $datarray = array(), $item = "") {
+function lose_follower($importer, $contact, array $datarray = [], $item = "") {
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_SHARING)) {
- dba::update('contact', array('rel' => CONTACT_IS_SHARING), array('id' => $contact['id']));
+ dba::update('contact', ['rel' => CONTACT_IS_SHARING], ['id' => $contact['id']]);
} else {
Contact::remove($contact['id']);
}
}
-function lose_sharer($importer, $contact, array $datarray = array(), $item = "") {
+function lose_sharer($importer, $contact, array $datarray = [], $item = "") {
if (($contact['rel'] == CONTACT_IS_FRIEND) || ($contact['rel'] == CONTACT_IS_FOLLOWER)) {
- dba::update('contact', array('rel' => CONTACT_IS_FOLLOWER), array('id' => $contact['id']));
+ dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
} else {
Contact::remove($contact['id']);
}
logger('subscribe_to_hub: ' . $hubmode . ' ' . $contact['name'] . ' to hub ' . $url . ' endpoint: ' . $push_url . ' with verifier ' . $verify_token);
if (!strlen($contact['hub-verify']) || ($contact['hub-verify'] != $verify_token)) {
- dba::update('contact', array('hub-verify' => $verify_token), array('id' => $contact['id']));
+ dba::update('contact', ['hub-verify' => $verify_token], ['id' => $contact['id']]);
}
post_url($url, $params);
// Only embed locally hosted photos
$replace = false;
$i = basename($image);
- $i = str_replace(array('.jpg', '.png', '.gif'), array('', '', ''), $i);
+ $i = str_replace(['.jpg', '.png', '.gif'], ['', '', ''], $i);
$x = strpos($i, '-');
if ($x) {
}
function item_getfeedtags($item) {
- $ret = array();
+ $ret = [];
$matches = false;
$cnt = preg_match_all('|\#\[url\=(.*?)\](.*?)\[\/url\]|', $item['tag'], $matches);
if ($cnt) {
for ($x = 0; $x < $cnt; $x ++) {
if ($matches[1][$x]) {
- $ret[$matches[2][$x]] = array('#', $matches[1][$x], $matches[2][$x]);
+ $ret[$matches[2][$x]] = ['#', $matches[1][$x], $matches[2][$x]];
}
}
}
if ($cnt) {
for ($x = 0; $x < $cnt; $x ++) {
if ($matches[1][$x]) {
- $ret[] = array('@', $matches[1][$x], $matches[2][$x]);
+ $ret[] = ['@', $matches[1][$x], $matches[2][$x]];
}
}
}
drop_item($item['id'], false);
}
- Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "Notifier", "expire", $uid);
+ Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], "Notifier", "expire", $uid);
}
/// @TODO type-hint is array
// multiple threads may have been deleted, send an expire notification
if ($uid) {
- Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "Notifier", "expire", $uid);
+ Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], "Notifier", "expire", $uid);
}
}
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
- $inputs = array();
+ $inputs = [];
foreach ($query['args'] as $arg) {
if (strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
- $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
+ $inputs[] = ['name' => $arg_parts[0], 'value' => $arg_parts[1]];
}
}
- return replace_macros(get_markup_template('confirm.tpl'), array(
+ return replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
'$message' => t('Do you really want to delete this item?'),
'$extra_inputs' => $inputs,
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
- ));
+ ]);
}
// Now check how the user responded to the confirmation query
if ($_REQUEST['canceled']) {
logger('delete item: ' . $item['id'], LOGGER_DEBUG);
// delete the item
- dba::update('item', array('deleted' => true, 'title' => '', 'body' => '',
- 'edited' => datetime_convert(), 'changed' => datetime_convert()),
- array('id' => $item['id']));
+ dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
+ 'edited' => datetime_convert(), 'changed' => datetime_convert()],
+ ['id' => $item['id']]);
create_tags_from_item($item['id']);
Term::createFromItem($item['id']);
* generate a resource-id and therefore aren't intimately linked to the item.
*/
if (strlen($item['resource-id'])) {
- dba::delete('photo', array('resource-id' => $item['resource-id'], 'uid' => $item['uid']));
+ dba::delete('photo', ['resource-id' => $item['resource-id'], 'uid' => $item['uid']]);
}
// If item is a link to an event, nuke the event record.
if (intval($item['event-id'])) {
- dba::delete('event', array('id' => $item['event-id'], 'uid' => $item['uid']));
+ dba::delete('event', ['id' => $item['event-id'], 'uid' => $item['uid']]);
}
// If item has attachments, drop them
foreach (explode(", ", $item['attach']) as $attach) {
preg_match("|attach/(\d+)|", $attach, $matches);
- dba::delete('attach', array('id' => $matches[1], 'uid' => $item['uid']));
+ dba::delete('attach', ['id' => $matches[1], 'uid' => $item['uid']]);
}
// The new code splits the queries since the mysql optimizer really has bad problems with subqueries
// If it's the parent of a comment thread, kill all the kids
if ($item['uri'] == $item['parent-uri']) {
- dba::update('item', array('deleted' => true, 'title' => '', 'body' => '',
- 'edited' => datetime_convert(), 'changed' => datetime_convert()),
- array('parent-uri' => $item['parent-uri'], 'uid' => $item['uid']));
+ dba::update('item', ['deleted' => true, 'title' => '', 'body' => '',
+ 'edited' => datetime_convert(), 'changed' => datetime_convert()],
+ ['parent-uri' => $item['parent-uri'], 'uid' => $item['uid']]);
create_tags_from_itemuri($item['parent-uri'], $item['uid']);
Term::createFromItemURI($item['parent-uri'], $item['uid']);
// ignore the result
} else {
// ensure that last-child is set in case the comment that had it just got wiped.
- dba::update('item', array('last-child' => false, 'changed' => datetime_convert()),
- array('parent-uri' => $item['parent-uri'], 'uid' => $item['uid']));
+ dba::update('item', ['last-child' => false, 'changed' => datetime_convert()],
+ ['parent-uri' => $item['parent-uri'], 'uid' => $item['uid']]);
// who is the last child now?
$r = q("SELECT `id` FROM `item` WHERE `parent-uri` = '%s' AND `type` != 'activity' AND `deleted` = 0 AND `uid` = %d ORDER BY `edited` DESC LIMIT 1",
intval($item['uid'])
);
if (DBM::is_result($r)) {
- dba::update('item', array('last-child' => true), array('id' => $r[0]['id']));
+ dba::update('item', ['last-child' => true], ['id' => $r[0]['id']]);
}
}
$drop_id = intval($item['id']);
$priority = ($interactive ? PRIORITY_HIGH : PRIORITY_LOW);
- Worker::add(array('priority' => $priority, 'dont_fork' => true), "Notifier", "drop", $drop_id);
+ Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", "drop", $drop_id);
if (! $interactive) {
return $owner;
$dthen = first_post_date($uid, $wall);
if (! $dthen) {
- return array();
+ return [];
}
// Set the start and end date to the beginning of the month
$dnow = substr($dnow, 0, 8) . '01';
$dthen = substr($dthen, 0, 8) . '01';
- $ret = array();
+ $ret = [];
/*
* Starting with the current month, get the first and last days of every
$end_month = datetime_convert('', '', $dend, 'Y-m-d');
$str = day_translate(datetime_convert('', '', $dnow, 'F'));
if (!$ret[$dyear]) {
- $ret[$dyear] = array();
+ $ret[$dyear] = [];
}
- $ret[$dyear][] = array($str, $end_month, $start_month);
+ $ret[$dyear][] = [$str, $end_month, $start_month];
$dnow = datetime_convert('', '', $dnow . ' -1 month', 'Y-m-d');
}
return $ret;
$dthen = first_post_date($uid, $wall);
if (! $dthen) {
- return array();
+ return [];
}
// Set the start and end date to the beginning of the month
$dnow = substr($dnow, 0, 8) . '01';
$dthen = substr($dthen, 0, 8) . '01';
- $ret = array();
+ $ret = [];
/*
* Starting with the current month, get the first and last days of every
* month down to and including the month of the first post
$start_month = datetime_convert('', '', $dstart, 'Y-m-d');
$end_month = datetime_convert('', '', $dend, 'Y-m-d');
$str = day_translate(datetime_convert('', '', $dnow, 'F Y'));
- $ret[] = array($str, $end_month, $start_month);
+ $ret[] = [$str, $end_month, $start_month];
$dnow = datetime_convert('', '', $dnow . ' -1 month', 'Y-m-d');
}
return $ret;
$cutoff_year = intval(datetime_convert('',date_default_timezone_get(), 'now', 'Y')) - $visible_years;
$cutoff = ((array_key_exists($cutoff_year, $ret))? true : false);
- $o = replace_macros(get_markup_template('posted_date_widget.tpl'),array(
+ $o = replace_macros(get_markup_template('posted_date_widget.tpl'),[
'$title' => t('Archives'),
'$size' => $visible_years,
'$cutoff_year' => $cutoff_year,
'$dates' => $ret,
'$showmore' => t('show more')
- ));
+ ]);
return $o;
}
// Clean up the Diaspora signatures for this like
// Go ahead and do it even if Diaspora support is disabled. We still want to clean up
// if it had been enabled in the past
- dba::delete('sign', array('iid' => $like_item['id']));
+ dba::delete('sign', ['iid' => $like_item['id']]);
$like_item_id = $like_item['id'];
Worker::add(PRIORITY_HIGH, "Notifier", "like", $like_item_id);
$alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$plink = '[url=' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]';
- $new_item = array(
+ $new_item = [
'guid' => get_guid(32),
'uri' => item_new_uri($a->get_hostname(), $item['uid']),
'uid' => $item['uid'],
'visible' => 1,
'unseen' => 1,
'last-child' => 0
- );
+ ];
$new_item_id = item_store($new_item);
if (!(x($a->page,'nav')))
$a->page['nav'] = '';
- $a->page['htmlhead'] .= replace_macros(get_markup_template('nav_head.tpl'), array());
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('nav_head.tpl'), []);
/*
* Placeholder div for popup panel
$tpl = get_markup_template('nav.tpl');
- $a->page['nav'] .= replace_macros($tpl, array(
+ $a->page['nav'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$sitelocation' => $nav_info['sitelocation'],
'$nav' => $nav_info['nav'],
'$apps' => $a->apps,
'$clear_notifs' => t('Clear notifications'),
'$search_hint' => t('@name, !forum, #tags, content')
- ));
+ ]);
call_hooks('page_header', $a->page['nav']);
}
$sitelocation = $myident . substr(System::baseUrl($ssl_state), strpos(System::baseUrl($ssl_state), '//') + 2 );
// nav links: array of array('href', 'text', 'extra css classes', 'title')
- $nav = array();
+ $nav = [];
// Display login or logout
- $nav['usermenu'] = array();
+ $nav['usermenu'] = [];
$userinfo = null;
if (local_user()) {
- $nav['logout'] = array('logout', t('Logout'), '', t('End this session'));
+ $nav['logout'] = ['logout', t('Logout'), '', t('End this session')];
// user menu
- $nav['usermenu'][] = array('profile/' . $a->user['nickname'], t('Status'), '', t('Your posts and conversations'));
- $nav['usermenu'][] = array('profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), '', t('Your profile page'));
- $nav['usermenu'][] = array('photos/' . $a->user['nickname'], t('Photos'), '', t('Your photos'));
- $nav['usermenu'][] = array('videos/' . $a->user['nickname'], t('Videos'), '', t('Your videos'));
- $nav['usermenu'][] = array('events/', t('Events'), '', t('Your events'));
- $nav['usermenu'][] = array('notes/', t('Personal notes'), '', t('Your personal notes'));
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'], t('Status'), '', t('Your posts and conversations')];
+ $nav['usermenu'][] = ['profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), '', t('Your profile page')];
+ $nav['usermenu'][] = ['photos/' . $a->user['nickname'], t('Photos'), '', t('Your photos')];
+ $nav['usermenu'][] = ['videos/' . $a->user['nickname'], t('Videos'), '', t('Your videos')];
+ $nav['usermenu'][] = ['events/', t('Events'), '', t('Your events')];
+ $nav['usermenu'][] = ['notes/', t('Personal notes'), '', t('Your personal notes')];
// user info
$contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
- $userinfo = array(
+ $userinfo = [
'icon' => (DBM::is_result($contact) ? $a->remove_baseurl($contact['micro']) : 'images/person-48.jpg'),
'name' => $a->user['username'],
- );
+ ];
} else {
- $nav['login'] = array('login', t('Login'), ($a->module == 'login' ? 'selected' : ''), t('Sign in'));
+ $nav['login'] = ['login', t('Login'), ($a->module == 'login' ? 'selected' : ''), t('Sign in')];
}
// "Home" should also take you home from an authenticated remote profile connection
}
if (($a->module != 'home') && (! (local_user()))) {
- $nav['home'] = array($homelink, t('Home'), '', t('Home Page'));
+ $nav['home'] = [$homelink, t('Home'), '', t('Home Page')];
}
if (($a->config['register_policy'] == REGISTER_OPEN) && (! local_user()) && (! remote_user())) {
- $nav['register'] = array('register', t('Register'), '', t('Create an account'));
+ $nav['register'] = ['register', t('Register'), '', t('Create an account')];
}
$help_url = 'help';
if (!Config::get('system', 'hide_help')) {
- $nav['help'] = array($help_url, t('Help'), '', t('Help and documentation'));
+ $nav['help'] = [$help_url, t('Help'), '', t('Help and documentation')];
}
if (count($a->apps) > 0) {
- $nav['apps'] = array('apps', t('Apps'), '', t('Addon applications, utilities, games'));
+ $nav['apps'] = ['apps', t('Apps'), '', t('Addon applications, utilities, games')];
}
if (local_user() || !Config::get('system', 'local_search')) {
- $nav['search'] = array('search', t('Search'), '', t('Search site content'));
+ $nav['search'] = ['search', t('Search'), '', t('Search site content')];
- $nav['searchoption'] = array(
+ $nav['searchoption'] = [
t('Full Text'),
t('Tags'),
- t('Contacts'));
+ t('Contacts')];
if (Config::get('system', 'poco_local_search')) {
$nav['searchoption'][] = t('Forums');
}
if (local_user() || Config::get('system', 'community_page_style') != CP_NO_COMMUNITY_PAGE) {
- $nav['community'] = array('community', t('Community'), '', t('Conversations on this and other servers'));
+ $nav['community'] = ['community', t('Community'), '', t('Conversations on this and other servers')];
}
if (local_user()) {
- $nav['events'] = array('events', t('Events'), '', t('Events and Calendar'));
+ $nav['events'] = ['events', t('Events'), '', t('Events and Calendar')];
}
- $nav['directory'] = array($gdirpath, t('Directory'), '', t('People directory'));
+ $nav['directory'] = [$gdirpath, t('Directory'), '', t('People directory')];
- $nav['about'] = array('friendica', t('Information'), '', t('Information about this friendica instance'));
+ $nav['about'] = ['friendica', t('Information'), '', t('Information about this friendica instance')];
// The following nav links are only show to logged in users
if (local_user()) {
- $nav['network'] = array('network', t('Network'), '', t('Conversations from your friends'));
- $nav['net_reset'] = array('network/0?f=&order=comment&nets=all', t('Network Reset'), '', t('Load Network page with no filters'));
+ $nav['network'] = ['network', t('Network'), '', t('Conversations from your friends')];
+ $nav['net_reset'] = ['network/0?f=&order=comment&nets=all', t('Network Reset'), '', t('Load Network page with no filters')];
- $nav['home'] = array('profile/' . $a->user['nickname'], t('Home'), '', t('Your posts and conversations'));
+ $nav['home'] = ['profile/' . $a->user['nickname'], t('Home'), '', t('Your posts and conversations')];
- if (in_array($_SESSION['page_flags'], array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP))) {
+ if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_PRVGROUP])) {
// only show friend requests for normal pages. Other page types have automatic friendship.
- if (in_array($_SESSION['page_flags'], array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP))) {
- $nav['introductions'] = array('notifications/intros', t('Introductions'), '', t('Friend Requests'));
+ if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_PRVGROUP])) {
+ $nav['introductions'] = ['notifications/intros', t('Introductions'), '', t('Friend Requests')];
}
- if (in_array($_SESSION['page_flags'], array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE))) {
- $nav['notifications'] = array('notifications', t('Notifications'), '', t('Notifications'));
- $nav['notifications']['all'] = array('notifications/system', t('See all notifications'), '', '');
- $nav['notifications']['mark'] = array('', t('Mark as seen'), '', t('Mark all system notifications seen'));
+ if (in_array($_SESSION['page_flags'], [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
+ $nav['notifications'] = ['notifications', t('Notifications'), '', t('Notifications')];
+ $nav['notifications']['all'] = ['notifications/system', t('See all notifications'), '', ''];
+ $nav['notifications']['mark'] = ['', t('Mark as seen'), '', t('Mark all system notifications seen')];
}
}
- $nav['messages'] = array('message', t('Messages'), '', t('Private mail'));
- $nav['messages']['inbox'] = array('message', t('Inbox'), '', t('Inbox'));
- $nav['messages']['outbox'] = array('message/sent', t('Outbox'), '', t('Outbox'));
- $nav['messages']['new'] = array('message/new', t('New Message'), '', t('New Message'));
+ $nav['messages'] = ['message', t('Messages'), '', t('Private mail')];
+ $nav['messages']['inbox'] = ['message', t('Inbox'), '', t('Inbox')];
+ $nav['messages']['outbox'] = ['message/sent', t('Outbox'), '', t('Outbox')];
+ $nav['messages']['new'] = ['message/new', t('New Message'), '', t('New Message')];
if (is_array($a->identities) && count($a->identities) > 1) {
- $nav['manage'] = array('manage', t('Manage'), '', t('Manage other pages'));
+ $nav['manage'] = ['manage', t('Manage'), '', t('Manage other pages')];
}
- $nav['delegations'] = array('delegate', t('Delegations'), '', t('Delegate Page Management'));
+ $nav['delegations'] = ['delegate', t('Delegations'), '', t('Delegate Page Management')];
- $nav['settings'] = array('settings', t('Settings'), '', t('Account settings'));
+ $nav['settings'] = ['settings', t('Settings'), '', t('Account settings')];
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
- $nav['profiles'] = array('profiles', t('Profiles'), '', t('Manage/Edit Profiles'));
+ $nav['profiles'] = ['profiles', t('Profiles'), '', t('Manage/Edit Profiles')];
}
- $nav['contacts'] = array('contacts', t('Contacts'), '', t('Manage/edit friends and contacts'));
+ $nav['contacts'] = ['contacts', t('Contacts'), '', t('Manage/edit friends and contacts')];
}
// Show the link to the admin configuration page if user is admin
if (is_site_admin()) {
- $nav['admin'] = array('admin/', t('Admin'), '', t('Site setup and configuration'));
+ $nav['admin'] = ['admin/', t('Admin'), '', t('Site setup and configuration')];
}
- $nav['navigation'] = array('navigation/', t('Navigation'), '', t('Site map'));
+ $nav['navigation'] = ['navigation/', t('Navigation'), '', t('Site map')];
// Provide a banner/logo/whatever
$banner = Config::get('system', 'banner');
call_hooks('nav_info', $nav);
- return array(
+ return [
'sitelocation' => $sitelocation,
'nav' => $nav,
'banner' => $banner,
'userinfo' => $userinfo,
- );
+ ];
}
/**
*/
function nav_set_selected($item){
$a = get_app();
- $a->nav_sel = array(
+ $a->nav_sel = [
'global' => null,
'community' => null,
'network' => null,
'manage' => null,
'events' => null,
'register' => null,
- );
+ ];
$a->nav_sel[$item] = 'selected';
}
$url,
$binary,
$redirects,
- array('timeout'=>$timeout,
+ ['timeout'=>$timeout,
'accept_content'=>$accept_content,
'cookiejar'=>$cookiejar
- )
+ ]
);
return($ret['body']);
* string 'header' => HTTP headers
* string 'body' => fetched content
*/
-function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array())
+function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = [])
{
- $ret = array('return_code' => 0, 'success' => false, 'header' => '', 'info' => '', 'body' => '');
+ $ret = ['return_code' => 0, 'success' => false, 'header' => '', 'info' => '', 'body' => ''];
$stamp1 = microtime(true);
curl_setopt(
$ch,
CURLOPT_HTTPHEADER,
- array('Accept: ' . $opts['accept_content'])
+ ['Accept: ' . $opts['accept_content']]
);
}
$newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
}
- $matches = array();
+ $matches = [];
if (preg_match('/(Location:|URI:)(.*?)\n/i', $header, $matches)) {
$newurl = trim(array_pop($matches));
if (defined('LIGHTTPD')) {
if (!is_array($headers)) {
- $headers = array('Expect:');
+ $headers = ['Expect:'];
} else {
if (!in_array('Expect:', $headers)) {
array_push($headers, 'Expect:');
}
if ($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307) {
- $matches = array();
+ $matches = [];
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
$newurl = trim(array_pop($matches));
function xml_status($st, $message = '')
{
- $result = array('status' => $st);
+ $result = ['status' => $st];
if ($message != '') {
$result['message'] = $message;
header("Content-type: text/xml");
- $xmldata = array("result" => $result);
+ $xmldata = ["result" => $result];
echo XML::fromArray($xmldata, $xml);
* 'title' => header title
* 'description' => optional message
*/
-function http_status_exit($val, $description = array())
+function http_status_exit($val, $description = [])
{
$err = '';
if ($val >= 400) {
$tpl = get_markup_template('http_status.tpl');
echo replace_macros(
$tpl,
- array(
+ [
'$title' => $description["title"],
- '$description' => $description["description"])
+ '$description' => $description["description"]]
);
}
return true;
}
- $domain_blocklist = Config::get('system', 'blocklist', array());
+ $domain_blocklist = Config::get('system', 'blocklist', []);
if (! $domain_blocklist) {
return false;
}
}
if ($ssl_changed) {
- $fields = array('url' => $contact['url'], 'request' => $contact['request'],
+ $fields = ['url' => $contact['url'], 'request' => $contact['request'],
'notify' => $contact['notify'], 'poll' => $contact['poll'],
- 'confirm' => $contact['confirm'], 'poco' => $contact['poco']);
- dba::update('contact', $fields, array('id' => $contact['id']));
+ 'confirm' => $contact['confirm'], 'poco' => $contact['poco']];
+ dba::update('contact', $fields, ['id' => $contact['id']]);
}
}
foreach ($querydata as $param => $value) {
if (in_array(
$param,
- array(
+ [
"utm_source", "utm_medium", "utm_term", "utm_content", "utm_campaign",
"wt_mc", "pk_campaign", "pk_kwd", "mc_cid", "mc_eid",
"fb_action_ids", "fb_action_types", "fb_ref",
"awesm", "wtrid",
- "woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term")
+ "woo_campaign", "woo_source", "woo_medium", "woo_content", "woo_term"]
)
) {
$pair = $param . "=" . urlencode($value);
$pair = $param . "=" . $value;
$url = str_replace($pair, "", $url);
- $url = str_replace(array("?&", "&&"), array("?", ""), $url);
+ $url = str_replace(["?&", "&&"], ["?", ""], $url);
}
}
}
$list = $xpath->query("//meta[@content]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
$yourls->set('password', $yourls_password);
$yourls->set('ssl', $yourls_ssl);
$yourls->set('yourls-url', $yourls_url);
- $slinky->set_cascade(array($yourls, new Slinky_Ur1ca(), new Slinky_TinyURL()));
+ $slinky->set_cascade([$yourls, new Slinky_Ur1ca(), new Slinky_TinyURL()]);
} else {
// setup a cascade of shortening services
// try to get a short link from these services
// in the order ur1.ca, tinyurl
- $slinky->set_cascade(array(new Slinky_Ur1ca(), new Slinky_TinyURL()));
+ $slinky->set_cascade([new Slinky_Ur1ca(), new Slinky_TinyURL()]);
}
return $slinky->short();
}
if (isset($a->strings) && count($a->strings)) {
$a->stringsave = $a->strings;
}
- $a->strings = array();
+ $a->strings = [];
load_translation_table($language);
$lang = $language;
}
if (isset($a->stringsave)) {
$a->strings = $a->stringsave;
} else {
- $a->strings = array();
+ $a->strings = [];
}
$lang = $a->langsave;
function load_translation_table($lang) {
$a = get_app();
- $a->strings = array();
+ $a->strings = [];
// load enabled plugins strings
- $plugins = dba::select('addon', array('name'), array('installed' => true));
+ $plugins = dba::select('addon', ['name'], ['installed' => true]);
while ($p = dba::fetch($plugins)) {
$name = $p['name'];
if (file_exists("addon/$name/lang/$lang/strings.php")) {
* @return array
*/
function get_available_languages() {
- $langs = array();
+ $langs = [];
$strings_file_paths = glob('view/lang/*/strings.php');
if (is_array($strings_file_paths) && count($strings_file_paths)) {
*/
function get_old_attachment_data($body) {
- $post = array();
+ $post = [];
// Simplify image codes
$body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
if (preg_match_all("(\[class=(.*?)\](.*?)\[\/class\])ism",$body, $attached, PREG_SET_ORDER)) {
foreach ($attached AS $data) {
- if (!in_array($data[1], array("type-link", "type-video", "type-photo")))
+ if (!in_array($data[1], ["type-link", "type-video", "type-photo"]))
continue;
$post["type"] = substr($data[1], 5);
$post["url"] = $matches[1];
$post["title"] = $matches[2];
}
- if (($post["url"] == "") && (in_array($post["type"], array("link", "video")))
+ if (($post["url"] == "") && (in_array($post["type"], ["link", "video"]))
&& preg_match("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $attacheddata, $matches)) {
$post["url"] = $matches[1];
}
return $data;
}
-function get_attached_data($body, $item = array()) {
+function get_attached_data($body, $item = []) {
/*
- text:
- type: link, video, photo
*/
function uninstall_plugin($plugin) {
logger("Addons: uninstalling " . $plugin);
- dba::delete('addon', array('name' => $plugin));
+ dba::delete('addon', ['name' => $plugin]);
@include_once('addon/' . $plugin . '/' . $plugin . '.php');
if (function_exists($plugin . '_uninstall')) {
$plugin_admin = (function_exists($plugin."_plugin_admin") ? 1 : 0);
- dba::insert('addon', array('name' => $plugin, 'installed' => true,
- 'timestamp' => $t, 'plugin_admin' => $plugin_admin));
+ dba::insert('addon', ['name' => $plugin, 'installed' => true,
+ 'timestamp' => $t, 'plugin_admin' => $plugin_admin]);
// we can add the following with the previous SQL
// once most site tables have been updated.
// This way the system won't fall over dead during the update.
if (file_exists('addon/' . $plugin . '/.hidden')) {
- dba::update('addon', array('hidden' => true), array('name' => $plugin));
+ dba::update('addon', ['hidden' => true], ['name' => $plugin]);
}
return true;
} else {
if (DBM::is_result($r)) {
$installed = $r;
} else {
- $installed = array();
+ $installed = [];
}
$parr = explode(',',$plugins);
$func = $pl . '_install';
$func();
}
- dba::update('addon', array('timestamp' => $t), array('id' => $i['id']));
+ dba::update('addon', ['timestamp' => $t], ['id' => $i['id']]);
}
}
}
* @return boolean
*/
function plugin_enabled($plugin) {
- return dba::exists('addon', array('installed' => true, 'name' => $plugin));
+ return dba::exists('addon', ['installed' => true, 'name' => $plugin]);
}
* @return mixed|bool
*/
function register_hook($hook, $file, $function, $priority=0) {
- $condition = array('hook' => $hook, 'file' => $file, 'function' => $function);
+ $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
$exists = dba::exists('hook', $condition);
if ($exists) {
return true;
}
- $r = dba::insert('hook', array('hook' => $hook, 'file' => $file, 'function' => $function, 'priority' => $priority));
+ $r = dba::insert('hook', ['hook' => $hook, 'file' => $file, 'function' => $function, 'priority' => $priority]);
return $r;
}
* @return array
*/
function unregister_hook($hook, $file, $function) {
- $condition = array('hook' => $hook, 'file' => $file, 'function' => $function);
+ $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
$r = dba::delete('hook', $condition);
return $r;
}
function load_hooks() {
$a = get_app();
- $a->hooks = array();
- $r = dba::select('hook', array('hook', 'file', 'function'), array(), array('order' => array('priority' => 'desc', 'file')));
+ $a->hooks = [];
+ $r = dba::select('hook', ['hook', 'file', 'function'], [], ['order' => ['priority' => 'desc', 'file']]);
while ($rr = dba::fetch($r)) {
if (! array_key_exists($rr['hook'],$a->hooks)) {
- $a->hooks[$rr['hook']] = array();
+ $a->hooks[$rr['hook']] = [];
}
- $a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
+ $a->hooks[$rr['hook']][] = [$rr['file'],$rr['function']];
}
dba::close($r);
}
$func($a, $data);
} else {
// remove orphan hooks
- $condition = array('hook' => $name, 'file' => $hook[0], 'function' => $hook[1]);
+ $condition = ['hook' => $name, 'file' => $hook[0], 'function' => $hook[1]];
dba::delete('hook', $condition);
}
}
$a = get_app();
- $info=Array(
+ $info=[
'name' => $plugin,
'description' => "",
- 'author' => array(),
+ 'author' => [],
'version' => "",
'status' => ""
- );
+ ];
if (!is_file("addon/$plugin/$plugin.php")) return $info;
if ($k == "author") {
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if ($r) {
- $info['author'][] = array('name'=>$m[1], 'link'=>$m[2]);
+ $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
} else {
- $info['author'][] = array('name'=>$v);
+ $info['author'][] = ['name'=>$v];
}
} else {
if (array_key_exists($k,$info)) {
*/
function get_theme_info($theme) {
- $info=Array(
+ $info=[
'name' => $theme,
'description' => "",
- 'author' => array(),
- 'maintainer' => array(),
+ 'author' => [],
+ 'maintainer' => [],
'version' => "",
'credits' => "",
'experimental' => false,
'unsupported' => false
- );
+ ];
if (file_exists("view/theme/$theme/experimental"))
$info['experimental'] = true;
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if ($r) {
- $info['author'][] = array('name'=>$m[1], 'link'=>$m[2]);
+ $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
} else {
- $info['author'][] = array('name'=>$v);
+ $info['author'][] = ['name'=>$v];
}
} elseif ($k == "maintainer") {
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if ($r) {
- $info['maintainer'][] = array('name'=>$m[1], 'link'=>$m[2]);
+ $info['maintainer'][] = ['name'=>$m[1], 'link'=>$m[2]];
} else {
- $info['maintainer'][] = array('name'=>$v);
+ $info['maintainer'][] = ['name'=>$v];
}
} else {
if (array_key_exists($k,$info)) {
* @return string
*/
function get_theme_screenshot($theme) {
- $exts = array('.png','.jpg');
+ $exts = ['.png','.jpg'];
foreach ($exts as $ext) {
if (file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
return(System::baseUrl() . '/view/theme/' . $theme . '/screenshot' . $ext);
$theme = current_theme();
$thname = $theme;
$ext = substr($file,strrpos($file,'.')+1);
- $paths = array(
+ $paths = [
"{$root}view/theme/$thname/$ext/$file",
"{$root}view/theme/$parent/$ext/$file",
"{$root}view/$ext/$file",
- );
+ ];
foreach ($paths as $p) {
// strpos() is faster than strstr when checking if one string is in another (http://php.net/manual/en/function.strstr.php)
if (strpos($p,'NOPATH') !== false) {
return false;
}
- $item_arr = array();
+ $item_arr = [];
foreach ($r AS $item) {
$index = $item["author-link"]."-".$item["uid"];
- $item_arr[$index] = array("author-link" => $item["author-link"],
+ $item_arr[$index] = ["author-link" => $item["author-link"],
"uid" => $item["uid"],
- "network" => $item["network"]);
+ "network" => $item["network"]];
}
// Set the "gcontact-id" in the item table and add a new gcontact entry if needed
foreach ($item_arr AS $item) {
- $gcontact_id = GContact::getId(array("url" => $item['author-link'], "network" => $item['network'],
- "photo" => $item['author-avatar'], "name" => $item['author-name']));
+ $gcontact_id = GContact::getId(["url" => $item['author-link'], "network" => $item['network'],
+ "photo" => $item['author-avatar'], "name" => $item['author-name']]);
q("UPDATE `item` SET `gcontact-id` = %d WHERE `uid` = %d AND `author-link` = '%s' AND `gcontact-id` = 0",
intval($gcontact_id), intval($item["uid"]), dbesc($item["author-link"]));
}
logger("Query done", LOGGER_DEBUG);
- $item_arr = array();
+ $item_arr = [];
foreach ($r AS $item) {
$index = $item["author-link"]."-".$item["owner-link"]."-".$item["uid"];
- $item_arr[$index] = array("author-link" => $item["author-link"],
+ $item_arr[$index] = ["author-link" => $item["author-link"],
"owner-link" => $item["owner-link"],
- "uid" => $item["uid"]);
+ "uid" => $item["uid"]];
}
// Set the "gcontact-id" in the item table and add a new gcontact entry if needed
function remove_queue_item($id) {
logger('queue: remove queue item ' . $id);
- dba::delete('queue', array('id' => $id));
+ dba::delete('queue', ['id' => $id]);
}
/**
* @param int $time
* @param array $user Record from "user" table
*/
-function new_cookie($time, $user = array())
+function new_cookie($time, $user = [])
{
if ($time != 0) {
$time = $time + time();
}
if ($user) {
- $value = json_encode(array("uid" => $user["uid"],
+ $value = json_encode(["uid" => $user["uid"],
"hash" => cookie_hash($user),
- "ip" => $_SERVER['REMOTE_ADDR']));
+ "ip" => $_SERVER['REMOTE_ADDR']]);
} else {
$value = "";
}
}
}
- $r = dba::select('user', array('uid', 'username', 'nickname'),
- array('password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false));
+ $r = dba::select('user', ['uid', 'username', 'nickname'],
+ ['password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false]);
if (DBM::is_result($r)) {
$a->identities = dba::inArray($r);
} else {
- $a->identities = array();
+ $a->identities = [];
}
$r = dba::p("SELECT `user`.`uid`, `user`.`username`, `user`.`nickname`
header('X-Account-Management-Status: active; name="' . $a->user['username'] . '"; id="' . $a->user['nickname'] . '"');
if ($login_initial || $login_refresh) {
- dba::update('user', array('login_date' => datetime_convert()), array('uid' => $_SESSION['uid']));
+ dba::update('user', ['login_date' => datetime_convert()], ['uid' => $_SESSION['uid']]);
// Set the login date for all identities of the user
- dba::update('user', array('login_date' => datetime_convert()),
- array('password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false));
+ dba::update('user', ['login_date' => datetime_convert()],
+ ['password' => $master_record['password'], 'email' => $master_record['email'], 'account_removed' => false]);
}
if ($login_initial) {
}
if ($session_exists) {
- $fields = array('data' => $data, 'expire' => $expire);
- $condition = array("`sid` = ? AND (`data` != ? OR `expire` != ?)", $id, $data, $expire);
+ $fields = ['data' => $data, 'expire' => $expire];
+ $condition = ["`sid` = ? AND (`data` != ? OR `expire` != ?)", $id, $data, $expire];
dba::update('session', $fields, $condition);
} else {
- $fields = array('sid' => $id, 'expire' => $default_expire, 'data' => $data);
+ $fields = ['sid' => $id, 'expire' => $default_expire, 'data' => $data];
dba::insert('session', $fields);
}
return true;
}
- dba::delete('session', array('sid' => $id));
+ dba::delete('session', ['sid' => $id]);
return true;
}
function ref_session_gc()
{
- dba::delete('session', array("`expire` < ?", time()));
+ dba::delete('session', ["`expire` < ?", time()]);
return true;
}
// ignore anything in a code block
$data = preg_replace('/\[code\](.*?)\[\/code\]/sm', '', $data);
- $tags = array();
+ $tags = [];
$pattern = '/\W\#([^\[].*?)[\s\'".,:;\?!\[\]\/]/ism';
if (preg_match_all($pattern, $data, $matches)) {
TERM_OBJ_POST
);
if (!DBM::is_result($r)) {
- return array();
+ return [];
}
return tag_calc($r);
}
$tpl = get_markup_template('tagblock_widget.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$title' => t('Tags'),
'$tags' => $tags
- ));
+ ]);
}
return $o;
}
*/
function tag_calc($arr)
{
- $tags = array();
+ $tags = [];
$min = 1e9;
$max = -1e9;
$x = 0;
if (!$arr) {
- return array();
+ return [];
}
foreach ($arr as $rr) {
* @return string Filtered string
*/
function notags($string) {
- return str_replace(array("<", ">"), array('[', ']'), $string);
+ return str_replace(["<", ">"], ['[', ']'], $string);
// High-bit filter no longer used
// return str_replace(array("<",">","\xBA","\xBC","\xBE"), array('[',']','','',''), $string);
return '';
}
- $vowels = array('a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u');
+ $vowels = ['a','a','ai','au','e','e','e','ee','ea','i','ie','o','ou','u'];
if (mt_rand(0, 5) == 4) {
$vowels[] = 'y';
}
- $cons = array(
+ $cons = [
'b','bl','br',
'c','ch','cl','cr',
'd','dr',
'w','wh',
'x',
'z','zh'
- );
+ ];
- $midcons = array('ck','ct','gn','ld','lf','lm','lt','mb','mm', 'mn','mp',
- 'nd','ng','nk','nt','rn','rp','rt');
+ $midcons = ['ck','ct','gn','ld','lf','lm','lt','mb','mm', 'mn','mp',
+ 'nd','ng','nk','nt','rn','rp','rt'];
- $noend = array('bl', 'br', 'cl','cr','dr','fl','fr','gl','gr',
- 'kh', 'kl','kr','mn','pl','pr','rh','tr','qu','wh');
+ $noend = ['bl', 'br', 'cl','cr','dr','fl','fr','gl','gr',
+ 'kh', 'kl','kr','mn','pl','pr','rh','tr','qu','wh'];
$start = mt_rand(0,2);
if ($start == 0) {
}
$url = $stripped;
- $data = array();
+ $data = [];
function _l(&$d, $name, $url, $text, $class = '') {
if (strpos($url, '?') === false && ($pos = strpos($url, '&')) !== false) {
$url = substr($url, 0, $pos) . '?' . substr($url, $pos + 1);
}
- $d[$name] = array('url' => $url, 'text' => $text, 'class' => $class);
+ $d[$name] = ['url' => $url, 'text' => $text, 'class' => $class];
}
if (!is_null($count)) {
$numstop = (($pagenum > ($numpages - 7)) ? $numpages : ($numstart + 8));
}
- $pages = array();
+ $pages = [];
for ($i = $numstart; $i <= $numstop; $i++) {
if ($i == $a->pager['page']) {
$data = paginate_data($a);
$tpl = get_markup_template("paginate.tpl");
- return replace_macros($tpl, array("pager" => $data));
+ return replace_macros($tpl, ["pager" => $data]);
}
$data = paginate_data($a, $i);
$tpl = get_markup_template("paginate.tpl");
- return replace_macros($tpl, array('pager' => $data));
+ return replace_macros($tpl, ['pager' => $data]);
}
*/
function scroll_loader() {
$tpl = get_markup_template("scroll_loader.tpl");
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'wait' => t('Loading more entries...'),
'end' => t('The end')
- ));
+ ]);
}
function expand_acl($s) {
// turn string array of angle-bracketed elements into numeric array
// e.g. "<1><2><3>" => array(1,2,3);
- $ret = array();
+ $ret = [];
if (strlen($s)) {
$t = str_replace('<', '', $s);
$uri = "urn:X-dfrn:" . $hostname . ':' . $uid . ':' . $hash;
- $dups = dba::exists('item', array('uri' => $uri));
+ $dups = dba::exists('item', ['uri' => $uri]);
} while ($dups == true);
return $uri;
/* setup int->string log level map */
-$LOGGER_LEVELS = array();
+$LOGGER_LEVELS = [];
/**
* @brief Logs the given message at the given log level
* @return array List of tag and person names
*/
function get_tags($string) {
- $ret = array();
+ $ret = [];
// Convert hashtag links to hashtags
$string = preg_replace('/#\[url\=([^\[\]]*)\](.*?)\[\/url\]/ism', '#$2', $string);
$string = preg_replace('/\[code\](.*?)\[\/code\]/sm', '', $string);
// Force line feeds at bbtags
- $string = str_replace(array('[', ']'), array("\n[", "]\n"), $string);
+ $string = str_replace(['[', ']'], ["\n[", "]\n"], $string);
// ignore anything in a bbtag
$string = preg_replace('/\[(.*?)\]/sm', '', $string);
intval($shown)
);
if (DBM::is_result($r)) {
- $contacts = array();
+ $contacts = [];
foreach ($r AS $contact) {
$contacts[] = $contact["id"];
}
if (DBM::is_result($r)) {
$contacts = sprintf(tt('%d Contact','%d Contacts', $total),$total);
- $micropro = Array();
+ $micropro = [];
foreach ($r as $rr) {
$micropro[] = micropro($rr,true,'mpfriend');
}
}
$tpl = get_markup_template('contact_block.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$contacts' => $contacts,
'$nickname' => $a->profile['nickname'],
'$viewcontacts' => t('View Contacts'),
'$micropro' => $micropro,
- ));
+ ]);
- $arr = array('contacts' => $r, 'output' => $o);
+ $arr = ['contacts' => $r, 'output' => $o];
call_hooks('contact_block_end', $arr);
return $o;
$url = '';
}
- return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),array(
+ return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),[
'$click' => defaults($contact, 'click', ''),
'$class' => $class,
'$url' => $url,
'$parkle' => $sparkle,
'$redir' => $redir,
- ));
+ ]);
}
/**
}
$save_label = $mode === 'text' ? t('Save') : t('Follow');
- $values = array(
+ $values = [
'$s' => htmlspecialchars($s),
'$id' => $id,
'$action_url' => $url,
'$savedsearch' => Feature::isEnabled(local_user(),'savedsearch'),
'$search_hint' => t('@name, !forum, #tags, content'),
'$mode' => $mode
- );
+ ];
if (!$aside) {
- $values['$searchoption'] = array(
+ $values['$searchoption'] = [
t("Full Text"),
t("Tags"),
- t("Contacts"));
+ t("Contacts")];
if (Config::get('system','poco_local_search')) {
$values['$searchoption'][] = t("Forums");
// index is present tense verb
// value is array containing past tense verb, translation of present, translation of past
- $arr = array(
- 'poke' => array('poked', t('poke'), t('poked')),
- 'ping' => array('pinged', t('ping'), t('pinged')),
- 'prod' => array('prodded', t('prod'), t('prodded')),
- 'slap' => array('slapped', t('slap'), t('slapped')),
- 'finger' => array('fingered', t('finger'), t('fingered')),
- 'rebuff' => array('rebuffed', t('rebuff'), t('rebuffed')),
- );
+ $arr = [
+ 'poke' => ['poked', t('poke'), t('poked')],
+ 'ping' => ['pinged', t('ping'), t('pinged')],
+ 'prod' => ['prodded', t('prod'), t('prodded')],
+ 'slap' => ['slapped', t('slap'), t('slapped')],
+ 'finger' => ['fingered', t('finger'), t('fingered')],
+ 'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')],
+ ];
call_hooks('poke_verbs', $arr);
return $arr;
}
* @return string Translated string.
*/
function day_translate($s) {
- $ret = str_replace(array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'),
- array(t('Monday'), t('Tuesday'), t('Wednesday'), t('Thursday'), t('Friday'), t('Saturday'), t('Sunday')),
+ $ret = str_replace(['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
+ [t('Monday'), t('Tuesday'), t('Wednesday'), t('Thursday'), t('Friday'), t('Saturday'), t('Sunday')],
$s);
- $ret = str_replace(array('January','February','March','April','May','June','July','August','September','October','November','December'),
- array(t('January'), t('February'), t('March'), t('April'), t('May'), t('June'), t('July'), t('August'), t('September'), t('October'), t('November'), t('December')),
+ $ret = str_replace(['January','February','March','April','May','June','July','August','September','October','November','December'],
+ [t('January'), t('February'), t('March'), t('April'), t('May'), t('June'), t('July'), t('August'), t('September'), t('October'), t('November'), t('December')],
$ret);
return $ret;
* @return string Translated string.
*/
function day_short_translate($s) {
- $ret = str_replace(array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'),
- array(t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sun')),
+ $ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+ [t('Mon'), t('Tue'), t('Wed'), t('Thu'), t('Fri'), t('Sat'), t('Sun')],
$s);
- $ret = str_replace(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'),
- array(t('Jan'), t('Feb'), t('Mar'), t('Apr'), t('May'), ('Jun'), t('Jul'), t('Aug'), t('Sep'), t('Oct'), t('Nov'), t('Dec')),
+ $ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov','Dec'],
+ [t('Jan'), t('Feb'), t('Mar'), t('Apr'), t('May'), ('Jun'), t('Jul'), t('Aug'), t('Sep'), t('Oct'), t('Nov'), t('Dec')],
$ret);
return $ret;
}
* @return string
*/
function normalise_link($url) {
- $ret = str_replace(array('https:', '//www.'), array('http:', '//'), $url);
+ $ret = str_replace(['https:', '//www.'], ['http:', '//'], $url);
return rtrim($ret,'/');
}
$item["body"] = $body;
if ($update && ($item["id"] > 0)) {
- dba::update('item', array('rendered-html' => $item["rendered-html"], 'rendered-hash' => $item["rendered-hash"]),
- array('id' => $item["id"]), false);
+ dba::update('item', ['rendered-html' => $item["rendered-html"], 'rendered-hash' => $item["rendered-hash"]],
+ ['id' => $item["id"]], false);
}
}
}
$searchpath = System::baseUrl() . "/search?tag=";
- $tags = array();
- $hashtags = array();
- $mentions = array();
+ $tags = [];
+ $hashtags = [];
+ $mentions = [];
// In order to provide theme developers more possibilities, event items
// are treated differently.
put_item_in_cache($item, $update);
$s = $item["rendered-html"];
- $prep_arr = array('item' => $item, 'html' => $s, 'preview' => $preview);
+ $prep_arr = ['item' => $item, 'html' => $s, 'preview' => $preview];
call_hooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
if (! $attach) {
// Replace the blockquotes with quotes that are used in mails.
$mailquote = '<blockquote type="cite" class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">';
- $s = str_replace(array('<blockquote>', '<blockquote class="spoiler">', '<blockquote class="author">'), array($mailquote, $mailquote, $mailquote), $s);
+ $s = str_replace(['<blockquote>', '<blockquote class="spoiler">', '<blockquote class="author">'], [$mailquote, $mailquote, $mailquote], $s);
return $s;
}
if (strpos($mime, 'video') !== false) {
if (!$vhead) {
$vhead = true;
- $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), array(
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), [
'$baseurl' => System::baseUrl(),
- ));
- $a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), array(
+ ]);
+ $a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), [
'$baseurl' => System::baseUrl(),
- ));
+ ]);
}
$id = end(explode('/', $the_url));
- $as .= replace_macros(get_markup_template('video_top.tpl'), array(
- '$video' => array(
+ $as .= replace_macros(get_markup_template('video_top.tpl'), [
+ '$video' => [
'id' => $id,
'title' => t('View Video'),
'src' => $the_url,
'mime' => $mime,
- ),
- ));
+ ],
+ ]);
}
$filetype = strtolower(substr($mime, 0, strpos($mime, '/')));
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
}
- $prep_arr = array('item' => $item, 'html' => $s);
+ $prep_arr = ['item' => $item, 'html' => $s];
call_hooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
*/
function get_cats_and_terms($item)
{
- $categories = array();
- $folders = array();
+ $categories = [];
+ $folders = [];
$matches = false;
$first = true;
$cnt = preg_match_all('/<(.*?)>/', $item['file'], $matches, PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
- $categories[] = array(
+ $categories[] = [
'name' => xmlify(file_tag_decode($mtch[1])),
'url' => "#",
'removeurl' => ((local_user() == $item['uid'])?'filerm/' . $item['id'] . '?f=&cat=' . xmlify(file_tag_decode($mtch[1])):""),
'first' => $first,
'last' => false
- );
+ ];
$first = false;
}
}
$cnt = preg_match_all('/\[(.*?)\]/', $item['file'], $matches, PREG_SET_ORDER);
if ($cnt) {
foreach ($matches as $mtch) {
- $folders[] = array(
+ $folders[] = [
'name' => xmlify(file_tag_decode($mtch[1])),
'url' => "#",
'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])) : ""),
'first' => $first,
'last' => false
- );
+ ];
$first = false;
}
}
$folders[count($folders) - 1]['last'] = true;
}
- return array($categories, $folders);
+ return [$categories, $folders];
}
$a = get_app();
if ($a->user['nickname'] != "") {
- $ret = array(
+ $ret = [
//'href' => "display/" . $a->user['nickname'] . "/" . $item['id'],
'href' => "display/" . $item['guid'],
'orig' => "display/" . $item['guid'],
'title' => t('View on separate page'),
'orig_title' => t('view on separate page'),
- );
+ ];
if (x($item, 'plink')) {
$ret["href"] = $a->remove_baseurl($item['plink']);
}
} elseif (x($item, 'plink') && ($item['private'] != 1)) {
- $ret = array(
+ $ret = [
'href' => $item['plink'],
'orig' => $item['plink'],
'title' => t('link to source'),
- );
+ ];
} else {
- $ret = array();
+ $ret = [];
}
return $ret;
// To do this we need to escape these characters if they appear in our tag.
function file_tag_encode($s) {
- return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s);
+ return str_replace(['<','>','[',']'],['%3c','%3e','%5b','%5d'],$s);
}
function file_tag_decode($s) {
- return str_replace(array('%3c', '%3e', '%5b', '%5d'), array('<', '>', '[', ']'), $s);
+ return str_replace(['%3c', '%3e', '%5b', '%5d'], ['<', '>', '[', ']'], $s);
}
function file_tag_file_query($table,$s,$type = 'file') {
$filetags_updated = $saved;
// check for new tags to be added as filetags in pconfig
- $new_tags = array();
+ $new_tags = [];
$check_new_tags = explode(",",file_tag_file_to_list($file_new,$type));
foreach ($check_new_tags as $tag) {
$filetags_updated .= file_tag_list_to_file(implode(",",$new_tags),$type);
// check for deleted tags to be removed from filetags in pconfig
- $deleted_tags = array();
+ $deleted_tags = [];
$check_deleted_tags = explode(",",file_tag_file_to_list($file_old,$type));
foreach ($check_deleted_tags as $tag) {
}
function normalise_openid($s) {
- return trim(str_replace(array('http://', 'https://'), array('', ''), $s), '/');
+ return trim(str_replace(['http://', 'https://'], ['', ''], $s), '/');
}
function deindent($text, $chr = "[\t ]", $count = NULL) {
$lines = explode("\n", $text);
if (is_null($count)) {
- $m = array();
+ $m = [];
$k = 0;
while ($k < count($lines) && strlen($lines[$k]) == 0) {
$k++;
}
function formatBytes($bytes, $precision = 2) {
- $units = array('B', 'KB', 'MB', 'GB', 'TB');
+ $units = ['B', 'KB', 'MB', 'GB', 'TB'];
$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
// Autoload the library to make constants available
class_exists('Text_Highlighter_Renderer_Html');
- $options = array(
+ $options = [
'numbers' => HL_NUMBERS_LI,
'tabsize' => 4,
- );
+ ];
$tag_added = false;
$s = trim(html_entity_decode($s, ENT_COMPAT));
}
// is it an entry from a connector? Only add an entry for natively connected networks
- if (!in_array($item["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) {
+ if (!in_array($item["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""])) {
return;
}
$item[0]['wall'] = 0;
$item[0]['contact-id'] = Contact::getIdForURL($item[0]['author-link'], 0);
- if (in_array($item[0]['type'], array("net-comment", "wall-comment"))) {
+ if (in_array($item[0]['type'], ["net-comment", "wall-comment"])) {
$item[0]['type'] = 'remote-comment';
} elseif ($item[0]['type'] == 'wall') {
$item[0]['type'] = 'remote';
$item['wall'] = 0;
$item['contact-id'] = Contact::getIdForURL($item['author-link'], 0);
- if (in_array($item['type'], array("net-comment", "wall-comment"))) {
+ if (in_array($item['type'], ["net-comment", "wall-comment"])) {
$item['type'] = 'remote-comment';
} elseif ($item['type'] == 'wall') {
$item['type'] = 'remote';
$sql = "";
foreach ($item AS $field => $data)
- if (!in_array($field, array("guid", "title", "body", "rendered-html", "rendered-hash"))) {
+ if (!in_array($field, ["guid", "title", "body", "rendered-html", "rendered-hash"])) {
if ($sql != "") {
$sql .= ", ";
}
intval($item["uid"])
);
if (!DBM::is_result($r)) {
- dba::delete('item', array('uri' => $itemuri, 'uid' => 0));
+ dba::delete('item', ['uri' => $itemuri, 'uid' => 0]);
logger("delete_thread: Deleted shadow for item ".$itemuri, LOGGER_DEBUG);
}
}
function update_threads() {
logger("update_threads: start");
- $messages = dba::select('item', array('id'), array("`id` = `parent`"));
+ $messages = dba::select('item', ['id'], ["`id` = `parent`"]);
logger("update_threads: fetched messages: ".dba::num_rows($messages));
logger("start");
$condition = "`uid` != 0 AND `network` IN ('', ?, ?, ?) AND `visible` AND NOT `deleted` AND NOT `moderated` AND NOT `private`";
- $messages = dba::select('thread', array('iid'), array($condition, NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS),
- array('order' => 'created'));
+ $messages = dba::select('thread', ['iid'], [$condition, NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS],
+ ['order' => 'created']);
logger("fetched messages: ".dba::num_rows($messages));
while ($message = dba::fetch($messages))
if (! x($_SESSION, 'sysmsg')) {
- $_SESSION['sysmsg'] = array();
+ $_SESSION['sysmsg'] = [];
}
if (! x($_SESSION, 'sysmsg_info')) {
- $_SESSION['sysmsg_info'] = array();
+ $_SESSION['sysmsg_info'] = [];
}
// Array for informations about last received items
if (! x($_SESSION, 'last_updated')) {
- $_SESSION['last_updated'] = array();
+ $_SESSION['last_updated'] = [];
}
/*
* check_config() is responsible for running update scripts. These automatically
//Don't populate apps_menu if apps are private
$privateapps = Config::get('config', 'private_addons');
if ((local_user()) || (! $privateapps === "1")) {
- $arr = array('app_menu' => $a->apps);
+ $arr = ['app_menu' => $a->apps];
call_hooks('app_menu', $arr);
$tpl = get_markup_template("404.tpl");
$a->page['content'] = replace_macros(
$tpl,
- array(
- '$message' => t('Page not found.'))
+ [
+ '$message' => t('Page not found.')]
);
}
}
}
if (! $a->error) {
- $arr = array('content' => $a->page['content']);
+ $arr = ['content' => $a->page['content']];
call_hooks($a->module . '_mod_content', $arr);
$a->page['content'] = $arr['content'];
if ($a->module_class) {
- $arr = array('content' => call_user_func([$a->module_class, 'content']));
+ $arr = ['content' => call_user_func([$a->module_class, 'content'])];
} else if (function_exists($a->module . '_content')) {
$func = $a->module . '_content';
- $arr = array('content' => $func($a));
+ $arr = ['content' => $func($a)];
}
call_hooks($a->module . '_mod_aftercontent', $arr);
$a->page['content'] .= $arr['content'];
}
$a->page['footer'] = replace_macros(
get_markup_template("toggle_mobile_footer.tpl"),
- array(
+ [
'$toggle_link' => $link,
- '$toggle_text' => t('toggle mobile'))
+ '$toggle_text' => t('toggle mobile')]
);
}
$scope = SR_SCOPE_NONE;
}
- $tags = array();
+ $tags = [];
if ($scope == SR_SCOPE_TAGS) {
$server_tags = Config::get('system', 'relay_server_tags');
}
}
- $taglist = array();
+ $taglist = [];
foreach ($tags AS $tag) {
$taglist[] = $tag;
}
- $relay = array(
+ $relay = [
"subscribe" => $subscribe,
"scope" => $scope,
"tags" => $taglist
- );
+ ];
header('Content-type: application/json; charset=utf-8');
echo json_encode($relay, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
// apc_delete($toDelete);
//}
// Header stuff
- $a->page['htmlhead'] .= replace_macros(get_markup_template('admin/settings_head.tpl'), array());
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('admin/settings_head.tpl'), []);
/*
* Side bar links
*/
- $aside_tools = array();
+ $aside_tools = [];
// array(url, name, extra css classes)
// not part of $aside to make the template more adjustable
- $aside_sub = array(
- 'site' => array("admin/site/" , t("Site") , "site"),
- 'users' => array("admin/users/" , t("Users") , "users"),
- 'plugins' => array("admin/plugins/" , t("Plugins") , "plugins"),
- 'themes' => array("admin/themes/" , t("Themes") , "themes"),
- 'features' => array("admin/features/" , t("Additional features") , "features"),
- 'dbsync' => array("admin/dbsync/" , t('DB updates') , "dbsync"),
- 'queue' => array("admin/queue/" , t('Inspect Queue') , "queue"),
- 'contactblock' => array("admin/contactblock/", t('Contact Blocklist') , "contactblock"),
- 'blocklist' => array("admin/blocklist/" , t('Server Blocklist') , "blocklist"),
- 'federation' => array("admin/federation/" , t('Federation Statistics'), "federation"),
- 'deleteitem' => array("admin/deleteitem/" , t('Delete Item') , 'deleteitem'),
- );
+ $aside_sub = [
+ 'site' => ["admin/site/" , t("Site") , "site"],
+ 'users' => ["admin/users/" , t("Users") , "users"],
+ 'plugins' => ["admin/plugins/" , t("Plugins") , "plugins"],
+ 'themes' => ["admin/themes/" , t("Themes") , "themes"],
+ 'features' => ["admin/features/" , t("Additional features") , "features"],
+ 'dbsync' => ["admin/dbsync/" , t('DB updates') , "dbsync"],
+ 'queue' => ["admin/queue/" , t('Inspect Queue') , "queue"],
+ 'contactblock' => ["admin/contactblock/", t('Contact Blocklist') , "contactblock"],
+ 'blocklist' => ["admin/blocklist/" , t('Server Blocklist') , "blocklist"],
+ 'federation' => ["admin/federation/" , t('Federation Statistics'), "federation"],
+ 'deleteitem' => ["admin/deleteitem/" , t('Delete Item') , 'deleteitem'],
+ ];
/* get plugins admin page */
$r = q("SELECT `name` FROM `addon` WHERE `plugin_admin` = 1 ORDER BY `name`");
- $aside_tools['plugins_admin'] = array();
+ $aside_tools['plugins_admin'] = [];
foreach ($r as $h) {
$plugin = $h['name'];
- $aside_tools['plugins_admin'][] = array("admin/plugins/" . $plugin, $plugin, "plugin");
+ $aside_tools['plugins_admin'][] = ["admin/plugins/" . $plugin, $plugin, "plugin"];
// temp plugins with admin
$a->plugins_admin[] = $plugin;
}
- $aside_tools['logs'] = array("admin/logs/", t("Logs"), "logs");
- $aside_tools['viewlogs'] = array("admin/viewlogs/", t("View Logs"), 'viewlogs');
- $aside_tools['diagnostics_probe'] = array('probe/', t('probe address'), 'probe');
- $aside_tools['diagnostics_webfinger'] = array('webfinger/', t('check webfinger'), 'webfinger');
+ $aside_tools['logs'] = ["admin/logs/", t("Logs"), "logs"];
+ $aside_tools['viewlogs'] = ["admin/viewlogs/", t("View Logs"), 'viewlogs'];
+ $aside_tools['diagnostics_probe'] = ['probe/', t('probe address'), 'probe'];
+ $aside_tools['diagnostics_webfinger'] = ['webfinger/', t('check webfinger'), 'webfinger'];
$t = get_markup_template('admin/aside.tpl');
- $a->page['aside'] .= replace_macros($t, array(
+ $a->page['aside'] .= replace_macros($t, [
'$admin' => $aside_tools,
'$subpages' => $aside_sub,
'$admtxt' => t('Admin'),
'$diagnosticstxt' => t('diagnostics'),
'$h_pending' => t('User registrations waiting for confirmation'),
'$admurl' => "admin/"
- ));
+ ]);
// Page content
$o = '';
function admin_page_blocklist(App $a)
{
$blocklist = Config::get('system', 'blocklist');
- $blocklistform = array();
+ $blocklistform = [];
if (is_array($blocklist)) {
foreach ($blocklist as $id => $b) {
- $blocklistform[] = array(
- 'domain' => array("domain[$id]", t('Blocked domain'), $b['domain'], '', t('The blocked domain'), 'required', '', ''),
- 'reason' => array("reason[$id]", t("Reason for the block"), $b['reason'], t('The reason why you blocked this domain.') . '(' . $b['domain'] . ')', 'required', '', ''),
- 'delete' => array("delete[$id]", t("Delete domain") . ' (' . $b['domain'] . ')', False, t("Check to delete this entry from the blocklist"))
- );
+ $blocklistform[] = [
+ 'domain' => ["domain[$id]", t('Blocked domain'), $b['domain'], '', t('The blocked domain'), 'required', '', ''],
+ 'reason' => ["reason[$id]", t("Reason for the block"), $b['reason'], t('The reason why you blocked this domain.') . '(' . $b['domain'] . ')', 'required', '', ''],
+ 'delete' => ["delete[$id]", t("Delete domain") . ' (' . $b['domain'] . ')', False, t("Check to delete this entry from the blocklist")]
+ ];
}
}
$t = get_markup_template('admin/blocklist.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Server Blocklist'),
'$intro' => t('This page can be used to define a black list of servers from the federated network that are not allowed to interact with your node. For all entered domains you should also give a reason why you have blocked the remote server.'),
'$public' => t('The list of blocked servers will be made publically available on the /friendica page so that your users and people investigating communication problems can find the reason easily.'),
'$addtitle' => t('Add new entry to block list'),
- '$newdomain' => array('newentry_domain', t('Server Domain'), '', t('The domain of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''),
- '$newreason' => array('newentry_reason', t('Block reason'), '', t('The reason why you blocked this domain.'), 'required', '', ''),
+ '$newdomain' => ['newentry_domain', t('Server Domain'), '', t('The domain of the new server to add to the block list. Do not include the protocol.'), 'required', '', ''],
+ '$newreason' => ['newentry_reason', t('Block reason'), '', t('The reason why you blocked this domain.'), 'required', '', ''],
'$submit' => t('Add Entry'),
'$savechanges' => t('Save changes to the blocklist'),
'$currenttitle' => t('Current Entries in the Blocklist'),
'$baseurl' => System::baseUrl(true),
'$confirm_delete' => t('Delete entry from blocklist?'),
'$form_security_token' => get_form_security_token("admin_blocklist")
- ));
+ ]);
}
/**
if (x($_POST['page_blocklist_save'])) {
// Add new item to blocklist
$blocklist = Config::get('system', 'blocklist');
- $blocklist[] = array(
+ $blocklist[] = [
'domain' => notags(trim($_POST['newentry_domain'])),
'reason' => notags(trim($_POST['newentry_reason']))
- );
+ ];
Config::set('system', 'blocklist', $blocklist);
info(t('Server added to blocklist.') . EOL);
} else {
// Edit the entries from blocklist
- $blocklist = array();
+ $blocklist = [];
foreach ($_POST['domain'] as $id => $domain) {
// Trimming whitespaces as well as any lingering slashes
$domain = notags(trim($domain, "\x00..\x1F/"));
$reason = notags(trim($_POST['reason'][$id]));
if (!x($_POST['delete'][$id])) {
- $blocklist[] = array(
+ $blocklist[] = [
'domain' => $domain,
'reason' => $reason
- );
+ ];
}
}
Config::set('system', 'blocklist', $blocklist);
$contacts = dba::inArray($statement);
$t = get_markup_template('admin/contactblock.tpl');
- $o = replace_macros($t, array(
+ $o = replace_macros($t, [
// strings //
'$title' => t('Administration'),
'$page' => t('Remote Contact Blocklist'),
'$total_contacts' => tt('%s total blocked contact', '%s total blocked contacts', $total),
'$paginate' => paginate($a),
'$contacturl' => ['contact_url', t("Profile URL"), '', t("URL of the remote contact to block.")],
- ));
+ ]);
return $o;
}
{
$t = get_markup_template('admin/deleteitem.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Delete Item'),
'$submit' => t('Delete this Item'),
'$intro1' => t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
'$intro2' => t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
- '$deleteitemguid' => array('deleteitemguid', t("GUID"), '', t("The GUID of the item you want to delete."), 'required', 'autofocus'),
+ '$deleteitemguid' => ['deleteitemguid', t("GUID"), '', t("The GUID of the item you want to delete."), 'required', 'autofocus'],
'$baseurl' => System::baseUrl(),
'$form_security_token' => get_form_security_token("admin_deleteitem")
- ));
+ ]);
}
/**
// Now that we have the GUID get all IDs of the associated entries in the
// item table of the DB and drop those items, which will also delete the
// associated threads.
- $r = dba::select('item', array('id'), array('guid' => $guid));
+ $r = dba::select('item', ['id'], ['guid' => $guid]);
while ($row = dba::fetch($r)) {
drop_item($row['id'], false);
}
// off one % two of them are needed in the query
// Add more platforms if you like, when one returns 0 known nodes it is not
// displayed on the stats page.
- $platforms = array('Friendi%%a', 'Diaspora', '%%red%%', 'Hubzilla', 'BlaBlaNet', 'GNU Social', 'StatusNet', 'Mastodon', 'Pleroma', 'socialhome');
- $colors = array(
+ $platforms = ['Friendi%%a', 'Diaspora', '%%red%%', 'Hubzilla', 'BlaBlaNet', 'GNU Social', 'StatusNet', 'Mastodon', 'Pleroma', 'socialhome'];
+ $colors = [
'Friendi%%a' => '#ffc018', // orange from the logo
'Diaspora' => '#a1a1a1', // logo is black and white, makes a gray
'%%red%%' => '#c50001', // fire red from the logo
'Mastodon' => '#1a9df9', // blue from the Mastodon logo
'Pleroma' => '#E46F0F', // Orange from the text that is used on Pleroma instances
'socialhome' => '#52056b' // lilac from the Django Image used at the Socialhome homepage
- );
- $counts = array();
+ ];
+ $counts = [];
$total = 0;
$users = 0;
// to the version string for the displayed list.
foreach ($v as $key => $value) {
if ($v[$key]['version'] == '') {
- $v[$key] = array('total' => $v[$key]['total'], 'version' => t('unknown'));
+ $v[$key] = ['total' => $v[$key]['total'], 'version' => t('unknown')];
}
}
// in the DB the Diaspora versions have the format x.x.x.x-xx the last
// part (-xx) should be removed to clean up the versions from the "head
// commit" information and combined into a single entry for x.x.x.x
if ($p == 'Diaspora') {
- $newV = array();
- $newVv = array();
+ $newV = [];
+ $newVv = [];
foreach ($v as $vv) {
$newVC = $vv['total'];
$newVV = $vv['version'];
}
}
foreach ($newV as $key => $value) {
- array_push($newVv, array('total' => $value, 'version' => $key));
+ array_push($newVv, ['total' => $value, 'version' => $key]);
}
$v = $newVv;
}
// DB version stamp; those should be operated out and versions be
// conbined
if ($p == 'Friendi%%a') {
- $newV = array();
- $newVv = array();
+ $newV = [];
+ $newVv = [];
foreach ($v as $vv) {
$newVC = $vv['total'];
$newVV = $vv['version'];
}
}
foreach ($newV as $key => $value) {
- array_push($newVv, array('total' => $value, 'version' => $key));
+ array_push($newVv, ['total' => $value, 'version' => $key]);
}
$v = $newVv;
}
// the 3rd array item is needed for the JavaScript graphs as JS does
// not like some characters in the names of variables...
- $counts[$p] = array($c[0], $v, str_replace(array(' ', '%'), '', $p), $colors[$p]);
+ $counts[$p] = [$c[0], $v, str_replace([' ', '%'], '', $p), $colors[$p]];
}
// some helpful text
// load the template, replace the macros and return the page content
$t = get_markup_template('admin/federation.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Federation Statistics'),
'$intro' => $intro,
'$version' => FRIENDICA_VERSION,
'$legendtext' => t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users),
'$baseurl' => System::baseUrl(),
- ));
+ ]);
}
/**
ORDER BY `q`.`cid`, `q`.`created`;");
$t = get_markup_template('admin/queue.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Inspect Queue'),
'$count' => count($r),
'$last_header' => t('Last Tried'),
'$info' => t('This page lists the content of the queue for outgoing postings. These are postings the initial delivery failed for. They will be resend later and eventually deleted if the delivery fails permanently.'),
'$entries' => $r,
- ));
+ ]);
}
/**
// are there MyISAM tables in the DB? If so, trigger a warning message
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(dba::database_name()));
$showwarning = false;
- $warningtext = array();
+ $warningtext = [];
if (DBM::is_result($r)) {
$showwarning = true;
$warningtext[] = t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php scripts/dbstructure.php toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
}
$r = q("SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` GROUP BY `page-flags`");
- $accounts = array(
- array(t('Normal Account'), 0),
- array(t('Automatic Follower Account'), 0),
- array(t('Public Forum Account'), 0),
- array(t('Automatic Friend Account'), 0),
- array(t('Blog Account'), 0),
- array(t('Private Forum Account'), 0)
- );
+ $accounts = [
+ [t('Normal Account'), 0],
+ [t('Automatic Follower Account'), 0],
+ [t('Public Forum Account'), 0],
+ [t('Automatic Friend Account'), 0],
+ [t('Blog Account'), 0],
+ [t('Private Forum Account'), 0]
+ ];
$users = 0;
foreach ($r as $u) {
// We can do better, but this is a quick queue status
- $queues = array('label' => t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue);
+ $queues = ['label' => t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue];
$t = get_markup_template('admin/summary.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Summary'),
'$queues' => $queues,
- '$users' => array(t('Registered users'), $users),
+ '$users' => [t('Registered users'), $users],
'$accounts' => $accounts,
- '$pending' => array(t('Pending registrations'), $pending),
- '$version' => array(t('Version'), FRIENDICA_VERSION),
+ '$pending' => [t('Pending registrations'), $pending],
+ '$version' => [t('Version'), FRIENDICA_VERSION],
'$baseurl' => System::baseUrl(),
'$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME,
'$build' => Config::get('system', 'build'),
- '$plugins' => array(t('Active plugins'), $a->plugins),
+ '$plugins' => [t('Active plugins'), $a->plugins],
'$showwarning' => $showwarning,
'$warningtext' => $warningtext
- ));
+ ]);
}
/**
$dbold = dbesc($old_url);
$dbnew = dbesc($new_url);
- $upd = array();
+ $upd = [];
foreach ($fields as $f) {
$upd[] = "`$f` = REPLACE(`$f`, '$dbold', '$dbnew')";
}
}
// update tables
// update profile links in the format "http://server.tld"
- update_table("profile", array('photo', 'thumb'), $old_url, $new_url);
- update_table("term", array('url'), $old_url, $new_url);
- update_table("contact", array('photo', 'thumb', 'micro', 'url', 'nurl', 'alias', 'request', 'notify', 'poll', 'confirm', 'poco', 'avatar'), $old_url, $new_url);
- update_table("gcontact", array('url', 'nurl', 'photo', 'server_url', 'notify', 'alias'), $old_url, $new_url);
- update_table("item", array('owner-link', 'owner-avatar', 'author-link', 'author-avatar', 'body', 'plink', 'tag'), $old_url, $new_url);
+ update_table("profile", ['photo', 'thumb'], $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("gcontact", ['url', 'nurl', 'photo', 'server_url', 'notify', 'alias'], $old_url, $new_url);
+ update_table("item", ['owner-link', 'owner-avatar', 'author-link', 'author-avatar', 'body', 'plink', 'tag'], $old_url, $new_url);
// update profile addresses in the format "user@server.tld"
- update_table("contact", array('addr'), $old_host, $new_host);
- update_table("gcontact", array('connect', 'addr'), $old_host, $new_host);
+ update_table("contact", ['addr'], $old_host, $new_host);
+ update_table("gcontact", ['connect', 'addr'], $old_host, $new_host);
// update config
$a->set_baseurl($new_url);
}
/* Installed themes */
- $theme_choices = array();
- $theme_choices_mobile = array();
+ $theme_choices = [];
+ $theme_choices_mobile = [];
$theme_choices_mobile["---"] = t("No special theme for mobile devices");
$files = glob('view/theme/*');
if (is_array($files)) {
}
/* Community page style */
- $community_page_style_choices = array(
+ $community_page_style_choices = [
CP_NO_COMMUNITY_PAGE => t("No community page"),
CP_USERS_ON_SERVER => t("Public postings from users of this site"),
CP_GLOBAL_COMMUNITY => t("Public postings from the federated network"),
CP_USERS_AND_GLOBAL => t("Public postings from local users and the federated network")
- );
+ ];
- $poco_discovery_choices = array(
+ $poco_discovery_choices = [
"0" => t("Disabled"),
"1" => t("Users"),
"2" => t("Users, Global Contacts"),
"3" => t("Users, Global Contacts/fallback"),
- );
+ ];
- $poco_discovery_since_choices = array(
+ $poco_discovery_since_choices = [
"30" => t("One month"),
"91" => t("Three months"),
"182" => t("Half a year"),
"365" => t("One year"),
- );
+ ];
/* get user names to make the install a personal install of X */
- $user_names = array();
+ $user_names = [];
$user_names['---'] = t('Multi user instance');
$users = q("SELECT `username`, `nickname` FROM `user`");
foreach ($users as $user) {
//echo "<pre>"; var_dump($lang_choices); die("</pre>");
/* Register policy */
- $register_choices = array(
+ $register_choices = [
REGISTER_CLOSED => t("Closed"),
REGISTER_APPROVE => t("Requires approval"),
REGISTER_OPEN => t("Open")
- );
+ ];
- $ssl_choices = array(
+ $ssl_choices = [
SSL_POLICY_NONE => t("No SSL policy, links will track page SSL state"),
SSL_POLICY_FULL => t("Force all links to use SSL"),
SSL_POLICY_SELFSIGN => t("Self-signed certificate, use SSL for local links only (discouraged)")
- );
+ ];
- $check_git_version_choices = array(
+ $check_git_version_choices = [
"none" => t("Don't check"),
"master" => t("check the stable version"),
"develop" => t("check the development version")
- );
+ ];
if ($a->config['hostname'] == "") {
$a->config['hostname'] = $a->get_hostname();
}
$t = get_markup_template('admin/site.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Site'),
'$submit' => t('Save Settings'),
'$relocate' => t('Relocate - WARNING: advanced function. Could make this server unreachable.'),
'$baseurl' => System::baseUrl(true),
// name, label, value, help string, extra data...
- '$sitename' => array('sitename', t("Site name"), $a->config['sitename'],''),
- '$hostname' => array('hostname', t("Host name"), $a->config['hostname'], ""),
- '$sender_email' => array('sender_email', t("Sender Email"), $a->config['sender_email'], t("The email address your server shall use to send notification emails from."), "", "", "email"),
- '$banner' => array('banner', t("Banner/Logo"), $banner, ""),
- '$shortcut_icon' => array('shortcut_icon', t("Shortcut icon"), Config::get('system','shortcut_icon'), t("Link to an icon that will be used for browsers.")),
- '$touch_icon' => array('touch_icon', t("Touch icon"), Config::get('system','touch_icon'), t("Link to an icon that will be used for tablets and mobiles.")),
- '$info' => array('info', t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())),
- '$language' => array('language', t("System language"), Config::get('system','language'), "", $lang_choices),
- '$theme' => array('theme', t("System theme"), Config::get('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
- '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), t("Theme for mobile devices"), $theme_choices_mobile),
- '$ssl_policy' => array('ssl_policy', t("SSL link policy"), (string) intval(Config::get('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices),
- '$force_ssl' => array('force_ssl', t("Force SSL"), Config::get('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")),
- '$hide_help' => array('hide_help', t("Hide help entry from navigation menu"), Config::get('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")),
- '$singleuser' => array('singleuser', t("Single user instance"), Config::get('system', 'singleuser', '---'), t("Make this instance multi-user or single-user for the named user"), $user_names),
- '$maximagesize' => array('maximagesize', t("Maximum image size"), Config::get('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
- '$maximagelength' => array('maximagelength', t("Maximum image length"), Config::get('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")),
- '$jpegimagequality' => array('jpegimagequality', t("JPEG image quality"), Config::get('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")),
-
- '$register_policy' => array('register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices),
- '$daily_registrations' => array('max_daily_registrations', t("Maximum Daily Registrations"), Config::get('system', 'max_daily_registrations'), t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.")),
- '$register_text' => array('register_text', t("Register text"), $a->config['register_text'], t("Will be displayed prominently on the registration page.")),
- '$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), Config::get('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
- '$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), Config::get('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
- '$allowed_email' => array('allowed_email', t("Allowed email domains"), Config::get('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
- '$no_oembed_rich_content' => array('no_oembed_rich_content', t("No OEmbed rich content"), Config::get('system','no_oembed_rich_content'), t("Don't show the rich content (e.g. embedded PDF), except from the domains listed below.")),
- '$allowed_oembed' => array('allowed_oembed', t("Allowed OEmbed domains"), Config::get('system','allowed_oembed'), t("Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.")),
- '$block_public' => array('block_public', t("Block public"), Config::get('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")),
- '$force_publish' => array('publish_all', t("Force publish"), Config::get('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
- '$global_directory' => array('directory', t("Global directory URL"), Config::get('system','directory'), t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")),
- '$newuser_private' => array('newuser_private', t("Private posts by default for new users"), Config::get('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")),
- '$enotify_no_content' => array('enotify_no_content', t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")),
- '$private_addons' => array('private_addons', t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")),
- '$disable_embedded' => array('disable_embedded', t("Don't embed private images in posts"), Config::get('system','disable_embedded'), t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")),
- '$allow_users_remote_self' => array('allow_users_remote_self', t('Allow Users to set remote_self'), Config::get('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')),
- '$no_multi_reg' => array('no_multi_reg', t("Block multiple registrations"), Config::get('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")),
- '$no_openid' => array('no_openid', t("OpenID support"), !Config::get('system','no_openid'), t("OpenID support for registration and logins.")),
- '$no_regfullname' => array('no_regfullname', t("Fullname check"), !Config::get('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")),
- '$community_page_style' => array('community_page_style', t("Community pages for visitors"), Config::get('system','community_page_style'), t("Which community pages should be available for visitors. Local users always see both pages."), $community_page_style_choices),
- '$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), Config::get('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")),
- '$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !Config::get('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
- '$ostatus_full_threads' => array('ostatus_full_threads', t("Only import OStatus threads from our contacts"), Config::get('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")),
+ '$sitename' => ['sitename', t("Site name"), $a->config['sitename'],''],
+ '$hostname' => ['hostname', t("Host name"), $a->config['hostname'], ""],
+ '$sender_email' => ['sender_email', t("Sender Email"), $a->config['sender_email'], t("The email address your server shall use to send notification emails from."), "", "", "email"],
+ '$banner' => ['banner', t("Banner/Logo"), $banner, ""],
+ '$shortcut_icon' => ['shortcut_icon', t("Shortcut icon"), Config::get('system','shortcut_icon'), t("Link to an icon that will be used for browsers.")],
+ '$touch_icon' => ['touch_icon', t("Touch icon"), Config::get('system','touch_icon'), t("Link to an icon that will be used for tablets and mobiles.")],
+ '$info' => ['info', t('Additional Info'), $info, t('For public servers: you can add additional information here that will be listed at %s/servers.', get_server())],
+ '$language' => ['language', t("System language"), Config::get('system','language'), "", $lang_choices],
+ '$theme' => ['theme', t("System theme"), Config::get('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices],
+ '$theme_mobile' => ['theme_mobile', t("Mobile system theme"), Config::get('system', 'mobile-theme', '---'), t("Theme for mobile devices"), $theme_choices_mobile],
+ '$ssl_policy' => ['ssl_policy', t("SSL link policy"), (string) intval(Config::get('system','ssl_policy')), t("Determines whether generated links should be forced to use SSL"), $ssl_choices],
+ '$force_ssl' => ['force_ssl', t("Force SSL"), Config::get('system','force_ssl'), t("Force all Non-SSL requests to SSL - Attention: on some systems it could lead to endless loops.")],
+ '$hide_help' => ['hide_help', t("Hide help entry from navigation menu"), Config::get('system','hide_help'), t("Hides the menu entry for the Help pages from the navigation menu. You can still access it calling /help directly.")],
+ '$singleuser' => ['singleuser', t("Single user instance"), Config::get('system', 'singleuser', '---'), t("Make this instance multi-user or single-user for the named user"), $user_names],
+ '$maximagesize' => ['maximagesize', t("Maximum image size"), Config::get('system','maximagesize'), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")],
+ '$maximagelength' => ['maximagelength', t("Maximum image length"), Config::get('system','max_image_length'), t("Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.")],
+ '$jpegimagequality' => ['jpegimagequality', t("JPEG image quality"), Config::get('system','jpeg_quality'), t("Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.")],
+
+ '$register_policy' => ['register_policy', t("Register policy"), $a->config['register_policy'], "", $register_choices],
+ '$daily_registrations' => ['max_daily_registrations', t("Maximum Daily Registrations"), Config::get('system', 'max_daily_registrations'), t("If registration is permitted above, this sets the maximum number of new user registrations to accept per day. If register is set to closed, this setting has no effect.")],
+ '$register_text' => ['register_text', t("Register text"), $a->config['register_text'], t("Will be displayed prominently on the registration page.")],
+ '$abandon_days' => ['abandon_days', t('Accounts abandoned after x days'), Config::get('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')],
+ '$allowed_sites' => ['allowed_sites', t("Allowed friend domains"), Config::get('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")],
+ '$allowed_email' => ['allowed_email', t("Allowed email domains"), Config::get('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")],
+ '$no_oembed_rich_content' => ['no_oembed_rich_content', t("No OEmbed rich content"), Config::get('system','no_oembed_rich_content'), t("Don't show the rich content (e.g. embedded PDF), except from the domains listed below.")],
+ '$allowed_oembed' => ['allowed_oembed', t("Allowed OEmbed domains"), Config::get('system','allowed_oembed'), t("Comma separated list of domains which oembed content is allowed to be displayed. Wildcards are accepted.")],
+ '$block_public' => ['block_public', t("Block public"), Config::get('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently logged in.")],
+ '$force_publish' => ['publish_all', t("Force publish"), Config::get('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")],
+ '$global_directory' => ['directory', t("Global directory URL"), Config::get('system','directory'), t("URL to the global directory. If this is not set, the global directory is completely unavailable to the application.")],
+ '$newuser_private' => ['newuser_private', t("Private posts by default for new users"), Config::get('system','newuser_private'), t("Set default post permissions for all new members to the default privacy group rather than public.")],
+ '$enotify_no_content' => ['enotify_no_content', t("Don't include post content in email notifications"), Config::get('system','enotify_no_content'), t("Don't include the content of a post/comment/private message/etc. in the email notifications that are sent out from this site, as a privacy measure.")],
+ '$private_addons' => ['private_addons', t("Disallow public access to addons listed in the apps menu."), Config::get('config','private_addons'), t("Checking this box will restrict addons listed in the apps menu to members only.")],
+ '$disable_embedded' => ['disable_embedded', t("Don't embed private images in posts"), Config::get('system','disable_embedded'), t("Don't replace locally-hosted private photos in posts with an embedded copy of the image. This means that contacts who receive posts containing private photos will have to authenticate and load each image, which may take a while.")],
+ '$allow_users_remote_self' => ['allow_users_remote_self', t('Allow Users to set remote_self'), Config::get('system','allow_users_remote_self'), t('With checking this, every user is allowed to mark every contact as a remote_self in the repair contact dialog. Setting this flag on a contact causes mirroring every posting of that contact in the users stream.')],
+ '$no_multi_reg' => ['no_multi_reg', t("Block multiple registrations"), Config::get('system','block_extended_register'), t("Disallow users to register additional accounts for use as pages.")],
+ '$no_openid' => ['no_openid', t("OpenID support"), !Config::get('system','no_openid'), t("OpenID support for registration and logins.")],
+ '$no_regfullname' => ['no_regfullname', t("Fullname check"), !Config::get('system','no_regfullname'), t("Force users to register with a space between firstname and lastname in Full name, as an antispam measure")],
+ '$community_page_style' => ['community_page_style', t("Community pages for visitors"), Config::get('system','community_page_style'), t("Which community pages should be available for visitors. Local users always see both pages."), $community_page_style_choices],
+ '$max_author_posts_community_page' => ['max_author_posts_community_page', t("Posts per user on community page"), Config::get('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")],
+ '$ostatus_disabled' => ['ostatus_disabled', t("Enable OStatus support"), !Config::get('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")],
+ '$ostatus_full_threads' => ['ostatus_full_threads', t("Only import OStatus threads from our contacts"), Config::get('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")],
'$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."),
'$diaspora_able' => $diaspora_able,
'$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."),
- '$diaspora_enabled' => array('diaspora_enabled', t("Enable Diaspora support"), Config::get('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")),
- '$dfrn_only' => array('dfrn_only', t('Only allow Friendica contacts'), Config::get('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")),
- '$verifyssl' => array('verifyssl', t("Verify SSL"), Config::get('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")),
- '$proxyuser' => array('proxyuser', t("Proxy user"), Config::get('system','proxyuser'), ""),
- '$proxy' => array('proxy', t("Proxy URL"), Config::get('system','proxy'), ""),
- '$timeout' => array('timeout', t("Network timeout"), (x(Config::get('system','curl_timeout'))?Config::get('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
- '$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(Config::get('system','maxloadavg')) > 0)?Config::get('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
- '$maxloadavg_frontend' => array('maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(Config::get('system','maxloadavg_frontend')) > 0)?Config::get('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")),
- '$min_memory' => array('min_memory', t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).")),
- '$optimize_max_tablesize'=> array('optimize_max_tablesize', t("Maximum table size for optimization"), $optimize_max_tablesize, t("Maximum table size (in MB) for the automatic optimization - default 100 MB. Enter -1 to disable it.")),
- '$optimize_fragmentation'=> array('optimize_fragmentation', t("Minimum level of fragmentation"), ((intval(Config::get('system','optimize_fragmentation')) > 0)?Config::get('system','optimize_fragmentation'):30), t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")),
-
- '$poco_completion' => array('poco_completion', t("Periodical check of global contacts"), Config::get('system','poco_completion'), t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")),
- '$poco_requery_days' => array('poco_requery_days', t("Days between requery"), Config::get('system','poco_requery_days'), t("Number of days after which a server is requeried for his contacts.")),
- '$poco_discovery' => array('poco_discovery', t("Discover contacts from other servers"), (string) intval(Config::get('system','poco_discovery')), t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices),
- '$poco_discovery_since' => array('poco_discovery_since', t("Timeframe for fetching global contacts"), (string) intval(Config::get('system','poco_discovery_since')), t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices),
- '$poco_local_search' => array('poco_local_search', t("Search the local directory"), Config::get('system','poco_local_search'), t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")),
-
- '$nodeinfo' => array('nodeinfo', t("Publish server information"), Config::get('system','nodeinfo'), t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href='http://the-federation.info/'>the-federation.info</a> for details.")),
-
- '$check_new_version_url' => array('check_new_version_url', t("Check upstream version"), Config::get('system', 'check_new_version_url'), t("Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview."), $check_git_version_choices),
- '$suppress_tags' => array('suppress_tags', t("Suppress Tags"), Config::get('system','suppress_tags'), t("Suppress showing a list of hashtags at the end of the posting.")),
- '$itemcache' => array('itemcache', t("Path to item cache"), Config::get('system','itemcache'), t("The item caches buffers generated bbcode and external images.")),
- '$itemcache_duration' => array('itemcache_duration', t("Cache duration in seconds"), Config::get('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")),
- '$max_comments' => array('max_comments', t("Maximum numbers of comments per post"), Config::get('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")),
- '$temppath' => array('temppath', t("Temp path"), Config::get('system','temppath'), t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")),
- '$basepath' => array('basepath', t("Base path to installation"), Config::get('system','basepath'), t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")),
- '$proxy_disabled' => array('proxy_disabled', t("Disable picture proxy"), Config::get('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")),
- '$only_tag_search' => array('only_tag_search', t("Only search in tags"), Config::get('system','only_tag_search'), t("On large systems the text search can slow down the system extremely.")),
-
- '$relocate_url' => array('relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")),
-
- '$rino' => array('rino', t("RINO Encryption"), intval(Config::get('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")),
-
- '$worker_queues' => array('worker_queues', t("Maximum number of parallel workers"), Config::get('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")),
- '$worker_dont_fork' => array('worker_dont_fork', t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")),
- '$worker_fastlane' => array('worker_fastlane', t("Enable fastlane"), Config::get('system','worker_fastlane'), t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")),
- '$worker_frontend' => array('worker_frontend', t('Enable frontend worker'), Config::get('system','frontend_worker'), t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', System::baseUrl())),
+ '$diaspora_enabled' => ['diaspora_enabled', t("Enable Diaspora support"), Config::get('system','diaspora_enabled'), t("Provide built-in Diaspora network compatibility.")],
+ '$dfrn_only' => ['dfrn_only', t('Only allow Friendica contacts'), Config::get('system','dfrn_only'), t("All contacts must use Friendica protocols. All other built-in communication protocols disabled.")],
+ '$verifyssl' => ['verifyssl', t("Verify SSL"), Config::get('system','verifyssl'), t("If you wish, you can turn on strict certificate checking. This will mean you cannot connect (at all) to self-signed SSL sites.")],
+ '$proxyuser' => ['proxyuser', t("Proxy user"), Config::get('system','proxyuser'), ""],
+ '$proxy' => ['proxy', t("Proxy URL"), Config::get('system','proxy'), ""],
+ '$timeout' => ['timeout', t("Network timeout"), (x(Config::get('system','curl_timeout'))?Config::get('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")],
+ '$maxloadavg' => ['maxloadavg', t("Maximum Load Average"), ((intval(Config::get('system','maxloadavg')) > 0)?Config::get('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")],
+ '$maxloadavg_frontend' => ['maxloadavg_frontend', t("Maximum Load Average (Frontend)"), ((intval(Config::get('system','maxloadavg_frontend')) > 0)?Config::get('system','maxloadavg_frontend'):50), t("Maximum system load before the frontend quits service - default 50.")],
+ '$min_memory' => ['min_memory', t("Minimal Memory"), ((intval(Config::get('system','min_memory')) > 0)?Config::get('system','min_memory'):0), t("Minimal free memory in MB for the worker. Needs access to /proc/meminfo - default 0 (deactivated).")],
+ '$optimize_max_tablesize'=> ['optimize_max_tablesize', t("Maximum table size for optimization"), $optimize_max_tablesize, t("Maximum table size (in MB) for the automatic optimization - default 100 MB. Enter -1 to disable it.")],
+ '$optimize_fragmentation'=> ['optimize_fragmentation', t("Minimum level of fragmentation"), ((intval(Config::get('system','optimize_fragmentation')) > 0)?Config::get('system','optimize_fragmentation'):30), t("Minimum fragmenation level to start the automatic optimization - default value is 30%.")],
+
+ '$poco_completion' => ['poco_completion', t("Periodical check of global contacts"), Config::get('system','poco_completion'), t("If enabled, the global contacts are checked periodically for missing or outdated data and the vitality of the contacts and servers.")],
+ '$poco_requery_days' => ['poco_requery_days', t("Days between requery"), Config::get('system','poco_requery_days'), t("Number of days after which a server is requeried for his contacts.")],
+ '$poco_discovery' => ['poco_discovery', t("Discover contacts from other servers"), (string) intval(Config::get('system','poco_discovery')), t("Periodically query other servers for contacts. You can choose between 'users': the users on the remote system, 'Global Contacts': active contacts that are known on the system. The fallback is meant for Redmatrix servers and older friendica servers, where global contacts weren't available. The fallback increases the server load, so the recommened setting is 'Users, Global Contacts'."), $poco_discovery_choices],
+ '$poco_discovery_since' => ['poco_discovery_since', t("Timeframe for fetching global contacts"), (string) intval(Config::get('system','poco_discovery_since')), t("When the discovery is activated, this value defines the timeframe for the activity of the global contacts that are fetched from other servers."), $poco_discovery_since_choices],
+ '$poco_local_search' => ['poco_local_search', t("Search the local directory"), Config::get('system','poco_local_search'), t("Search the local directory instead of the global directory. When searching locally, every search will be executed on the global directory in the background. This improves the search results when the search is repeated.")],
+
+ '$nodeinfo' => ['nodeinfo', t("Publish server information"), Config::get('system','nodeinfo'), t("If enabled, general server and usage data will be published. The data contains the name and version of the server, number of users with public profiles, number of posts and the activated protocols and connectors. See <a href='http://the-federation.info/'>the-federation.info</a> for details.")],
+
+ '$check_new_version_url' => ['check_new_version_url', t("Check upstream version"), Config::get('system', 'check_new_version_url'), t("Enables checking for new Friendica versions at github. If there is a new version, you will be informed in the admin panel overview."), $check_git_version_choices],
+ '$suppress_tags' => ['suppress_tags', t("Suppress Tags"), Config::get('system','suppress_tags'), t("Suppress showing a list of hashtags at the end of the posting.")],
+ '$itemcache' => ['itemcache', t("Path to item cache"), Config::get('system','itemcache'), t("The item caches buffers generated bbcode and external images.")],
+ '$itemcache_duration' => ['itemcache_duration', t("Cache duration in seconds"), Config::get('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")],
+ '$max_comments' => ['max_comments', t("Maximum numbers of comments per post"), Config::get('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")],
+ '$temppath' => ['temppath', t("Temp path"), Config::get('system','temppath'), t("If you have a restricted system where the webserver can't access the system temp path, enter another path here.")],
+ '$basepath' => ['basepath', t("Base path to installation"), Config::get('system','basepath'), t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot.")],
+ '$proxy_disabled' => ['proxy_disabled', t("Disable picture proxy"), Config::get('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")],
+ '$only_tag_search' => ['only_tag_search', t("Only search in tags"), Config::get('system','only_tag_search'), t("On large systems the text search can slow down the system extremely.")],
+
+ '$relocate_url' => ['relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.")],
+
+ '$rino' => ['rino', t("RINO Encryption"), intval(Config::get('system','rino_encrypt')), t("Encryption layer between nodes."), ["Disabled", "RINO1 (deprecated)", "RINO2"]],
+
+ '$worker_queues' => ['worker_queues', t("Maximum number of parallel workers"), Config::get('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")],
+ '$worker_dont_fork' => ['worker_dont_fork', t("Don't use 'proc_open' with the worker"), Config::get('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of worker calls in your crontab.")],
+ '$worker_fastlane' => ['worker_fastlane', t("Enable fastlane"), Config::get('system','worker_fastlane'), t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")],
+ '$worker_frontend' => ['worker_frontend', t('Enable frontend worker'), Config::get('system','frontend_worker'), t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.', System::baseUrl())],
'$form_security_token' => get_form_security_token("admin_site")
- ));
+ ]);
}
/**
return $o;
}
- $failed = array();
+ $failed = [];
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
if (DBM::is_result($r)) {
foreach ($r as $rr) {
}
}
if (!count($failed)) {
- $o = replace_macros(get_markup_template('structure_check.tpl'), array(
+ $o = replace_macros(get_markup_template('structure_check.tpl'), [
'$base' => System::baseUrl(true),
'$banner' => t('No failed updates.'),
'$check' => t('Check database structure'),
- ));
+ ]);
} else {
- $o = replace_macros(get_markup_template('failed_updates.tpl'), array(
+ $o = replace_macros(get_markup_template('failed_updates.tpl'), [
'$base' => System::baseUrl(true),
'$banner' => t('Failed Updates'),
'$desc' => t('This does not include updates prior to 1139, which did not return a status.'),
'$mark' => t('Mark success (if update was manually applied)'),
'$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed
- ));
+ ]);
}
return $o;
*/
function admin_page_users_post(App $a)
{
- $pending = defaults($_POST, 'pending' , array());
- $users = defaults($_POST, 'user' , array());
+ $pending = defaults($_POST, 'pending' , []);
+ $users = defaults($_POST, 'user' , []);
$nu_name = defaults($_POST, 'new_user_name' , '');
$nu_nickname = defaults($_POST, 'new_user_nickname', '');
$nu_email = defaults($_POST, 'new_user_email' , '');
$preamble = sprintf($preamble, $user['username'], $a->config['sitename']);
$body = sprintf($body, System::baseUrl(), $user['email'], $result['password'], $a->config['sitename']);
- notification(array(
+ notification([
'type' => SYSTEM_EMAIL,
'to_email' => $user['email'],
'subject' => t('Registration details for %s', $a->config['sitename']),
'preamble' => $preamble,
- 'body' => $body));
+ 'body' => $body]);
}
if (x($_POST, 'page_users_block')) {
}
/* ordering */
- $valid_orders = array(
+ $valid_orders = [
'contact.name',
'user.email',
'user.register_date',
'user.login_date',
'lastitem_date',
'user.page-flags'
- );
+ ];
$order = "contact.name";
$order_direction = "+";
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
$_setup_users = function ($e) use ($adminlist) {
- $accounts = array(
+ $accounts = [
t('Normal Account'),
t('Automatic Follower Account'),
t('Public Forum Account'),
t('Automatic Friend Account')
- );
+ ];
$e['page-flags'] = $accounts[$e['page-flags']];
$e['register_date'] = relative_date($e['register_date']);
$e['login_date'] = relative_date($e['login_date']);
// Get rid of dashes in key names, Smarty3 can't handle them
// and extracting deleted users
- $tmp_users = array();
- $deleted = array();
+ $tmp_users = [];
+ $deleted = [];
while (count($users)) {
- $new_user = array();
+ $new_user = [];
foreach (array_pop($users) as $k => $v) {
$k = str_replace('-', '_', $k);
$new_user[$k] = $v;
array_push($users, array_pop($tmp_users));
}
- $th_users = array_map(null, array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')), $valid_orders
+ $th_users = array_map(null, [t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Account')], $valid_orders
);
$t = get_markup_template('admin/users.tpl');
- $o = replace_macros($t, array(
+ $o = replace_macros($t, [
// strings //
'$title' => t('Administration'),
'$page' => t('Users'),
'$select_all' => t('select all'),
'$h_pending' => t('User registrations waiting for confirm'),
'$h_deleted' => t('User waiting for permanent deletion'),
- '$th_pending' => array(t('Request date'), t('Name'), t('Email')),
+ '$th_pending' => [t('Request date'), t('Name'), t('Email')],
'$no_pending' => t('No registrations.'),
'$pendingnotetext' => t('Note from the user'),
'$approve' => t('Approve'),
'$h_users' => t('Users'),
'$h_newuser' => t('New User'),
- '$th_deleted' => array(t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since')),
+ '$th_deleted' => [t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since')],
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
'$pending' => $pending,
'deleted' => $deleted,
'$users' => $users,
- '$newusername' => array('new_user_name', t("Name"), '', t("Name of the new user.")),
- '$newusernickname' => array('new_user_nickname', t("Nickname"), '', t("Nickname of the new user.")),
- '$newuseremail' => array('new_user_email', t("Email"), '', t("Email address of the new user."), '', '', 'email'),
- ));
+ '$newusername' => ['new_user_name', t("Name"), '', t("Name of the new user.")],
+ '$newusernickname' => ['new_user_nickname', t("Nickname"), '', t("Nickname of the new user.")],
+ '$newuseremail' => ['new_user_email', t("Email"), '', t("Email address of the new user."), '', '', 'email'],
+ ]);
$o .= paginate($a);
return $o;
}
$t = get_markup_template('admin/plugins_details.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$toggle' => t('Toggle'),
'$readme' => $readme,
'$form_security_token' => get_form_security_token("admin_themes"),
- ));
+ ]);
}
/*
goaway(System::baseUrl() . '/admin/plugins');
}
- $plugins = array();
+ $plugins = [];
$files = glob("addon/*/");
if (is_array($files)) {
foreach ($files as $file) {
}
if ($show_plugin) {
- $plugins[] = array($id, (in_array($id, $a->plugins) ? "on" : "off"), $info);
+ $plugins[] = [$id, (in_array($id, $a->plugins) ? "on" : "off"), $info];
}
}
}
}
$t = get_markup_template('admin/plugins.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$submit' => t('Save Settings'),
'$pcount' => count($plugins),
'$noplugshint' => t('There are currently no plugins available on your node. You can find the official plugin repository at %1$s and might find other interesting plugins in the open plugin registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
'$form_security_token' => get_form_security_token("admin_themes"),
- ));
+ ]);
}
/**
{
$allowed_themes_str = Config::get('system', 'allowed_themes');
$allowed_themes_raw = explode(',', $allowed_themes_str);
- $allowed_themes = array();
+ $allowed_themes = [];
if (count($allowed_themes_raw)) {
foreach ($allowed_themes_raw as $x) {
if (strlen(trim($x))) {
}
}
- $themes = array();
+ $themes = [];
$files = glob('view/theme/*');
if (is_array($files)) {
foreach ($files as $file) {
$is_allowed = intval(in_array($f, $allowed_themes));
if ($is_allowed || $is_supported || Config::get("system", "show_unsupported_themes")) {
- $themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
+ $themes[] = ['name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed];
}
}
}
$a->page = $orig_page;
}
- $screenshot = array(get_theme_screenshot($theme), t('Screenshot'));
+ $screenshot = [get_theme_screenshot($theme), t('Screenshot')];
if (!stristr($screenshot[0], $theme)) {
$screenshot = null;
}
$t = get_markup_template('admin/plugins_details.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Themes'),
'$toggle' => t('Toggle'),
'$readme' => $readme,
'$form_security_token' => get_form_security_token("admin_themes"),
- ));
+ ]);
}
* List themes
*/
- $plugins = array();
+ $plugins = [];
foreach ($themes as $th) {
- $plugins[] = array($th['name'], (($th['allowed']) ? "on" : "off"), get_theme_info($th['name']));
+ $plugins[] = [$th['name'], (($th['allowed']) ? "on" : "off"), get_theme_info($th['name'])];
}
$t = get_markup_template('admin/plugins.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Themes'),
'$submit' => t('Save Settings'),
'$experimental' => t('[Experimental]'),
'$unsupported' => t('[Unsupported]'),
'$form_security_token' => get_form_security_token("admin_themes"),
- ));
+ ]);
}
/**
*/
function admin_page_logs(App $a)
{
- $log_choices = array(
+ $log_choices = [
LOGGER_NORMAL => 'Normal',
LOGGER_TRACE => 'Trace',
LOGGER_DEBUG => 'Debug',
LOGGER_DATA => 'Data',
LOGGER_ALL => 'All'
- );
+ ];
if (ini_get('log_errors')) {
$phplogenabled = t('PHP log currently enabled.');
$t = get_markup_template('admin/logs.tpl');
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Logs'),
'$submit' => t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$logname' => Config::get('system', 'logfile'),
// name, label, value, help string, extra data...
- '$debugging' => array('debugging', t("Enable Debugging"), Config::get('system', 'debugging'), ""),
- '$logfile' => array('logfile', t("Log file"), Config::get('system', 'logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")),
- '$loglevel' => array('loglevel', t("Log level"), Config::get('system', 'loglevel'), "", $log_choices),
+ '$debugging' => ['debugging', t("Enable Debugging"), Config::get('system', 'debugging'), ""],
+ '$logfile' => ['logfile', t("Log file"), Config::get('system', 'logfile'), t("Must be writable by web server. Relative to your Friendica top-level directory.")],
+ '$loglevel' => ['loglevel', t("Log level"), Config::get('system', 'loglevel'), "", $log_choices],
'$form_security_token' => get_form_security_token("admin_logs"),
'$phpheader' => t("PHP logging"),
'$phphint' => t("To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."),
'$phplogcode' => "error_reporting(E_ERROR | E_WARNING | E_PARSE);\nini_set('error_log','php.out');\nini_set('log_errors','1');\nini_set('display_errors', '1');",
'$phplogenabled' => $phplogenabled,
- ));
+ ]);
}
/**
fclose($fp);
}
}
- return replace_macros($t, array(
+ return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('View Logs'),
'$data' => $data,
'$logname' => Config::get('system', 'logfile')
- ));
+ ]);
}
/**
function admin_page_features(App $a)
{
if ((argc() > 1) && (argv(1) === 'features')) {
- $arr = array();
+ $arr = [];
$features = Feature::get(false);
foreach ($features as $fname => $fdata) {
- $arr[$fname] = array();
+ $arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata, 1) as $f) {
$set = Config::get('feature', $f[0], $f[3]);
- $arr[$fname][1][] = array(
- array('feature_' . $f[0], $f[1], $set, $f[2], array(t('Off'), t('On'))),
- array('featurelock_' . $f[0], t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', array(t('Off'), t('On')))
- );
+ $arr[$fname][1][] = [
+ ['feature_' . $f[0], $f[1], $set, $f[2], [t('Off'), t('On')]],
+ ['featurelock_' . $f[0], t('Lock feature %s', $f[1]), (($f[4] !== false) ? "1" : ''), '', [t('Off'), t('On')]]
+ ];
}
}
$tpl = get_markup_template('admin/settings_features.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("admin_manage_features"),
'$title' => t('Manage Additional Features'),
'$features' => $arr,
'$submit' => t('Save Settings'),
- ));
+ ]);
return $o;
}
$photo_menu = Contact::photoMenu($rr);
} else {
$connlnk = System::baseUrl() . '/follow/?url=' . $rr['url'];
- $photo_menu = array(
- 'profile' => array(t("View Profile"), Profile::zrl($rr['url'])),
- 'follow' => array(t("Connect/Follow"), $connlnk)
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($rr['url'])],
+ 'follow' => [t("Connect/Follow"), $connlnk]
+ ];
}
- $entry = array(
+ $entry = [
'url' => $rr['url'],
'itemurl' => defaults($contact_details, 'addr', $rr['url']),
'name' => htmlentities($contact_details['name']),
'conntxt' => t('Connect'),
'connlnk' => $connlnk,
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$tpl = get_markup_template('viewcontact_template.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
//'$title' => sprintf( t('Friends of %s'), htmlentities($c[0]['name'])),
'$tab_str' => $tab_str,
'$contacts' => $entries,
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
}
}
$tpl = get_markup_template("oauth_authorize_done.tpl");
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$title' => t('Authorize application connection'),
'$info' => t('Return to your app and insert this Securty Code:'),
'$code' => $verifier,
- ));
+ ]);
return $o;
}
}
$tpl = get_markup_template('oauth_authorize.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$title' => t('Authorize application connection'),
'$app' => $app,
'$authorize' => t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
'$yes' => t('Yes'),
'$no' => t('No'),
- ));
+ ]);
return $o;
}
}
$tpl = get_markup_template('apps.tpl');
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$title' => $title,
'$apps' => $a->apps,
- ));
+ ]);
}
if (!strstr($referer, $page)) {
$content = add_page_info($_REQUEST["url"]);
- $x = array(
+ $x = [
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'profile_uid' => local_user(),
'title' => trim($_REQUEST["title"], "*"),
'content' => $content
- );
+ ];
$o = status_editor($a, $x, 0, false);
$o .= "<script>window.resizeTo(800,550);</script>";
} else {
$tpl = get_markup_template("vcard-widget.tpl");
- $vcard_widget = replace_macros($tpl, array(
+ $vcard_widget = replace_macros($tpl, [
'$name' => $profile['name'],
'$photo' => $profile['photo'],
'$addr' => (($profile['addr'] != "") ? $profile['addr'] : ""),
'$account_type' => $account_type,
'$pdesc' => (($profile['pdesc'] != "") ? $profile['pdesc'] : ""),
- ));
+ ]);
$cal_widget = widget_events();
$i18n = get_event_strings();
$htpl = get_markup_template('event_head.tpl');
- $a->page['htmlhead'] .= replace_macros($htpl, array(
+ $a->page['htmlhead'] .= replace_macros($htpl, [
'$baseurl' => System::baseUrl(),
'$module_url' => '/cal/' . $a->data['user']['nickname'],
'$modparams' => 2,
'$i18n' => $i18n,
- ));
+ ]);
$etpl = get_markup_template('event_end.tpl');
- $a->page['end'] .= replace_macros($etpl, array(
+ $a->page['end'] .= replace_macros($etpl, [
'$baseurl' => System::baseUrl(),
- ));
+ ]);
$mode = 'view';
$y = 0;
$adjust_finish = datetime_convert('UTC', date_default_timezone_get(), $finish);
// put the event parametes in an array so we can better transmit them
- $event_params = array(
+ $event_params = [
'event_id' => (x($_GET, 'id') ? $_GET["id"] : 0),
'start' => $start,
'finish' => $finish,
'adjust_start' => $adjust_start,
'adjust_finish' => $adjust_finish,
'ignored' => $ignored,
- );
+ ];
// get events by id or by date
if (x($_GET, 'id')) {
$r = events_by_date($owner_uid, $event_params, $sql_extra);
}
- $links = array();
+ $links = [];
if (DBM::is_result($r)) {
$r = sort_by_date($r);
// Get rid of dashes in key names, Smarty3 can't handle them
foreach ($events as $key => $event) {
- $event_item = array();
+ $event_item = [];
foreach ($event['item'] as $k => $v) {
$k = str_replace('-', '_', $k);
$event_item[$k] = $v;
$events[$key]['item'] = $event_item;
}
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$tabs' => $tabs,
'$title' => t('Events'),
'$view' => t('View'),
- '$previous' => array(System::baseUrl() . "/events/$prevyear/$prevmonth", t('Previous'), '', ''),
- '$next' => array(System::baseUrl() . "/events/$nextyear/$nextmonth", t('Next'), '', ''),
+ '$previous' => [System::baseUrl() . "/events/$prevyear/$prevmonth", t('Previous'), '', ''],
+ '$next' => [System::baseUrl() . "/events/$nextyear/$nextmonth", t('Next'), '', ''],
'$calendar' => cal($y, $m, $links, ' eventcal'),
'$events' => $events,
"today" => t("today"),
"week" => t("week"),
"day" => t("day"),
"list" => t("list"),
- ));
+ ]);
if (x($_GET, 'id')) {
echo $o;
$contact = dba::selectFirst('contact', ['name', 'url', 'photo'], ['self' => true, 'uid' => $uid]);
if (DBM::is_result($contact)) {
- $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
+ $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
'$name' => htmlentities($contact['name']),
'$photo' => $contact['photo'],
'url' => 'contacts/' . $cid
- ));
-
+ ]);
+
if (!x($a->page, 'aside')) {
$a->page['aside'] = '';
}
$photo_menu = Contact::photoMenu($rr);
- $entry = array(
+ $entry = [
'url' => $rr['url'],
'itemurl' => defaults($contact_details, 'addr', $rr['url']),
'name' => $contact_details['name'],
'network' => ContactSelector::networkToName($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$tpl = get_markup_template('viewcontact_template.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => $title,
'$tab_str' => $tab_str,
'$contacts' => $entries,
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
}
$tabs = [];
if ((local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_USERS_ON_SERVER])) && empty(Config::get('system','singleuser'))) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Community'),
'url' => 'community/local',
'sel' => $content == 'local' ? 'active' : '',
'title' => t('Posts from local users on this server'),
'id' => 'community-local-tab',
'accesskey' => 'l'
- );
+ ];
}
if (local_user() || in_array($page_style, [CP_USERS_AND_GLOBAL, CP_GLOBAL_COMMUNITY])) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Global Timeline'),
'url' => 'community/global',
'sel' => $content == 'global' ? 'active' : '',
'title' => t('Posts from users of the federated network'),
'id' => 'community-global-tab',
'accesskey' => 'g'
- );
+ ];
}
$tab_tpl = get_markup_template('common_tabs.tpl');
- $o .= replace_macros($tab_tpl, array('$tabs' => $tabs));
+ $o .= replace_macros($tab_tpl, ['$tabs' => $tabs]);
nav_set_selected('community');
// We need the editor here to be able to reshare an item.
if (local_user()) {
- $x = array(
+ $x = [
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'bang' => '',
'visitor' => 'block',
'profile_uid' => local_user(),
- );
+ ];
$o .= status_editor($a, $x, 0, true);
}
}
$count = 1;
$previousauthor = "";
$numposts = 0;
- $s = array();
+ $s = [];
do {
foreach ($r as $item) {
}
$t = get_markup_template("community.tpl");
- return replace_macros($t, array(
+ return replace_macros($t, [
'$content' => $o,
'$header' => '',
'$show_global_community_hint' => ($content == 'global') && Config::get('system', 'show_global_community_hint'),
'$global_community_hint' => t("This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.")
- ));
+ ]);
}
function community_getitems($start, $itemspage, $content)
}
// Should never happen
- return array();
+ return [];
}
$group = $r[0];
$members = Contact::getByGroupId($group['id']);
- $preselected = array();
+ $preselected = [];
if (count($members)) {
foreach ($members as $member) {
$preselected[] = $member['id'];
}
/// @TODO Add nice spaces
- $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array(
+ $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), [
'$name' => htmlentities($a->data['contact']['name']),
'$photo' => $a->data['contact']['photo'],
'$url' => ($a->data['contact']['network'] == NETWORK_DFRN) ? "redir/" . $a->data['contact']['id'] : $a->data['contact']['url'],
'$network_name' => $networkname,
'$network' => t('Network:'),
'$account_type' => Contact::getAccountType($a->data['contact'])
- ));
+ ]);
$findpeople_widget = '';
$follow_widget = '';
$groups_widget = Group::sidebarWidget('contacts', 'group', 'full', 0, $contact_id);
- $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"), array(
+ $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"), [
'$vcard_widget' => $vcard_widget,
'$findpeople_widget' => $findpeople_widget,
'$follow_widget' => $follow_widget,
'$groups_widget' => $groups_widget,
'$networks_widget' => $networks_widget
- ));
+ ]);
$base = System::baseUrl();
$tpl = get_markup_template("contacts-head.tpl");
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$base' => $base
- ));
+ ]);
$tpl = get_markup_template("contacts-end.tpl");
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$base' => $base
- ));
+ ]);
}
function contacts_batch_actions(App $a)
$data = Probe::uri($contact["url"], "", 0, false);
// "Feed" or "Unknown" is mostly a sign of communication problems
- if ((in_array($data["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) && ($data["network"] != $contact["network"])) {
+ if ((in_array($data["network"], [NETWORK_FEED, NETWORK_PHANTOM])) && ($data["network"] != $contact["network"])) {
return;
}
- $updatefields = array("name", "nick", "url", "addr", "batch", "notify", "poll", "request", "confirm",
- "poco", "network", "alias");
- $update = array();
+ $updatefields = ["name", "nick", "url", "addr", "batch", "notify", "poll", "request", "confirm",
+ "poco", "network", "alias"];
+ $update = [];
if ($data["network"] == NETWORK_OSTATUS) {
$result = Contact::createFromProbe($uid, $data["url"], false);
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
- $inputs = array();
+ $inputs = [];
foreach ($query['args'] as $arg) {
if (strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
- $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
+ $inputs[] = ['name' => $arg_parts[0], 'value' => $arg_parts[1]];
}
}
$a->page['aside'] = '';
- return replace_macros(get_markup_template('contact_drop_confirm.tpl'), array(
+ return replace_macros(get_markup_template('contact_drop_confirm.tpl'), [
'$header' => t('Drop contact'),
'$contact' => _contact_detail_for_template($orig_record),
'$method' => 'get',
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
- ));
+ ]);
}
// Now check how the user responded to the confirmation query
if (x($_REQUEST, 'canceled')) {
$contact_id = $a->data['contact']['id'];
$contact = $a->data['contact'];
- $a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), [
'$baseurl' => System::baseUrl(true),
- ));
- $a->page['end'] .= replace_macros(get_markup_template('contact_end.tpl'), array(
+ ]);
+ $a->page['end'] .= replace_macros(get_markup_template('contact_end.tpl'), [
'$baseurl' => System::baseUrl(true),
- ));
+ ]);
$dir_icon = '';
$relation_text = '';
break;
}
- if (!in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) {
+ if (!in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$relation_text = "";
}
}
$lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
- $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL));
+ $poll_enabled = in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL]);
$nettype = t('Network type: %s', ContactSelector::networkToName($contact['network'], $contact["url"]));
$fetch_further_information = null;
if ($contact['network'] == NETWORK_FEED) {
- $fetch_further_information = array(
+ $fetch_further_information = [
'fetch_further_information',
t('Fetch further information for feeds'),
$contact['fetch_further_information'],
t("Fetch information like preview pictures, title and teaser from the feed item. You can activate this if the feed doesn't contain much text. Keywords are taken from the meta header in the feed item and are posted as hash tags."),
- array('0' => t('Disabled'),
+ ['0' => t('Disabled'),
'1' => t('Fetch information'),
'3' => t('Fetch keywords'),
'2' => t('Fetch information and keywords')
- )
- );
+ ]
+ ];
}
$poll_interval = null;
- if (in_array($contact['network'], array(NETWORK_FEED, NETWORK_MAIL))) {
+ if (in_array($contact['network'], [NETWORK_FEED, NETWORK_MAIL])) {
$poll_interval = ContactSelector::pollInterval($contact['priority'], (!$poll_enabled));
}
$follow = '';
$follow_text = '';
- if (in_array($contact['network'], array(NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
if ($contact['rel'] == CONTACT_IS_FOLLOWER) {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = t("Connect/Follow");
$contact_actions = contact_actions($contact);
$tpl = get_markup_template("contact_edit.tpl");
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$header' => t("Contact"),
'$tab_str' => $tab_str,
'$submit' => t('Submit'),
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'$insecure' => (($contact['network'] !== NETWORK_DFRN && $contact['network'] !== NETWORK_MAIL && $contact['network'] !== NETWORK_FACEBOOK && $contact['network'] !== NETWORK_DIASPORA) ? $insecure : ''),
'$info' => $contact['info'],
- '$cinfo' => array('info', '', $contact['info'], ''),
+ '$cinfo' => ['info', '', $contact['info'], ''],
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
'$pending' => (($contact['pending']) ? t('Awaiting connection acknowledge') : ''),
- '$hidden' => array('hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')),
- '$notify' => array('notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')),
+ '$hidden' => ['hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')],
+ '$notify' => ['notify', t('Notification for new posts'), ($contact['notify_new_posts'] == 1), t('Send a notification of every new post of this contact')],
'$fetch_further_information' => $fetch_further_information,
'$ffi_keyword_blacklist' => $contact['ffi_keyword_blacklist'],
- '$ffi_keyword_blacklist' => array('ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')),
+ '$ffi_keyword_blacklist' => ['ffi_keyword_blacklist', t('Blacklisted keywords'), $contact['ffi_keyword_blacklist'], t('Comma separated list of keywords that should not be converted to hashtags, when "Fetch information and keywords" is selected')],
'$photo' => $contact['photo'],
'$name' => htmlentities($contact['name']),
'$dir_icon' => $dir_icon,
'$contact_status' => t("Status"),
'$contact_settings_label' => t('Contact Settings'),
'$contact_profile_label' => t("Profile"),
- ));
+ ]);
- $arr = array('contact' => $contact, 'output' => $o);
+ $arr = ['contact' => $contact, 'output' => $o];
call_hooks('contact_edit', $arr);
$search = x($_GET, 'search') ? notags(trim($_GET['search'])) : '';
$nets = x($_GET, 'nets' ) ? notags(trim($_GET['nets'])) : '';
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('Suggestions'),
'url' => 'suggest',
'sel' => '',
'title' => t('Suggest potential friends'),
'id' => 'suggestions-tab',
'accesskey' => 'g',
- ),
- array(
+ ],
+ [
'label' => t('All Contacts'),
'url' => 'contacts/all',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all contacts'),
'id' => 'showall-tab',
'accesskey' => 'l',
- ),
- array(
+ ],
+ [
'label' => t('Unblocked'),
'url' => 'contacts',
'sel' => ((!$all) && (!$blocked) && (!$hidden) && (!$search) && (!$nets) && (!$ignored) && (!$archived)) ? 'active' : '',
'title' => t('Only show unblocked contacts'),
'id' => 'showunblocked-tab',
'accesskey' => 'o',
- ),
- array(
+ ],
+ [
'label' => t('Blocked'),
'url' => 'contacts/blocked',
'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked contacts'),
'id' => 'showblocked-tab',
'accesskey' => 'b',
- ),
- array(
+ ],
+ [
'label' => t('Ignored'),
'url' => 'contacts/ignored',
'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored contacts'),
'id' => 'showignored-tab',
'accesskey' => 'i',
- ),
- array(
+ ],
+ [
'label' => t('Archived'),
'url' => 'contacts/archived',
'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived contacts'),
'id' => 'showarchived-tab',
'accesskey' => 'y',
- ),
- array(
+ ],
+ [
'label' => t('Hidden'),
'url' => 'contacts/hidden',
'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden contacts'),
'id' => 'showhidden-tab',
'accesskey' => 'h',
- ),
- );
+ ],
+ ];
$tab_tpl = get_markup_template('common_tabs.tpl');
- $t = replace_macros($tab_tpl, array('$tabs' => $tabs));
+ $t = replace_macros($tab_tpl, ['$tabs' => $tabs]);
$total = 0;
$searching = false;
$sql_extra3 = Widget::unavailableNetworks();
- $contacts = array();
+ $contacts = [];
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 $sql_extra3 ORDER BY `name` ASC LIMIT %d , %d ",
intval($_SESSION['uid']),
}
$tpl = get_markup_template("contacts-template.tpl");
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$header' => t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''),
'$tabs' => $t,
'$contacts' => $contacts,
'$contact_drop_confirm' => t('Do you really want to delete this contact?'),
'multiselect' => 1,
- '$batch_actions' => array(
+ '$batch_actions' => [
'contacts_batch_update' => t('Update'),
'contacts_batch_block' => t('Block') . "/" . t("Unblock"),
"contacts_batch_ignore" => t('Ignore') . "/" . t("Unignore"),
"contacts_batch_archive" => t('Archive') . "/" . t("Unarchive"),
"contacts_batch_drop" => t('Delete'),
- ),
+ ],
'$h_batch_actions' => t('Batch Actions'),
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
}
function contacts_tab($a, $contact_id, $active_tab)
{
// tabs
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('Status'),
'url' => "contacts/" . $contact_id . "/posts",
'sel' => (($active_tab == 1) ? 'active' : ''),
'title' => t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
- ),
- array(
+ ],
+ [
'label' => t('Profile'),
'url' => "contacts/" . $contact_id,
'sel' => (($active_tab == 2) ? 'active' : ''),
'title' => t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'o',
- )
- );
+ ]
+ ];
// Show this tab only if there is visible friend list
$x = GContact::countAllFriends(local_user(), $contact_id);
if ($x) {
- $tabs[] = array('label' => t('Contacts'),
+ $tabs[] = ['label' => t('Contacts'),
'url' => "allfriends/" . $contact_id,
'sel' => (($active_tab == 3) ? 'active' : ''),
'title' => t('View all contacts'),
'id' => 'allfriends-tab',
- 'accesskey' => 't');
+ 'accesskey' => 't'];
}
// Show this tab only if there is visible common friend list
$common = GContact::countCommonFriends(local_user(), $contact_id);
if ($common) {
- $tabs[] = array('label' => t('Common Friends'),
+ $tabs[] = ['label' => t('Common Friends'),
'url' => "common/loc/" . local_user() . "/" . $contact_id,
'sel' => (($active_tab == 4) ? 'active' : ''),
'title' => t('View all common friends'),
'id' => 'common-loc-tab',
'accesskey' => 'd'
- );
+ ];
}
- $tabs[] = array('label' => t('Advanced'),
+ $tabs[] = ['label' => t('Advanced'),
'url' => 'crepair/' . $contact_id,
'sel' => (($active_tab == 5) ? 'active' : ''),
'title' => t('Advanced Contact Settings'),
'id' => 'advanced-tab',
'accesskey' => 'r'
- );
+ ];
$tab_tpl = get_markup_template('common_tabs.tpl');
- $tab_str = replace_macros($tab_tpl, array('$tabs' => $tabs));
+ $tab_str = replace_macros($tab_tpl, ['$tabs' => $tabs]);
return $tab_str;
}
$sparkle = '';
}
- return array(
+ return [
'img_hover' => t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
'edit_hover' => t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr),
'itemurl' => (($rr['addr'] != "") ? $rr['addr'] : $rr['url']),
'url' => $url,
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
- );
+ ];
}
/**
*/
function contact_actions($contact)
{
- $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL));
- $contact_actions = array();
+ $poll_enabled = in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL]);
+ $contact_actions = [];
// Provide friend suggestion only for Friendica contacts
if ($contact['network'] === NETWORK_DFRN) {
- $contact_actions['suggest'] = array(
+ $contact_actions['suggest'] = [
'label' => t('Suggest friends'),
'url' => 'fsuggest/' . $contact['id'],
'title' => '',
'sel' => '',
'id' => 'suggest',
- );
+ ];
}
if ($poll_enabled) {
- $contact_actions['update'] = array(
+ $contact_actions['update'] = [
'label' => t('Update now'),
'url' => 'contacts/' . $contact['id'] . '/update',
'title' => '',
'sel' => '',
'id' => 'update',
- );
+ ];
}
- $contact_actions['block'] = array(
+ $contact_actions['block'] = [
'label' => (intval($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => 'contacts/' . $contact['id'] . '/block',
'title' => t('Toggle Blocked status'),
'sel' => (intval($contact['blocked']) ? 'active' : ''),
'id' => 'toggle-block',
- );
+ ];
- $contact_actions['ignore'] = array(
+ $contact_actions['ignore'] = [
'label' => (intval($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => 'contacts/' . $contact['id'] . '/ignore',
'title' => t('Toggle Ignored status'),
'sel' => (intval($contact['readonly']) ? 'active' : ''),
'id' => 'toggle-ignore',
- );
+ ];
- $contact_actions['archive'] = array(
+ $contact_actions['archive'] = [
'label' => (intval($contact['archive']) ? t('Unarchive') : t('Archive') ),
'url' => 'contacts/' . $contact['id'] . '/archive',
'title' => t('Toggle Archive status'),
'sel' => (intval($contact['archive']) ? 'active' : ''),
'id' => 'toggle-archive',
- );
+ ];
- $contact_actions['delete'] = array(
+ $contact_actions['delete'] = [
'label' => t('Delete'),
'url' => 'contacts/' . $contact['id'] . '/drop',
'title' => t('Delete contact'),
'sel' => '',
'id' => 'delete',
- );
+ ];
return $contact_actions;
}
// Disable remote self for everything except feeds.
// There is an issue when you repeat an item from maybe twitter and you got comments from friendica and twitter
// Problem is, you couldn't reply to both networks.
- if (!in_array($contact['network'], array(NETWORK_FEED, NETWORK_DFRN, NETWORK_DIASPORA))) {
+ if (!in_array($contact['network'], [NETWORK_FEED, NETWORK_DFRN, NETWORK_DIASPORA])) {
$allow_remote_self = false;
}
if ($contact['network'] == NETWORK_FEED) {
- $remote_self_options = array('0' => t('No mirroring'), '1' => t('Mirror as forwarded posting'), '2' => t('Mirror as my own posting'));
+ $remote_self_options = ['0' => t('No mirroring'), '1' => t('Mirror as forwarded posting'), '2' => t('Mirror as my own posting')];
} else {
- $remote_self_options = array('0' => t('No mirroring'), '2' => t('Mirror as my own posting'));
+ $remote_self_options = ['0' => t('No mirroring'), '2' => t('Mirror as my own posting')];
}
- $update_profile = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS));
+ $update_profile = in_array($contact['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]);
$tab_str = contacts_tab($a, $contact['id'], 5);
$tpl = get_markup_template('crepair.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$tab_str' => $tab_str,
'$warning' => $warning,
'$info' => $info,
'$lbl_submit' => t('Submit'),
'$label_remote_self' => t('Remote Self'),
'$allow_remote_self' => $allow_remote_self,
- '$remote_self' => array('remote_self',
+ '$remote_self' => ['remote_self',
t('Mirror postings from this contact'),
$contact['remote_self'],
t('Mark this contact as remote_self, this will cause friendica to repost new entries from this contact.'),
$remote_self_options
- ),
-
- '$name' => array('name', t('Name') , htmlentities($contact['name'])),
- '$nick' => array('nick', t('Account Nickname'), htmlentities($contact['nick'])),
- '$attag' => array('attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']),
- '$url' => array('url', t('Account URL'), $contact['url']),
- '$request' => array('request', t('Friend Request URL'), $contact['request']),
- 'confirm' => array('confirm', t('Friend Confirm URL'), $contact['confirm']),
- 'notify' => array('notify', t('Notification Endpoint URL'), $contact['notify']),
- 'poll' => array('poll', t('Poll/Feed URL'), $contact['poll']),
- 'photo' => array('photo', t('New photo from this URL'), ''),
- ));
+ ],
+
+ '$name' => ['name', t('Name') , htmlentities($contact['name'])],
+ '$nick' => ['nick', t('Account Nickname'), htmlentities($contact['nick'])],
+ '$attag' => ['attag', t('@Tagname - overrides Name/Nickname'), $contact['attag']],
+ '$url' => ['url', t('Account URL'), $contact['url']],
+ '$request' => ['request', t('Friend Request URL'), $contact['request']],
+ 'confirm' => ['confirm', t('Friend Confirm URL'), $contact['confirm']],
+ 'notify' => ['notify', t('Notification Endpoint URL'), $contact['notify']],
+ 'poll' => ['poll', t('Poll/Feed URL'), $contact['poll']],
+ 'photo' => ['photo', t('New photo from this URL'), ''],
+ ]);
return $o;
}
if ((int) $xml->status === 1) {
$_SESSION['authenticated'] = 1;
if (!x($_SESSION, 'remote')) {
- $_SESSION['remote'] = array();
+ $_SESSION['remote'] = [];
}
- $_SESSION['remote'][] = array('cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']);
+ $_SESSION['remote'][] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']];
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
. '&sec=' . $sec
);
} else {
- $s = post_url($r[0]['poll'], array(
+ $s = post_url($r[0]['poll'], [
'dfrn_id' => $encrypted_id,
'type' => 'profile-check',
'dfrn_version' => DFRN_PROTOCOL_VERSION,
'challenge' => $challenge,
'sec' => $sec
- ));
+ ]);
}
$profile = ((DBM::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
if (((int) $xml->status == 0) && ($xml->challenge == $hash) && ($xml->sec == $sec)) {
$_SESSION['authenticated'] = 1;
if (!x($_SESSION, 'remote')) {
- $_SESSION['remote'] = array();
+ $_SESSION['remote'] = [];
}
- $_SESSION['remote'][] = array('cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']);
+ $_SESSION['remote'][] = ['cid' => $r[0]['id'], 'uid' => $r[0]['uid'], 'url' => $r[0]['url']];
$_SESSION['visitor_id'] = $r[0]['id'];
$_SESSION['visitor_home'] = $r[0]['url'];
$_SESSION['visitor_visiting'] = $r[0]['uid'];
return;
} else {
$contact_record = $ret[0];
- $parms = array('dfrn-request' => $ret[0]['request']);
+ $parms = ['dfrn-request' => $ret[0]['request']];
}
}
}
$tpl = get_markup_template("dfrn_req_confirm.tpl");
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
'$hidethem' => t('Hide this contact'),
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url']
- ));
+ ]);
return $o;
} elseif ((x($_GET, 'confirm_key')) && strlen($_GET['confirm_key'])) {
// we are the requestee and it is now safe to send our user their introduction,
}
if (!$auto_confirm) {
- notification(array(
+ notification([
'type' => NOTIFY_INTRO,
'notify_flags' => $r[0]['notify-flags'],
'language' => $r[0]['language'],
'source_photo' => $r[0]['photo'],
'verb' => ACTIVITY_REQ_FRIEND,
'otype' => 'intro'
- ));
+ ]);
}
if ($auto_confirm) {
require_once 'mod/dfrn_confirm.php';
- $handsfree = array(
+ $handsfree = [
'uid' => $r[0]['uid'],
'node' => $r[0]['nickname'],
'dfrn_id' => $r[0]['issued-id'],
'intro_id' => $intro[0]['id'],
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
'activity' => intval(PConfig::get($r[0]['uid'], 'system', 'post_newfriend'))
- );
+ ];
dfrn_confirm_post($a, $handsfree);
}
}
get_server()
);
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$header' => t('Friend/Connection Request'),
'$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
'$pls_answer' => t('Please answer the following:'),
- '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', array(t('No'), t('Yes'))),
+ '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'), $a->profile['name']), false, '', [t('No'), t('Yes')]],
'$add_note' => t('Add a personal note:'),
'$page_desc' => $page_desc,
'$friendica' => t('Friendica'),
'$nickname' => $a->argv[1],
'$name' => $a->profile['name'],
'$myaddr' => $myaddr
- ));
+ ]);
return $o;
}
$location_e = $location;
- $photo_menu = array(
- 'profile' => array(t("View Profile"), Profile::zrl($profile_link))
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($profile_link)]
+ ];
- $entry = array(
+ $entry = [
'id' => $rr['id'],
'url' => $profile_link,
'itemurl' => $itemurl,
'about' => $about,
'photo_menu' => $photo_menu,
- );
+ ];
- $arr = array('contact' => $rr, 'entry' => $entry);
+ $arr = ['contact' => $rr, 'entry' => $entry];
call_hooks('directory_item', $arr);
$tpl = get_markup_template('directory_header.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$search' => $search,
'$globaldir' => t('Global Directory'),
'$gdirpath' => $gdirpath,
'$title' => t('Site Directory'),
'$submit' => t('Find'),
'$paginate' => paginate($a),
- ));
+ ]);
}
else
if ((valid_email($search) && validate_email($search)) ||
(substr(normalise_link($search), 0, 7) == "http://")) {
$user_data = Probe::uri($search);
- $discover_user = (in_array($user_data["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA)));
+ $discover_user = (in_array($user_data["network"], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA]));
}
}
$details = _contact_detail_for_template($contact[0]);
$alt_text = $details['alt_text'];
} else {
- $photo_menu = array();
+ $photo_menu = [];
}
} else {
$connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
$conntxt = t('Connect');
- $photo_menu = array(
- 'profile' => array(t("View Profile"), Profile::zrl($jj->url)),
- 'follow' => array(t("Connect/Follow"), $connlnk)
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($jj->url)],
+ 'follow' => [t("Connect/Follow"), $connlnk]
+ ];
}
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
- $entry = array(
+ $entry = [
'alt_text' => $alt_text,
'url' => Profile::zrl($jj->url),
'itemurl' => $itemurl,
'account_type' => Contact::getAccountType($contact_details),
'network' => ContactSelector::networkToName($jj->network, $jj->url),
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$tpl = get_markup_template('viewcontact_template.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'title' => $header,
'$contacts' => $entries,
'$paginate' => paginate($a),
- ));
+ ]);
} else {
info( t('No matches') . EOL);
}
$nick = (($a->argc > 1) ? $a->argv[1] : '');
- $profiledata = array();
+ $profiledata = [];
if ($a->argc == 3) {
if (substr($a->argv[2], -5) == '.atom') {
}
$profiledata["network"] = NETWORK_DFRN;
} else {
- $profiledata = array();
+ $profiledata = [];
}
}
}
}
function display_fetchauthor($a, $item) {
- $profiledata = array();
+ $profiledata = [];
$profiledata["uid"] = -1;
$profiledata["nickname"] = $item["author-name"];
$profiledata["name"] = $item["author-name"];
$profiledata["photo"] = System::removedBaseUrl($profiledata["photo"]);
if (local_user()) {
- if (in_array($profiledata["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (in_array($profiledata["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) {
$profiledata["remoteconnect"] = System::baseUrl()."/follow?url=".urlencode($profiledata["url"]);
}
} elseif ($profiledata["network"] == NETWORK_DFRN) {
if ($update) {
$item_id = $_REQUEST['item_id'];
$item = dba::selectFirst('item', ['uid', 'parent'], ['id' => $item_id]);
- $a->profile = array('uid' => intval($item['uid']), 'profile_uid' => intval($item['uid']));
+ $a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
$item_parent = $item['parent'];
} else {
$item_id = (($a->argc > 2) ? $a->argv[2] : 0);
}
// We are displaying an "alternate" link if that post was public. See issue 2864
- $is_public = dba::exists('item', array('id' => $item_id, 'private' => false));
+ $is_public = dba::exists('item', ['id' => $item_id, 'private' => false]);
if ($is_public) {
// For the atom feed the nickname doesn't matter at all, we only need the item id.
$alternate = System::baseUrl().'/display/feed-item/'.$item_id.'.atom';
}
$a->page['htmlhead'] .= replace_macros(get_markup_template('display-head.tpl'),
- array('$alternate' => $alternate,
- '$conversation' => $conversation));
+ ['$alternate' => $alternate,
+ '$conversation' => $conversation]);
- $groups = array();
+ $groups = [];
$contact = null;
$remote_contact = false;
// We need the editor here to be able to reshare an item.
if ($is_owner) {
- $x = array(
+ $x = [
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'bang' => '',
'visitor' => 'block',
'profile_uid' => local_user(),
- );
+ ];
$o .= status_editor($a, $x, 0, true);
}
if (local_user() && (local_user() == $a->profile['uid'])) {
$unseen = dba::selectFirst('item', ['id'], ['parent' => $s[0]['parent'], 'unseen' => true]);
if (DBM::is_result($unseen)) {
- dba::update('item', array('unseen' => false), array('parent' => $s[0]['parent'], 'unseen' => true));
+ dba::update('item', ['unseen' => false], ['parent' => $s[0]['parent'], 'unseen' => true]);
}
}
return;
}
- $o .= replace_macros(get_markup_template("section_title.tpl"),array(
+ $o .= replace_macros(get_markup_template("section_title.tpl"),[
'$title' => t('Edit post')
- ));
+ ]);
$tpl = get_markup_template('jot-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag,
'$nickname' => $a->user['nickname']
- ));
+ ]);
$tpl = get_markup_template('jot-end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
'$geotag' => $geotag,
'$nickname' => $a->user['nickname']
- ));
+ ]);
$tpl = get_markup_template("jot.tpl");
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$is_edit' => true,
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
'$message' => t('Message'),
'$browser' => t('Browser'),
'$shortpermset' => t('permissions'),
- ));
+ ]);
return $o;
}
- $datarray = array();
+ $datarray = [];
$datarray['guid'] = get_guid(32);
$datarray['start'] = $start;
$datarray['finish'] = $finish;
$i18n = get_event_strings();
$htpl = get_markup_template('event_head.tpl');
- $a->page['htmlhead'] .= replace_macros($htpl, array(
+ $a->page['htmlhead'] .= replace_macros($htpl, [
'$baseurl' => System::baseUrl(),
'$module_url' => '/events',
'$modparams' => 1,
'$i18n' => $i18n,
- ));
+ ]);
$etpl = get_markup_template('event_end.tpl');
- $a->page['end'] .= replace_macros($etpl, array(
+ $a->page['end'] .= replace_macros($etpl, [
'$baseurl' => System::baseUrl(),
- ));
+ ]);
$o = '';
$tabs = '';
$adjust_finish = datetime_convert('UTC', date_default_timezone_get(), $finish);
// put the event parametes in an array so we can better transmit them
- $event_params = array(
+ $event_params = [
'event_id' => (x($_GET, 'id') ? $_GET['id'] : 0),
'start' => $start,
'finish' => $finish,
'adjust_start' => $adjust_start,
'adjust_finish' => $adjust_finish,
'ignored' => $ignored,
- );
+ ];
// get events by id or by date
if (x($_GET, 'id')) {
$r = events_by_date(local_user(), $event_params);
}
- $links = array();
+ $links = [];
if (DBM::is_result($r)) {
$r = sort_by_date($r);
}
}
- $events = array();
+ $events = [];
// transform the event in a usable array
if (DBM::is_result($r)) {
// Get rid of dashes in key names, Smarty3 can't handle them
foreach ($events as $key => $event) {
- $event_item = array();
+ $event_item = [];
foreach ($event['item'] as $k => $v) {
$k = str_replace('-' ,'_', $k);
$event_item[$k] = $v;
$events[$key]['item'] = $event_item;
}
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$tabs' => $tabs,
'$title' => t('Events'),
'$view' => t('View'),
- '$new_event' => array(System::baseUrl() . '/events/new', t('Create New Event'), '', ''),
- '$previous' => array(System::baseUrl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''),
- '$next' => array(System::baseUrl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''),
+ '$new_event' => [System::baseUrl() . '/events/new', t('Create New Event'), '', ''],
+ '$previous' => [System::baseUrl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''],
+ '$next' => [System::baseUrl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''],
'$calendar' => cal($y, $m, $links, ' eventcal'),
'$events' => $events,
'$week' => t('week'),
'$day' => t('day'),
'$list' => t('list'),
- ));
+ ]);
if (x($_GET, 'id')) {
echo $o;
}
// Passed parameters overrides anything found in the DB
- if (in_array($mode, array('edit', 'new', 'copy'))) {
- if (!x($orig_event)) {$orig_event = array();}
+ if (in_array($mode, ['edit', 'new', 'copy'])) {
+ if (!x($orig_event)) {$orig_event = [];}
// In case of an error the browser is redirected back here, with these parameters filled in with the previous values
if (x($_REQUEST, 'nofinish')) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
if (x($_REQUEST, 'adjust')) {$orig_event['adjust'] = $_REQUEST['adjust'];}
$tpl = get_markup_template('event_form.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$post' => System::baseUrl() . '/events',
'$eid' => $eid,
'$cid' => $cid,
'$l_orig' => $l_orig,
'$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>',
'$t_orig' => $t_orig,
- '$summary' => array('summary', t('Title:'), $t_orig, '', '*'),
+ '$summary' => ['summary', t('Title:'), $t_orig, '', '*'],
'$sh_text' => t('Share this event'),
- '$share' => array('share', t('Share this event'), $sh_checked, '', $sh_disabled),
+ '$share' => ['share', t('Share this event'), $sh_checked, '', $sh_disabled],
'$sh_checked' => $sh_checked,
- '$nofinish' => array('nofinish', t('Finish date/time is not known or not relevant'), $n_checked),
- '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked),
+ '$nofinish' => ['nofinish', t('Finish date/time is not known or not relevant'), $n_checked],
+ '$adjust' => ['adjust', t('Adjust for viewer timezone'), $a_checked],
'$preview' => t('Preview'),
'$acl' => $acl,
'$submit' => t('Submit'),
'$advanced' => t('Advanced'),
'$permissions' => t('Permissions'),
- ));
+ ]);
return $o;
}
if ($mode === 'drop' && $event_id) {
$del = 0;
- $params = array('event_id' => ($event_id));
+ $params = ['event_id' => ($event_id)];
$ev = event_by_id(local_user(), $params);
// Delete only real events (no birthdays)
switch ($a->argv[1]) {
case "image":
- $path = array(array("", t("Photos")));
+ $path = [["", t("Photos")]];
$albums = false;
$sql_extra = "";
$sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
dbesc( t('Contact Photos'))
);
- function _map_folder1($el){return array(bin2hex($el['album']),$el['album']);};
+ function _map_folder1($el){return [bin2hex($el['album']),$el['album']];};
$albums = array_map( "_map_folder1" , $albums);
}
$album = hex2bin($a->argv[2]);
$sql_extra = sprintf("AND `album` = '%s' ",dbesc($album));
$sql_extra2 = "";
- $path[]=array($a->argv[2], $album);
+ $path[]=[$a->argv[2], $album];
}
$r = q("SELECT `resource-id`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
else
$scale = $rr['loq'];
- return array(
+ return [
System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
$filename_e,
System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
- );
+ ];
}
$files = array_map("_map_files1", $r);
$tpl = get_markup_template($template_file);
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$type' => 'image',
'$baseurl' => System::baseUrl(),
'$path' => $path,
'$files' => $files,
'$cancel' => t('Cancel'),
'$nickname' => $a->user['nickname'],
- ));
+ ]);
break;
$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
$filename_e = $rr['filename'];
- return array(System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png');
+ return [System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png'];
}
$files = array_map("_map_files2", $files);
$tpl = get_markup_template($template_file);
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$type' => 'file',
'$baseurl' => System::baseUrl(),
- '$path' => array( array( "", t("Files")) ),
+ '$path' => [ [ "", t("Files")] ],
'$folders' => false,
'$files' =>$files,
'$cancel' => t('Cancel'),
'$nickname' => $a->user['nickname'],
- ));
+ ]);
}
function fetch_init(App $a)
{
- if (($a->argc != 3) || (!in_array($a->argv[1], array("post", "status_message", "reshare")))) {
+ if (($a->argc != 3) || (!in_array($a->argv[1], ["post", "status_message", "reshare"]))) {
header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));
killme();
}
$filetags = explode(",", $filetags);
$tpl = get_markup_template("filer_dialog.tpl");
- $o = replace_macros($tpl, array(
- '$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')),
+ $o = replace_macros($tpl, [
+ '$field' => ['term', t("Save to Folder:"), '', '', $filetags, t('- select -')],
'$submit' => t('Save'),
- ));
+ ]);
echo $o;
}
normalise_link($ret["url"]));
if (!$r) {
- $r = array(array("location" => "", "about" => "", "keywords" => ""));
+ $r = [["location" => "", "about" => "", "keywords" => ""]];
} else {
$gcontact_id = $r[0]["id"];
}
$header = t("Connect/Follow");
- $o = replace_macros($tpl,array(
+ $o = replace_macros($tpl,[
'$header' => htmlentities($header),
//'$photo' => proxy_url($ret["photo"], false, PROXY_SIZE_SMALL),
'$desc' => "",
'$pls_answer' => t('Please answer the following:'),
- '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', array(t('No'), t('Yes'))),
+ '$does_know_you' => ['knowyou', sprintf(t('Does %s know you?'),$ret["name"]), false, '', [t('No'), t('Yes')]],
'$add_note' => t('Add a personal note:'),
'$page_desc' => "",
'$friendica' => "",
'$about_label' => t("About:"), */
'$keywords' => $r[0]["keywords"],
'$keywords_label' => t("Tags:")
- ));
+ ]);
$a->page['aside'] = "";
if ($gcontact_id <> 0) {
$o .= replace_macros(get_markup_template('section_title.tpl'),
- array('$title' => t('Status Messages and Posts')
- ));
+ ['$title' => t('Status Messages and Posts')
+ ]);
// Show last public posts
$o .= Contact::getPostsFromUrl($ret["url"]);
function friendica_init(App $a) {
if ($a->argv[1] == "json"){
- $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
+ $register_policy = ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'];
$sql_extra = '';
if (x($a->config,'admin_nickname')) {
$adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
$r = q("SELECT `username`, `nickname` FROM `user` WHERE `email` = '%s' $sql_extra", dbesc($adminlist[0]));
- $admin = array(
+ $admin = [
'name' => $r[0]['username'],
'profile'=> System::baseUrl() . '/profile/' . $r[0]['nickname'],
- );
+ ];
} else {
$admin = false;
}
- $visible_plugins = array();
+ $visible_plugins = [];
if (is_array($a->plugins) && count($a->plugins)) {
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
if (DBM::is_result($r)) {
}
Config::load('feature_lock');
- $locked_features = array();
+ $locked_features = [];
if (is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
foreach ($a->config['feature_lock'] as $k => $v) {
if ($k === 'config_loaded') {
}
}
- $data = Array(
+ $data = [
'version' => FRIENDICA_VERSION,
'url' => System::baseUrl(),
'plugins' => $visible_plugins,
'platform' => FRIENDICA_PLATFORM,
'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
'no_scrape_url' => System::baseUrl().'/noscrape'
- );
+ ];
echo json_encode($data);
killme();
$o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
$o .= '</p>' . PHP_EOL;
- $visible_plugins = array();
+ $visible_plugins = [];
if (is_array($a->plugins) && count($a->plugins)) {
$r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
if (DBM::is_result($r)) {
$o .= contact_selector(
'suggest',
'suggest-select',
- array('size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true),
+ ['size' => 4, 'exclude' => $contact_id, 'networks' => 'DFRN_ONLY', 'single' => true],
false
);
$tpl = get_markup_template('group_edit.tpl');
- $context = array(
+ $context = [
'$submit' => t('Save Group'),
- );
+ ];
if (($a->argc == 2) && ($a->argv[1] === 'new')) {
- return replace_macros($tpl, $context + array(
+ return replace_macros($tpl, $context + [
'$title' => t('Create a group of contacts/friends.'),
- '$gname' => array('groupname', t('Group Name: '), '', ''),
+ '$gname' => ['groupname', t('Group Name: '), '', ''],
'$gid' => 'new',
'$form_security_token' => get_form_security_token("group_edit"),
- ));
+ ]);
}
$group = $r[0];
$members = Contact::getByGroupId($group['id']);
- $preselected = array();
- $entry = array();
+ $preselected = [];
+ $entry = [];
$id = 0;
if (count($members)) {
}
$members = Contact::getByGroupId($group['id']);
- $preselected = array();
+ $preselected = [];
if (count($members)) {
foreach ($members as $member) {
$preselected[] = $member['id'];
}
$drop_tpl = get_markup_template('group_drop.tpl');
- $drop_txt = replace_macros($drop_tpl, array(
+ $drop_txt = replace_macros($drop_tpl, [
'$id' => $group['id'],
'$delete' => t('Delete Group'),
'$form_security_token' => get_form_security_token("group_drop"),
- ));
+ ]);
- $context = $context + array(
+ $context = $context + [
'$title' => t('Group Editor'),
- '$gname' => array('groupname', t('Group Name: '), $group['name'], ''),
+ '$gname' => ['groupname', t('Group Name: '), $group['name'], ''],
'$gid' => $group['id'],
'$drop' => $drop_txt,
'$form_security_token' => get_form_security_token('group_edit'),
'$edit_name' => t('Edit Group Name')
- );
+ ];
}
return;
}
- $groupeditor = array(
+ $groupeditor = [
'label_members' => t('Members'),
- 'members' => array(),
+ 'members' => [],
'label_contacts' => t('All Contacts'),
'group_is_empty' => t('Group is empty'),
- 'contacts' => array(),
- );
+ 'contacts' => [],
+ ];
$sec_token = addslashes(get_form_security_token('group_member_change'));
$entry = _contact_detail_for_template($member);
$entry['label'] = 'members';
$entry['photo_menu'] = '';
- $entry['change_member'] = array(
+ $entry['change_member'] = [
'title' => t("Remove Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
- );
+ ];
$groupeditor['members'][] = $entry;
} else {
$entry = _contact_detail_for_template($member);
$entry['label'] = 'contacts';
$entry['photo_menu'] = '';
- $entry['change_member'] = array(
+ $entry['change_member'] = [
'title' => t("Add Contact"),
'gid' => $group['id'],
'cid' => $member['id'],
'sec_token' => $sec_token
- );
+ ];
$groupeditor['contacts'][] = $entry;
}
if (!$blocked) {
$keywords = ((x($a->profile, 'pub_keywords')) ? $a->profile['pub_keywords'] : '');
- $keywords = str_replace(array(',',' ',',,'), array(' ',',',','), $keywords);
+ $keywords = str_replace([',',' ',',,'], [' ',',',','], $keywords);
if (strlen($keywords)) {
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
}
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
- $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
+ $dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
foreach ($dfrn_pages as $dfrn) {
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".System::baseUrl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
}
if (!strlen($text)) {
header($_SERVER["SERVER_PROTOCOL"] . ' 404 ' . t('Not Found'));
$tpl = get_markup_template("404.tpl");
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$message' => t('Page not found.')
- ));
+ ]);
}
$html = Markdown::convert($text, false);
$lines = explode("\n", $html);
$toc="<style>aside ul {padding-left: 1em;}aside h1{font-size:2em}</style><h2>TOC</h2><ul id='toc'>";
$lastlevel=1;
- $idnum = array(0,0,0,0,0,0,0);
+ $idnum = [0,0,0,0,0,0,0];
foreach($lines as &$line){
if (substr($line,0,2)=="<h") {
$level = substr($line,2,1);
if(! function_exists('home_init')) {
function home_init(App $a) {
- $ret = array();
+ $ret = [];
call_hooks('home_init',$ret);
if (local_user() && ($a->user['nickname'])) {
}
$tpl = get_markup_template('xrd_host.tpl');
- echo replace_macros($tpl, array(
+ echo replace_macros($tpl, [
'$zhost' => $a->get_hostname(),
'$zroot' => System::baseUrl(),
'$domain' => System::baseUrl(),
- '$bigkey' => Salmon::salmonKey(Config::get('system', 'site_pubkey')))
+ '$bigkey' => Salmon::salmonKey(Config::get('system', 'site_pubkey'))]
);
exit();
}
// Move the contact data to the profile array so we can deliver it to
- $profile = array(
+ $profile = [
'name' => $contact['name'],
'nick' => $contact['nick'],
'addr' => defaults($contact, 'addr', $contact['url']),
'bd' => $contact['birthday'] <= '0001-01-01' ? '' : $contact['birthday'],
'account_type' => Contact::getAccountType($contact),
'actions' => $actions,
- );
+ ];
if ($datatype == 'html') {
$tpl = get_markup_template('hovercard.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$profile' => $profile,
- ));
+ ]);
return $o;
} else {
dba::connect($dbhost, $dbuser, $dbpass, $dbdata, true);
$tpl = get_markup_template('htconfig.tpl');
- $txt = replace_macros($tpl,array(
+ $txt = replace_macros($tpl,[
'$dbhost' => $dbhost,
'$dbuser' => $dbuser,
'$dbpass' => $dbpass,
'$phpath' => $phpath,
'$adminmail' => $adminmail,
'$rino' => $rino
- ));
+ ]);
$result = file_put_contents('.htconfig.php', $txt);
$r = q("SELECT COUNT(*) as `total` FROM `user`");
if (DBM::is_result($r) && $r[0]['total']) {
$tpl = get_markup_template('install.tpl');
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$title' => $install_title,
'$pass' => '',
'$status' => t('Database already in use.'),
'$text' => '',
- ));
+ ]);
}
}
if ($db_return_text != "") {
$tpl = get_markup_template('install.tpl');
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$title' => $install_title,
'$pass' => "",
'$text' => $db_return_text . what_next(),
- ));
+ ]);
}
switch ($install_wizard_pass) {
case 1: { // System check
- $checks = array();
+ $checks = [];
check_funcs($checks);
$tpl = get_markup_template('install_checks.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => $install_title,
'$pass' => t('System check'),
'$checks' => $checks,
'$reload' => t('Check again'),
'$phpath' => $phpath,
'$baseurl' => System::baseUrl(),
- ));
+ ]);
return $o;
}; break;
$tpl = get_markup_template('install_db.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => $install_title,
'$pass' => t('Database connection'),
'$info_01' => t('In order to install Friendica we need to know how to connect to your database.'),
'$status' => $wizard_status,
- '$dbhost' => array('dbhost', t('Database Server Name'), $dbhost, '', 'required'),
- '$dbuser' => array('dbuser', t('Database Login Name'), $dbuser, '', 'required', 'autofocus'),
- '$dbpass' => array('dbpass', t('Database Login Password'), $dbpass, t("For security reasons the password must not be empty"), 'required'),
- '$dbdata' => array('dbdata', t('Database Name'), $dbdata, '', 'required'),
- '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'),
+ '$dbhost' => ['dbhost', t('Database Server Name'), $dbhost, '', 'required'],
+ '$dbuser' => ['dbuser', t('Database Login Name'), $dbuser, '', 'required', 'autofocus'],
+ '$dbpass' => ['dbpass', t('Database Login Password'), $dbpass, t("For security reasons the password must not be empty"), 'required'],
+ '$dbdata' => ['dbdata', t('Database Name'), $dbdata, '', 'required'],
+ '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
'$submit' => t('Submit'),
- ));
+ ]);
return $o;
}; break;
case 3: { // Site settings
$lang_choices = get_available_languages();
$tpl = get_markup_template('install_settings.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => $install_title,
'$pass' => t('Site settings'),
'$dbdata' => $dbdata,
'$phpath' => $phpath,
- '$adminmail' => array('adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'),
+ '$adminmail' => ['adminmail', t('Site administrator email address'), $adminmail, t('Your account email address must match this in order to use the web admin panel.'), 'required', 'autofocus', 'email'],
'$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''),
- '$language' => array('language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices),
+ '$language' => ['language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices],
'$baseurl' => System::baseUrl(),
'$submit' => t('Submit'),
- ));
+ ]);
return $o;
}; break;
* help : string optional
*/
function check_add(&$checks, $title, $status, $required, $help) {
- $checks[] = array(
+ $checks[] = [
'title' => $title,
'status' => $status,
'required' => $required,
'help' => $help,
- );
+ ];
}
function check_php(&$phpath, &$checks) {
$help .= t("If you don't have a command line version of PHP installed on your server, you will not be able to run the background processing. See <a href='https://github.com/friendica/friendica/blob/master/doc/Install.md#set-up-the-worker'>'Setup the worker'</a>") . EOL;
$help .= EOL . EOL;
$tpl = get_markup_template('field_input.tpl');
- $help .= replace_macros($tpl, array(
- '$field' => array('phpath', t('PHP executable path'), $phpath, t('Enter full path to php executable. You can leave this blank to continue the installation.')),
- ));
+ $help .= replace_macros($tpl, [
+ '$field' => ['phpath', t('PHP executable path'), $phpath, t('Enter full path to php executable. You can leave this blank to continue the installation.')],
+ ]);
$phpath = "";
}
$res = false;
if (function_exists('openssl_pkey_new')) {
- $res = openssl_pkey_new(array(
+ $res = openssl_pkey_new([
'digest_alg' => 'sha1',
'private_key_bits' => 4096,
'encrypt_key' => false
- ));
+ ]);
}
// Get private key
function check_funcs(&$checks) {
- $ck_funcs = array();
+ $ck_funcs = [];
check_add($ck_funcs, t('libCurl PHP module'), true, true, "");
check_add($ck_funcs, t('GD graphics PHP module'), true, true, "");
check_add($ck_funcs, t('OpenSSL PHP module'), true, true, "");
}
- $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : array());
+ $recips = ((x($_POST,'recipients')) ? explode("\n",$_POST['recipients']) : []);
$message = ((x($_POST,'message')) ? notags(trim($_POST['message'])) : '');
$total = 0;
}
}
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$form_security_token' => get_form_security_token("send_invite"),
'$invite' => t('Send invitations'),
'$addr_text' => t('Enter email addresses, one per line:'),
. "\r\n" . "\r\n" . System::baseUrl() . '/profile/' . $a->user['nickname']
. "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" ,
'$submit' => t('Submit')
- ));
+ ]);
return $o;
}
if (x($_REQUEST, 'dropitems')) {
$arr_drop = explode(',', $_REQUEST['dropitems']);
drop_items($arr_drop);
- $json = array('success' => 1);
+ $json = ['success' => 1];
echo json_encode($json);
killme();
}
}
}
- $tagged = array();
+ $tagged = [];
$private_forum = false;
$only_to_forum = false;
- $forum_contact = array();
+ $forum_contact = [];
if (count($tags)) {
foreach ($tags as $tag) {
$parent_uri = $uri;
}
- $datarray = array();
+ $datarray = [];
$datarray['uid'] = $profile_uid;
$datarray['type'] = $post_type;
$datarray['wall'] = $wall;
$datarray['postopts'] = $postopts;
$datarray['origin'] = $origin;
$datarray['moderated'] = $allow_moderated;
- $datarray['gcontact-id'] = GContact::getId(array("url" => $datarray['author-link'], "network" => $datarray['network'],
- "photo" => $datarray['author-avatar'], "name" => $datarray['author-name']));
+ $datarray['gcontact-id'] = GContact::getId(["url" => $datarray['author-link'], "network" => $datarray['network'],
+ "photo" => $datarray['author-avatar'], "name" => $datarray['author-name']]);
$datarray['object'] = $object;
$datarray['last-child'] = 1;
// We set the datarray ID to -1 because in preview mode the dataray
// doesn't have an ID.
$datarray["id"] = -1;
- $o = conversation($a,array(array_merge($contact_record,$datarray)),'search', false, true);
+ $o = conversation($a,[array_merge($contact_record,$datarray)],'search', false, true);
logger('preview: ' . $o);
- echo json_encode(array('preview' => $o));
+ echo json_encode(['preview' => $o]);
killme();
}
goaway($return_path);
}
- $json = array('cancel' => 1);
+ $json = ['cancel' => 1];
if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = System::baseUrl() . '/' . $_REQUEST['jsreload'];
}
// This could be done in Item::update as well - but we have to check for the existance of some fields.
put_item_in_cache($datarray);
- $fields = array(
+ $fields = [
'title' => $datarray['title'],
'body' => $datarray['body'],
'tag' => $datarray['tag'],
'rendered-html' => $datarray['rendered-html'],
'rendered-hash' => $datarray['rendered-hash'],
'edited' => datetime_convert(),
- 'changed' => datetime_convert());
+ 'changed' => datetime_convert()];
Item::update($fields, ['id' => $post_id]);
// These notifications are sent if someone else is commenting other your wall
if ($parent) {
if ($contact_record != $author) {
- notification(array(
+ notification([
'type' => NOTIFY_COMMENT,
'notify_flags' => $user['notify-flags'],
'language' => $user['language'],
'otype' => 'item',
'parent' => $parent,
'parent_uri' => $parent_item['uri']
- ));
+ ]);
}
// Store the comment signature information in case we need to relay to Diaspora
Diaspora::storeCommentSignature($datarray, $author, ($self ? $user['prvkey'] : false), $post_id);
} else {
if (($contact_record != $author) && !count($forum_contact)) {
- notification(array(
+ notification([
'type' => NOTIFY_WALL,
'notify_flags' => $user['notify-flags'],
'language' => $user['language'],
'source_photo' => $datarray['author-avatar'],
'verb' => ACTIVITY_POST,
'otype' => 'item'
- ));
+ ]);
}
}
$html = prepare_body($datarray);
$message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
include_once 'include/html2plain.php';
- $params = array (
+ $params = [
'fromName' => $a->user['username'],
'fromEmail' => $a->user['email'],
'toEmail' => $addr,
'messageSubject' => $subject,
'htmlVersion' => $message,
'textVersion' => html2plain($html.$disclaimer)
- );
+ ];
Emailer::send($params);
}
}
// We now do it in the background to save some time.
// This is important in interactive environments like the frontend or the API.
// We don't fork a new process since this is done anyway with the following command
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "CreateShadowEntry", $post_id);
+ Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "CreateShadowEntry", $post_id);
// Call the background process that is delivering the item to the receivers
Worker::add(PRIORITY_HIGH, "Notifier", $notify_type, $post_id);
goaway($return_path);
}
- $json = array('success' => 1);
+ $json = ['success' => 1];
if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) {
$json['reload'] = $baseurl . '/' . $_REQUEST['jsreload'];
}
$o = drop_item($a->argv[2], !is_ajax());
if (is_ajax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
- echo json_encode(array(intval($a->argv[2]), intval($o)));
+ echo json_encode([intval($a->argv[2]), intval($o)]);
killme();
}
}
}
}
- return array('replaced' => $replaced, 'contact' => $r[0]);
+ return ['replaced' => $replaced, 'contact' => $r[0]];
}
if(! $item_id)
killme();
- if (!in_array($type, array('item','photo','event')))
+ if (!in_array($type, ['item','photo','event']))
killme();
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
$deny_groups = expand_acl($item['deny_gid']);
$o = t('Visible to:') . '<br />';
- $l = array();
+ $l = [];
if(count($allowed_groups)) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
$preamble = sprintf($preamble, $username, $sitename);
$body = sprintf($body, $resetlink, System::baseUrl(), $email);
- notification(array(
+ notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Password reset requested at %s'),$sitename),
'preamble'=> $preamble,
- 'body' => $body));
+ 'body' => $body]);
goaway(System::baseUrl());
/// @TODO Is DBM::is_result() okay here?
if ($r) {
$tpl = get_markup_template('pwdreset.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$lbl1' => t('Password Reset'),
'$lbl2' => t('Your password has been reset as requested.'),
'$lbl3' => t('Your new password is'),
'$newpass' => $new_password,
'$baseurl' => System::baseUrl()
- ));
+ ]);
info("Your password has been reset." . EOL);
$preamble = sprintf($preamble, $username);
$body = sprintf($body, System::baseUrl(), $email, $new_password);
- notification(array(
+ notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Your password has been changed at %s'),$sitename),
'preamble'=> $preamble,
- 'body' => $body));
+ 'body' => $body]);
return $o;
}
else {
$tpl = get_markup_template('lostpass.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$title' => t('Forgot your Password?'),
'$desc' => t('Enter your email address and submit to have your password reset. Then check your email for further instructions.'),
'$name' => t('Nickname or Email: '),
'$submit' => t('Reset')
- ));
+ ]);
return $o;
}
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 600');
- return replace_macros(get_markup_template('maintenance.tpl'), array(
+ return replace_macros(get_markup_template('maintenance.tpl'), [
'$sysdown' => t('System down for maintenance'),
'$reason' => $reason
- ));
+ ]);
}
$_SESSION['submanage'] = $original_id;
}
- $ret = array();
+ $ret = [];
call_hooks('home_init',$ret);
goaway( System::baseUrl() . "/profile/" . $a->user['nickname'] );
$identities[$key]['notifications'] = $notifications;
}
- $o = replace_macros(get_markup_template('manage.tpl'), array(
+ $o = replace_macros(get_markup_template('manage.tpl'), [
'$title' => t('Manage Identities and/or Pages'),
'$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
'$choose' => t('Select an identity to manage: '),
'$identities' => $identities,
'$submit' => t('Submit'),
- ));
+ ]);
return $o;
$touch_icon = 'images/friendica-128.png';
}
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$touch_icon' => $touch_icon,
'$title' => Config::get('config', 'sitename', 'Friendica'),
- ));
+ ]);
echo $o;
return;
}
- $params = array();
+ $params = [];
$tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
if ($tags) {
if (!count($match)) {
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = System::baseUrl() . '/follow/?url=' . $jj->url;
- $photo_menu = array(
- 'profile' => array(t("View Profile"), Profile::zrl($jj->url)),
- 'follow' => array(t("Connect/Follow"), $connlnk)
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($jj->url)],
+ 'follow' => [t("Connect/Follow"), $connlnk]
+ ];
$contact_details = Contact::getDetailsByURL($jj->url, local_user());
- $entry = array(
+ $entry = [
'url' => Profile::zrl($jj->url),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $jj->url),
'name' => $jj->name,
'img_hover' => $jj->tags,
'photo_menu' => $photo_menu,
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
}
$o .= replace_macros(
$tpl,
- array(
+ [
'$title' => t('Profile Match'),
'$contacts' => $entries,
- '$paginate' => paginate($a))
+ '$paginate' => paginate($a)]
);
} else {
info(t('No matches') . EOL);
$tabs = render_messages(get_messages(local_user(), 0, 5), 'mail_list.tpl');
}
- $new = array(
+ $new = [
'label' => t('New Message'),
'url' => 'message/new',
'sel' => $a->argc > 1 && $a->argv[1] == 'new',
'accesskey' => 'm',
- );
+ ];
$tpl = get_markup_template('message_side.tpl');
- $a->page['aside'] = replace_macros($tpl, array(
+ $a->page['aside'] = replace_macros($tpl, [
'$tabs' => $tabs,
'$new' => $new,
- ));
+ ]);
$base = System::baseUrl();
$head_tpl = get_markup_template('message-head.tpl');
- $a->page['htmlhead'] .= replace_macros($head_tpl, array(
+ $a->page['htmlhead'] .= replace_macros($head_tpl, [
'$baseurl' => System::baseUrl(true),
'$base' => $base
- ));
+ ]);
$end_tpl = get_markup_template('message-end.tpl');
- $a->page['end'] .= replace_macros($end_tpl, array(
+ $a->page['end'] .= replace_macros($end_tpl, [
'$baseurl' => System::baseUrl(true),
'$base' => $base
- ));
+ ]);
}
function message_post(App $a)
$myprofile = System::baseUrl() . '/profile/' . $a->user['nickname'];
$tpl = get_markup_template('mail_head.tpl');
- $header = replace_macros($tpl, array(
+ $header = replace_macros($tpl, [
'$messages' => t('Messages'),
- ));
+ ]);
if (($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) {
if (!intval($a->argv[2])) {
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
- $inputs = array();
+ $inputs = [];
foreach ($query['args'] as $arg) {
if (strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
- $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
+ $inputs[] = ['name' => $arg_parts[0], 'value' => $arg_parts[1]];
}
}
//$a->page['aside'] = '';
- return replace_macros(get_markup_template('confirm.tpl'), array(
+ return replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
'$message' => t('Do you really want to delete this message?'),
'$extra_inputs' => $inputs,
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
- ));
+ ]);
}
// Now check how the user responded to the confirmation query
if ($_REQUEST['canceled']) {
$o .= $header;
$tpl = get_markup_template('msg-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
$tpl = get_markup_template('msg-end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
- $preselect = isset($a->argv[2]) ? array($a->argv[2]) : false;
+ $preselect = isset($a->argv[2]) ? [$a->argv[2]] : false;
$prename = $preurl = $preid = '';
$prename = $r[0]['name'];
$preurl = $r[0]['url'];
$preid = $r[0]['id'];
- $preselect = array($preid);
+ $preselect = [$preid];
} else {
$preselect = false;
}
$select = contact_select('messageto', 'message-to-select', $preselect, 4, true, false, false, 10);
$tpl = get_markup_template('prv_message.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$header' => t('Send Private Message'),
'$to' => t('To:'),
'$showinputs' => 'true',
'$insert' => t('Insert web link'),
'$wait' => t('Please wait'),
'$submit' => t('Submit')
- ));
+ ]);
return $o;
}
require_once("include/bbcode.php");
$tpl = get_markup_template('msg-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
$tpl = get_markup_template('msg-end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
- $mails = array();
+ $mails = [];
$seen = 0;
$unknown = false;
$from_photo = $message['from-photo'];
}
- $mails[] = array(
+ $mails[] = [
'id' => $message['id'],
'from_name' => $from_name_e,
'from_url' => $from_url,
'to_name' => $to_name_e,
'date' => datetime_convert('UTC', date_default_timezone_get(), $message['created'], 'D, d M Y - g:i A'),
'ago' => relative_date($message['created']),
- );
+ ];
$seen = $message['seen'];
}
$parent = '<input type="hidden" name="replyto" value="' . $message['parent-uri'] . '" />';
$tpl = get_markup_template('mail_display.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$thread_id' => $a->argv[1],
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
'$insert' => t('Insert web link'),
'$submit' => t('Submit'),
'$wait' => t('Please wait')
- ));
+ ]);
return $o;
}
$from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']);
}
- $rslt .= replace_macros($tpl, array(
+ $rslt .= replace_macros($tpl, [
'$id' => $rr['id'],
'$from_name' => $participants,
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
'$ago' => relative_date($rr['mailcreated']),
'$seen' => $rr['mailseen'],
'$count' => tt('%d message', '%d messages', $rr['count']),
- ));
+ ]);
}
return $rslt;
if (DBM::is_result($r))
$total = $r[0]['total'];
- $results = array();
+ $results = [];
$r = q("SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') LIMIT %d , %d ",
dbesc($search),
if (DBM::is_result($r)) {
foreach($r as $rr)
- $results[] = array(
+ $results[] = [
'name' => $rr['name'],
'url' => System::baseUrl() . '/profile/' . $rr['nickname'],
'photo' => System::baseUrl() . '/photo/avatar/' . $rr['uid'] . '.jpg',
- 'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords'])
- );
+ 'tags' => str_replace([',',' '],[' ',' '],$rr['pub_keywords'])
+ ];
}
- $output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results);
+ $output = ['total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results];
echo json_encode($output);
}
if (x($_GET, 'save')) {
- $exists = dba::exists('search', array('uid' => local_user(), 'term' => $search));
+ $exists = dba::exists('search', ['uid' => local_user(), 'term' => $search]);
if (!$exists) {
- dba::insert('search', array('uid' => local_user(), 'term' => $search));
+ dba::insert('search', ['uid' => local_user(), 'term' => $search]);
}
}
if (x($_GET, 'remove')) {
- dba::delete('search', array('uid' => local_user(), 'term' => $search));
+ dba::delete('search', ['uid' => local_user(), 'term' => $search]);
}
$is_a_date_query = false;
}
// convert query string to array. remove friendica args
- $query_array = array();
+ $query_array = [];
$query_string = str_replace($a->cmd."?", "", $a->query_string);
parse_str($query_string, $query_array);
array_shift($query_array);
$remember_group = ($sel_groups === false && $last_sel_groups && $last_sel_groups != 0);
$net_baseurl = '/network';
- $net_args = array();
+ $net_args = [];
if ($remember_group) {
$net_baseurl .= '/' . $last_sel_groups; // Note that the group number must come before the "/new" tab selection
// last selected tab is _not_ '/network?f=&order=comment'.
// and this isn't a date query
- $tab_baseurls = array(
+ $tab_baseurls = [
'', //all
'', //postord
'', //conv
'', //starred
'', //bookmarked
'', //spam
- );
- $tab_args = array(
+ ];
+ $tab_args = [
'f=&order=comment', //all
'f=&order=post', //postord
'f=&conv=1', //conv
'f=&star=1', //starred
'f=&bmark=1', //bookmarked
'f=&spam=1', //spam
- );
+ ];
$k = array_search('active', $last_sel_tabs);
$net_baseurl .= $tab_baseurls[$k];
// parse out tab queries
- $dest_qa = array();
+ $dest_qa = [];
$dest_qs = $tab_args[$k];
parse_str($dest_qs, $dest_qa);
$net_args = array_merge($net_args, $dest_qa);
$o = '';
- $terms = dba::select('search', array('id', 'term'), array('uid' => local_user()));
- $saved = array();
+ $terms = dba::select('search', ['id', 'term'], ['uid' => local_user()]);
+ $saved = [];
while ($rr = dba::fetch($terms)) {
- $saved[] = array(
+ $saved[] = [
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
'delete' => t('Remove term'),
'selected' => ($search==$rr['term']),
- );
+ ];
}
$tpl = get_markup_template("saved_searches_aside.tpl");
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$title' => t('Saved Searches'),
'$add' => t('add'),
'$searchbox' => search($search,'netsearch-box',$srchurl,true),
'$saved' => $saved,
- ));
+ ]);
return $o;
}
}
}
- return array($no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active);
+ return [$no_active, $all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active];
}
/**
$unseen = dba::exists('item', $condition);
if ($unseen) {
- $r = dba::update('item', array('unseen' => false), $condition);
+ $r = dba::update('item', ['unseen' => false], $condition);
}
}
}
/// @TODO Is this really necessary? $a is already available to hooks
- $arr = array('query' => $a->query_string);
+ $arr = ['query' => $a->query_string];
call_hooks('network_content_init', $arr);
$nouveau = false;
nav_set_selected('network');
- $x = array(
+ $x = [
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'visitor' => 'block',
'profile_uid' => local_user(),
'content' => '',
- );
+ ];
$o .= status_editor($a, $x);
intval($_SESSION['uid'])
);
- $condition = array('unseen' => true, 'uid' => local_user());
+ $condition = ['unseen' => true, 'uid' => local_user()];
networkSetSeen($condition);
$mode = 'network-new';
}
} elseif (intval($a->argv[$x])) {
$gid = intval($a->argv[$x]);
- $def_acl = array('allow_gid' => '<' . $gid . '>');
+ $def_acl = ['allow_gid' => '<' . $gid . '>'];
}
}
}
$nets = ((x($_GET,'nets')) ? $_GET['nets'] : '');
if ($cid) {
- $def_acl = array('allow_cid' => '<' . intval($cid) . '>');
+ $def_acl = ['allow_cid' => '<' . intval($cid) . '>'];
}
if ($nets) {
- $r = dba::select('contact', array('id'), array('uid' => local_user(), 'network' => $nets), array('self' => false));
+ $r = dba::select('contact', ['id'], ['uid' => local_user(), 'network' => $nets], ['self' => false]);
$str = '';
while ($rr = dba::fetch($r)) {
$str .= '<' . $rr['id'] . '>';
}
if (strlen($str)) {
- $def_acl = array('allow_cid' => $str);
+ $def_acl = ['allow_cid' => $str];
}
}
PConfig::set(local_user(), 'network.view', 'net.selected', ($nets ? $nets : 'all'));
}
}
- $x = array(
+ $x = [
'is_owner' => true,
'allow_location' => $a->user['allow_location'],
'default_location' => $a->user['default-location'],
'visitor' => 'block',
'profile_uid' => local_user(),
'content' => $content,
- );
+ ];
$o .= status_editor($a, $x);
}
// NOTREACHED
}
- $contacts = Group::expand(array($gid));
+ $contacts = Group::expand([$gid]);
if ((is_array($contacts)) && count($contacts)) {
$contact_str_self = "";
info(t('Group is empty'));
}
- $o = replace_macros(get_markup_template("section_title.tpl"),array(
+ $o = replace_macros(get_markup_template("section_title.tpl"),[
'$title' => t('Group: %s', $group['name'])
- )) . $o;
+ ]) . $o;
} elseif ($cid) {
$fields = ['id', 'name', 'network', 'writable', 'nurl',
if (DBM::is_result($contact)) {
$sql_extra = " AND ".$sql_table.".`contact-id` = ".intval($cid);
- $entries[0] = array(
+ $entries[0] = [
'id' => 'network',
'name' => htmlentities($contact['name']),
'itemurl' => defaults($contact, 'addr', $contact['nurl']),
'thumb' => proxy_url($contact['thumb'], false, PROXY_SIZE_THUMB),
'details' => $contact['location'],
- );
+ ];
$entries[0]["account_type"] = Contact::getAccountType($contact);
- $o = replace_macros(get_markup_template("viewcontact_template.tpl"),array(
+ $o = replace_macros(get_markup_template("viewcontact_template.tpl"),[
'contacts' => $entries,
'id' => 'network',
- )) . $o;
+ ]) . $o;
if ($contact['network'] === NETWORK_OSTATUS && $contact['writable'] && !PConfig::get(local_user(),'system','nowarn_insecure')) {
notice(t('Private messages to this person are at risk of public disclosure.') . EOL);
// Then fetch all the children of the parents that are on this page
- $parents_arr = array();
+ $parents_arr = [];
$parents_str = '';
$date_offset = "";
- $items = array();
+ $items = [];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
if (!in_array($rr['item_id'], $parents_arr)) {
// at the top level network page just mark everything seen.
if (!$gid && !$cid && !$star) {
- $condition = array('unseen' => true, 'uid' => local_user());
+ $condition = ['unseen' => true, 'uid' => local_user()];
networkSetSeen($condition);
} elseif ($parents_str) {
- $condition = array("`uid` = ? AND `unseen` AND `parent` IN (" . dbesc($parents_str) . ")", local_user());
+ $condition = ["`uid` = ? AND `unseen` AND `parent` IN (" . dbesc($parents_str) . ")", local_user()];
networkSetSeen($condition);
}
$cmd = $a->cmd;
// tabs
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('Commented Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=comment' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $all_active,
'title' => t('Sort by Comment Date'),
'id' => 'commented-order-tab',
'accesskey' => "e",
- ),
- array(
+ ],
+ [
'label' => t('Posted Order'),
'url' => str_replace('/new', '', $cmd) . '?f=&order=post' . ((x($_GET,'cid')) ? '&cid=' . $_GET['cid'] : ''),
'sel' => $postord_active,
'title' => t('Sort by Post Date'),
'id' => 'posted-order-tab',
'accesskey' => "t",
- ),
- );
+ ],
+ ];
if (Feature::isEnabled(local_user(),'personal_tab')) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Personal'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&conv=1',
'sel' => $conv_active,
'title' => t('Posts that mention or involve you'),
'id' => 'personal-tab',
'accesskey' => "r",
- );
+ ];
}
if (Feature::isEnabled(local_user(),'new_tab')) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('New'),
'url' => 'network/new' . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : ''),
'sel' => $new_active,
'title' => t('Activity Stream - by date'),
'id' => 'activitiy-by-date-tab',
'accesskey' => "w",
- );
+ ];
}
if (Feature::isEnabled(local_user(),'link_tab')) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Shared Links'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&bmark=1',
'sel' => $bookmarked_active,
'title' => t('Interesting Links'),
'id' => 'shared-links-tab',
'accesskey' => "b",
- );
+ ];
}
if (Feature::isEnabled(local_user(),'star_posts')) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Starred'),
'url' => str_replace('/new', '', $cmd) . ((x($_GET,'cid')) ? '/?f=&cid=' . $_GET['cid'] : '/?f=') . '&star=1',
'sel' => $starred_active,
'title' => t('Favourite Posts'),
'id' => 'starred-posts-tab',
'accesskey' => "m",
- );
+ ];
}
// save selected tab, but only if not in file mode
if (!x($_GET,'file')) {
- PConfig::set(local_user(), 'network.view','tab.selected',array($all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active));
+ PConfig::set(local_user(), 'network.view','tab.selected',[$all_active, $postord_active, $conv_active, $new_active, $starred_active, $bookmarked_active, $spam_active]);
}
- $arr = array('tabs' => $tabs);
+ $arr = ['tabs' => $tabs];
call_hooks('network_tabs', $arr);
$tpl = get_markup_template('common_tabs.tpl');
- return replace_macros($tpl, array('$tabs' => $arr['tabs']));
+ return replace_macros($tpl, ['$tabs' => $arr['tabs']]);
// --- end item filter tabs
}
require_once 'include/plugin.php';
function nodeinfo_wellknown(App $a) {
- $nodeinfo = array('links' => array(array('rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
- 'href' => System::baseUrl().'/nodeinfo/1.0')));
+ $nodeinfo = ['links' => [['rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0',
+ 'href' => System::baseUrl().'/nodeinfo/1.0']]];
header('Content-type: application/json; charset=utf-8');
echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
$smtp = (function_exists('imap_open') && !Config::get('system', 'imap_disabled') && !Config::get('system', 'dfrn_only'));
- $nodeinfo = array();
+ $nodeinfo = [];
$nodeinfo['version'] = '1.0';
- $nodeinfo['software'] = array('name' => 'friendica', 'version' => FRIENDICA_VERSION.'-'.DB_UPDATE_VERSION);
+ $nodeinfo['software'] = ['name' => 'friendica', 'version' => FRIENDICA_VERSION.'-'.DB_UPDATE_VERSION];
- $nodeinfo['protocols'] = array();
- $nodeinfo['protocols']['inbound'] = array();
- $nodeinfo['protocols']['outbound'] = array();
+ $nodeinfo['protocols'] = [];
+ $nodeinfo['protocols']['inbound'] = [];
+ $nodeinfo['protocols']['outbound'] = [];
if (Config::get('system', 'diaspora_enabled')) {
$nodeinfo['protocols']['inbound'][] = 'diaspora';
$nodeinfo['protocols']['outbound'][] = 'gnusocial';
}
- $nodeinfo['services'] = array();
- $nodeinfo['services']['inbound'] = array();
- $nodeinfo['services']['outbound'] = array();
+ $nodeinfo['services'] = [];
+ $nodeinfo['services']['inbound'] = [];
+ $nodeinfo['services']['outbound'] = [];
- $nodeinfo['usage'] = array();
+ $nodeinfo['usage'] = [];
$nodeinfo['openRegistrations'] = ($a->config['register_policy'] != 0);
- $nodeinfo['metadata'] = array('nodeName' => $a->config['sitename']);
+ $nodeinfo['metadata'] = ['nodeName' => $a->config['sitename']];
if (Config::get('system', 'nodeinfo')) {
- $nodeinfo['usage']['users'] = array('total' => (int)Config::get('nodeinfo', 'total_users'),
+ $nodeinfo['usage']['users'] = ['total' => (int)Config::get('nodeinfo', 'total_users'),
'activeHalfyear' => (int)Config::get('nodeinfo', 'active_users_halfyear'),
- 'activeMonth' => (int)Config::get('nodeinfo', 'active_users_monthly'));
+ 'activeMonth' => (int)Config::get('nodeinfo', 'active_users_monthly')];
$nodeinfo['usage']['localPosts'] = (int)Config::get('nodeinfo', 'local_posts');
$nodeinfo['usage']['localComments'] = (int)Config::get('nodeinfo', 'local_comments');
$plugin = 'statistics_json';
$plugins = Config::get('system', 'addon');
- $plugins_arr = array();
+ $plugins_arr = [];
if ($plugins) {
$plugins_arr = explode(',',str_replace(' ', '',$plugins));
foreach ($r as $rr) {
$contact_details = Contact::getDetailsByURL($rr['url'], local_user(), $rr);
- $contacts[] = array(
+ $contacts[] = [
'img_hover' => t('Visit %s\'s profile [%s]', $contact_details['name'], $rr['url']),
'edit_hover' => t('Edit contact'),
'photo_menu' => Contact::photoMenu($rr),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'url' => $rr['url'],
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
- );
+ ];
}
}
$tpl = get_markup_template("nogroup-template.tpl");
$o = replace_macros(
$tpl,
- array(
+ [
'$header' => t('Contacts who are not members of a group'),
'$contacts' => $contacts,
- '$paginate' => paginate($a))
+ '$paginate' => paginate($a)]
);
return $o;
if (!$a->profile['net-publish'] || $a->profile['hidewall']) {
header('Content-type: application/json; charset=utf-8');
- $json_info = array("hide" => true);
+ $json_info = ["hide" => true];
echo json_encode($json_info);
exit;
}
$keywords = ((x($a->profile, 'pub_keywords')) ? $a->profile['pub_keywords'] : '');
- $keywords = str_replace(array('#',',',' ',',,'), array('',' ',',',','), $keywords);
+ $keywords = str_replace(['#',',',' ',',,'], ['',' ',',',','], $keywords);
$keywords = explode(',', $keywords);
$contactPhoto = dba::selectFirst('contact', ['photo'], ['self' => true, 'uid' => $a->profile['uid']]);
- $json_info = array(
+ $json_info = [
'fn' => $a->profile['name'],
'addr' => $a->profile['addr'],
'nick' => $which,
'comm' => (x($a->profile, 'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY),
'photo' => $contactPhoto["photo"],
'tags' => $keywords
- );
+ ];
if (is_array($a->profile) && !$a->profile['hide-friends']) {
/// @todo What should this value tell us?
$json_info["last-activity"] = date("o-W", $last_active);
//These are optional fields.
- $profile_fields = array('pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about');
+ $profile_fields = ['pdesc', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital', 'about'];
foreach ($profile_fields as $field) {
if (!empty($a->profile[$field])) {
$json_info["$field"] = $a->profile[$field];
}
}
- $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
+ $dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
foreach ($dfrn_pages as $dfrn) {
$json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}";
}
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
- $groups = array();
+ $groups = [];
$o = '';
$commpage = false;
$commvisitor = false;
- $x = array(
+ $x = [
'is_owner' => $is_owner,
'allow_location' => (($a->user['allow_location']) ? true : false),
'default_location' => $a->user['default-location'],
'profile_uid' => local_user(),
'button' => t('Save'),
'acl_data' => '',
- );
+ ];
$o .= status_editor($a,$x,$a->contact['id']);
);
- $parents_arr = array();
+ $parents_arr = [];
$parents_str = '';
if (DBM::is_result($r)) {
$o = '';
// Get the nav tabs for the notification pages
$tabs = $nm->getTabs();
- $notif_content = array();
+ $notif_content = [];
// Notification results per page
$perpage = 20;
$tpl = get_markup_template("intros.tpl");
// The link to switch between ignored and normal connection requests
- $notif_show_lnk = array(
+ $notif_show_lnk = [
'href' => (!$all ? 'notifications/intros/all' : 'notifications/intros' ),
'text' => (!$all ? t('Show Ignored Requests') : t('Hide Ignored Requests'))
- );
+ ];
// Loop through all introduction notifications.This creates an array with the output html for each
// introduction
// We have to distinguish between these two because they use different data.
switch ($it['label']) {
case 'friend_suggestion':
- $notif_content[] = replace_macros($sugg, array(
+ $notif_content[] = replace_macros($sugg, [
'$str_notifytype' => t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$intro_id' => $it['intro_id'],
'$photo' => $it['photo'],
'$fullname' => $it['name'],
'$url' => $it['url'],
- '$hidden' => array('hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''),
- '$activity' => array('activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')),
+ '$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
+ '$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
'$knowyou' => $it['knowyou'],
'$approve' => t('Approve'),
'$request' => $it['request'],
'$ignore' => t('Ignore'),
'$discard' => t('Discard'),
- ));
+ ]);
break;
// Normal connection requests
}
}
- $dfrn_text = replace_macros($dfrn_tpl,array(
+ $dfrn_text = replace_macros($dfrn_tpl,[
'$intro_id' => $it['intro_id'],
'$friend_selected' => $friend_selected,
'$fan_selected' => $fan_selected,
'$approve_as3' => $helptext3,
'$as_friend' => t('Friend'),
'$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Subscriber'))
- ));
+ ]);
$header = $it["name"];
$discard = '';
}
- $notif_content[] = replace_macros($tpl, array(
+ $notif_content[] = replace_macros($tpl, [
'$header' => htmlentities($header),
'$str_notifytype' => t('Notification type: '),
'$notify_type' => $it['notify_type'],
'$lbl_keywords' => t('Tags:'),
'$gender' => $it['gender'],
'$lbl_gender' => t('Gender:'),
- '$hidden' => array('hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''),
- '$activity' => array('activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')),
+ '$hidden' => ['hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''],
+ '$activity' => ['activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')],
'$url' => $it['url'],
'$zrl' => $it['zrl'],
'$lbl_url' => t('Profile URL'),
'$ignore' => t('Ignore'),
'$discard' => $discard,
- ));
+ ]);
break;
}
}
$tpl_var_name = 'tpl_item_'.$it['label'];
$tpl_notif = get_markup_template($$tpl_var_name);
- $notif_content[] = replace_macros($tpl_notif,array(
+ $notif_content[] = replace_macros($tpl_notif,[
'$item_label' => $it['label'],
'$item_link' => $it['link'],
'$item_image' => $it['image'],
'$item_when' => $it['when'],
'$item_ago' => $it['ago'],
'$item_seen' => $it['seen'],
- ));
+ ]);
}
// It doesn't make sense to show the Show unread / Show all link visible if the user is on the
// "Show all" page and there are no notifications. So we will hide it.
if($show == 0 || intval($show) && $notifs['total'] > 0) {
- $notif_show_lnk = array(
+ $notif_show_lnk = [
'href' => ($show ? 'notifications/'.$notifs['ident'] : 'notifications/'.$notifs['ident'].'?show=all' ),
'text' => ($show ? t('Show unread') : t('Show all')),
- );
+ ];
}
// Output if there aren't any notifications available
$notif_nocontent = sprintf( t('No more %s notifications.'), $notifs['ident']);
}
- $o .= replace_macros($notif_tpl, array(
+ $o .= replace_macros($notif_tpl, [
'$notif_header' => $notif_header,
'$tabs' => $tabs,
'$notif_content' => $notif_content,
'$notif_nocontent' => $notif_nocontent,
'$notif_show_lnk' => $notif_show_lnk,
'$notif_paginate' => paginate($a)
- ));
+ ]);
return $o;
}
if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) {
$r = $nm->setAllSeen();
- $j = json_encode(array('result' => ($r) ? 'success' : 'fail'));
+ $j = json_encode(['result' => ($r) ? 'success' : 'fail']);
echo $j;
killme();
}
$not_tpl = get_markup_template('notify.tpl');
require_once('include/bbcode.php');
- $r = $nm->getAll(array('seen'=>0));
+ $r = $nm->getAll(['seen'=>0]);
if (DBM::is_result($r) > 0) {
foreach ($r as $it) {
- $notif_content .= replace_macros($not_tpl,array(
+ $notif_content .= replace_macros($not_tpl,[
'$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'],
'$item_image' => $it['photo'],
'$item_text' => strip_tags(bbcode($it['msg'])),
'$item_when' => relative_date($it['date'])
- ));
+ ]);
}
} else {
$notif_content .= t('No more system notifications.');
}
- $o .= replace_macros($notif_tpl, array(
+ $o .= replace_macros($notif_tpl, [
'$notif_header' => t('System Notifications'),
'$tabs' => false, // $tabs,
'$notif_content' => $notif_content,
- ));
+ ]);
return $o;
if (($a->argc > 1) && ($a->argv[1] === 'xrd')) {
$tpl = get_markup_template('oexchange_xrd.tpl');
- $o = replace_macros($tpl, array('$base' => System::baseUrl()));
+ $o = replace_macros($tpl, ['$base' => System::baseUrl()]);
echo $o;
killme();
}
require_once('include/html2bbcode.php');
- $post = array();
+ $post = [];
$post['profile_uid'] = local_user();
$post['return'] = '/oexchange/done' ;
header("Content-type: application/opensearchdescription+xml");
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$nodename' => $a->get_hostname(),
- ));
+ ]);
echo $o;
// the URL with the corresponding BBCode media tag
$redirects = 0;
// Fetch the header of the URL
- $result = z_fetch_url($url, false, $redirects, array("novalidate" => true, "nobody" => true));
+ $result = z_fetch_url($url, false, $redirects, ["novalidate" => true, "nobody" => true]);
if($result["success"]) {
// Convert the header fields into an array
- $hdrs = array();
+ $hdrs = [];
$h = explode("\n", $result["header"]);
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$template = "[bookmark=%s]%s[/bookmark]%s";
- $arr = array("url" => $url, "text" => "");
+ $arr = ["url" => $url, "text" => ""];
call_hooks("parse_link", $arr);
// need to parse the url for content.
if ($url && $title && $text) {
- $title = str_replace(array("\r","\n"),array("",""),$title);
+ $title = str_replace(["\r","\n"],["",""],$title);
$text = "[quote]" . trim($text) . "[/quote]" . $br;
break;
}
- $uid = str_replace(array('.jpg', '.png', '.gif'), array('', '', ''), $person);
+ $uid = str_replace(['.jpg', '.png', '.gif'], ['', '', ''], $person);
foreach (Image::supportedTypes() AS $m => $e) {
$uid = str_replace('.' . $e, '', $uid);
} else {
// Other photos
$resolution = 0;
- $photo = str_replace(array('.jpg', '.png', '.gif'), array('', '', ''), $photo);
+ $photo = str_replace(['.jpg', '.png', '.gif'], ['', '', ''], $photo);
foreach (Image::supportedTypes() AS $m => $e) {
$photo = str_replace('.' . $e, '', $photo);
$tpl = get_markup_template("vcard-widget.tpl");
- $vcard_widget = replace_macros($tpl, array(
+ $vcard_widget = replace_macros($tpl, [
'$name' => $profile['name'],
'$photo' => $profile['photo'],
'$addr' => defaults($profile, 'addr', ''),
'$account_type' => $account_type,
'$pdesc' => defaults($profile, 'pdesc', ''),
- ));
+ ]);
$albums = Photo::getAlbums($a->data['user']['uid']);
$albums_visible = ((intval($a->data['user']['hidewall']) && !local_user() && !remote_user()) ? false : true);
// add various encodings to the array so we can just loop through and pick them out in a template
- $ret = array('success' => false);
+ $ret = ['success' => false];
if ($albums) {
$a->data['albums'] = $albums;
$ret['success'] = true;
}
- $ret['albums'] = array();
+ $ret['albums'] = [];
foreach ($albums as $k => $album) {
//hide profile photos to others
if (!$is_owner && !remote_user() && ($album['album'] == t('Profile Photos')))
continue;
- $entry = array(
+ $entry = [
'text' => $album['album'],
'total' => $album['total'],
'url' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album['album']),
'urlencode' => urlencode($album['album']),
'bin2hex' => bin2hex($album['album'])
- );
+ ];
$ret['albums'][] = $entry;
}
}
}
if ($ret['success']) {
- $photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'), array(
+ $photo_albums_widget = replace_macros(get_markup_template('photo_albums.tpl'), [
'$nick' => $a->data['user']['nickname'],
'$title' => t('Photo Albums'),
'$recent' => t('Recent Photos'),
'$albums' => $ret['albums'],
'$baseurl' => System::baseUrl(),
- '$upload' => array(t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'),
+ '$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'],
'$can_post' => $can_post
- ));
+ ]);
}
$a->page['aside'] .= $photo_albums_widget;
$tpl = get_markup_template("photos_head.tpl");
- $a->page['htmlhead'] .= replace_macros($tpl,array(
+ $a->page['htmlhead'] .= replace_macros($tpl,[
'$ispublic' => t('everybody')
- ));
+ ]);
}
return;
// Check if we should do HTML-based delete confirmation
if (x($_REQUEST, 'confirm')) {
$drop_url = $a->query_string;
- $extra_inputs = array(
- array('name' => 'albumname', 'value' => $_POST['albumname']),
- );
- $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
+ $extra_inputs = [
+ ['name' => 'albumname', 'value' => $_POST['albumname']],
+ ];
+ $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
'$message' => t('Do you really want to delete this photo album and all its photos?'),
'$extra_inputs' => $extra_inputs,
'$confirm_url' => $drop_url,
'$confirm_name' => 'dropalbum', // Needed so that confirmation will bring us back into this if statement
'$cancel' => t('Cancel'),
- ));
+ ]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
}
- $res = array();
+ $res = [];
// get the list of photos we are about to delete
// Check if we should do HTML-based delete confirmation
if (x($_REQUEST, 'confirm')) {
$drop_url = $a->query_string;
- $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
+ $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
'$message' => t('Do you really want to delete this photo?'),
- '$extra_inputs' => array(),
+ '$extra_inputs' => [],
'$confirm' => t('Delete Photo'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'delete', // Needed so that confirmation will bring us back into this if statement
'$cancel' => t('Cancel'),
- ));
+ ]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
}
$title = '';
$uri = item_new_uri($a->get_hostname(),$page_owner_uid);
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$rawtags = '#' . $rawtags;
}
- $taginfo = array();
+ $taginfo = [];
$tags = get_tags($rawtags);
if (count($tags)) {
}
}
}
- $taginfo[] = array($newname, $profile, $salmon);
+ $taginfo[] = [$newname, $profile, $salmon];
} else {
$newname = $name;
$alias = '';
}
if ($profile) {
if (substr($notify, 0, 4) === 'cid:') {
- $taginfo[] = array($newname, $profile, $notify, $r[0], '@[url=' . str_replace(',','%2c',$profile) . ']' . $newname . '[/url]');
+ $taginfo[] = [$newname, $profile, $notify, $r[0], '@[url=' . str_replace(',','%2c',$profile) . ']' . $newname . '[/url]'];
} else {
- $taginfo[] = array($newname, $profile, $notify, null, $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]');
+ $taginfo[] = [$newname, $profile, $notify, null, $str_tags .= '@[url=' . $profile . ']' . $newname . '[/url]'];
}
if (strlen($str_tags)) {
$str_tags .= ',';
foreach ($taginfo as $tagged) {
$uri = item_new_uri($a->get_hostname(), $page_owner_uid);
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uid'] = $page_owner_uid;
$arr['uri'] = $uri;
$str_group_deny = perms2str(is_array($group_deny) ? $group_deny : explode(',', $group_deny));
$str_contact_deny = perms2str(is_array($contact_deny) ? $contact_deny : explode(',', $contact_deny));
- $ret = array('src' => '', 'filename' => '', 'filesize' => 0, 'type' => '');
+ $ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''];
call_hooks('photo_post_file', $ret);
$lon = Photo::getGps($exif['GPS']['GPSLongitude'], $exif['GPS']['GPSLongitudeRef']);
}
- $arr = array();
+ $arr = [];
if ($lat && $lon) {
$arr['coord'] = $lat . ' ' . $lon;
}
$uploader = '';
- $ret = array('post_url' => 'photos/' . $a->data['user']['nickname'],
+ $ret = ['post_url' => 'photos/' . $a->data['user']['nickname'],
'addon_text' => $uploader,
- 'default_upload' => true);
+ 'default_upload' => true];
call_hooks('photo_upload_form',$ret);
- $default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), array());
- $default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), array(
+ $default_upload_box = replace_macros(get_markup_template('photos_default_uploader_box.tpl'), []);
+ $default_upload_submit = replace_macros(get_markup_template('photos_default_uploader_submit.tpl'), [
'$submit' => t('Submit'),
- ));
+ ]);
$usage_message = '';
$aclselect_e = ($visitor ? '' : populate_acl($a->user));
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$pagename' => t('Upload Photos'),
'$sessid' => session_id(),
'$usage' => $usage_message,
'$group_perms' => t('Show to Groups'),
'$contact_perms' => t('Show to Contacts'),
'$return_path' => $a->query_string,
- ));
+ ]);
return $o;
}
$album_e = $album;
- $o .= replace_macros($edit_tpl,array(
+ $o .= replace_macros($edit_tpl,[
'$nametext' => t('New album name: '),
'$nickname' => $a->data['user']['nickname'],
'$album' => $album_e,
'$hexalbum' => bin2hex($album),
'$submit' => t('Submit'),
'$dropsubmit' => t('Delete Album')
- ));
+ ]);
}
}
} else {
if (($album !== t('Profile Photos')) && ($album !== 'Contact Photos') && ($album !== t('Contact Photos')) && $can_post) {
- $edit = array(t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit');
+ $edit = [t('Edit Album'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '/edit'];
}
}
if ($order_field === 'posted') {
- $order = array(t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album));
+ $order = [t('Show Newest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album)];
} else {
- $order = array(t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted');
+ $order = [t('Show Oldest First'), 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($album) . '?f=&order=posted'];
}
- $photos = array();
+ $photos = [];
if (DBM::is_result($r)) {
// "Twist" is only used for the duepunto theme with style "slackr"
$imgalt_e = $rr['filename'];
$desc_e = $rr['desc'];
- $photos[] = array(
+ $photos[] = [
'id' => $rr['id'],
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id']
'desc'=> $desc_e,
'ext' => $ext,
'hash'=> $rr['resource-id'],
- );
+ ];
}
}
$tpl = get_markup_template('photo_album.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$photos' => $photos,
'$album' => $album,
'$can_post' => $can_post,
- '$upload' => array(t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)),
+ '$upload' => [t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload/' . bin2hex($album)],
'$order' => $order,
'$edit' => $edit,
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
$lock = null;
if ($can_post && ($ph[0]['uid'] == $owner_uid)) {
- $tools = array(
- 'edit' => array('photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
- 'profile'=>array('profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')),
- );
+ $tools = [
+ 'edit' => ['photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))],
+ 'profile'=>['profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')],
+ ];
// lock
$lock = ( ( ($ph[0]['uid'] == local_user()) && (strlen($ph[0]['allow_cid']) || strlen($ph[0]['allow_gid'])
if ( $cmd === 'edit') {
$tpl = get_markup_template('photo_edit_head.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl,array(
+ $a->page['htmlhead'] .= replace_macros($tpl,[
'$prevlink' => $prevlink,
'$nextlink' => $nextlink
- ));
+ ]);
}
if ($prevlink)
- $prevlink = array($prevlink, '<div class="icon prev"></div>') ;
+ $prevlink = [$prevlink, '<div class="icon prev"></div>'] ;
- $photo = array(
+ $photo = [
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
'title'=> t('View Full Size'),
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?f=&_u=' . datetime_convert('','','','ymdhis'),
'width' => $hires['width'],
'album' => $hires['album'],
'filename' => $hires['filename'],
- );
+ ];
if ($nextlink) {
- $nextlink = array($nextlink, '<div class="icon next"></div>');
+ $nextlink = [$nextlink, '<div class="icon next"></div>'];
}
}
$tag_str .= bbcode($t);
}
- $tags = array(t('Tags: '), $tag_str);
+ $tags = [t('Tags: '), $tag_str];
if ($cmd === 'edit') {
$tags[] = 'tagrm/' . $link_item['id'];
$tags[] = t('[Remove any tag]');
$caption_e = $ph[0]['desc'];
$aclselect_e = populate_acl($ph[0]);
- $edit = replace_macros($edit_tpl, array(
+ $edit = replace_macros($edit_tpl, [
'$id' => $ph[0]['id'],
- '$album' => array('albname', t('New album name'), $album_e,''),
- '$caption' => array('desc', t('Caption'), $caption_e, ''),
- '$tags' => array('newtag', t('Add a Tag'), "", t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')),
- '$rotate_none' => array('rotate', t('Do not rotate'),0,'', true),
- '$rotate_cw' => array('rotate', t('Rotate CW (right)'),1,''),
- '$rotate_ccw' => array('rotate', t('Rotate CCW (left)'),2,''),
+ '$album' => ['albname', t('New album name'), $album_e,''],
+ '$caption' => ['desc', t('Caption'), $caption_e, ''],
+ '$tags' => ['newtag', t('Add a Tag'), "", t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping')],
+ '$rotate_none' => ['rotate', t('Do not rotate'),0,'', true],
+ '$rotate_cw' => ['rotate', t('Rotate CW (right)'),1,''],
+ '$rotate_ccw' => ['rotate', t('Rotate CCW (left)'),2,''],
'$nickname' => $a->data['user']['nickname'],
'$resource_id' => $ph[0]['resource-id'],
'$group_perms' => t('Show to Groups'),
'$contact_perms' => t('Show to Contacts'),
'$return_path' => $a->query_string,
- ));
+ ]);
}
$like = '';
if ($can_post || can_write_wall($owner_uid)) {
$like_tpl = get_markup_template('like_noshare.tpl');
- $likebuttons = replace_macros($like_tpl, array(
+ $likebuttons = replace_macros($like_tpl, [
'$id' => $link_item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => (Feature::isEnabled(local_user(), 'dislike') ? t("I don't like this \x28toggle\x29") : ''),
'$wait' => t('Please wait'),
'$return_path' => $a->query_string,
- ));
+ ]);
}
if (!DBM::is_result($r)) {
if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
- $comments .= replace_macros($cmnt_tpl, array(
+ $comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
'$type' => 'wall-comment',
'$sourceapp' => t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
- ));
+ ]);
}
}
- $conv_responses = array(
- 'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')),
- 'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title'))
- );
+ $conv_responses = [
+ 'like' => ['title' => t('Likes','title')],'dislike' => ['title' => t('Dislikes','title')],
+ 'attendyes' => ['title' => t('Attending','title')], 'attendno' => ['title' => t('Not attending','title')], 'attendmaybe' => ['title' => t('Might attend','title')]
+ ];
// display comments
if (DBM::is_result($r)) {
}
if (($can_post || can_write_wall($owner_uid)) && $link_item['last-child']) {
- $comments .= replace_macros($cmnt_tpl,array(
+ $comments .= replace_macros($cmnt_tpl,[
'$return_path' => '',
'$jsreload' => $return_url,
'$type' => 'wall-comment',
'$sourceapp' => t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
- ));
+ ]);
}
foreach ($r as $item) {
$profile_link = $profile_url;
$dropping = (($item['contact-id'] == $contact_id) || ($item['uid'] == local_user()));
- $drop = array(
+ $drop = [
'dropping' => $dropping,
'pagedrop' => false,
'select' => t('Select'),
'delete' => t('Delete'),
- );
+ ];
$name_e = $profile_name;
$title_e = $item['title'];
$body_e = bbcode($item['body']);
- $comments .= replace_macros($template,array(
+ $comments .= replace_macros($template,[
'$id' => $item['item_id'],
'$profile_url' => $profile_link,
'$name' => $name_e,
'$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
'$drop' => $drop,
'$comment' => $comment
- ));
+ ]);
if (($can_post || can_write_wall($owner_uid)) && $item['last-child']) {
- $comments .= replace_macros($cmnt_tpl, array(
+ $comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
'$jsreload' => $return_url,
'$type' => 'wall-comment',
'$sourceapp' => t($a->sourcename),
'$ww' => '',
'$rand_num' => random_digits(12)
- ));
+ ]);
}
}
}
- $response_verbs = array('like');
+ $response_verbs = ['like'];
if (Feature::isEnabled($owner_uid, 'dislike')) {
$response_verbs[] = 'dislike';
}
}
$photo_tpl = get_markup_template('photo_view.tpl');
- $o .= replace_macros($photo_tpl, array(
+ $o .= replace_macros($photo_tpl, [
'$id' => $ph[0]['id'],
'$album' => [$album_link, $ph[0]['album']],
'$tools' => $tools,
'responses' => $responses,
'$comments' => $comments,
'$paginate' => $paginate,
- ));
+ ]);
$a->page['htmlhead'] .= "\n" . '<meta name="twitter:card" content="photo" />' . "\n";
$a->page['htmlhead'] .= '<meta name="twitter:title" content="' . $photo["album"] . '" />' . "\n";
intval($a->pager['itemspage'])
);
- $photos = array();
+ $photos = [];
if (DBM::is_result($r)) {
// "Twist" is only used for the duepunto theme with style "slackr"
$twist = false;
$alt_e = $rr['filename'];
$name_e = $rr['album'];
- $photos[] = array(
+ $photos[] = [
'id' => $rr['id'],
'twist' => ' ' . ($twist ? 'rotleft' : 'rotright') . rand(2,4),
'link' => 'photos/' . $a->data['user']['nickname'] . '/image/' . $rr['resource-id'],
'title' => t('View Photo'),
'src' => 'photo/' . $rr['resource-id'] . '-' . ((($rr['scale']) == 6) ? 4 : $rr['scale']) . '.' . $ext,
'alt' => $alt_e,
- 'album' => array(
+ 'album' => [
'link' => 'photos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
'alt' => t('View Album'),
- ),
+ ],
- );
+ ];
}
}
$tpl = get_markup_template('photos_recent.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => t('Recent Photos'),
'$can_post' => $can_post,
- '$upload' => array(t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'),
+ '$upload' => [t('Upload New Photos'), 'photos/'.$a->data['user']['nickname'].'/upload'],
'$photos' => $photos,
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
}
$format = 'json';
}
- $tags = array();
- $comments = array();
- $likes = array();
- $dislikes = array();
- $friends = array();
- $posts = array();
- $regs = array();
- $mails = array();
- $notifications = array();
+ $tags = [];
+ $comments = [];
+ $likes = [];
+ $dislikes = [];
+ $friends = [];
+ $posts = [];
+ $regs = [];
+ $mails = [];
+ $notifications = [];
$intro_count = 0;
$mail_count = 0;
$network_count = 0;
$register_count = 0;
$sysnotify_count = 0;
- $groups_unseen = array();
- $forums_unseen = array();
+ $groups_unseen = [];
+ $forums_unseen = [];
$all_events = 0;
$all_events_today = 0;
$birthdays = 0;
$birthdays_today = 0;
- $data = array();
+ $data = [];
$data['intro'] = $intro_count;
$data['mail'] = $mail_count;
$data['net'] = $network_count;
if (local_user()) {
// Different login session than the page that is calling us.
if (intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
- $data = array('result' => array('invalid' => 1));
+ $data = ['result' => ['invalid' => 1]];
if ($format == 'json') {
if (isset($_GET['callback'])) {
);
if (DBM::is_result($items_unseen)) {
- $arr = array('items' => $items_unseen);
+ $arr = ['items' => $items_unseen];
call_hooks('network_ping', $arr);
foreach ($items_unseen as $item) {
// merge all notification types in one array
if (DBM::is_result($intros)) {
foreach ($intros as $intro) {
- $notif = array(
+ $notif = [
'href' => System::baseUrl() . '/notifications/intros/' . $intro['id'],
'name' => $intro['name'],
'url' => $intro['url'],
'date' => $intro['datetime'],
'seen' => false,
'message' => t('{0} wants to be your friend'),
- );
+ ];
$notifs[] = $notif;
}
}
if (DBM::is_result($mails)) {
foreach ($mails as $mail) {
- $notif = array(
+ $notif = [
'href' => System::baseUrl() . '/message/' . $mail['id'],
'name' => $mail['from-name'],
'url' => $mail['from-url'],
'date' => $mail['created'],
'seen' => false,
'message' => t('{0} sent you a message'),
- );
+ ];
$notifs[] = $notif;
}
}
if (DBM::is_result($regs)) {
foreach ($regs as $reg) {
- $notif = array(
+ $notif = [
'href' => System::baseUrl() . '/admin/users/',
'name' => $reg['name'],
'url' => $reg['url'],
'date' => $reg['created'],
'seen' => false,
'message' => t('{0} requested registration'),
- );
+ ];
$notifs[] = $notif;
}
}
$local_time = datetime_convert('UTC', date_default_timezone_get(), $notif['date']);
- $notifications[] = array(
+ $notifications[] = [
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'message' => $notif['message'],
'seen' => $notif['seen'],
'timestamp' => strtotime($local_time)
- );
+ ];
}
}
}
- $sysmsgs = array();
- $sysmsgs_info = array();
+ $sysmsgs = [];
+ $sysmsgs_info = [];
if (x($_SESSION, 'sysmsg')) {
$sysmsgs = $_SESSION['sysmsg'];
$data['forums'] = $forums_unseen;
$data['notify'] = $sysnotify_count + $intro_count + $mail_count + $register_count;
$data['notifications'] = $notifications;
- $data['sysmsgs'] = array(
+ $data['sysmsgs'] = [
'notice' => $sysmsgs,
'info' => $sysmsgs_info
- );
+ ];
- $json_payload = json_encode(array("result" => $data));
+ $json_payload = json_encode(["result" => $data]);
if (isset($_GET['callback'])) {
// JSONP support
$data = ping_format_xml_data($data, $sysnotify_count, $notifications, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen);
header("Content-type: text/xml");
- echo XML::fromArray(array("result" => $data), $xml);
+ echo XML::fromArray(["result" => $data], $xml);
}
killme();
*/
function ping_get_notifications($uid)
{
- $result = array();
+ $result = [];
$offset = 0;
$seen = false;
$seensql = "NOT";
*/
function ping_format_xml_data($data, $sysnotify, $notifs, $sysmsgs, $sysmsgs_info, $groups_unseen, $forums_unseen)
{
- $notifications = array();
+ $notifications = [];
foreach ($notifs as $key => $notif) {
$notifications[$key . ':note'] = $notif['message'];
- $notifications[$key . ':@attributes'] = array(
+ $notifications[$key . ':@attributes'] = [
'id' => $notif['id'],
'href' => $notif['href'],
'name' => $notif['name'],
'date' => $notif['date'],
'seen' => $notif['seen'],
'timestamp' => $notif['timestamp']
- );
+ ];
}
- $sysmsg = array();
+ $sysmsg = [];
foreach ($sysmsgs as $key => $m) {
$sysmsg[$key . ':notice'] = $m;
}
}
$data['notif'] = $notifications;
- $data['@attributes'] = array('count' => $sysnotify_count + $data['intro'] + $data['mail'] + $data['register']);
+ $data['@attributes'] = ['count' => $sysnotify_count + $data['intro'] + $data['mail'] + $data['register']];
$data['sysmsgs'] = $sysmsg;
if ($data['register'] == 0) {
unset($data['register']);
}
- $groups = array();
+ $groups = [];
if (count($groups_unseen)) {
foreach ($groups_unseen as $key => $item) {
$groups[$key . ':group'] = $item['count'];
- $groups[$key . ':@attributes'] = array('id' => $item['id']);
+ $groups[$key . ':@attributes'] = ['id' => $item['id']];
}
$data['groups'] = $groups;
}
- $forums = array();
+ $forums = [];
if (count($forums_unseen)) {
foreach ($forums_unseen as $key => $item) {
$forums[$count . ':forum'] = $item['count'];
- $forums[$count . ':@attributes'] = array('id' => $item['id']);
+ $forums[$count . ':@attributes'] = ['id' => $item['id']];
}
$data['forums'] = $forums;
}
}
logger("Query done", LOGGER_DEBUG);
- $ret = array();
+ $ret = [];
if (x($_GET, 'sorted')) {
$ret['sorted'] = false;
}
$ret['startIndex'] = (int) $startIndex;
$ret['itemsPerPage'] = (int) $itemsPerPage;
$ret['totalResults'] = (int) $totalResults;
- $ret['entry'] = array();
+ $ret['entry'] = [];
- $fields_ret = array(
+ $fields_ret = [
'id' => false,
'displayName' => false,
'urls' => false,
'address' => false,
'contactType' => false,
'generation' => false
- );
+ ];
if ((! x($_GET, 'fields')) || ($_GET['fields'] === '@all')) {
foreach ($fields_ret as $k => $v) {
$contact['gender'] = "";
}
- $entry = array();
+ $entry = [];
if ($fields_ret['id']) {
$entry['id'] = (int)$contact['id'];
}
$entry['generation'] = (int)$contact['generation'];
}
if ($fields_ret['urls']) {
- $entry['urls'] = array(array('value' => $contact['url'], 'type' => 'profile'));
+ $entry['urls'] = [['value' => $contact['url'], 'type' => 'profile']];
if ($contact['addr'] && ($contact['network'] !== NETWORK_MAIL)) {
- $entry['urls'][] = array('value' => 'acct:' . $contact['addr'], 'type' => 'webfinger');
+ $entry['urls'][] = ['value' => 'acct:' . $contact['addr'], 'type' => 'webfinger'];
}
}
if ($fields_ret['preferredUsername']) {
$entry['updated'] = date("c", strtotime($entry['updated']));
}
if ($fields_ret['photos']) {
- $entry['photos'] = array(array('value' => $contact['photo'], 'type' => 'profile'));
+ $entry['photos'] = [['value' => $contact['photo'], 'type' => 'profile']];
}
if ($fields_ret['network']) {
$entry['network'] = $contact['network'];
$tags = str_replace(",", " ", $contact['keywords']);
$tags = explode(" ", $tags);
- $cleaned = array();
+ $cleaned = [];
foreach ($tags as $tag) {
$tag = trim(strtolower($tag));
if ($tag != "") {
}
}
- $entry['tags'] = array($cleaned);
+ $entry['tags'] = [$cleaned];
}
if ($fields_ret['address']) {
- $entry['address'] = array();
+ $entry['address'] = [];
// Deactivated. It just reveals too much data. (Although its from the default profile)
//if (isset($rr['paddress']))
$ret['entry'][] = $entry;
}
} else {
- $ret['entry'][] = array();
+ $ret['entry'][] = [];
}
} else {
http_status_exit(500);
if ($format === 'xml') {
header('Content-type: text/xml');
- echo replace_macros(get_markup_template('poco_xml.tpl'), array_xmlify(array('$response' => $ret)));
+ echo replace_macros(get_markup_template('poco_xml.tpl'), array_xmlify(['$response' => $ret]));
killme();
}
if ($format === 'json') {
$uri = item_new_uri($a->get_hostname(),$uid);
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uid'] = $uid;
$base = System::baseUrl();
$head_tpl = get_markup_template('poke_head.tpl');
- $a->page['htmlhead'] .= replace_macros($head_tpl,array(
+ $a->page['htmlhead'] .= replace_macros($head_tpl,[
'$baseurl' => System::baseUrl(true),
'$base' => $base
- ));
+ ]);
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');
$verbs = get_poke_verbs();
- $shortlist = array();
+ $shortlist = [];
foreach($verbs as $k => $v)
if($v[1] !== 'NOTRANSLATION')
- $shortlist[] = array($k,$v[1]);
+ $shortlist[] = [$k,$v[1]];
$tpl = get_markup_template('poke_content.tpl');
- $o = replace_macros($tpl,array(
+ $o = replace_macros($tpl,[
'$title' => t('Poke/Prod'),
'$desc' => t('poke, prod or do other things to somebody'),
'$clabel' => t('Recipient'),
'$submit' => t('Submit'),
'$name' => $name,
'$id' => $id
- ));
+ ]);
return $o;
$version = '';
$credits = '';
}
- echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
+ echo json_encode(['img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
}
killme();
function probe_content(App $a) {
if (!local_user()) {
- http_status_exit(403, array("title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a probing.")));
+ http_status_exit(403, ["title" => t("Public access denied."),
+ "description" => t("Only logged in users are permitted to perform a probing.")]);
killme();
}
// site block
if (!$blocked && !$userblock) {
- $keywords = str_replace(array('#', ',', ' ', ',,'), array('', ' ', ',', ','), defaults($a->profile, 'pub_keywords', ''));
+ $keywords = str_replace(['#', ',', ' ', ',,'], ['', ' ', ',', ','], defaults($a->profile, 'pub_keywords', ''));
if (strlen($keywords)) {
$a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n";
}
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
- $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
+ $dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
foreach ($dfrn_pages as $dfrn) {
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"" . System::baseUrl() . "/dfrn_{$dfrn}/{$which}\" />\r\n";
}
require_once 'include/acl_selectors.php';
require_once 'include/items.php';
- $groups = array();
+ $groups = [];
$tab = 'posts';
$o = '';
$a->page['aside'] .= tagcloud_wall_widget();
if (can_write_wall($a->profile['profile_uid'])) {
- $x = array(
+ $x = [
'is_owner' => $is_owner,
'allow_location' => ($is_owner || $commvisitor) && $a->profile['allow_location'],
'default_location' => $is_owner ? $a->user['default-location'] : '',
'bang' => '',
'visitor' => $is_owner || $commvisitor ? 'block' : 'none',
'profile_uid' => $a->profile['profile_uid'],
- );
+ ];
$o .= status_editor($a, $x);
}
);
}
- $parents_arr = array();
+ $parents_arr = [];
$parents_str = '';
// Set a time stamp for this page. We will make use of it when we
$items = conv_sort($items, 'created');
} else {
- $items = array();
+ $items = [];
}
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
if ($is_owner) {
- $unseen = dba::exists('item', array('wall' => true, 'unseen' => true, 'uid' => local_user()));
+ $unseen = dba::exists('item', ['wall' => true, 'unseen' => true, 'uid' => local_user()]);
if ($unseen) {
- $r = dba::update('item', array('unseen' => false),
- array('wall' => true, 'unseen' => true, 'uid' => local_user()));
+ $r = dba::update('item', ['unseen' => false],
+ ['wall' => true, 'unseen' => true, 'uid' => local_user()]);
}
}
$tpl = get_markup_template('profile_photo.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$user' => $a->user['nickname'],
'$lbl_upfile' => t('Upload File:'),
'$lbl_profiles' => t('Select a profile:'),
'$profiles' => $profiles,
'$form_security_token' => get_form_security_token("profile_photo"),
'$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . System::baseUrl() . '">' . t('skip this step') . '</a>' : '<a href="'. System::baseUrl() . '/photos/' . $a->user['nickname'] . '">' . t('select a photo from your photo albums') . '</a>')
- ));
+ ]);
return $o;
}
$filename = $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'] . '.'.$a->config['imagecrop_ext'];
$resolution = $a->config['imagecrop_resolution'];
$tpl = get_markup_template("cropbody.tpl");
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$filename' => $filename,
'$profile' => intval($_REQUEST['profile']),
'$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'],
'$desc' => t('Please adjust the image cropping for optimum viewing.'),
'$form_security_token' => get_form_security_token("profile_photo"),
'$done' => t('Done Editing')
- ));
+ ]);
return $o;
}
$a->config['imagecrop'] = $hash;
$a->config['imagecrop_resolution'] = $smallest;
$a->config['imagecrop_ext'] = $Image->getExt();
- $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), array());
- $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), array());
+ $a->page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), []);
+ $a->page['end'] .= replace_macros(get_markup_template("cropend.tpl"), []);
return;
}
$keywords = str_replace(",", " ", $keywords);
$keywords = explode(" ", $keywords);
- $cleaned = array();
+ $cleaned = [];
foreach ($keywords as $keyword) {
$keyword = trim(strtolower($keyword));
$keyword = trim($keyword, "#");
} else {
$ignore_year = false;
}
- if (!in_array($dob, array('0000-00-00', '0001-01-01'))) {
+ if (!in_array($dob, ['0000-00-00', '0001-01-01'])) {
if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
$ignore_year = true;
$dob = substr($dob, 5);
PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailled_profile'] == 1) ? 1: 0));
- $changes = array();
+ $changes = [];
$value = '';
if ($is_default) {
if ($marital != $orig[0]['marital']) {
}
if ($is_default) {
- $location = Profile::formatLocation(array("locality" => $locality, "region" => $region, "country-name" => $country_name));
+ $location = Profile::formatLocation(["locality" => $locality, "region" => $region, "country-name" => $country_name]);
q("UPDATE `contact` SET `about` = '%s', `location` = '%s', `keywords` = '%s', `gender` = '%s' WHERE `self` AND `uid` = %d",
dbesc($about),
return;
}
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), local_user());
notice( t('Profile not found.') . EOL);
return;
}
-
- $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array(
+
+ $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), [
'$baseurl' => System::baseUrl(true),
- ));
- $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
+ ]);
+ $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), [
'$baseurl' => System::baseUrl(true),
- ));
+ ]);
$opt_tpl = get_markup_template("profile-hide-friends.tpl");
- $hide_friends = replace_macros($opt_tpl,array(
- '$yesno' => array(
+ $hide_friends = replace_macros($opt_tpl,[
+ '$yesno' => [
'hide-friends', //Name
t('Hide contacts and friends:'), //Label
!!$r[0]['hide-friends'], //Value
'', //Help string
- array(t('No'), t('Yes')) //Off - On strings
- ),
+ [t('No'), t('Yes')] //Off - On strings
+ ],
'$desc' => t('Hide your contact/friend list from viewers of this profile?'),
'$yes_str' => t('Yes'),
'$no_str' => t('No'),
'$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
'$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
- ));
+ ]);
$personal_account = !(in_array($a->user["page-flags"],
- array(PAGE_COMMUNITY, PAGE_PRVGROUP)));
+ [PAGE_COMMUNITY, PAGE_PRVGROUP]));
$detailled_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account);
$is_default = (($r[0]['is-default']) ? 1 : 0);
$tpl = get_markup_template("profile_edit.tpl");
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$personal_account' => $personal_account,
'$detailled_profile' => $detailled_profile,
- '$details' => array(
+ '$details' => [
'detailled_profile', //Name
t('Show more profile fields:'), //Label
$detailled_profile, //Value
'', //Help string
- array(t('No'), t('Yes')) //Off - On strings
- ),
+ [t('No'), t('Yes')] //Off - On strings
+ ],
'$multi_profiles' => Feature::isEnabled(local_user(), 'multi_profiles'),
'$form_security_token' => get_form_security_token("profile_edit"),
'$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
'$baseurl' => System::baseUrl(true),
'$profile_id' => $r[0]['id'],
- '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'),
+ '$profile_name' => ['profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'],
'$is_default' => $is_default,
'$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
- '$name' => array('name', t('Your Full Name:'), $r[0]['name']),
- '$pdesc' => array('pdesc', t('Title/Description:'), $r[0]['pdesc']),
+ '$name' => ['name', t('Your Full Name:'), $r[0]['name']],
+ '$pdesc' => ['pdesc', t('Title/Description:'), $r[0]['pdesc']],
'$dob' => dob($r[0]['dob']),
'$hide_friends' => $hide_friends,
- '$address' => array('address', t('Street Address:'), $r[0]['address']),
- '$locality' => array('locality', t('Locality/City:'), $r[0]['locality']),
- '$region' => array('region', t('Region/State:'), $r[0]['region']),
- '$postal_code' => array('postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']),
- '$country_name' => array('country_name', t('Country:'), $r[0]['country-name']),
+ '$address' => ['address', t('Street Address:'), $r[0]['address']],
+ '$locality' => ['locality', t('Locality/City:'), $r[0]['locality']],
+ '$region' => ['region', t('Region/State:'), $r[0]['region']],
+ '$postal_code' => ['postal_code', t('Postal/Zip Code:'), $r[0]['postal-code']],
+ '$country_name' => ['country_name', t('Country:'), $r[0]['country-name']],
'$age' => ((intval($r[0]['dob'])) ? '(' . t('Age: ') . age($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
'$gender' => ContactSelector::gender($r[0]['gender']),
'$marital' => ContactSelector::maritalStatus($r[0]['marital']),
- '$with' => array('with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')),
- '$howlong' => array('howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
+ '$with' => ['with', t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), t('Examples: cathy123, Cathy Williams, cathy@example.com')],
+ '$howlong' => ['howlong', t('Since [date]:'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))],
'$sexual' => ContactSelector::sexualPreference($r[0]['sexual']),
- '$about' => array('about', t('Tell us about yourself...'), $r[0]['about']),
- '$xmpp' => array('xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")),
- '$homepage' => array('homepage', t('Homepage URL:'), $r[0]['homepage']),
- '$hometown' => array('hometown', t('Hometown:'), $r[0]['hometown']),
- '$politic' => array('politic', t('Political Views:'), $r[0]['politic']),
- '$religion' => array('religion', t('Religious Views:'), $r[0]['religion']),
- '$pub_keywords' => array('pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")),
- '$prv_keywords' => array('prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")),
- '$likes' => array('likes', t('Likes:'), $r[0]['likes']),
- '$dislikes' => array('dislikes', t('Dislikes:'), $r[0]['dislikes']),
- '$music' => array('music', t('Musical interests'), $r[0]['music']),
- '$book' => array('book', t('Books, literature'), $r[0]['book']),
- '$tv' => array('tv', t('Television'), $r[0]['tv']),
- '$film' => array('film', t('Film/dance/culture/entertainment'), $r[0]['film']),
- '$interest' => array('interest', t('Hobbies/Interests'), $r[0]['interest']),
- '$romance' => array('romance', t('Love/romance'), $r[0]['romance']),
- '$work' => array('work', t('Work/employment'), $r[0]['work']),
- '$education' => array('education', t('School/education'), $r[0]['education']),
- '$contact' => array('contact', t('Contact information and Social Networks'), $r[0]['contact']),
- ));
-
- $arr = array('profile' => $r[0], 'entry' => $o);
+ '$about' => ['about', t('Tell us about yourself...'), $r[0]['about']],
+ '$xmpp' => ['xmpp', t('XMPP (Jabber) address:'), $r[0]['xmpp'], t("The XMPP address will be propagated to your contacts so that they can follow you.")],
+ '$homepage' => ['homepage', t('Homepage URL:'), $r[0]['homepage']],
+ '$hometown' => ['hometown', t('Hometown:'), $r[0]['hometown']],
+ '$politic' => ['politic', t('Political Views:'), $r[0]['politic']],
+ '$religion' => ['religion', t('Religious Views:'), $r[0]['religion']],
+ '$pub_keywords' => ['pub_keywords', t('Public Keywords:'), $r[0]['pub_keywords'], t("\x28Used for suggesting potential friends, can be seen by others\x29")],
+ '$prv_keywords' => ['prv_keywords', t('Private Keywords:'), $r[0]['prv_keywords'], t("\x28Used for searching profiles, never shown to others\x29")],
+ '$likes' => ['likes', t('Likes:'), $r[0]['likes']],
+ '$dislikes' => ['dislikes', t('Dislikes:'), $r[0]['dislikes']],
+ '$music' => ['music', t('Musical interests'), $r[0]['music']],
+ '$book' => ['book', t('Books, literature'), $r[0]['book']],
+ '$tv' => ['tv', t('Television'), $r[0]['tv']],
+ '$film' => ['film', t('Film/dance/culture/entertainment'), $r[0]['film']],
+ '$interest' => ['interest', t('Hobbies/Interests'), $r[0]['interest']],
+ '$romance' => ['romance', t('Love/romance'), $r[0]['romance']],
+ '$work' => ['work', t('Work/employment'), $r[0]['work']],
+ '$education' => ['education', t('School/education'), $r[0]['education']],
+ '$contact' => ['contact', t('Contact information and Social Networks'), $r[0]['contact']],
+ ]);
+
+ $arr = ['profile' => $r[0], 'entry' => $o];
call_hooks('profile_edit', $arr);
return $o;
$profiles = '';
foreach ($r as $rr) {
- $profiles .= replace_macros($tpl, array(
+ $profiles .= replace_macros($tpl, [
'$photo' => $a->remove_baseurl($rr['thumb']),
'$id' => $rr['id'],
'$alt' => t('Profile Image'),
'$profile_name' => $rr['profile-name'],
'$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
: '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
- ));
+ ]);
}
$tpl_header = get_markup_template('profile_listing_header.tpl');
- $o .= replace_macros($tpl_header,array(
+ $o .= replace_macros($tpl_header,[
'$header' => t('Edit/Manage Profiles'),
'$chg_photo' => t('Change profile photo'),
'$cr_new' => t('Create New Profile'),
'$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"),
'$profiles' => $profiles
- ));
+ ]);
}
return $o;
}
intval($a->argv[1])
);
- $ingroup = array();
+ $ingroup = [];
if (DBM::is_result($r))
foreach($r as $member)
$ingroup[] = $member['id'];
$members = $r;
- $ingroup = array();
+ $ingroup = [];
if (DBM::is_result($r))
foreach($r as $member)
$ingroup[] = $member['id'];
$url = substr($url, 0, $pos + 1);
}
- $url = str_replace(array('.jpg', '.jpeg', '.gif', '.png'), array('','','',''), $url);
+ $url = str_replace(['.jpg', '.jpeg', '.gif', '.png'], ['','','',''], $url);
$url = base64_decode(strtr($url, '-_', '+/'), true);
die();
}
- $fields = array('uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => datetime_convert(), 'edited' => datetime_convert(),
+ $fields = ['uid' => 0, 'contact-id' => 0, 'guid' => get_guid(), 'resource-id' => $urlhash, 'created' => datetime_convert(), 'edited' => datetime_convert(),
'filename' => basename($_REQUEST['url']), 'type' => '', 'album' => '', 'height' => imagesy($image), 'width' => imagesx($image),
'datasize' => 0, 'data' => $img_str, 'scale' => 100, 'profile' => 0,
- 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime);
+ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '', 'desc' => $mime];
dba::insert('photo', $fields);
} else {
$Image = new Image($img_str, $mime);
// Extract the URL extension
$extension = pathinfo(parse_url($url, PHP_URL_PATH), PATHINFO_EXTENSION);
- $extensions = array('jpg', 'jpeg', 'gif', 'png');
+ $extensions = ['jpg', 'jpeg', 'gif', 'png'];
if (in_array($extension, $extensions)) {
$shortpath .= '.' . $extension;
$longpath .= '.' . $extension;
$query = parse_url($url, PHP_URL_QUERY);
$query = html_entity_decode($query);
$query_list = explode('&', $query);
- $arr = array();
+ $arr = [];
foreach ($query_list as $key_value) {
$key_value_list = explode('=', $key_value);
$verified = 0;
$blocked = 1;
- $arr = array('post' => $_POST);
+ $arr = ['post' => $_POST];
call_hooks('register_post', $arr);
$max_dailies = intval(Config::get('system', 'max_daily_registrations'));
// send notification to admins
foreach ($adminlist as $admin) {
- notification(array(
+ notification([
'type' => NOTIFY_SYSTEM,
'event' => 'SYSTEM_REGISTER_REQUEST',
'source_name' => $user['username'],
'uid' => $admin['uid'],
'language' => $admin['language'] ? $admin['language'] : 'en',
'show_in_notification_page' => false
- ));
+ ]);
}
// send notification to the user, that the registration is pending
User::sendRegisterPendingEmail(
$profile_publish = '<input type="hidden" name="profile_publish_reg" value="1" />';
} else {
$publish_tpl = get_markup_template("profile_publish.tpl");
- $profile_publish = replace_macros($publish_tpl, array(
+ $profile_publish = replace_macros($publish_tpl, [
'$instance' => 'reg',
'$pubdesc' => t('Include your profile in member directory?'),
'$yes_selected' => ' checked="checked" ',
'$no_selected' => '',
'$str_yes' => t('Yes'),
'$str_no' => t('No'),
- ));
+ ]);
}
$r = q("SELECT COUNT(*) AS `contacts` FROM `contact`");
$tpl = get_markup_template("register.tpl");
- $arr = array('template' => $tpl);
+ $arr = ['template' => $tpl];
call_hooks('register_form', $arr);
'$oidhtml' => $oidhtml,
'$invitations' => Config::get('system', 'invitation_only'),
'$permonly' => $a->config['register_policy'] == REGISTER_APPROVE,
- '$permonlybox' => array('permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')),
+ '$permonlybox' => ['permonlybox', t('Note for the admin'), '', t('Leave a message for the admin, why you want to join this node')],
'$invite_desc' => t('Membership on this site is by invitation only.'),
'$invite_label' => t('Your invitation ID: '),
'$invite_id' => $invite_id,
'$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith, real or real-looking' . "\x29" . ': '),
'$addrlabel' => t('Your Email Address: (Initial information will be send there, so this has to be an existing address.)'),
'$passwords' => $passwords,
- '$password1' => array('password1', t('New Password:'), '', t('Leave empty for an auto generated password.')),
- '$password2' => array('confirm', t('Confirm:'), '', ''),
+ '$password1' => ['password1', t('New Password:'), '', t('Leave empty for an auto generated password.')],
+ '$password2' => ['confirm', t('Confirm:'), '', ''],
'$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@%s</strong>\'.', $a->get_hostname()),
'$nicklabel' => t('Choose a nickname: '),
'$photo' => $photo,
intval($register[0]['uid'])
);
- dba::delete('user', array('uid' => $register[0]['uid']));
- dba::delete('register', array('hash' => $register[0]['hash']));
+ dba::delete('user', ['uid' => $register[0]['uid']]);
+ dba::delete('register', ['hash' => $register[0]['hash']]);
notice(sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
return true;
$_SESSION['remove_account_verify'] = $hash;
$tpl = get_markup_template('removeme.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$basedir' => System::baseUrl(),
'$hash' => $hash,
'$title' => t('Remove My Account'),
'$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'),
'$passwd' => t('Please enter your password for verification:'),
'$submit' => t('Remove My Account')
- ));
+ ]);
return $o;
}
*/
function robots_txt_init(App $a)
{
- $allDisalloweds = array(
+ $allDisalloweds = [
'/settings/',
'/admin/',
'/message/',
- );
+ ];
header('Content-Type: text/plain');
echo 'User-agent: *' . PHP_EOL;
// unpack the data
// strip whitespace so our data element will return to one big base64 blob
- $data = str_replace(array(" ","\t","\r","\n"),array("","","",""),$base->data);
+ $data = str_replace([" ","\t","\r","\n"],["","","",""],$base->data);
// stash away some other stuff for later
);
if (DBM::is_result($r)) {
- $saved = array();
+ $saved = [];
foreach ($r as $rr) {
- $saved[] = array(
+ $saved[] = [
'id' => $rr['id'],
'term' => $rr['term'],
'encodedterm' => urlencode($rr['term']),
'delete' => t('Remove term'),
'selected' => ($search==$rr['term']),
- );
+ ];
}
$tpl = get_markup_template("saved_searches_aside.tpl");
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => t('Saved Searches'),
'$add' => '',
'$searchbox' => '',
'$saved' => $saved,
- ));
+ ]);
}
return $o;
dbesc($search)
);
if (!DBM::is_result($r)) {
- dba::insert('search', array('uid' => local_user(), 'term' => $search));
+ dba::insert('search', ['uid' => local_user(), 'term' => $search]);
}
}
if (x($_GET,'remove') && $search) {
- dba::delete('search', array('uid' => local_user(), 'term' => $search));
+ dba::delete('search', ['uid' => local_user(), 'term' => $search]);
}
$a->page['aside'] .= search_saved_searches();
if (Config::get('system','local_search') && !local_user() && !remote_user()) {
http_status_exit(403,
- array("title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a search.")));
+ ["title" => t("Public access denied."),
+ "description" => t("Only logged in users are permitted to perform a search.")]);
killme();
//notice(t('Public access denied.').EOL);
//return;
$resultdata = json_decode($result);
if (($resultdata->time > (time() - $crawl_permit_period)) && ($resultdata->accesses > $free_crawls)) {
http_status_exit(429,
- array("title" => t("Too Many Requests"),
- "description" => t("Only one search per minute is permitted for not logged in users.")));
+ ["title" => t("Too Many Requests"),
+ "description" => t("Only one search per minute is permitted for not logged in users.")]);
killme();
}
- Cache::set("remote_search:".$remote, json_encode(array("time" => time(), "accesses" => $resultdata->accesses + 1)), CACHE_HOUR);
+ Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => $resultdata->accesses + 1]), CACHE_HOUR);
} else
- Cache::set("remote_search:".$remote, json_encode(array("time" => time(), "accesses" => 1)), CACHE_HOUR);
+ Cache::set("remote_search:".$remote, json_encode(["time" => time(), "accesses" => 1]), CACHE_HOUR);
}
nav_set_selected('search');
}
// contruct a wrapper for the search header
- $o .= replace_macros(get_markup_template("content_wrapper.tpl"),array(
+ $o .= replace_macros(get_markup_template("content_wrapper.tpl"),[
'name' => "search-header",
'$title' => t("Search"),
'$title_size' => 3,
'$content' => search($search,'search-box','search',((local_user()) ? true : false), false)
- ));
+ ]);
if (strpos($search,'#') === 0) {
$tag = true;
else
$title = sprintf( t('Results for: %s'), $search);
- $o .= replace_macros(get_markup_template("section_title.tpl"),array(
+ $o .= replace_macros(get_markup_template("section_title.tpl"),[
'$title' => $title
- ));
+ ]);
logger("Start Conversation for '".$search."'", LOGGER_DEBUG);
$o .= conversation($a,$r,'search',false);
// These lines provide the javascript needed by the acl selector
$tpl = get_markup_template('settings/head.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl,array(
+ $a->page['htmlhead'] .= replace_macros($tpl,[
'$ispublic' => t('everybody')
- ));
+ ]);
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('Account'),
'url' => 'settings',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
'accesskey' => 'o',
- ),
- );
+ ],
+ ];
if (Feature::get()) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Additional features'),
'url' => 'settings/features',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
'accesskey' => 't',
- );
+ ];
}
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Display'),
'url' => 'settings/display',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
'accesskey' => 'i',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Social Networks'),
'url' => 'settings/connectors',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
'accesskey' => 'w',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Plugins'),
'url' => 'settings/addon',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
'accesskey' => 'l',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Delegations'),
'url' => 'delegate',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''),
'accesskey' => 'd',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Connected apps'),
'url' => 'settings/oauth',
'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
'accesskey' => 'b',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Export personal data'),
'url' => 'uexport',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''),
'accesskey' => 'e',
- );
+ ];
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Remove account'),
'url' => 'removeme',
'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
'accesskey' => 'r',
- );
+ ];
$tabtpl = get_markup_template("generic_links_widget.tpl");
- $a->page['aside'] = replace_macros($tabtpl, array(
+ $a->page['aside'] = replace_macros($tabtpl, [
'$title' => t('Settings'),
'$class' => 'settings-widget',
'$items' => $tabs,
- ));
+ ]);
}
intval(local_user())
);
if (!DBM::is_result($r)) {
- dba::insert('mailacct', array('uid' => local_user()));
+ dba::insert('mailacct', ['uid' => local_user()]);
}
if (strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass, $pass, $a->user['pubkey']);
- dba::update('mailacct', array('pass' => bin2hex($pass)), array('uid' => local_user()));
+ dba::update('mailacct', ['pass' => bin2hex($pass)], ['uid' => local_user()]);
}
$r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
`action` = %d, `movetofolder` = '%s',
}
// Adjust the page flag if the account type doesn't fit to the page flag.
- if (($account_type == ACCOUNT_TYPE_PERSON) && !in_array($page_flags, array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE))) {
+ if (($account_type == ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
$page_flags = PAGE_NORMAL;
- } elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, array(PAGE_SOAPBOX))) {
+ } elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [PAGE_SOAPBOX])) {
$page_flags = PAGE_SOAPBOX;
- } elseif (($account_type == ACCOUNT_TYPE_NEWS) && !in_array($page_flags, array(PAGE_SOAPBOX))) {
+ } elseif (($account_type == ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [PAGE_SOAPBOX])) {
$page_flags = PAGE_SOAPBOX;
- } elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, array(PAGE_COMMUNITY, PAGE_PRVGROUP))) {
+ } elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
$page_flags = PAGE_COMMUNITY;
}
if (($a->argc > 1) && ($a->argv[1] === 'oauth')) {
if (($a->argc > 2) && ($a->argv[2] === 'add')) {
$tpl = get_markup_template('settings/oauth_edit.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
'$title' => t('Add application'),
'$submit' => t('Save Settings'),
'$cancel' => t('Cancel'),
- '$name' => array('name', t('Name'), '', ''),
- '$key' => array('key', t('Consumer Key'), '', ''),
- '$secret' => array('secret', t('Consumer Secret'), '', ''),
- '$redirect' => array('redirect', t('Redirect'), '', ''),
- '$icon' => array('icon', t('Icon url'), '', ''),
- ));
+ '$name' => ['name', t('Name'), '', ''],
+ '$key' => ['key', t('Consumer Key'), '', ''],
+ '$secret' => ['secret', t('Consumer Secret'), '', ''],
+ '$redirect' => ['redirect', t('Redirect'), '', ''],
+ '$icon' => ['icon', t('Icon url'), '', ''],
+ ]);
return $o;
}
$app = $r[0];
$tpl = get_markup_template('settings/oauth_edit.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
- '$name' => array('name', t('Name'), $app['name'] , ''),
- '$key' => array('key', t('Consumer Key'), $app['client_id'], ''),
- '$secret' => array('secret', t('Consumer Secret'), $app['pw'], ''),
- '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], ''),
- '$icon' => array('icon', t('Icon url'), $app['icon'], ''),
- ));
+ '$name' => ['name', t('Name'), $app['name'] , ''],
+ '$key' => ['key', t('Consumer Key'), $app['client_id'], ''],
+ '$secret' => ['secret', t('Consumer Secret'), $app['pw'], ''],
+ '$redirect' => ['redirect', t('Redirect'), $app['redirect_uri'], ''],
+ '$icon' => ['icon', t('Icon url'), $app['icon'], ''],
+ ]);
return $o;
}
$tpl = get_markup_template('settings/oauth.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_oauth"),
'$baseurl' => System::baseUrl(true),
'$title' => t('Connected Apps'),
'$noname' => t('No name'),
'$remove' => t('Remove authorization'),
'$apps' => $r,
- ));
+ ]);
return $o;
}
$tpl = get_markup_template('settings/addons.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_addon"),
'$title' => t('Plugin Settings'),
'$settings_addons' => $settings_addons
- ));
+ ]);
return $o;
}
if (($a->argc > 1) && ($a->argv[1] === 'features')) {
- $arr = array();
+ $arr = [];
$features = Feature::get();
foreach ($features as $fname => $fdata) {
- $arr[$fname] = array();
+ $arr[$fname] = [];
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
- $arr[$fname][1][] = array('feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],array(t('Off'), t('On')));
+ $arr[$fname][1][] = ['feature_' .$f[0], $f[1],((intval(Feature::isEnabled(local_user(), $f[0]))) ? "1" : ''), $f[2],[t('Off'), t('On')]];
}
}
$tpl = get_markup_template('settings/features.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
'$features' => $arr,
'$submit' => t('Save Settings'),
- ));
+ ]);
return $o;
}
$mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$form_security_token' => get_form_security_token("settings_connectors"),
'$title' => t('Social Networks'),
'$ostat_enabled' => $ostat_enabled,
'$general_settings' => t('General Social Media Settings'),
- '$no_intelligent_shortening' => array('no_intelligent_shortening', t('Disable intelligent shortening'), $no_intelligent_shortening, t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')),
- '$ostatus_autofriend' => array('snautofollow', t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')),
+ '$no_intelligent_shortening' => ['no_intelligent_shortening', t('Disable intelligent shortening'), $no_intelligent_shortening, t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.')],
+ '$ostatus_autofriend' => ['snautofollow', t('Automatically follow any GNU Social (OStatus) followers/mentioners'), $ostatus_autofriend, t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.')],
'$default_group' => Group::displayGroupSelection(local_user(), $default_group, t("Default group for OStatus contacts")),
- '$legacy_contact' => array('legacy_contact', t('Your legacy GNU Social account'), $legacy_contact, t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')),
+ '$legacy_contact' => ['legacy_contact', t('Your legacy GNU Social account'), $legacy_contact, t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.')],
'$repair_ostatus_url' => System::baseUrl() . '/repair_ostatus',
'$repair_ostatus_text' => t('Repair OStatus subscriptions'),
'$h_imap' => t('Email/Mailbox Setup'),
'$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
- '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk, ''),
+ '$imap_lastcheck' => ['imap_lastcheck', t('Last successful email check:'), $mail_chk, ''],
'$mail_disabled' => $mail_disabled_message,
- '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
- '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
- '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array('notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
- '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''),
- '$mail_pass' => array('mail_pass', t('Email password:'), '', ''),
- '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'),
- '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
- '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder'))),
- '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''),
+ '$mail_server' => ['mail_server', t('IMAP server name:'), $mail_server, ''],
+ '$mail_port' => ['mail_port', t('IMAP port:'), $mail_port, ''],
+ '$mail_ssl' => ['mail_ssl', t('Security:'), strtoupper($mail_ssl), '', ['notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL']],
+ '$mail_user' => ['mail_user', t('Email login name:'), $mail_user, ''],
+ '$mail_pass' => ['mail_pass', t('Email password:'), '', ''],
+ '$mail_replyto' => ['mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'],
+ '$mail_pubmail' => ['mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''],
+ '$mail_action' => ['mail_action', t('Action after import:'), $mail_action, '', [0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder')]],
+ '$mail_movetofolder' => ['mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''],
'$submit' => t('Save Settings'),
- ));
+ ]);
call_hooks('display_settings', $o);
return $o;
$allowed_themes_str = Config::get('system', 'allowed_themes');
$allowed_themes_raw = explode(',', $allowed_themes_str);
- $allowed_themes = array();
+ $allowed_themes = [];
if (count($allowed_themes_raw)) {
foreach ($allowed_themes_raw as $x) {
if (strlen(trim($x)) && is_dir("view/theme/$x")) {
}
- $themes = array();
- $mobile_themes = array("---" => t('No special theme for mobile devices'));
+ $themes = [];
+ $mobile_themes = ["---" => t('No special theme for mobile devices')];
if ($allowed_themes) {
foreach ($allowed_themes as $theme) {
$is_experimental = file_exists('view/theme/' . $theme . '/experimental');
$nosmile = PConfig::get(local_user(), 'system', 'no_smilies', 0);
$first_day_of_week = PConfig::get(local_user(), 'system', 'first_day_of_week', 0);
- $weekdays = array(0 => t("Sunday"), 1 => t("Monday"));
+ $weekdays = [0 => t("Sunday"), 1 => t("Monday")];
$noinfo = PConfig::get(local_user(), 'system', 'ignore_info', 0);
$infinite_scroll = PConfig::get(local_user(), 'system', 'infinite_scroll', 0);
}
$tpl = get_markup_template('settings/display.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$ptitle' => t('Display Settings'),
'$form_security_token' => get_form_security_token("settings_display"),
'$submit' => t('Save Settings'),
'$baseurl' => System::baseUrl(true),
'$uid' => local_user(),
- '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true),
- '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false),
- '$nowarn_insecure' => array('nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")),
- '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')),
- '$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')),
- '$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')),
- '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''),
+ '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes, true],
+ '$mobile_theme' => ['mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false],
+ '$nowarn_insecure' => ['nowarn_insecure', t('Suppress warning of insecure networks'), $nowarn_insecure, t("Should the system suppress the warning that the current group contains members of networks that can't receive non public postings.")],
+ '$ajaxint' => ['browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')],
+ '$itemspage_network' => ['itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')],
+ '$itemspage_mobile_network' => ['itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')],
+ '$nosmile' => ['nosmile', t("Don't show emoticons"), $nosmile, ''],
'$calendar_title' => t('Calendar'),
- '$first_day_of_week' => array('first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false),
- '$noinfo' => array('noinfo', t("Don't show notices"), $noinfo, ''),
- '$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''),
- '$no_auto_update' => array('no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, t('When disabled, the network page is updated all the time, which could be confusing while reading.')),
- '$bandwidth_saver' => array('bandwidth_saver', t('Bandwith Saver Mode'), $bandwidth_saver, t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')),
- '$smart_threading' => array('smart_threading', t('Smart Threading'), $smart_threading, t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')),
+ '$first_day_of_week' => ['first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false],
+ '$noinfo' => ['noinfo', t("Don't show notices"), $noinfo, ''],
+ '$infinite_scroll' => ['infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''],
+ '$no_auto_update' => ['no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, t('When disabled, the network page is updated all the time, which could be confusing while reading.')],
+ '$bandwidth_saver' => ['bandwidth_saver', t('Bandwith Saver Mode'), $bandwidth_saver, t('When enabled, embedded content is not displayed on automatic updates, they only show on page reload.')],
+ '$smart_threading' => ['smart_threading', t('Smart Threading'), $smart_threading, t('When enabled, suppress extraneous thread indentation while keeping it where it matters. Only works if threading is available and enabled.')],
'$d_tset' => t('General Theme Settings'),
'$d_ctset' => t('Custom Theme Settings'),
'$d_cset' => t('Content Settings'),
'stitle' => t('Theme settings'),
'$theme_config' => $theme_config,
- ));
+ ]);
$tpl = get_markup_template('settings/display_end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
- '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes)
- ));
+ $a->page['end'] .= replace_macros($tpl, [
+ '$theme' => ['theme', t('Display Theme:'), $theme_selected, '', $themes]
+ ]);
return $o;
}
// Set the account type to "Community" when the page is a community page but the account type doesn't fit
// This is only happening on the first visit after the update
- if (in_array($a->user['page-flags'], array(PAGE_COMMUNITY, PAGE_PRVGROUP)) &&
+ if (in_array($a->user['page-flags'], [PAGE_COMMUNITY, PAGE_PRVGROUP]) &&
($a->user['account-type'] != ACCOUNT_TYPE_COMMUNITY))
$a->user['account-type'] = ACCOUNT_TYPE_COMMUNITY;
$pageset_tpl = get_markup_template('settings/pagetypes.tpl');
- $pagetype = replace_macros($pageset_tpl, array(
+ $pagetype = replace_macros($pageset_tpl, [
'$account_types' => t("Account Types"),
'$user' => t("Personal Page Subtypes"),
'$community' => t("Community Forum Subtypes"),
'$type_news' => ACCOUNT_TYPE_NEWS,
'$type_community' => ACCOUNT_TYPE_COMMUNITY,
- '$account_person' => array('account-type', t('Personal Page'), ACCOUNT_TYPE_PERSON,
+ '$account_person' => ['account-type', t('Personal Page'), ACCOUNT_TYPE_PERSON,
t('Account for a personal profile.'),
- ($a->user['account-type'] == ACCOUNT_TYPE_PERSON)),
+ ($a->user['account-type'] == ACCOUNT_TYPE_PERSON)],
- '$account_organisation' => array('account-type', t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
+ '$account_organisation' => ['account-type', t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
t('Account for an organisation that automatically approves contact requests as "Followers".'),
- ($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)),
+ ($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)],
- '$account_news' => array('account-type', t('News Page'), ACCOUNT_TYPE_NEWS,
+ '$account_news' => ['account-type', t('News Page'), ACCOUNT_TYPE_NEWS,
t('Account for a news reflector that automatically approves contact requests as "Followers".'),
- ($a->user['account-type'] == ACCOUNT_TYPE_NEWS)),
+ ($a->user['account-type'] == ACCOUNT_TYPE_NEWS)],
- '$account_community' => array('account-type', t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
+ '$account_community' => ['account-type', t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
t('Account for community discussions.'),
- ($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)),
+ ($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)],
- '$page_normal' => array('page-flags', t('Normal Account Page'), PAGE_NORMAL,
+ '$page_normal' => ['page-flags', t('Normal Account Page'), PAGE_NORMAL,
t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
- ($a->user['page-flags'] == PAGE_NORMAL)),
+ ($a->user['page-flags'] == PAGE_NORMAL)],
- '$page_soapbox' => array('page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
+ '$page_soapbox' => ['page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
t('Account for a public profile that automatically approves contact requests as "Followers".'),
- ($a->user['page-flags'] == PAGE_SOAPBOX)),
+ ($a->user['page-flags'] == PAGE_SOAPBOX)],
- '$page_community' => array('page-flags', t('Public Forum'), PAGE_COMMUNITY,
+ '$page_community' => ['page-flags', t('Public Forum'), PAGE_COMMUNITY,
t('Automatically approves all contact requests.'),
- ($a->user['page-flags'] == PAGE_COMMUNITY)),
+ ($a->user['page-flags'] == PAGE_COMMUNITY)],
- '$page_freelove' => array('page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
+ '$page_freelove' => ['page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
t('Account for a popular profile that automatically approves contact requests as "Friends".'),
- ($a->user['page-flags'] == PAGE_FREELOVE)),
+ ($a->user['page-flags'] == PAGE_FREELOVE)],
- '$page_prvgroup' => array('page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
+ '$page_prvgroup' => ['page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
t('Requires manual approval of contact requests.'),
- ($a->user['page-flags'] == PAGE_PRVGROUP)),
+ ($a->user['page-flags'] == PAGE_PRVGROUP)],
- ));
+ ]);
$noid = Config::get('system', 'no_openid');
if ($noid) {
$openid_field = false;
} else {
- $openid_field = array('openid_url', t('OpenID:'), $openid, t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url");
+ $openid_field = ['openid_url', t('OpenID:'), $openid, t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url"];
}
$opt_tpl = get_markup_template("field_yesno.tpl");
if (Config::get('system', 'publish_all')) {
$profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
} else {
- $profile_in_dir = replace_macros($opt_tpl, array(
- '$field' => array('profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], t("Your profile may be visible in public."), array(t('No'), t('Yes')))
- ));
+ $profile_in_dir = replace_macros($opt_tpl, [
+ '$field' => ['profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], t("Your profile may be visible in public."), [t('No'), t('Yes')]]
+ ]);
}
if (strlen(Config::get('system', 'directory'))) {
- $profile_in_net_dir = replace_macros($opt_tpl, array(
- '$field' => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'), t('Yes')))
- ));
+ $profile_in_net_dir = replace_macros($opt_tpl, [
+ '$field' => ['profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', [t('No'), t('Yes')]]
+ ]);
} else {
$profile_in_net_dir = '';
}
- $hide_friends = replace_macros($opt_tpl, array(
- '$field' => array('hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', array(t('No'), t('Yes'))),
- ));
+ $hide_friends = replace_macros($opt_tpl, [
+ '$field' => ['hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', [t('No'), t('Yes')]],
+ ]);
- $hide_wall = replace_macros($opt_tpl, array(
- '$field' => array('hidewall', t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], t("If enabled, posting public messages to Diaspora and other networks isn't possible."), array(t('No'), t('Yes'))),
- ));
+ $hide_wall = replace_macros($opt_tpl, [
+ '$field' => ['hidewall', t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], t("If enabled, posting public messages to Diaspora and other networks isn't possible."), [t('No'), t('Yes')]],
+ ]);
- $blockwall = replace_macros($opt_tpl, array(
- '$field' => array('blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', array(t('No'), t('Yes'))),
- ));
+ $blockwall = replace_macros($opt_tpl, [
+ '$field' => ['blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ ]);
- $blocktags = replace_macros($opt_tpl, array(
- '$field' => array('blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', array(t('No'), t('Yes'))),
- ));
+ $blocktags = replace_macros($opt_tpl, [
+ '$field' => ['blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', [t('No'), t('Yes')]],
+ ]);
- $suggestme = replace_macros($opt_tpl, array(
- '$field' => array('suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', array(t('No'), t('Yes'))),
- ));
+ $suggestme = replace_macros($opt_tpl, [
+ '$field' => ['suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', [t('No'), t('Yes')]],
+ ]);
- $unkmail = replace_macros($opt_tpl, array(
- '$field' => array('unkmail', t('Permit unknown people to send you private mail?'), $unkmail, '', array(t('No'), t('Yes'))),
- ));
+ $unkmail = replace_macros($opt_tpl, [
+ '$field' => ['unkmail', t('Permit unknown people to send you private mail?'), $unkmail, '', [t('No'), t('Yes')]],
+ ]);
if (!$profile['publish'] && !$profile['net-publish']) {
info(t('Profile is <strong>not published</strong>.') . EOL);
$tpl_addr = get_markup_template('settings/nick_set.tpl');
- $prof_addr = replace_macros($tpl_addr,array(
+ $prof_addr = replace_macros($tpl_addr,[
'$desc' => t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . $a->get_hostname() . $a->get_path(), System::baseUrl() . '/profile/' . $nickname),
'$basepath' => $a->get_hostname()
- ));
+ ]);
$stpl = get_markup_template('settings/settings.tpl');
- $expire_arr = array(
- 'days' => array('expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
+ $expire_arr = [
+ 'days' => ['expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')],
'advanced' => t('Advanced expiration settings'),
'label' => t('Advanced Expiration'),
- 'items' => array('expire_items', t("Expire posts:"), $expire_items, '', array(t('No'), t('Yes'))),
- 'notes' => array('expire_notes', t("Expire personal notes:"), $expire_notes, '', array(t('No'), t('Yes'))),
- 'starred' => array('expire_starred', t("Expire starred posts:"), $expire_starred, '', array(t('No'), t('Yes'))),
- 'photos' => array('expire_photos', t("Expire photos:"), $expire_photos, '', array(t('No'), t('Yes'))),
- 'network_only' => array('expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', array(t('No'), t('Yes'))),
- );
+ 'items' => ['expire_items', t("Expire posts:"), $expire_items, '', [t('No'), t('Yes')]],
+ 'notes' => ['expire_notes', t("Expire personal notes:"), $expire_notes, '', [t('No'), t('Yes')]],
+ 'starred' => ['expire_starred', t("Expire starred posts:"), $expire_starred, '', [t('No'), t('Yes')]],
+ 'photos' => ['expire_photos', t("Expire photos:"), $expire_photos, '', [t('No'), t('Yes')]],
+ 'network_only' => ['expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', [t('No'), t('Yes')]],
+ ];
$group_select = Group::displayGroupSelection(local_user(), $a->user['def_gid']);
$query_str = $a->query_string;
if (strpos($query_str, 'public=1') !== false) {
- $query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
+ $query_str = str_replace(['?public=1', '&public=1'], ['', ''], $query_str);
}
// I think $a->query_string may never have ? in it, but I could be wrong
$lang_choices = get_available_languages();
/// @TODO Fix indending (or so)
- $o .= replace_macros($stpl, array(
+ $o .= replace_macros($stpl, [
'$ptitle' => t('Account Settings'),
'$submit' => t('Save Settings'),
'$nickname_block' => $prof_addr,
'$h_pass' => t('Password Settings'),
- '$password1'=> array('password', t('New Password:'), '', ''),
- '$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
- '$password3'=> array('opassword', t('Current Password:'), '', t('Your current password to confirm the changes')),
- '$password4'=> array('mpassword', t('Password:'), '', t('Your current password to confirm the changes')),
+ '$password1'=> ['password', t('New Password:'), '', ''],
+ '$password2'=> ['confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')],
+ '$password3'=> ['opassword', t('Current Password:'), '', t('Your current password to confirm the changes')],
+ '$password4'=> ['mpassword', t('Password:'), '', t('Your current password to confirm the changes')],
'$oid_enable' => (!Config::get('system', 'no_openid')),
'$openid' => $openid_field,
'$h_basic' => t('Basic Settings'),
- '$username' => array('username', t('Full Name:'), $username, ''),
- '$email' => array('email', t('Email Address:'), $email, '', '', '', 'email'),
- '$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
- '$language' => array('language', t('Your Language:'), $language, t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices),
- '$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
- '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
+ '$username' => ['username', t('Full Name:'), $username, ''],
+ '$email' => ['email', t('Email Address:'), $email, '', '', '', 'email'],
+ '$timezone' => ['timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''],
+ '$language' => ['language', t('Your Language:'), $language, t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices],
+ '$defloc' => ['defloc', t('Default Post Location:'), $defloc, ''],
+ '$allowloc' => ['allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''],
'$h_prv' => t('Security and Privacy Settings'),
- '$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), $maxreq , t("\x28to prevent spam abuse\x29")),
+ '$maxreq' => ['maxreq', t('Maximum Friend Requests/Day:'), $maxreq , t("\x28to prevent spam abuse\x29")],
'$permissions' => t('Default Post Permissions'),
'$permdesc' => t("\x28click to open/close\x29"),
'$visibility' => $profile['net-publish'],
'$hide_friends' => $hide_friends,
'$hide_wall' => $hide_wall,
'$unkmail' => $unkmail,
- '$cntunkmail' => array('cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail , t("\x28to prevent spam abuse\x29")),
+ '$cntunkmail' => ['cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail , t("\x28to prevent spam abuse\x29")],
'$h_not' => t('Notification Settings'),
'$activity_options' => t('By default post a status message when:'),
- '$post_newfriend' => array('post_newfriend', t('accepting a friend request'), $post_newfriend, ''),
- '$post_joingroup' => array('post_joingroup', t('joining a forum/community'), $post_joingroup, ''),
- '$post_profilechange' => array('post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, ''),
+ '$post_newfriend' => ['post_newfriend', t('accepting a friend request'), $post_newfriend, ''],
+ '$post_joingroup' => ['post_joingroup', t('joining a forum/community'), $post_joingroup, ''],
+ '$post_profilechange' => ['post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, ''],
'$lbl_not' => t('Send a notification email when:'),
- '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
- '$notify2' => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),
- '$notify3' => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''),
- '$notify4' => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''),
- '$notify5' => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''),
- '$notify6' => array('notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''),
- '$notify7' => array('notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''),
- '$notify8' => array('notify8', t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''),
-
- '$desktop_notifications' => array('desktop_notifications', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')),
-
- '$email_textonly' => array('email_textonly', t('Text-only notification emails'),
+ '$notify1' => ['notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''],
+ '$notify2' => ['notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''],
+ '$notify3' => ['notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''],
+ '$notify4' => ['notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''],
+ '$notify5' => ['notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''],
+ '$notify6' => ['notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''],
+ '$notify7' => ['notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''],
+ '$notify8' => ['notify8', t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''],
+
+ '$desktop_notifications' => ['desktop_notifications', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')],
+
+ '$email_textonly' => ['email_textonly', t('Text-only notification emails'),
PConfig::get(local_user(), 'system', 'email_textonly'),
- t('Send text only notification emails, without the html part')),
+ t('Send text only notification emails, without the html part')],
- '$detailed_notif' => array('detailed_notif', t('Show detailled notifications'),
+ '$detailed_notif' => ['detailed_notif', t('Show detailled notifications'),
PConfig::get(local_user(), 'system', 'detailed_notif'),
- t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')),
+ t('Per default the notificiation are condensed to a single notification per item. When enabled, every notification is displayed.')],
'$h_advn' => t('Advanced Account/Page Type Settings'),
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
'$relocate_text' => t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
'$relocate_button' => t("Resend relocate message to contacts"),
- ));
+ ]);
call_hooks('settings_form', $o);
}
function share_header($author, $profile, $avatar, $guid, $posted, $link) {
- $header = "[share author='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $author).
- "' profile='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $profile).
- "' avatar='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $avatar);
+ $header = "[share author='".str_replace(["'", "[", "]"], ["'", "[", "]"], $author).
+ "' profile='".str_replace(["'", "[", "]"], ["'", "[", "]"], $profile).
+ "' avatar='".str_replace(["'", "[", "]"], ["'", "[", "]"], $avatar);
if ($guid) {
- $header .= "' guid='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $guid);
+ $header .= "' guid='".str_replace(["'", "[", "]"], ["'", "[", "]"], $guid);
}
if ($posted) {
- $header .= "' posted='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $posted);
+ $header .= "' posted='".str_replace(["'", "[", "]"], ["'", "[", "]"], $posted);
}
- $header .= "' link='".str_replace(array("'", "[", "]"), array("'", "[", "]"), $link)."']";
+ $header .= "' link='".str_replace(["'", "[", "]"], ["'", "[", "]"], $link)."']";
return $header;
}
{
if ($a->argv[1] === "json") {
$tmp = Smilies::getList();
- $results = array();
+ $results = [];
for ($i = 0; $i < count($tmp['texts']); $i++) {
- $results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
+ $results[] = ['text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]];
}
json_return_and_die($results);
} else {
killme();
}
- $statistics = array(
+ $statistics = [
"name" => $a->config["sitename"],
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
"active_users_halfyear" => Config::get('nodeinfo', 'active_users_halfyear'),
"active_users_monthly" => Config::get('nodeinfo', 'active_users_monthly'),
"local_posts" => Config::get('nodeinfo', 'local_posts')
- );
+ ];
- $statistics["services"] = array();
+ $statistics["services"] = [];
$statistics["services"]["appnet"] = plugin_enabled("appnet");
$statistics["services"]["blogger"] = plugin_enabled("blogger");
$statistics["services"]["buffer"] = plugin_enabled("buffer");
return;
}
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uri'] = $uri;
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
- $inputs = array();
+ $inputs = [];
foreach ($query['args'] as $arg) {
if (strpos($arg, 'confirm=') === false) {
$arg_parts = explode('=', $arg);
- $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
+ $inputs[] = ['name' => $arg_parts[0], 'value' => $arg_parts[1]];
}
}
- $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
+ $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'get',
'$message' => t('Do you really want to delete this suggestion?'),
'$extra_inputs' => $inputs,
'$confirm_url' => $query['base'],
'$confirm_name' => 'confirmed',
'$cancel' => t('Cancel'),
- ));
+ ]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
}
// Now check how the user responded to the confirmation query
if (!$_REQUEST['canceled']) {
- dba::insert('gcign', array('uid' => local_user(), 'gcid' => $_GET['ignore']));
+ dba::insert('gcign', ['uid' => local_user(), 'gcid' => $_GET['ignore']]);
}
}
$connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id'];
- $photo_menu = array(
- 'profile' => array(t("View Profile"), Profile::zrl($rr["url"])),
- 'follow' => array(t("Connect/Follow"), $connlnk),
- 'hide' => array(t('Ignore/Hide'), $ignlnk)
- );
+ $photo_menu = [
+ 'profile' => [t("View Profile"), Profile::zrl($rr["url"])],
+ 'follow' => [t("Connect/Follow"), $connlnk],
+ 'hide' => [t('Ignore/Hide'), $ignlnk]
+ ];
$contact_details = Contact::getDetailsByURL($rr["url"], local_user(), $rr);
- $entry = array(
+ $entry = [
'url' => Profile::zrl($rr['url']),
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'img_hover' => $rr['url'],
'ignore' => t('Ignore/Hide'),
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$tpl = get_markup_template('viewcontact_template.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$title' => t('Friend Suggestions'),
'$contacts' => $entries,
- ));
+ ]);
return $o;
}
$term = notags(trim($_GET['term']));
// no commas allowed
- $term = str_replace(array(',',' '),array('','_'),$term);
+ $term = str_replace([',',' '],['','_'],$term);
if(! $term)
return;
$termlink = html_entity_decode('⌗') . '[url=' . System::baseUrl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]';
- $arr = array();
+ $arr = [];
$arr['guid'] = get_guid(32);
$arr['uri'] = $uri;
* options shown on "Export personal data" page
* list of array( 'link url', 'link text', 'help text' )
*/
- $options = array(
- array('uexport/account', t('Export account'), t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')),
- array('uexport/backup', t('Export all'), t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')),
- );
+ $options = [
+ ['uexport/account', t('Export account'), t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
+ ['uexport/backup', t('Export all'), t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')],
+ ];
call_hooks('uexport_options', $options);
$tpl = get_markup_template("uexport.tpl");
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$title' => t('Export personal data'),
'$options' => $options
- ));
+ ]);
}
function _uexport_multirow($query) {
- $result = array();
+ $result = [];
$r = q($query);
if (DBM::is_result($r)) {
foreach ($r as $rr) {
- $p = array();
+ $p = [];
foreach ($rr as $k => $v) {
$p[$k] = $v;
}
}
function _uexport_row($query) {
- $result = array();
+ $result = [];
$r = q($query);
if (DBM::is_result($r)) {
foreach ($r as $rr) {
sprintf("SELECT `group_member`.`gid`, `group_member`.`contact-id` FROM `group_member` INNER JOIN `group` ON `group`.`id` = `group_member`.`gid` WHERE `group`.`uid` = %d", intval(local_user()))
);
- $output = array(
+ $output = [
'version' => FRIENDICA_VERSION,
'schema' => DB_UPDATE_VERSION,
'baseurl' => System::baseUrl(),
'pconfig' => $pconfig,
'group' => $group,
'group_member' => $group_member,
- );
+ ];
//echo "<pre>"; var_dump(json_encode($output)); killme();
echo json_encode($output, JSON_PARTIAL_OUTPUT_ON_ERROR);
// chunk the output to avoid exhausting memory
for ($x = 0; $x < $total; $x += 500) {
- $item = array();
+ $item = [];
$r = q("SELECT * FROM `item` WHERE `uid` = %d LIMIT %d, %d",
intval(local_user()),
intval($x),
intval(500)
);
- $output = array('item' => $r);
+ $output = ['item' => $r];
echo json_encode($output, JSON_PARTIAL_OUTPUT_ON_ERROR). "\n";
}
}
}
$tpl = get_markup_template("uimport.tpl");
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$regbutt' => t('Import'),
- '$import' => array(
+ '$import' => [
'title' => t("Move account"),
'intro' => t("You can import an account from another Friendica server."),
'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
- 'field' => array('accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
- ),
- ));
+ 'field' => ['accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')],
+ ],
+ ]);
}
if (!DBM::is_result($contact)) {
notice(t("Contact wasn't found or can't be unfollowed."));
} else {
- if (in_array($contact['network'], array(NETWORK_OSTATUS, NETWORK_DIASPORA))) {
+ if (in_array($contact['network'], [NETWORK_OSTATUS, NETWORK_DIASPORA])) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)
Contact::terminateFriendship($r[0], $contact);
}
}
- dba::update('contact', array('rel' => CONTACT_IS_FOLLOWER), array('id' => $contact['id']));
+ dba::update('contact', ['rel' => CONTACT_IS_FOLLOWER], ['id' => $contact['id']]);
info(t('Contact unfollowed').EOL);
goaway(System::baseUrl().'/contacts/'.$contact['id']);
// NOTREACHED
}
- if (!in_array($contact['network'], array(NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (!in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
notice(t("Unfollowing is currently not supported by your network.").EOL);
$submit = "";
// NOTREACHED
$header = t("Disconnect/Unfollow");
- $o = replace_macros($tpl,array(
+ $o = replace_macros($tpl,[
'$header' => htmlentities($header),
'$desc' => "",
'$pls_answer' => "",
'$request' => $request,
'$keywords' => "",
'$keywords_label' => ""
- ));
+ ]);
$a->page['aside'] = "";
Profile::load($a, "", 0, Contact::getDetailsByURL($contact["url"]));
- $o .= replace_macros(get_markup_template('section_title.tpl'), array('$title' => t('Status Messages and Posts')));
+ $o .= replace_macros(get_markup_template('section_title.tpl'), ['$title' => t('Status Messages and Posts')]);
// Show last public posts
$o .= Contact::getPostsFromUrl($contact["url"]);
$tpl = get_markup_template("vcard-widget.tpl");
- $vcard_widget = replace_macros($tpl, array(
+ $vcard_widget = replace_macros($tpl, [
'$name' => $profile['name'],
'$photo' => $profile['photo'],
'$addr' => defaults($profile, 'addr', ''),
'$account_type' => $account_type,
'$pdesc' => defaults($profile, 'pdesc', ''),
- ));
+ ]);
/*$sql_extra = permissions_sql($a->data['user']['uid']);
$tpl = get_markup_template("videos_head.tpl");
- $a->page['htmlhead'] .= replace_macros($tpl,array(
+ $a->page['htmlhead'] .= replace_macros($tpl,[
'$baseurl' => System::baseUrl(),
- ));
+ ]);
$tpl = get_markup_template("videos_end.tpl");
- $a->page['end'] .= replace_macros($tpl,array(
+ $a->page['end'] .= replace_macros($tpl,[
'$baseurl' => System::baseUrl(),
- ));
+ ]);
}
}
$drop_url = $a->query_string;
- $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
+ $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), [
'$method' => 'post',
'$message' => t('Do you really want to delete this video?'),
- '$extra_inputs' => array(
- array('name'=>'id', 'value'=> $_POST['id']),
- array('name'=>'delete', 'value'=>'x')
- ),
+ '$extra_inputs' => [
+ ['name'=>'id', 'value'=> $_POST['id']],
+ ['name'=>'delete', 'value'=>'x']
+ ],
'$confirm' => t('Delete Video'),
'$confirm_url' => $drop_url,
'$confirm_name' => 'confirm', // Needed so that confirmation will bring us back into this if statement
'$cancel' => t('Cancel'),
- ));
+ ]);
$a->error = 1; // Set $a->error so the other module functions don't execute
return;
}
- $videos = array();
+ $videos = [];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$alt_e = $rr['filename'];
$name_e = $rr['album'];
- $videos[] = array(
+ $videos[] = [
'id' => $rr['id'],
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'],
'title' => t('View Video'),
'src' => System::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0',
'alt' => $alt_e,
'mime' => $rr['filetype'],
- 'album' => array(
+ 'album' => [
'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']),
'name' => $name_e,
'alt' => t('View Album'),
- ),
+ ],
- );
+ ];
}
}
$tpl = get_markup_template('videos_recent.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => t('Recent Videos'),
'$can_post' => $can_post,
- '$upload' => array(t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'),
+ '$upload' => [t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'],
'$videos' => $videos,
'$delete_url' => (($can_post)?System::baseUrl().'/videos/'.$a->data['user']['nickname']:False)
- ));
+ ]);
$o .= paginate($a);
return $o;
}
- $contacts = array();
+ $contacts = [];
foreach ($r as $rr) {
/// @TODO This triggers an E_NOTICE if 'self' is not there
$contact_details = Contact::getDetailsByURL($rr['url'], $a->profile['uid'], $rr);
- $contacts[] = array(
+ $contacts[] = [
'id' => $rr['id'],
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $contact_details['name'], $rr['url']),
'photo_menu' => Contact::photoMenu($rr),
'sparkle' => '',
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),
'network' => ContactSelector::networkToName($rr['network'], $rr['url']),
- );
+ ];
}
$tpl = get_markup_template("viewcontact_template.tpl");
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$title' => t('Contacts'),
'$contacts' => $contacts,
'$paginate' => paginate($a),
- ));
+ ]);
return $o;
);
if (! DBM::is_result($r)) {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
} else {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
}
if(! $can_post) {
if ($r_json) {
- echo json_encode(array('error'=>t('Permission denied.')));
+ echo json_encode(['error'=>t('Permission denied.')]);
killme();
}
notice( t('Permission denied.') . EOL );
if(! x($_FILES,'userfile')) {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
}
killme();
}
if($filesize <=0) {
$msg = t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(t('Or - did you try to upload an empty file?'));
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
notice( $msg. EOL );
}
if(($maxfilesize) && ($filesize > $maxfilesize)) {
$msg = sprintf(t('File exceeds size limit of %s'), formatBytes($maxfilesize));
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
$hash = get_guid(64);
$created = datetime_convert();
- $fields = array('uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
+ $fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
- 'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => '');
+ 'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => ''];
$r = dba::insert('attach', $fields);
if(! $r) {
$msg = t('File upload failed.');
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
if (! DBM::is_result($r)) {
$msg = t('File upload failed.');
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
}
if ($r_json) {
- echo json_encode(array('ok'=>true));
+ echo json_encode(['ok'=>true]);
killme();
}
if (! DBM::is_result($r)) {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
}
} else {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
if (! $can_post) {
if ($r_json) {
- echo json_encode(array('error'=>t('Permission denied.')));
+ echo json_encode(['error'=>t('Permission denied.')]);
killme();
}
notice(t('Permission denied.') . EOL);
if (! x($_FILES, 'userfile') && ! x($_FILES, 'media')) {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
}
killme();
}
if ($src=="") {
if ($r_json) {
- echo json_encode(array('error'=>t('Invalid request.')));
+ echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
notice(t('Invalid request.').EOL);
if (($maximagesize) && ($filesize > $maximagesize)) {
$msg = sprintf(t('Image exceeds size limit of %s'), formatBytes($maximagesize));
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
if (! $Image->isValid()) {
$msg = t('Unable to process image.');
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
if (! $r) {
$msg = t('Image upload failed.');
if ($r_json) {
- echo json_encode(array('error'=>$msg));
+ echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL;
}
);
if (!$r) {
if ($r_json) {
- echo json_encode(array('error'=>''));
+ echo json_encode(['error'=>'']);
killme();
}
return false;
}
- $picture = array();
+ $picture = [];
$picture["id"] = $r[0]["id"];
$picture["size"] = $r[0]["datasize"];
$picture["preview"] = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $Image->getExt();
if ($r_json) {
- echo json_encode(array('picture'=>$picture));
+ echo json_encode(['picture'=>$picture]);
killme();
}
return $picture;
if ($r_json) {
- echo json_encode(array('ok'=>true));
+ echo json_encode(['ok'=>true]);
killme();
}
}
$tpl = get_markup_template('wallmsg-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $a->page['htmlhead'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
$tpl = get_markup_template('wallmsg-end.tpl');
- $a->page['end'] .= replace_macros($tpl, array(
+ $a->page['end'] .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(true),
'$nickname' => $user['nickname'],
'$linkurl' => t('Please enter a link URL:')
- ));
+ ]);
$tpl = get_markup_template('wallmessage.tpl');
- $o .= replace_macros($tpl,array(
+ $o .= replace_macros($tpl,[
'$header' => t('Send Private Message'),
'$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
'$to' => t('To:'),
'$upload' => t('Upload photo'),
'$insert' => t('Insert web link'),
'$wait' => t('Please wait')
- ));
+ ]);
return $o;
}
if (!local_user()) {
http_status_exit(403,
- array("title" => t("Public access denied."),
- "description" => t("Only logged in users are permitted to perform a probing.")));
+ ["title" => t("Public access denied."),
+ "description" => t("Only logged in users are permitted to perform a probing.")]);
killme();
}
header('Access-Control-Allow-Origin: *');
header("Content-type: application/json; charset=utf-8");
- $json = array('subject' => $uri,
- 'aliases' => array($alias, $profile_url),
- 'links' => array(array('rel' => NAMESPACE_DFRN, 'href' => $profile_url),
- array('rel' => NAMESPACE_FEED, 'type' => 'application/atom+xml', 'href' => System::baseUrl().'/dfrn_poll/'.$r['nickname']),
- array('rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => $profile_url),
- array('rel' => 'http://microformats.org/profile/hcard', 'type' => 'text/html', 'href' => System::baseUrl().'/hcard/'.$r['nickname']),
- array('rel' => NAMESPACE_POCO, 'href' => System::baseUrl().'/poco/'.$r['nickname']),
- array('rel' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'),
- array('rel' => 'http://joindiaspora.com/seed_location', 'type' => 'text/html', 'href' => System::baseUrl()),
- array('rel' => 'salmon', 'href' => System::baseUrl().'/salmon/'.$r['nickname']),
- array('rel' => 'http://salmon-protocol.org/ns/salmon-replies', 'href' => System::baseUrl().'/salmon/'.$r['nickname']),
- array('rel' => 'http://salmon-protocol.org/ns/salmon-mention', 'href' => System::baseUrl().'/salmon/'.$r['nickname'].'/mention'),
- array('rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => System::baseUrl().'/follow?url={uri}'),
- array('rel' => 'magic-public-key', 'href' => 'data:application/magic-public-key,'.$salmon_key)
- ));
+ $json = ['subject' => $uri,
+ 'aliases' => [$alias, $profile_url],
+ 'links' => [['rel' => NAMESPACE_DFRN, 'href' => $profile_url],
+ ['rel' => NAMESPACE_FEED, 'type' => 'application/atom+xml', 'href' => System::baseUrl().'/dfrn_poll/'.$r['nickname']],
+ ['rel' => 'http://webfinger.net/rel/profile-page', 'type' => 'text/html', 'href' => $profile_url],
+ ['rel' => 'http://microformats.org/profile/hcard', 'type' => 'text/html', 'href' => System::baseUrl().'/hcard/'.$r['nickname']],
+ ['rel' => NAMESPACE_POCO, 'href' => System::baseUrl().'/poco/'.$r['nickname']],
+ ['rel' => 'http://webfinger.net/rel/avatar', 'type' => 'image/jpeg', 'href' => System::baseUrl().'/photo/profile/'.$r['uid'].'.jpg'],
+ ['rel' => 'http://joindiaspora.com/seed_location', 'type' => 'text/html', 'href' => System::baseUrl()],
+ ['rel' => 'salmon', 'href' => System::baseUrl().'/salmon/'.$r['nickname']],
+ ['rel' => 'http://salmon-protocol.org/ns/salmon-replies', 'href' => System::baseUrl().'/salmon/'.$r['nickname']],
+ ['rel' => 'http://salmon-protocol.org/ns/salmon-mention', 'href' => System::baseUrl().'/salmon/'.$r['nickname'].'/mention'],
+ ['rel' => 'http://ostatus.org/schema/1.0/subscribe', 'template' => System::baseUrl().'/follow?url={uri}'],
+ ['rel' => 'magic-public-key', 'href' => 'data:application/magic-public-key,'.$salmon_key]
+ ]];
echo json_encode($json);
killme();
}
$tpl = get_markup_template('xrd_person.tpl');
- $o = replace_macros($tpl, array(
+ $o = replace_macros($tpl, [
'$nick' => $r['nickname'],
'$accturi' => $uri,
'$alias' => $alias,
'$salmon' => System::baseUrl() . '/salmon/' . $r['nickname'],
'$salmen' => System::baseUrl() . '/salmon/' . $r['nickname'] . '/mention',
'$subscribe' => System::baseUrl() . '/follow?url={uri}',
- '$modexp' => 'data:application/magic-public-key,' . $salmon_key)
+ '$modexp' => 'data:application/magic-public-key,' . $salmon_key]
);
- $arr = array('user' => $r, 'xml' => $o);
+ $arr = ['user' => $r, 'xml' => $o];
call_hooks('personal_xrd', $arr);
echo $arr['xml'];
public $contacts;
public $page_contact;
public $content;
- public $data = array();
+ public $data = [];
public $error = false;
public $cmd;
public $argv;
public $timezone;
public $interactive = true;
public $plugins;
- public $plugins_admin = array();
- public $apps = array();
+ public $plugins_admin = [];
+ public $apps = [];
public $identities;
public $is_mobile = false;
public $is_tablet = false;
public $is_friendica_app;
- public $performance = array();
- public $callstack = array();
- public $theme_info = array();
+ public $performance = [];
+ public $callstack = [];
+ public $theme_info = [];
public $backend = true;
public $nav_sel;
public $category;
* Mostly unimplemented yet. Only options 'template_engine' and
* beyond are used.
*/
- public $theme = array(
+ public $theme = [
'sourcename' => '',
'videowidth' => 425,
'videoheight' => 350,
'force_max_items' => 0,
'stylesheet' => '',
'template_engine' => 'smarty3',
- );
+ ];
/**
* @brief An array of registered template engines ('name'=>'class name')
*/
- public $template_engines = array();
+ public $template_engines = [];
/**
* @brief An array of instanced template engines ('name'=>'instance')
*/
- public $template_engine_instance = array();
+ public $template_engine_instance = [];
public $process_id;
public $queue;
- private $ldelim = array(
+ private $ldelim = [
'internal' => '',
'smarty3' => '{{'
- );
- private $rdelim = array(
+ ];
+ private $rdelim = [
'internal' => '',
'smarty3' => '}}'
- );
+ ];
private $scheme;
private $hostname;
private $db;
$this->performance['marktime'] = 0;
$this->performance['markstart'] = microtime(true);
- $this->callstack['database'] = array();
- $this->callstack['database_write'] = array();
- $this->callstack['network'] = array();
- $this->callstack['file'] = array();
- $this->callstack['rendering'] = array();
- $this->callstack['parser'] = array();
+ $this->callstack['database'] = [];
+ $this->callstack['database_write'] = [];
+ $this->callstack['network'] = [];
+ $this->callstack['file'] = [];
+ $this->callstack['rendering'] = [];
+ $this->callstack['parser'] = [];
- $this->config = array();
- $this->page = array();
- $this->pager = array();
+ $this->config = [];
+ $this->page = [];
+ $this->pager = [];
$this->query_string = '';
$this->module = str_replace('-', '_', $this->module);
} else {
$this->argc = 1;
- $this->argv = array('home');
+ $this->argv = ['home'];
$this->module = 'home';
}
$invinite_scroll = infinite_scroll_data($this->module);
$tpl = get_markup_template('head.tpl');
- $this->page['htmlhead'] = replace_macros($tpl, array(
+ $this->page['htmlhead'] = replace_macros($tpl, [
'$baseurl' => $this->get_baseurl(),
'$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$touch_icon' => $touch_icon,
'$stylesheet' => $stylesheet,
'$infinite_scroll' => $invinite_scroll,
- )) . $this->page['htmlhead'];
+ ]) . $this->page['htmlhead'];
}
function init_page_end() {
$this->page['end'] = '';
}
$tpl = get_markup_template('end.tpl');
- $this->page['end'] = replace_macros($tpl, array(
+ $this->page['end'] = replace_macros($tpl, [
'$baseurl' => $this->get_baseurl()
- )) . $this->page['end'];
+ ]) . $this->page['end'];
}
function set_curl_code($code) {
$r = q('SELECT `pid` FROM `process` WHERE `pid` = %d', intval(getmypid()));
if (!DBM::is_result($r)) {
- dba::insert('process', array('pid' => getmypid(), 'command' => $command, 'created' => datetime_convert()));
+ dba::insert('process', ['pid' => getmypid(), 'command' => $command, 'created' => datetime_convert()]);
}
dba::commit();
}
if (DBM::is_result($r)) {
foreach ($r AS $process) {
if (!posix_kill($process['pid'], 0)) {
- dba::delete('process', array('pid' => $process['pid']));
+ dba::delete('process', ['pid' => $process['pid']]);
}
}
}
* @brief Remove the active process from the "process" table
*/
function end_process() {
- dba::delete('process', array('pid' => getmypid()));
+ dba::delete('process', ['pid' => getmypid()]);
}
function get_useragent() {
* @return bool Is it a known backend?
*/
function is_backend() {
- static $backends = array();
+ static $backends = [];
$backends[] = '_well_known';
$backends[] = 'api';
$backends[] = 'dfrn_notify';
$memdata = explode("\n", file_get_contents('/proc/meminfo'));
- $meminfo = array();
+ $meminfo = [];
foreach ($memdata as $line) {
list($key, $val) = explode(':', $line);
$meminfo[$key] = (int) trim(str_replace('kB', '', $val));
}
if (Config::get('system', 'proc_windows')) {
- $resource = proc_open('cmd /c start /b ' . $cmdline, array(), $foo, $this->get_basepath());
+ $resource = proc_open('cmd /c start /b ' . $cmdline, [], $foo, $this->get_basepath());
} else {
- $resource = proc_open($cmdline . ' &', array(), $foo, $this->get_basepath());
+ $resource = proc_open($cmdline . ' &', [], $foo, $this->get_basepath());
}
if (!is_resource($resource)) {
logger('We got no resource for command ' . $cmdline, LOGGER_DEBUG);
$o = '';
$o .= "<select id=\"contact-poll-interval\" name=\"poll\" $dis />" . "\r\n";
- $rep = array(
+ $rep = [
0 => t('Frequently'),
1 => t('Hourly'),
2 => t('Twice daily'),
3 => t('Daily'),
4 => t('Weekly'),
5 => t('Monthly')
- );
+ ];
foreach ($rep as $k => $v) {
$selected = (($k == $current) ? " selected=\"selected\" " : "");
*/
public static function networkToName($s, $profile = "")
{
- $nets = array(
+ $nets = [
NETWORK_DFRN => t('Friendica'),
NETWORK_OSTATUS => t('OStatus'),
NETWORK_FEED => t('RSS/Atom'),
NETWORK_STATUSNET => t('GNU Social Connector'),
NETWORK_PNUT => t('pnut'),
NETWORK_APPNET => t('App.net')
- );
+ ];
call_hooks('network_to_name', $nets);
$networkname = str_replace($search, $replace, $s);
- if ((in_array($s, array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) && ($profile != "")) {
+ if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
$r = dba::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
$x = self::getDefault($feature);
}
- $arr = array('uid' => $uid, 'feature' => $feature, 'enabled' => $x);
+ $arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x];
call_hooks('isEnabled', $arr);
return($arr['enabled']);
}
*/
public static function get($filtered = true)
{
- $arr = array(
+ $arr = [
// General
- 'general' => array(
+ 'general' => [
t('General Features'),
//array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
- array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)),
- array('photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)),
- array('export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)),
- ),
+ ['multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles'), false, Config::get('feature_lock', 'multi_profiles', false)],
+ ['photo_location', t('Photo Location'), t('Photo metadata is normally stripped. This extracts the location (if present) prior to stripping metadata and links it to a map.'), false, Config::get('feature_lock', 'photo_location', false)],
+ ['export_calendar', t('Export Public Calendar'), t('Ability for visitors to download the public calendar'), false, Config::get('feature_lock', 'export_calendar', false)],
+ ],
// Post composition
- 'composition' => array(
+ 'composition' => [
t('Post Composition Features'),
- array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)),
- array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)),
- ),
+ ['preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them'), false, Config::get('feature_lock', 'preview', false)],
+ ['aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a forum page is selected/deselected in ACL window.'), false, Config::get('feature_lock', 'aclautomention', false)],
+ ],
// Network sidebar widgets
- 'widgets' => array(
+ 'widgets' => [
t('Network Sidebar Widgets'),
- array('archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)),
- array('forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)),
- array('groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)),
- array('networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)),
- array('savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)),
- ),
+ ['archives', t('Search by Date'), t('Ability to select posts by date ranges'), false, Config::get('feature_lock', 'archives', false)],
+ ['forumlist_widget', t('List Forums'), t('Enable widget to display the forums your are connected with'), true, Config::get('feature_lock', 'forumlist_widget', false)],
+ ['groups', t('Group Filter'), t('Enable widget to display Network posts only from selected group'), false, Config::get('feature_lock', 'groups', false)],
+ ['networks', t('Network Filter'), t('Enable widget to display Network posts only from selected network'), false, Config::get('feature_lock', 'networks', false)],
+ ['savedsearch', t('Saved Searches'), t('Save search terms for re-use'), false, Config::get('feature_lock', 'savedsearch', false)],
+ ],
// Network tabs
- 'net_tabs' => array(
+ 'net_tabs' => [
t('Network Tabs'),
- array('personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)),
- array('new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)),
- array('link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)),
- ),
+ ['personal_tab', t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, Config::get('feature_lock', 'personal_tab', false)],
+ ['new_tab', t('Network New Tab'), t('Enable tab to display only new Network posts (from the last 12 hours)'), false, Config::get('feature_lock', 'new_tab', false)],
+ ['link_tab', t('Network Shared Links Tab'), t('Enable tab to display only Network posts with links in them'), false, Config::get('feature_lock', 'link_tab', false)],
+ ],
// Item tools
- 'tools' => array(
+ 'tools' => [
t('Post/Comment Tools'),
- array('multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)),
- array('edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)),
- array('commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)),
- array('categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)),
- array('filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)),
- array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)),
- array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)),
- array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)),
- ),
+ ['multi_delete', t('Multiple Deletion'), t('Select and delete multiple posts/comments at once'), false, Config::get('feature_lock', 'multi_delete', false)],
+ ['edit_posts', t('Edit Sent Posts'), t('Edit and correct posts and comments after sending'), false, Config::get('feature_lock', 'edit_posts', false)],
+ ['commtag', t('Tagging'), t('Ability to tag existing posts'), false, Config::get('feature_lock', 'commtag', false)],
+ ['categories', t('Post Categories'), t('Add categories to your posts'), false, Config::get('feature_lock', 'categories', false)],
+ ['filing', t('Saved Folders'), t('Ability to file posts under folders'), false, Config::get('feature_lock', 'filing', false)],
+ ['dislike', t('Dislike Posts'), t('Ability to dislike posts/comments'), false, Config::get('feature_lock', 'dislike', false)],
+ ['star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator'), false, Config::get('feature_lock', 'star_posts', false)],
+ ['ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread'), false, Config::get('feature_lock', 'ignore_posts', false)],
+ ],
// Advanced Profile Settings
- 'advanced_profile' => array(
+ 'advanced_profile' => [
t('Advanced Profile Settings'),
- array('forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)),
- array('tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)),
- ),
- );
+ ['forumlist_profile', t('List Forums'), t('Show visitors public community forums at the Advanced Profile Page'), false, Config::get('feature_lock', 'forumlist_profile', false)],
+ ['tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your profile page'), false, Config::get('feature_lock', 'tagadelic', false)],
+ ],
+ ];
// removed any locked features and remove the entire category if this makes it empty
*/
public static function getList($uid, $lastitem, $showhidden = true, $showprivate = false)
{
- $forumlist = array();
+ $forumlist = [];
$order = (($showhidden) ? '' : ' AND NOT `hidden` ');
$order .= (($lastitem) ? ' ORDER BY `last-item` DESC ' : ' ORDER BY `name` ASC ');
}
while ($contact = dba::fetch($contacts)) {
- $forumlist[] = array(
+ $forumlist[] = [
'url' => $contact['url'],
'name' => $contact['name'],
'id' => $contact['id'],
'micro' => $contact['micro'],
'thumb' => $contact['thumb'],
- );
+ ];
}
dba::close($contacts);
foreach ($contacts as $contact) {
$selected = (($cid == $contact['id']) ? ' forum-selected' : '');
- $entry = array(
+ $entry = [
'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'],
'selected' => $selected,
'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$o .= replace_macros(
$tpl,
- array(
+ [
'$title' => t('Forums'),
'$forums' => $entries,
'$link_desc' => t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
- '$showmore' => t('show more'))
+ '$showmore' => t('show more')]
);
}
// These media files should now be caught in bbcode.php
// left here as a fallback in case this is called from another source
- $noexts = array("mp3", "mp4", "ogg", "ogv", "oga", "ogm", "webm");
+ $noexts = ["mp3", "mp4", "ogg", "ogv", "oga", "ogm", "webm"];
$ext = pathinfo(strtolower($embedurl), PATHINFO_EXTENSION);
// Always embed the SSL version
if (isset($j->html)) {
- $j->html = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"), array("https://www.youtube.com/", "https://player.vimeo.com/"), $j->html);
+ $j->html = str_replace(["http://www.youtube.com/", "http://player.vimeo.com/"], ["https://www.youtube.com/", "https://player.vimeo.com/"], $j->html);
}
$j->embedurl = $embedurl;
$th = 120;
$tw = $th * $tr;
$tpl = get_markup_template('oembed_video.tpl');
- $ret .= replace_macros($tpl, array(
+ $ret .= replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$embedurl' => $embedurl,
'$escapedhtml' => base64_encode($jhtml),
'$tw' => $tw,
'$th' => $th,
'$turl' => $j->thumbnail_url,
- ));
+ ]);
} else {
$ret = $jhtml;
}
public static function getHTML($url, $title = null)
{
// Always embed the SSL version
- $url = str_replace(array("http://www.youtube.com/", "http://player.vimeo.com/"),
- array("https://www.youtube.com/", "https://player.vimeo.com/"), $url);
+ $url = str_replace(["http://www.youtube.com/", "http://player.vimeo.com/"],
+ ["https://www.youtube.com/", "https://player.vimeo.com/"], $url);
$o = self::fetchURL($url, !self::isAllowedURL($url));
*/
public static function getList()
{
- $texts = array(
+ $texts = [
'<3',
'</3',
'<\\3',
'red#',
'red#matrix'
- );
+ ];
- $icons = array(
+ $icons = [
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-heart.gif" alt="<3" title="<3" />',
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="</3" title="</3" />',
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="<\\3" title="<\\3" />',
'<a href="https://friendi.ca">~friendica <img class="smiley" src="' . System::baseUrl() . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . System::baseUrl() . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . System::baseUrl() . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
- );
+ ];
- $params = array('texts' => $texts, 'icons' => $icons);
+ $params = ['texts' => $texts, 'icons' => $icons];
call_hooks('smilie', $params);
return $params;
$params = self::getList();
if ($no_images) {
- $cleaned = array('texts' => array(), 'icons' => array());
+ $cleaned = ['texts' => [], 'icons' => []];
$icons = $params['icons'];
foreach ($icons as $key => $icon) {
if (!strstr($icon, '<img ')) {
$memcache->set(get_app()->get_hostname().":".$key, serialize($value), MEMCACHE_COMPRESSED, self::duration($duration));
return;
}
- $fields = array('v' => serialize($value), 'expire_mode' => $duration, 'updated' => datetime_convert());
- $condition = array('k' => $key);
+ $fields = ['v' => serialize($value), 'expire_mode' => $duration, 'updated' => datetime_convert()];
+ $condition = ['k' => $key];
dba::update('cache', $fields, $condition, true);
}
// Clear long lasting cache entries only once a day
if (Config::get("system", "cache_cleared_day") < time() - self::duration(CACHE_DAY)) {
if ($max_level == CACHE_MONTH) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 30 days"),
- CACHE_MONTH);
+ CACHE_MONTH];
dba::delete('cache', $condition);
}
if ($max_level <= CACHE_WEEK) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 7 days"),
- CACHE_WEEK);
+ CACHE_WEEK];
dba::delete('cache', $condition);
}
if ($max_level <= CACHE_DAY) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 1 days"),
- CACHE_DAY);
+ CACHE_DAY];
dba::delete('cache', $condition);
}
Config::set("system", "cache_cleared_day", time());
}
if (($max_level <= CACHE_HOUR) && (Config::get("system", "cache_cleared_hour")) < time() - self::duration(CACHE_HOUR)) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 1 hours"),
- CACHE_HOUR);
+ CACHE_HOUR];
dba::delete('cache', $condition);
Config::set("system", "cache_cleared_hour", time());
}
if (($max_level <= CACHE_HALF_HOUR) && (Config::get("system", "cache_cleared_half_hour")) < time() - self::duration(CACHE_HALF_HOUR)) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 30 minutes"),
- CACHE_HALF_HOUR);
+ CACHE_HALF_HOUR];
dba::delete('cache', $condition);
Config::set("system", "cache_cleared_half_hour", time());
}
if (($max_level <= CACHE_QUARTER_HOUR) && (Config::get("system", "cache_cleared_quarter_hour")) < time() - self::duration(CACHE_QUARTER_HOUR)) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 15 minutes"),
- CACHE_QUARTER_HOUR);
+ CACHE_QUARTER_HOUR];
dba::delete('cache', $condition);
Config::set("system", "cache_cleared_quarter_hour", time());
}
if (($max_level <= CACHE_FIVE_MINUTES) && (Config::get("system", "cache_cleared_five_minute")) < time() - self::duration(CACHE_FIVE_MINUTES)) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 5 minutes"),
- CACHE_FIVE_MINUTES);
+ CACHE_FIVE_MINUTES];
dba::delete('cache', $condition);
Config::set("system", "cache_cleared_five_minute", time());
}
if (($max_level <= CACHE_MINUTE) && (Config::get("system", "cache_cleared_minute")) < time() - self::duration(CACHE_MINUTE)) {
- $condition = array("`updated` < ? AND `expire_mode` = ?",
+ $condition = ["`updated` < ? AND `expire_mode` = ?",
datetime_convert('UTC', 'UTC', "now - 1 minutes"),
- CACHE_MINUTE);
+ CACHE_MINUTE];
dba::delete('cache', $condition);
Config::set("system", "cache_cleared_minute", time());
$a = get_app();
- $r = dba::select('config', array('v', 'k'), array('cat' => $family));
+ $r = dba::select('config', ['v', 'k'], ['cat' => $family]);
while ($rr = dba::fetch($r)) {
$k = $rr['k'];
if ($family === 'config') {
// manage array value
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
- $ret = dba::update('config', array('v' => $dbvalue), array('cat' => $family, 'k' => $key), true);
+ $ret = dba::update('config', ['v' => $dbvalue], ['cat' => $family, 'k' => $key], true);
if ($ret) {
self::$in_db[$family][$key] = true;
unset(self::$in_db[$family][$key]);
}
- $ret = dba::delete('config', array('cat' => $family, 'k' => $key));
+ $ret = dba::delete('config', ['cat' => $family, 'k' => $key]);
return $ret;
}
*/
private function _set_extra($notes)
{
- $rets = array();
+ $rets = [];
foreach ($notes as $n) {
$local_time = datetime_convert('UTC', date_default_timezone_get(), $n['date']);
$n['timestamp'] = strtotime($local_time);
*
* @return array of results or false on errors
*/
- public function getAll($filter = array(), $order = "-date", $limit = "")
+ public function getAll($filter = [], $order = "-date", $limit = "")
{
- $filter_str = array();
+ $filter_str = [];
$filter_sql = "";
foreach ($filter as $column => $value) {
$filter_str[] = sprintf("`%s` = '%s'", $column, dbesc($value));
}
$aOrder = explode(" ", $order);
- $asOrder = array();
+ $asOrder = [];
foreach ($aOrder as $o) {
$dir = "asc";
if ($o[0] === "-") {
*/
public function getTabs()
{
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('System'),
'url' => 'notifications/system',
'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''),
'id' => 'system-tab',
'accesskey' => 'y',
- ),
- array(
+ ],
+ [
'label' => t('Network'),
'url' => 'notifications/network',
'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''),
'id' => 'network-tab',
'accesskey' => 'w',
- ),
- array(
+ ],
+ [
'label' => t('Personal'),
'url' => 'notifications/personal',
'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''),
'id' => 'personal-tab',
'accesskey' => 'r',
- ),
- array(
+ ],
+ [
'label' => t('Home'),
'url' => 'notifications/home',
'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''),
'id' => 'home-tab',
'accesskey' => 'h',
- ),
- array(
+ ],
+ [
'label' => t('Introductions'),
'url' => 'notifications/intros',
'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''),
'id' => 'intro-tab',
'accesskey' => 'i',
- ),
- );
+ ],
+ ];
return $tabs;
}
*/
private function formatNotifs($notifs, $ident = "")
{
- $notif = array();
- $arr = array();
+ $notif = [];
+ $arr = [];
if (DBM::is_result($notifs)) {
foreach ($notifs as $it) {
// Transform the different types of notification in an usable array
switch ($it['verb']) {
case ACTIVITY_LIKE:
- $notif = array(
+ $notif = [
'label' => 'like',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
case ACTIVITY_DISLIKE:
- $notif = array(
+ $notif = [
'label' => 'dislike',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
case ACTIVITY_ATTEND:
- $notif = array(
+ $notif = [
'label' => 'attend',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
case ACTIVITY_ATTENDNO:
- $notif = array(
+ $notif = [
'label' => 'attendno',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
case ACTIVITY_ATTENDMAYBE:
- $notif = array(
+ $notif = [
'label' => 'attendmaybe',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
case ACTIVITY_FRIEND:
$obj = parse_xml_string($xmlhead . $it['object']);
$it['fname'] = $obj->title;
- $notif = array(
+ $notif = [
'label' => 'friend',
'link' => System::baseUrl(true) . '/display/' . $it['pguid'],
'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
break;
default:
- $notif = array(
+ $notif = [
'label' => $default_item_label,
'link' => $default_item_link,
'image' => $default_item_image,
'when' => $default_item_when,
'ago' => $default_item_ago,
'seen' => $it['seen']
- );
+ ];
}
$arr[] = $notif;
{
$ident = 'network';
$total = $this->networkTotal($seen);
- $notifs = array();
+ $notifs = [];
$sql_seen = "";
if ($seen === 0) {
{
$ident = 'system';
$total = $this->systemTotal($seen);
- $notifs = array();
+ $notifs = [];
$sql_seen = "";
if ($seen === 0) {
{
$myurl = System::baseUrl(true) . '/profile/' . self::getApp()->user['nickname'];
$myurl = substr($myurl, strpos($myurl, '://') + 3);
- $myurl = str_replace(array('www.', '.'), array('', '\\.'), $myurl);
+ $myurl = str_replace(['www.', '.'], ['', '\\.'], $myurl);
$diasp_url = str_replace('/profile/', '/u/', $myurl);
$sql_extra = sprintf(
" AND ( `item`.`author-link` regexp '%s' OR `item`.`tag` regexp '%s' OR `item`.`tag` regexp '%s' ) ",
$ident = 'personal';
$total = $this->personalTotal($seen);
$sql_extra = $this->personalSqlExtra();
- $notifs = array();
+ $notifs = [];
$sql_seen = "";
if ($seen === 0) {
$notifs = $this->formatNotifs($r, $ident);
}
- $arr = array(
+ $arr = [
'notifications' => $notifs,
'ident' => $ident,
'total' => $total,
- );
+ ];
return $arr;
}
{
$ident = 'home';
$total = $this->homeTotal($seen);
- $notifs = array();
+ $notifs = [];
$sql_seen = "";
if ($seen === 0) {
{
$ident = 'introductions';
$total = $this->introTotal($all);
- $notifs = array();
+ $notifs = [];
$sql_extra = "";
if (!$all) {
if ($it['fid']) {
$return_addr = bin2hex(self::getApp()->user['nickname'] . '@' . self::getApp()->get_hostname() . ((self::getApp()->path) ? '/' . self::getApp()->path : ''));
- $intro = array(
+ $intro = [
'label' => 'friend_suggestion',
'notify_type' => t('Friend Suggestion'),
'intro_id' => $it['intro_id'],
'knowyou' => $knowyou,
'note' => $it['note'],
'request' => $it['frequest'] . '?addr=' . $return_addr,
- );
+ ];
// Normal connection requests
} else {
$it['gabout'] = "";
$it['ggender'] = "";
}
- $intro = array(
+ $intro = [
'label' => (($it['network'] !== NETWORK_OSTATUS) ? 'friend_request' : 'follower'),
'notify_type' => (($it['network'] !== NETWORK_OSTATUS) ? t('Friend/Connect Request') : t('New Follower')),
'dfrn_id' => $it['issued-id'],
'network' => $it['gnetwork'],
'knowyou' => $it['knowyou'],
'note' => $it['note'],
- );
+ ];
}
$arr[] = $intro;
{
$a = get_app();
- $r = dba::select('pconfig', array('v', 'k'), array('cat' => $family, 'uid' => $uid));
+ $r = dba::select('pconfig', ['v', 'k'], ['cat' => $family, 'uid' => $uid]);
if (DBM::is_result($r)) {
while ($rr = dba::fetch($r)) {
$k = $rr['k'];
// manage array value
$dbvalue = (is_array($value) ? serialize($value) : $dbvalue);
- $ret = dba::update('pconfig', array('v' => $dbvalue), array('uid' => $uid, 'cat' => $family, 'k' => $key), true);
+ $ret = dba::update('pconfig', ['v' => $dbvalue], ['uid' => $uid, 'cat' => $family, 'k' => $key], true);
if ($ret) {
self::$in_db[$uid][$family][$key] = true;
unset(self::$in_db[$uid][$family][$key]);
}
- $ret = dba::delete('pconfig', array('uid' => $uid, 'cat' => $family, 'k' => $key));
+ $ret = dba::delete('pconfig', ['uid' => $uid, 'cat' => $family, 'k' => $key]);
return $ret;
}
array_shift($trace);
array_shift($trace);
- $callstack = array();
+ $callstack = [];
$counter = 0;
- $previous = array('class' => '', 'function' => '');
+ $previous = ['class' => '', 'function' => ''];
// The ignore list contains all functions that are only wrapper functions
- $ignore = array('get_config', 'get_pconfig', 'set_config', 'set_pconfig', 'fetch_url', 'probe_url');
+ $ignore = ['get_config', 'get_pconfig', 'set_config', 'set_pconfig', 'fetch_url', 'probe_url'];
while ($func = array_pop($trace)) {
if (!empty($func['class'])) {
}
}
- $callstack2 = array();
+ $callstack2 = [];
while ((count($callstack2) < $depth) && (count($callstack) > 0)) {
$callstack2[] = array_pop($callstack);
}
if (self::IMPORT_DEBUG) {
return 1;
}
-
+
return dba::lastInsertId();
}
$query = sprintf("SHOW COLUMNS IN `%s`", dbesc($table));
logger("uimport: $query", LOGGER_DEBUG);
$r = q($query);
- $tcols = array();
+ $tcols = [];
// get a plain array of column names
foreach ($r as $tcol) {
$tcols[] = $tcol['Field'];
unset($account['user']['expire_notification_sent']);
$callback = function (&$value) use ($oldbaseurl, $oldaddr, $newbaseurl, $newaddr) {
- $value = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $value);
+ $value = str_replace([$oldbaseurl, $oldaddr], [$newbaseurl, $newaddr], $value);
};
array_walk($account['user'], $callback);
foreach ($account['profile'] as &$profile) {
foreach ($profile as $k => &$v) {
- $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
- foreach (array("profile", "avatar") as $k) {
+ $v = str_replace([$oldbaseurl, $oldaddr], [$newbaseurl, $newaddr], $v);
+ foreach (["profile", "avatar"] as $k) {
$v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);
}
}
if ($r === false) {
logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . dba::errorMessage(), LOGGER_NORMAL);
info(t("User profile creation error"));
- dba::delete('user', array('uid' => $newuid));
+ dba::delete('user', ['uid' => $newuid]);
return;
}
}
foreach ($account['contact'] as &$contact) {
if ($contact['uid'] == $olduid && $contact['self'] == '1') {
foreach ($contact as $k => &$v) {
- $v = str_replace(array($oldbaseurl, $oldaddr), array($newbaseurl, $newaddr), $v);
- foreach (array("profile", "avatar", "micro") as $k) {
+ $v = str_replace([$oldbaseurl, $oldaddr], [$newbaseurl, $newaddr], $v);
+ foreach (["profile", "avatar", "micro"] as $k) {
$v = str_replace($oldbaseurl . "/photo/" . $k . "/" . $olduid . ".jpg", $newbaseurl . "/photo/" . $k . "/" . $newuid . ".jpg", $v);
}
}
*/
private static function highestPriority()
{
- $condition = array("`executed` <= ? AND NOT `done`", NULL_DATE);
+ $condition = ["`executed` <= ? AND NOT `done`", NULL_DATE];
$workerqueue = dba::selectFirst('workerqueue', ['priority'], $condition, ['order' => ['priority']]);
if (DBM::is_result($workerqueue)) {
return $workerqueue["priority"];
*/
private static function processWithPriorityActive($priority)
{
- $condition = array("`priority` <= ? AND `executed` > ? AND NOT `done`", $priority, NULL_DATE);
+ $condition = ["`priority` <= ? AND `executed` > ? AND NOT `done`", $priority, NULL_DATE];
return dba::exists('workerqueue', $condition);
}
if ($age > 1) {
$stamp = (float)microtime(true);
- dba::update('workerqueue', array('executed' => datetime_convert()), array('pid' => $mypid, 'done' => false));
+ dba::update('workerqueue', ['executed' => datetime_convert()], ['pid' => $mypid, 'done' => false]);
self::$db_duration += (microtime(true) - $stamp);
}
self::execFunction($queue, $include, $argv, true);
$stamp = (float)microtime(true);
- if (dba::update('workerqueue', array('done' => true), array('id' => $queue["id"]))) {
+ if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
Config::set('system', 'last_poller_execution', datetime_convert());
}
self::$db_duration = (microtime(true) - $stamp);
if (!validate_include($include)) {
logger("Include file ".$argv[0]." is not valid!");
- dba::delete('workerqueue', array('id' => $queue["id"]));
+ dba::delete('workerqueue', ['id' => $queue["id"]]);
return true;
}
if ($age > 1) {
$stamp = (float)microtime(true);
- dba::update('workerqueue', array('executed' => datetime_convert()), array('pid' => $mypid, 'done' => false));
+ dba::update('workerqueue', ['executed' => datetime_convert()], ['pid' => $mypid, 'done' => false]);
self::$db_duration += (microtime(true) - $stamp);
}
self::execFunction($queue, $funcname, $argv, false);
$stamp = (float)microtime(true);
- if (dba::update('workerqueue', array('done' => true), array('id' => $queue["id"]))) {
+ if (dba::update('workerqueue', ['done' => true], ['id' => $queue["id"]])) {
Config::set('system', 'last_poller_execution', datetime_convert());
}
self::$db_duration = (microtime(true) - $stamp);
} else {
logger("Function ".$funcname." does not exist");
- dba::delete('workerqueue', array('id' => $queue["id"]));
+ dba::delete('workerqueue', ['id' => $queue["id"]]);
}
return true;
$a->performance["parser"] = 0;
$a->performance["marktime"] = 0;
$a->performance["markstart"] = microtime(true);
- $a->callstack = array();
+ $a->callstack = [];
}
// For better logging create a new process id for every worker call
{
$entries = dba::select(
'workerqueue',
- array('id', 'pid', 'executed', 'priority', 'parameter'),
- array('`executed` > ? AND NOT `done` AND `pid` != 0', NULL_DATE),
- array('order' => array('priority', 'created'))
+ ['id', 'pid', 'executed', 'priority', 'parameter'],
+ ['`executed` > ? AND NOT `done` AND `pid` != 0', NULL_DATE],
+ ['order' => ['priority', 'created']]
);
while ($entry = dba::fetch($entries)) {
if (!posix_kill($entry["pid"], 0)) {
dba::update(
'workerqueue',
- array('executed' => NULL_DATE, 'pid' => 0),
- array('id' => $entry["id"])
+ ['executed' => NULL_DATE, 'pid' => 0],
+ ['id' => $entry["id"]]
);
} else {
// Kill long running processes
// Check if the priority is in a valid range
- if (!in_array($entry["priority"], array(PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE))) {
+ if (!in_array($entry["priority"], [PRIORITY_CRITICAL, PRIORITY_HIGH, PRIORITY_MEDIUM, PRIORITY_LOW, PRIORITY_NEGLIGIBLE])) {
$entry["priority"] = PRIORITY_MEDIUM;
}
// Define the maximum durations
- $max_duration_defaults = array(PRIORITY_CRITICAL => 720, PRIORITY_HIGH => 10, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180, PRIORITY_NEGLIGIBLE => 720);
+ $max_duration_defaults = [PRIORITY_CRITICAL => 720, PRIORITY_HIGH => 10, PRIORITY_MEDIUM => 60, PRIORITY_LOW => 180, PRIORITY_NEGLIGIBLE => 720];
$max_duration = $max_duration_defaults[$entry["priority"]];
$argv = json_decode($entry["parameter"]);
}
dba::update(
'workerqueue',
- array('executed' => NULL_DATE, 'created' => datetime_convert(), 'priority' => $new_priority, 'pid' => 0),
- array('id' => $entry["id"])
+ ['executed' => NULL_DATE, 'created' => datetime_convert(), 'priority' => $new_priority, 'pid' => 0],
+ ['id' => $entry["id"]]
);
} else {
logger("Worker process ".$entry["pid"]." (".implode(" ", $argv).") now runs for ".round($duration)." of ".$max_duration." allowed minutes. That's okay.", LOGGER_DEBUG);
if (Config::get('system', 'worker_debug')) {
// Create a list of queue entries grouped by their priority
- $listitem = array();
+ $listitem = [];
// Adding all processes with no workerqueue entry
$processes = dba::p(
}
dba::close($entries);
- $intervals = array(1, 10, 60);
- $jobs_per_minute = array();
+ $intervals = [1, 10, 60];
+ $jobs_per_minute = [];
foreach ($intervals as $interval) {
$jobs = dba::p("SELECT COUNT(*) AS `jobs` FROM `workerqueue` WHERE `done` AND `executed` > UTC_TIMESTAMP() - INTERVAL ".intval($interval)." MINUTE");
if ($job = dba::fetch($jobs)) {
if (!DBM::is_result($r)) {
return false;
}
- $priorities = array();
+ $priorities = [];
while ($line = dba::fetch($r)) {
$priorities[] = $line["priority"];
}
if ($found) {
$condition = "`id` IN (".substr(str_repeat("?, ", count($ids)), 0, -2).") AND `pid` = 0 AND NOT `done`";
array_unshift($ids, $condition);
- dba::update('workerqueue', array('executed' => datetime_convert(), 'pid' => $mypid), $ids);
+ dba::update('workerqueue', ['executed' => datetime_convert(), 'pid' => $mypid], $ids);
}
return $found;
$stamp = (float)microtime(true);
// There can already be jobs for us in the queue.
- $r = dba::select('workerqueue', array(), array('pid' => getmypid(), 'done' => false));
+ $r = dba::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]);
if (DBM::is_result($r)) {
self::$db_duration += (microtime(true) - $stamp);
return dba::inArray($r);
Lock::remove('poller_worker_process');
if ($found) {
- $r = dba::select('workerqueue', array(), array('pid' => getmypid(), 'done' => false));
+ $r = dba::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]);
return dba::inArray($r);
}
return false;
{
$mypid = getmypid();
- dba::update('workerqueue', array('executed' => NULL_DATE, 'pid' => 0), array('pid' => $mypid, 'done' => false));
+ dba::update('workerqueue', ['executed' => NULL_DATE, 'pid' => 0], ['pid' => $mypid, 'done' => false]);
}
/**
$timeout = Config::get("system", "frontend_worker_timeout", 10);
/// @todo We should clean up the corresponding workerqueue entries as well
- $condition = array("`created` < ? AND `command` = 'worker.php'",
- datetime_convert('UTC', 'UTC', "now - ".$timeout." minutes"));
+ $condition = ["`created` < ? AND `command` = 'worker.php'",
+ datetime_convert('UTC', 'UTC', "now - ".$timeout." minutes")];
dba::delete('process', $condition);
}
*/
public static function spawnWorker()
{
- $args = array("scripts/worker.php", "no_cron");
+ $args = ["scripts/worker.php", "no_cron"];
get_app()->proc_run($args);
}
{
$proc_args = func_get_args();
- $args = array();
+ $args = [];
if (!count($proc_args)) {
return false;
}
// Now we add the run parameters back to the array
array_unshift($args, $run_parameter);
- $arr = array('args' => $args, 'run_cmd' => true);
+ $arr = ['args' => $args, 'run_cmd' => true];
call_hooks("proc_run", $arr);
if (!$arr['run_cmd'] || !count($args)) {
array_shift($argv);
$parameters = json_encode($argv);
- $found = dba::exists('workerqueue', array('parameter' => $parameters, 'done' => false));
+ $found = dba::exists('workerqueue', ['parameter' => $parameters, 'done' => false]);
// Quit if there was a database error - a precaution for the update process to 3.5.3
if (dba::errorNo() != 0) {
}
if (!$found) {
- dba::insert('workerqueue', array('parameter' => $parameters, 'created' => $created, 'priority' => $priority));
+ dba::insert('workerqueue', ['parameter' => $parameters, 'created' => $created, 'priority' => $priority]);
}
// Should we quit and wait for the worker to be called as a cronjob?
public static function processlist()
{
$r = q("SHOW PROCESSLIST");
- $s = array();
+ $s = [];
$processes = 0;
- $states = array();
+ $states = [];
foreach ($r as $process) {
$state = trim($process["State"]);
// Filter out all non blocking processes
- if (!in_array($state, array("", "init", "statistics", "updating"))) {
+ if (!in_array($state, ["", "init", "statistics", "updating"])) {
++$states[$state];
++$processes;
}
}
$statelist .= $state.": ".$usage;
}
- return(array("list" => $statelist, "amount" => $processes));
+ return(["list" => $statelist, "amount" => $processes]);
}
/**
$preamble = sprintf($preamble, $update_id);
$body = sprintf($body, $error_message);
- notification(array(
+ notification([
'type' => SYSTEM_EMAIL,
'to_email' => $admin['email'],
'preamble' => $preamble,
'body' => $body,
- 'language' => $lang)
+ 'language' => $lang]
);
}
if (DBM::is_result($table_status)) {
$table_status = $table_status[0];
} else {
- $table_status = array();
+ $table_status = [];
}
- $fielddata = array();
- $indexdata = array();
+ $fielddata = [];
+ $indexdata = [];
if (DBM::is_result($indexes)) {
foreach ($indexes AS $index) {
if ($index['Key_name'] != 'PRIMARY' && $index['Non_unique'] == '0' && !isset($indexdata[$index["Key_name"]])) {
- $indexdata[$index["Key_name"]] = array('UNIQUE');
+ $indexdata[$index["Key_name"]] = ['UNIQUE'];
}
$column = $index["Column_name"];
}
}
- return array("fields" => $fielddata, "indexes" => $indexdata, "table_status" => $table_status);
+ return ["fields" => $fielddata, "indexes" => $indexdata, "table_status" => $table_status];
}
public static function printStructure() {
logger('updating structure', LOGGER_DEBUG);
// Get the current structure
- $database = array();
+ $database = [];
if (is_null($tables)) {
$tables = q("SHOW TABLES");
private static function createTable($name, $fields, $verbose, $action, $indexes=null) {
$r = true;
- $sql_rows = array();
- $primary_keys = array();
+ $sql_rows = [];
+ $primary_keys = [];
foreach ($fields AS $fieldname => $field) {
$sql_rows[] = "`".dbesc($fieldname)."` ".self::FieldCommand($field);
if (x($field,'primary') && $field['primary']!='') {
}
public static function definition() {
- $database = array();
+ $database = [];
- $database["addon"] = array(
+ $database["addon"] = [
"comment" => "registered plugins",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "name" => array("type" => "varchar(190)", "not null" => "1", "default" => "", "comment" => ""),
- "version" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "installed" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "hidden" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "timestamp" => array("type" => "bigint", "not null" => "1", "default" => "0", "comment" => ""),
- "plugin_admin" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "name" => array("UNIQUE", "name"),
- )
- );
- $database["attach"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "name" => ["type" => "varchar(190)", "not null" => "1", "default" => "", "comment" => ""],
+ "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "timestamp" => ["type" => "bigint", "not null" => "1", "default" => "0", "comment" => ""],
+ "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "name" => ["UNIQUE", "name"],
+ ]
+ ];
+ $database["attach"] = [
"comment" => "file attachments",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""),
- "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "filetype" => array("type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""),
- "filesize" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "data" => array("type" => "longblob", "not null" => "1", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "allow_cid" => array("type" => "mediumtext", "comment" => ""),
- "allow_gid" => array("type" => "mediumtext", "comment" => ""),
- "deny_cid" => array("type" => "mediumtext", "comment" => ""),
- "deny_gid" => array("type" => "mediumtext", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["auth_codes"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
+ "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
+ "filesize" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "data" => ["type" => "longblob", "not null" => "1", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "allow_cid" => ["type" => "mediumtext", "comment" => ""],
+ "allow_gid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_cid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["auth_codes"] = [
"comment" => "OAuth usage",
- "fields" => array(
- "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""),
- "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => array("clients" => "client_id"), "comment" => ""),
- "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""),
- "expires" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "scope" => array("type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["cache"] = array(
+ "fields" => [
+ "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"], "comment" => ""],
+ "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
+ "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["cache"] = [
"comment" => "Used to store different data that doesn't to be stored for a long time",
- "fields" => array(
- "k" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""),
- "v" => array("type" => "mediumtext", "comment" => ""),
- "expire_mode" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("k"),
- "expire_mode_updated" => array("expire_mode", "updated"),
- )
- );
- $database["challenge"] = array(
+ "fields" => [
+ "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "v" => ["type" => "mediumtext", "comment" => ""],
+ "expire_mode" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["k"],
+ "expire_mode_updated" => ["expire_mode", "updated"],
+ ]
+ ];
+ $database["challenge"] = [
"comment" => "",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "challenge" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "expire" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "type" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "last_update" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["clients"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "expire" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["clients"] = [
"comment" => "OAuth usage",
- "fields" => array(
- "client_id" => array("type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""),
- "pw" => array("type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""),
- "redirect_uri" => array("type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""),
- "name" => array("type" => "text", "comment" => ""),
- "icon" => array("type" => "text", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- ),
- "indexes" => array(
- "PRIMARY" => array("client_id"),
- )
- );
- $database["config"] = array(
+ "fields" => [
+ "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
+ "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
+ "name" => ["type" => "text", "comment" => ""],
+ "icon" => ["type" => "text", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["client_id"],
+ ]
+ ];
+ $database["config"] = [
"comment" => "main configuration storage",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "k" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "v" => array("type" => "mediumtext", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "cat_k" => array("UNIQUE", "cat", "k"),
- )
- );
- $database["contact"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "cat" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "k" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "v" => ["type" => "mediumtext", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "cat_k" => ["UNIQUE", "cat", "k"],
+ ]
+ ];
+ $database["contact"] = [
"comment" => "contact table",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "self" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "remote_self" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "rel" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "duplex" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "network" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "location" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "about" => array("type" => "text", "comment" => ""),
- "keywords" => array("type" => "text", "comment" => ""),
- "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "xmpp" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "attag" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "text", "comment" => ""),
- "thumb" => array("type" => "text", "comment" => ""),
- "micro" => array("type" => "text", "comment" => ""),
- "site-pubkey" => array("type" => "text", "comment" => ""),
- "issued-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "dfrn-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pubkey" => array("type" => "text", "comment" => ""),
- "prvkey" => array("type" => "text", "comment" => ""),
- "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "request" => array("type" => "text", "comment" => ""),
- "notify" => array("type" => "text", "comment" => ""),
- "poll" => array("type" => "text", "comment" => ""),
- "confirm" => array("type" => "text", "comment" => ""),
- "poco" => array("type" => "text", "comment" => ""),
- "aes_allow" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "ret-aes" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "usehub" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "subhub" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "hub-verify" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "last-update" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "success_update" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "failure_update" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "name-date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "uri-date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "avatar-date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "term-date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "last-item" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "priority" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "blocked" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "readonly" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "writable" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "forum" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "prv" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "contact-type" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "hidden" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "archive" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "pending" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "rating" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "reason" => array("type" => "text", "comment" => ""),
- "closeness" => array("type" => "tinyint", "not null" => "1", "default" => "99", "comment" => ""),
- "info" => array("type" => "mediumtext", "comment" => ""),
- "profile-id" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "bdyear" => array("type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""),
- "bd" => array("type" => "date", "not null" => "1", "default" => "0001-01-01", "comment" => ""),
- "notify_new_posts" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "fetch_further_information" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "ffi_keyword_blacklist" => array("type" => "text", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_name" => array("uid", "name(190)"),
- "self_uid" => array("self", "uid"),
- "alias_uid" => array("alias(32)", "uid"),
- "pending_uid" => array("pending", "uid"),
- "blocked_uid" => array("blocked", "uid"),
- "uid_rel_network_poll" => array("uid", "rel", "network(4)", "poll(64)", "archive"),
- "uid_network_batch" => array("uid", "network(4)", "batch(64)"),
- "addr_uid" => array("addr(32)", "uid"),
- "nurl_uid" => array("nurl(32)", "uid"),
- "nick_uid" => array("nick(32)", "uid"),
- "dfrn-id" => array("dfrn-id(64)"),
- "issued-id" => array("issued-id(64)"),
- )
- );
- $database["conv"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "rel" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "network" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "about" => ["type" => "text", "comment" => ""],
+ "keywords" => ["type" => "text", "comment" => ""],
+ "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "photo" => ["type" => "text", "comment" => ""],
+ "thumb" => ["type" => "text", "comment" => ""],
+ "micro" => ["type" => "text", "comment" => ""],
+ "site-pubkey" => ["type" => "text", "comment" => ""],
+ "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["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" => ""],
+ "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pubkey" => ["type" => "text", "comment" => ""],
+ "prvkey" => ["type" => "text", "comment" => ""],
+ "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "request" => ["type" => "text", "comment" => ""],
+ "notify" => ["type" => "text", "comment" => ""],
+ "poll" => ["type" => "text", "comment" => ""],
+ "confirm" => ["type" => "text", "comment" => ""],
+ "poco" => ["type" => "text", "comment" => ""],
+ "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "ret-aes" => ["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" => ""],
+ "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "last-update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "success_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "failure_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "name-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "uri-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "term-date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "last-item" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "priority" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "reason" => ["type" => "text", "comment" => ""],
+ "closeness" => ["type" => "tinyint", "not null" => "1", "default" => "99", "comment" => ""],
+ "info" => ["type" => "mediumtext", "comment" => ""],
+ "profile-id" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
+ "bd" => ["type" => "date", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
+ "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "fetch_further_information" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_name" => ["uid", "name(190)"],
+ "self_uid" => ["self", "uid"],
+ "alias_uid" => ["alias(32)", "uid"],
+ "pending_uid" => ["pending", "uid"],
+ "blocked_uid" => ["blocked", "uid"],
+ "uid_rel_network_poll" => ["uid", "rel", "network(4)", "poll(64)", "archive"],
+ "uid_network_batch" => ["uid", "network(4)", "batch(64)"],
+ "addr_uid" => ["addr(32)", "uid"],
+ "nurl_uid" => ["nurl(32)", "uid"],
+ "nick_uid" => ["nick(32)", "uid"],
+ "dfrn-id" => ["dfrn-id(64)"],
+ "issued-id" => ["issued-id(64)"],
+ ]
+ ];
+ $database["conv"] = [
"comment" => "private messages",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "recips" => array("type" => "text", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "creator" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "subject" => array("type" => "text", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid" => array("uid"),
- )
- );
- $database["conversation"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "recips" => ["type" => "text", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "subject" => ["type" => "text", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid" => ["uid"],
+ ]
+ ];
+ $database["conversation"] = [
"comment" => "Raw data and structure information for messages",
- "fields" => array(
- "item-uri" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""),
- "reply-to-uri" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "conversation-uri" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "conversation-href" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "protocol" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "source" => array("type" => "mediumtext", "comment" => ""),
- "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("item-uri"),
- "conversation-uri" => array("conversation-uri"),
- "received" => array("received"),
- )
- );
- $database["event"] = array(
+ "fields" => [
+ "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "protocol" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "source" => ["type" => "mediumtext", "comment" => ""],
+ "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["item-uri"],
+ "conversation-uri" => ["conversation-uri"],
+ "received" => ["received"],
+ ]
+ ];
+ $database["event"] = [
"comment" => "Events",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "cid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "start" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "finish" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "summary" => array("type" => "text", "comment" => ""),
- "desc" => array("type" => "text", "comment" => ""),
- "location" => array("type" => "text", "comment" => ""),
- "type" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nofinish" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "adjust" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "ignore" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "allow_cid" => array("type" => "mediumtext", "comment" => ""),
- "allow_gid" => array("type" => "mediumtext", "comment" => ""),
- "deny_cid" => array("type" => "mediumtext", "comment" => ""),
- "deny_gid" => array("type" => "mediumtext", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_start" => array("uid", "start"),
- )
- );
- $database["fcontact"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "cid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "start" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "finish" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "summary" => ["type" => "text", "comment" => ""],
+ "desc" => ["type" => "text", "comment" => ""],
+ "location" => ["type" => "text", "comment" => ""],
+ "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "allow_cid" => ["type" => "mediumtext", "comment" => ""],
+ "allow_gid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_cid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_start" => ["uid", "start"],
+ ]
+ ];
+ $database["fcontact"] = [
"comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "request" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "batch" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "notify" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "poll" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "confirm" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "priority" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "network" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pubkey" => array("type" => "text", "comment" => ""),
- "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "addr" => array("addr(32)"),
- "url" => array("UNIQUE", "url(190)"),
- )
- );
- $database["fsuggest"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "priority" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "network" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pubkey" => ["type" => "text", "comment" => ""],
+ "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "addr" => ["addr(32)"],
+ "url" => ["UNIQUE", "url(190)"],
+ ]
+ ];
+ $database["fsuggest"] = [
"comment" => "friend suggestion stuff",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "cid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "request" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "note" => array("type" => "text", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["gcign"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "cid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "note" => ["type" => "text", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["gcign"] = [
"comment" => "contacts ignored by friend suggestions",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "gcid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id"), "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid" => array("uid"),
- "gcid" => array("gcid"),
- )
- );
- $database["gcontact"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "gcid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid" => ["uid"],
+ "gcid" => ["gcid"],
+ ]
+ ];
+ $database["gcontact"] = [
"comment" => "global contacts",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nick" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "connect" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "updated" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- "last_contact" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- "last_failure" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- "location" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "about" => array("type" => "text", "comment" => ""),
- "keywords" => array("type" => "text", "comment" => ""),
- "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "birthday" => array("type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""),
- "community" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "contact-type" => array("type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""),
- "hide" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "nsfw" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "network" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "addr" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "notify" => array("type" => "text", "comment" => ""),
- "alias" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "generation" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "server_url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "nurl" => array("UNIQUE", "nurl(190)"),
- "name" => array("name(64)"),
- "nick" => array("nick(32)"),
- "addr" => array("addr(64)"),
- "hide_network_updated" => array("hide", "network(4)", "updated"),
- "updated" => array("updated"),
- )
- );
- $database["glink"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "updated" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ "last_contact" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ "last_failure" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "about" => ["type" => "text", "comment" => ""],
+ "keywords" => ["type" => "text", "comment" => ""],
+ "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
+ "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
+ "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "network" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "notify" => ["type" => "text", "comment" => ""],
+ "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "generation" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "nurl" => ["UNIQUE", "nurl(190)"],
+ "name" => ["name(64)"],
+ "nick" => ["nick(32)"],
+ "addr" => ["addr(64)"],
+ "hide_network_updated" => ["hide", "network(4)", "updated"],
+ "updated" => ["updated"],
+ ]
+ ];
+ $database["glink"] = [
"comment" => "'friends of friends' linkages derived from poco",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "cid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "gcid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id"), "comment" => ""),
- "zcid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id"), "comment" => ""),
- "updated" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "cid_uid_gcid_zcid" => array("UNIQUE", "cid","uid","gcid","zcid"),
- "gcid" => array("gcid"),
- )
- );
- $database["group"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "cid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "gcid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+ "zcid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+ "updated" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "cid_uid_gcid_zcid" => ["UNIQUE", "cid","uid","gcid","zcid"],
+ "gcid" => ["gcid"],
+ ]
+ ];
+ $database["group"] = [
"comment" => "privacy groups, group info",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "visible" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "deleted" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid" => array("uid"),
- )
- );
- $database["group_member"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid" => ["uid"],
+ ]
+ ];
+ $database["group_member"] = [
"comment" => "privacy groups, member info",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "gid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("group" => "id"), "comment" => ""),
- "contact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "contactid" => array("contact-id"),
- "gid_contactid" => array("UNIQUE", "gid", "contact-id"),
- )
- );
- $database["gserver"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "gid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => ""],
+ "contact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "contactid" => ["contact-id"],
+ "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
+ ]
+ ];
+ $database["gserver"] = [
"comment" => "Global servers",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nurl" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "version" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "site_name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "info" => array("type" => "text", "comment" => ""),
- "register_policy" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "registered-users" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "poco" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "noscrape" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "network" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "platform" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "last_poco_query" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- "last_contact" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- "last_failure" => array("type" => "datetime", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "nurl" => array("UNIQUE", "nurl(190)"),
- )
- );
- $database["hook"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "info" => ["type" => "text", "comment" => ""],
+ "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "registered-users" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "network" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "last_poco_query" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ "last_contact" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ "last_failure" => ["type" => "datetime", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "nurl" => ["UNIQUE", "nurl(190)"],
+ ]
+ ];
+ $database["hook"] = [
"comment" => "plugin hook registry",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "hook" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "file" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "function" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "priority" => array("type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "hook_file_function" => array("UNIQUE", "hook(50)","file(80)","function(60)"),
- )
- );
- $database["intro"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "hook" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "file" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "function" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "priority" => ["type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "hook_file_function" => ["UNIQUE", "hook(50)","file(80)","function(60)"],
+ ]
+ ];
+ $database["intro"] = [
"comment" => "",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "fid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("fcontact" => "id"), "comment" => ""),
- "contact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "knowyou" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "duplex" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "note" => array("type" => "text", "comment" => ""),
- "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "datetime" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "blocked" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "ignore" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["item"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "fid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
+ "contact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "note" => ["type" => "text", "comment" => ""],
+ "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "datetime" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["item"] = [
"comment" => "All posts",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => array("thread" => "iid")),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "contact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "gcontact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id"), "comment" => ""),
- "type" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "wall" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "gravity" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "parent" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "extid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "thr-parent" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "changed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "owner-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "owner-name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "owner-link" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "owner-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "author-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "author-name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "author-link" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "author-avatar" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "title" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "body" => array("type" => "mediumtext", "comment" => ""),
- "app" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "object-type" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "object" => array("type" => "text", "comment" => ""),
- "target-type" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "target" => array("type" => "text", "comment" => ""),
- "postopts" => array("type" => "text", "comment" => ""),
- "plink" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "event-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("event" => "id"), "comment" => ""),
- "tag" => array("type" => "mediumtext", "comment" => ""),
- "attach" => array("type" => "mediumtext", "comment" => ""),
- "inform" => array("type" => "mediumtext", "comment" => ""),
- "file" => array("type" => "mediumtext", "comment" => ""),
- "location" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "coord" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "allow_cid" => array("type" => "mediumtext", "comment" => ""),
- "allow_gid" => array("type" => "mediumtext", "comment" => ""),
- "deny_cid" => array("type" => "mediumtext", "comment" => ""),
- "deny_gid" => array("type" => "mediumtext", "comment" => ""),
- "private" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "pubmail" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "moderated" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "visible" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "spam" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "starred" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "bookmark" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "unseen" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "deleted" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "origin" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "forum_mode" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "last-child" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "mention" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "network" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "rendered-hash" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "rendered-html" => array("type" => "mediumtext", "comment" => ""),
- "global" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "guid" => array("guid(191)"),
- "uri" => array("uri(191)"),
- "parent" => array("parent"),
- "parent-uri" => array("parent-uri(191)"),
- "extid" => array("extid(191)"),
- "uid_id" => array("uid","id"),
- "uid_contactid_id" => array("uid","contact-id","id"),
- "uid_created" => array("uid","created"),
- "uid_unseen_contactid" => array("uid","unseen","contact-id"),
- "uid_network_received" => array("uid","network(4)","received"),
- "uid_network_commented" => array("uid","network(4)","commented"),
- "uid_thrparent" => array("uid","thr-parent(190)"),
- "uid_parenturi" => array("uid","parent-uri(190)"),
- "uid_contactid_created" => array("uid","contact-id","created"),
- "authorid_created" => array("author-id","created"),
- "ownerid" => array("owner-id"),
- "uid_uri" => array("uid", "uri(190)"),
- "resource-id" => array("resource-id(191)"),
- "contactid_allowcid_allowpid_denycid_denygid" => array("contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"), //
- "uid_type_changed" => array("uid","type(190)","changed"),
- "contactid_verb" => array("contact-id","verb(190)"),
- "deleted_changed" => array("deleted","changed"),
- "uid_wall_changed" => array("uid","wall","changed"),
- "uid_eventid" => array("uid","event-id"),
- "uid_authorlink" => array("uid","author-link(190)"),
- "uid_ownerlink" => array("uid","owner-link(190)"),
- )
- );
- $database["locks"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "contact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "gcontact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+ "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "gravity" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "parent" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "owner-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "owner-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "owner-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "owner-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "author-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "author-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "author-link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "author-avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "body" => ["type" => "mediumtext", "comment" => ""],
+ "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "verb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "object-type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "object" => ["type" => "text", "comment" => ""],
+ "target-type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "target" => ["type" => "text", "comment" => ""],
+ "postopts" => ["type" => "text", "comment" => ""],
+ "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "resource-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "event-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => ""],
+ "tag" => ["type" => "mediumtext", "comment" => ""],
+ "attach" => ["type" => "mediumtext", "comment" => ""],
+ "inform" => ["type" => "mediumtext", "comment" => ""],
+ "file" => ["type" => "mediumtext", "comment" => ""],
+ "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "allow_cid" => ["type" => "mediumtext", "comment" => ""],
+ "allow_gid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_cid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+ "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "forum_mode" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "last-child" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "network" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "rendered-html" => ["type" => "mediumtext", "comment" => ""],
+ "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "guid" => ["guid(191)"],
+ "uri" => ["uri(191)"],
+ "parent" => ["parent"],
+ "parent-uri" => ["parent-uri(191)"],
+ "extid" => ["extid(191)"],
+ "uid_id" => ["uid","id"],
+ "uid_contactid_id" => ["uid","contact-id","id"],
+ "uid_created" => ["uid","created"],
+ "uid_unseen_contactid" => ["uid","unseen","contact-id"],
+ "uid_network_received" => ["uid","network(4)","received"],
+ "uid_network_commented" => ["uid","network(4)","commented"],
+ "uid_thrparent" => ["uid","thr-parent(190)"],
+ "uid_parenturi" => ["uid","parent-uri(190)"],
+ "uid_contactid_created" => ["uid","contact-id","created"],
+ "authorid_created" => ["author-id","created"],
+ "ownerid" => ["owner-id"],
+ "uid_uri" => ["uid", "uri(190)"],
+ "resource-id" => ["resource-id(191)"],
+ "contactid_allowcid_allowpid_denycid_denygid" => ["contact-id","allow_cid(10)","allow_gid(10)","deny_cid(10)","deny_gid(10)"], //
+ "uid_type_changed" => ["uid","type(190)","changed"],
+ "contactid_verb" => ["contact-id","verb(190)"],
+ "deleted_changed" => ["deleted","changed"],
+ "uid_wall_changed" => ["uid","wall","changed"],
+ "uid_eventid" => ["uid","event-id"],
+ "uid_authorlink" => ["uid","author-link(190)"],
+ "uid_ownerlink" => ["uid","owner-link(190)"],
+ ]
+ ];
+ $database["locks"] = [
"comment" => "",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "name" => array("type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""),
- "locked" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "pid" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["mail"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
+ "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "pid" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["mail"] = [
"comment" => "private messages",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "from-name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "from-photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "from-url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "contact-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => array("contact" => "id"), "comment" => ""),
- "convid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("conv" => "id"), "comment" => ""),
- "title" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "body" => array("type" => "mediumtext", "comment" => ""),
- "seen" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "reply" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "replied" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "unknown" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "uri" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "parent-uri" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_seen" => array("uid", "seen"),
- "convid" => array("convid"),
- "uri" => array("uri(64)"),
- "parent-uri" => array("parent-uri(64)"),
- "contactid" => array("contact-id(32)"),
- )
- );
- $database["mailacct"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => ""],
+ "convid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => ""],
+ "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "body" => ["type" => "mediumtext", "comment" => ""],
+ "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "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" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_seen" => ["uid", "seen"],
+ "convid" => ["convid"],
+ "uri" => ["uri(64)"],
+ "parent-uri" => ["parent-uri(64)"],
+ "contactid" => ["contact-id(32)"],
+ ]
+ ];
+ $database["mailacct"] = [
"comment" => "Mail account data for fetching mails",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "server" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "port" => array("type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""),
- "ssltype" => array("type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""),
- "mailbox" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "user" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pass" => array("type" => "text", "comment" => ""),
- "reply_to" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "action" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "movetofolder" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pubmail" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "last_check" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["manage"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+ "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
+ "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pass" => ["type" => "text", "comment" => ""],
+ "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "action" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "last_check" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["manage"] = [
"comment" => "table of accounts that can manage each other",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "mid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_mid" => array("UNIQUE", "uid","mid"),
- )
- );
- $database["notify"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "mid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_mid" => ["UNIQUE", "uid","mid"],
+ ]
+ ];
+ $database["notify"] = [
"comment" => "notifications",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "hash" => array("type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""),
- "type" => array("type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "msg" => array("type" => "mediumtext", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "link" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "iid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "parent" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "seen" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "verb" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "otype" => array("type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""),
- "name_cache" => array("type" => "tinytext", "comment" => ""),
- "msg_cache" => array("type" => "mediumtext", "comment" => "")
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "hash_uid" => array("hash", "uid"),
- "seen_uid_date" => array("seen", "uid", "date"),
- "uid_date" => array("uid", "date"),
- "uid_type_link" => array("uid", "type", "link(190)"),
- )
- );
- $database["notify-threads"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
+ "type" => ["type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["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" => ""],
+ "msg" => ["type" => "mediumtext", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "iid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "parent" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "verb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "otype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
+ "name_cache" => ["type" => "tinytext", "comment" => ""],
+ "msg_cache" => ["type" => "mediumtext", "comment" => ""]
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "hash_uid" => ["hash", "uid"],
+ "seen_uid_date" => ["seen", "uid", "date"],
+ "uid_date" => ["uid", "date"],
+ "uid_type_link" => ["uid", "type", "link(190)"],
+ ]
+ ];
+ $database["notify-threads"] = [
"comment" => "",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "notify-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("notify" => "id"), "comment" => ""),
- "master-parent-item" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "parent-item" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "receiver-uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["oembed"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "notify-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
+ "master-parent-item" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "parent-item" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "receiver-uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["oembed"] = [
"comment" => "cache for OEmbed queries",
- "fields" => array(
- "url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""),
- "maxwidth" => array("type" => "mediumint", "not null" => "1", "primary" => "1", "comment" => ""),
- "content" => array("type" => "mediumtext", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("url", "maxwidth"),
- "created" => array("created"),
- )
- );
- $database["parsed_url"] = array(
+ "fields" => [
+ "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "maxwidth" => ["type" => "mediumint", "not null" => "1", "primary" => "1", "comment" => ""],
+ "content" => ["type" => "mediumtext", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["url", "maxwidth"],
+ "created" => ["created"],
+ ]
+ ];
+ $database["parsed_url"] = [
"comment" => "cache for 'parse_url' queries",
- "fields" => array(
- "url" => array("type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""),
- "guessing" => array("type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""),
- "oembed" => array("type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""),
- "content" => array("type" => "mediumtext", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("url", "guessing", "oembed"),
- "created" => array("created"),
- )
- );
- $database["participation"] = array(
+ "fields" => [
+ "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
+ "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
+ "content" => ["type" => "mediumtext", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["url", "guessing", "oembed"],
+ "created" => ["created"],
+ ]
+ ];
+ $database["participation"] = [
"comment" => "Storage for participation messages from Diaspora",
- "fields" => array(
- "iid" => array("type" => "int", "not null" => "1", "primary" => "1", "relation" => array("item" => "id"), "comment" => ""),
- "server" => array("type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""),
- "cid" => array("type" => "int", "not null" => "1", "relation" => array("contact" => "id"), "comment" => ""),
- "fid" => array("type" => "int", "not null" => "1", "relation" => array("fcontact" => "id"), "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("iid", "server")
- )
- );
- $database["pconfig"] = array(
+ "fields" => [
+ "iid" => ["type" => "int", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
+ "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "cid" => ["type" => "int", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
+ "fid" => ["type" => "int", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["iid", "server"]
+ ]
+ ];
+ $database["pconfig"] = [
"comment" => "personal (per user) configuration storage",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "cat" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "k" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "v" => array("type" => "mediumtext", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_cat_k" => array("UNIQUE", "uid", "cat", "k"),
- )
- );
- $database["photo"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "cat" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "k" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "v" => ["type" => "mediumtext", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
+ ]
+ ];
+ $database["photo"] = [
"comment" => "photo storage",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "contact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""),
- "resource-id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "title" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "desc" => array("type" => "text", "comment" => ""),
- "album" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "filename" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "type" => array("type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"),
- "height" => array("type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""),
- "width" => array("type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""),
- "datasize" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "data" => array("type" => "mediumblob", "not null" => "1", "comment" => ""),
- "scale" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "profile" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "allow_cid" => array("type" => "mediumtext", "comment" => ""),
- "allow_gid" => array("type" => "mediumtext", "comment" => ""),
- "deny_cid" => array("type" => "mediumtext", "comment" => ""),
- "deny_gid" => array("type" => "mediumtext", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "contactid" => array("contact-id"),
- "uid_contactid" => array("uid", "contact-id"),
- "uid_profile" => array("uid", "profile"),
- "uid_album_scale_created" => array("uid", "album(32)", "scale", "created"),
- "uid_album_resource-id_created" => array("uid", "album(32)", "resource-id(64)", "created"),
- "resource-id" => array("resource-id(64)"),
- )
- );
- $database["poll"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "contact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
+ "resource-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "desc" => ["type" => "text", "comment" => ""],
+ "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "type" => ["type" => "varchar(128)", "not null" => "1", "default" => "image/jpeg"],
+ "height" => ["type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""],
+ "width" => ["type" => "smallint", "not null" => "1", "default" => "0", "comment" => ""],
+ "datasize" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
+ "scale" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "allow_cid" => ["type" => "mediumtext", "comment" => ""],
+ "allow_gid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_cid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "contactid" => ["contact-id"],
+ "uid_contactid" => ["uid", "contact-id"],
+ "uid_profile" => ["uid", "profile"],
+ "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
+ "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id(64)", "created"],
+ "resource-id" => ["resource-id(64)"],
+ ]
+ ];
+ $database["poll"] = [
"comment" => "Currently unused table for storing poll results",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "q0" => array("type" => "text", "comment" => ""),
- "q1" => array("type" => "text", "comment" => ""),
- "q2" => array("type" => "text", "comment" => ""),
- "q3" => array("type" => "text", "comment" => ""),
- "q4" => array("type" => "text", "comment" => ""),
- "q5" => array("type" => "text", "comment" => ""),
- "q6" => array("type" => "text", "comment" => ""),
- "q7" => array("type" => "text", "comment" => ""),
- "q8" => array("type" => "text", "comment" => ""),
- "q9" => array("type" => "text", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid" => array("uid"),
- )
- );
- $database["poll_result"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "q0" => ["type" => "text", "comment" => ""],
+ "q1" => ["type" => "text", "comment" => ""],
+ "q2" => ["type" => "text", "comment" => ""],
+ "q3" => ["type" => "text", "comment" => ""],
+ "q4" => ["type" => "text", "comment" => ""],
+ "q5" => ["type" => "text", "comment" => ""],
+ "q6" => ["type" => "text", "comment" => ""],
+ "q7" => ["type" => "text", "comment" => ""],
+ "q8" => ["type" => "text", "comment" => ""],
+ "q9" => ["type" => "text", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid" => ["uid"],
+ ]
+ ];
+ $database["poll_result"] = [
"comment" => "data for polls - currently unused",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "poll_id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("poll" => "id")),
- "choice" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "poll_id" => array("poll_id"),
- )
- );
- $database["process"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "poll_id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
+ "choice" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "poll_id" => ["poll_id"],
+ ]
+ ];
+ $database["process"] = [
"comment" => "Currently running system processes",
- "fields" => array(
- "pid" => array("type" => "int", "not null" => "1", "primary" => "1", "comment" => ""),
- "command" => array("type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("pid"),
- "command" => array("command"),
- )
- );
- $database["profile"] = array(
+ "fields" => [
+ "pid" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
+ "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["pid"],
+ "command" => ["command"],
+ ]
+ ];
+ $database["profile"] = [
"comment" => "user profiles data",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "profile-name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "is-default" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "hide-friends" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pdesc" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "dob" => array("type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""),
- "address" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "locality" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "region" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "postal-code" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "country-name" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "hometown" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "gender" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "marital" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "with" => array("type" => "text", "comment" => ""),
- "howlong" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "sexual" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "politic" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "religion" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pub_keywords" => array("type" => "text", "comment" => ""),
- "prv_keywords" => array("type" => "text", "comment" => ""),
- "likes" => array("type" => "text", "comment" => ""),
- "dislikes" => array("type" => "text", "comment" => ""),
- "about" => array("type" => "text", "comment" => ""),
- "summary" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "music" => array("type" => "text", "comment" => ""),
- "book" => array("type" => "text", "comment" => ""),
- "tv" => array("type" => "text", "comment" => ""),
- "film" => array("type" => "text", "comment" => ""),
- "interest" => array("type" => "text", "comment" => ""),
- "romance" => array("type" => "text", "comment" => ""),
- "work" => array("type" => "text", "comment" => ""),
- "education" => array("type" => "text", "comment" => ""),
- "contact" => array("type" => "text", "comment" => ""),
- "homepage" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "xmpp" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "photo" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "thumb" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "publish" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "net-publish" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid_is-default" => array("uid", "is-default"),
- )
- );
- $database["profile_check"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0001-01-01", "comment" => ""],
+ "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "with" => ["type" => "text", "comment" => ""],
+ "howlong" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pub_keywords" => ["type" => "text", "comment" => ""],
+ "prv_keywords" => ["type" => "text", "comment" => ""],
+ "likes" => ["type" => "text", "comment" => ""],
+ "dislikes" => ["type" => "text", "comment" => ""],
+ "about" => ["type" => "text", "comment" => ""],
+ "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "music" => ["type" => "text", "comment" => ""],
+ "book" => ["type" => "text", "comment" => ""],
+ "tv" => ["type" => "text", "comment" => ""],
+ "film" => ["type" => "text", "comment" => ""],
+ "interest" => ["type" => "text", "comment" => ""],
+ "romance" => ["type" => "text", "comment" => ""],
+ "work" => ["type" => "text", "comment" => ""],
+ "education" => ["type" => "text", "comment" => ""],
+ "contact" => ["type" => "text", "comment" => ""],
+ "homepage" => ["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" => ""],
+ "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid_is-default" => ["uid", "is-default"],
+ ]
+ ];
+ $database["profile_check"] = [
"comment" => "DFRN remote auth use",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "cid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "dfrn_id" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "sec" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "expire" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["push_subscriber"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "cid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "expire" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["push_subscriber"] = [
"comment" => "Used for OStatus: Contains feed subscribers",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "callback_url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "topic" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "push" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "last_update" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "secret" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["queue"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "last_update" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["queue"] = [
"comment" => "Queue for messages that couldn't be delivered",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "cid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "network" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "last" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "content" => array("type" => "mediumtext", "comment" => ""),
- "batch" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "cid" => array("cid"),
- "created" => array("created"),
- "last" => array("last"),
- "network" => array("network"),
- "batch" => array("batch"),
- )
- );
- $database["register"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "cid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "network" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "last" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "content" => ["type" => "mediumtext", "comment" => ""],
+ "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "cid" => ["cid"],
+ "created" => ["created"],
+ "last" => ["last"],
+ "network" => ["network"],
+ "batch" => ["batch"],
+ ]
+ ];
+ $database["register"] = [
"comment" => "registrations requiring admin approval",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "hash" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "password" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "language" => array("type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""),
- "note" => array("type" => "text", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["search"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
+ "note" => ["type" => "text", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["search"] = [
"comment" => "",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "term" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "uid" => array("uid"),
- )
- );
- $database["session"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "uid" => ["uid"],
+ ]
+ ];
+ $database["session"] = [
"comment" => "web session storage",
- "fields" => array(
- "id" => array("type" => "bigint", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "sid" => array("type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""),
- "data" => array("type" => "text", "comment" => ""),
- "expire" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "sid" => array("sid(64)"),
- "expire" => array("expire"),
- )
- );
- $database["sign"] = array(
+ "fields" => [
+ "id" => ["type" => "bigint", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "data" => ["type" => "text", "comment" => ""],
+ "expire" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "sid" => ["sid(64)"],
+ "expire" => ["expire"],
+ ]
+ ];
+ $database["sign"] = [
"comment" => "Diaspora signatures",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "iid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "signed_text" => array("type" => "mediumtext", "comment" => ""),
- "signature" => array("type" => "text", "comment" => ""),
- "signer" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "iid" => array("UNIQUE", "iid"),
- )
- );
- $database["term"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "iid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "signed_text" => ["type" => "mediumtext", "comment" => ""],
+ "signature" => ["type" => "text", "comment" => ""],
+ "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "iid" => ["UNIQUE", "iid"],
+ ]
+ ];
+ $database["term"] = [
"comment" => "item taxonomy (categories, tags, etc.) table",
- "fields" => array(
- "tid" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "oid" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("item" => "id"), "comment" => ""),
- "otype" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "type" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "term" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "url" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "guid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "global" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "aid" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- ),
- "indexes" => array(
- "PRIMARY" => array("tid"),
- "oid_otype_type_term" => array("oid","otype","type","term(32)"),
- "uid_otype_type_term_global_created" => array("uid","otype","type","term(32)","global","created"),
- "uid_otype_type_url" => array("uid","otype","type","url(64)"),
- "guid" => array("guid(64)"),
- )
- );
- $database["thread"] = array(
+ "fields" => [
+ "tid" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "oid" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+ "otype" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "aid" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["tid"],
+ "oid_otype_type_term" => ["oid","otype","type","term(32)"],
+ "uid_otype_type_term_global_created" => ["uid","otype","type","term(32)","global","created"],
+ "uid_otype_type_url" => ["uid","otype","type","url(64)"],
+ "guid" => ["guid(64)"],
+ ]
+ ];
+ $database["thread"] = [
"comment" => "Thread related data",
- "fields" => array(
- "iid" => array("type" => "int", "not null" => "1", "default" => "0", "primary" => "1", "relation" => array("item" => "id"), "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- "contact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "gcontact-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("gcontact" => "id"), "comment" => ""),
- "owner-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "author-id" => array("type" => "int", "not null" => "1", "default" => "0", "relation" => array("contact" => "id"), "comment" => ""),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "edited" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "commented" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "received" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "changed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "wall" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "private" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "pubmail" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "moderated" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "visible" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "spam" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "starred" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "ignored" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "bookmark" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "unseen" => array("type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""),
- "deleted" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "origin" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "forum_mode" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "mention" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "network" => array("type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("iid"),
- "uid_network_commented" => array("uid","network","commented"),
- "uid_network_created" => array("uid","network","created"),
- "uid_contactid_commented" => array("uid","contact-id","commented"),
- "uid_contactid_created" => array("uid","contact-id","created"),
- "contactid" => array("contact-id"),
- "ownerid" => array("owner-id"),
- "authorid" => array("author-id"),
- "uid_created" => array("uid","created"),
- "uid_commented" => array("uid","commented"),
- "uid_wall_created" => array("uid","wall","created"),
- "private_wall_commented" => array("private","wall","commented"),
- )
- );
- $database["tokens"] = array(
+ "fields" => [
+ "iid" => ["type" => "int", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ "contact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "gcontact-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
+ "owner-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "author-id" => ["type" => "int", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "edited" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "commented" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "received" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "changed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "spam" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "bookmark" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+ "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "forum_mode" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "network" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["iid"],
+ "uid_network_commented" => ["uid","network","commented"],
+ "uid_network_created" => ["uid","network","created"],
+ "uid_contactid_commented" => ["uid","contact-id","commented"],
+ "uid_contactid_created" => ["uid","contact-id","created"],
+ "contactid" => ["contact-id"],
+ "ownerid" => ["owner-id"],
+ "authorid" => ["author-id"],
+ "uid_created" => ["uid","created"],
+ "uid_commented" => ["uid","commented"],
+ "uid_wall_created" => ["uid","wall","created"],
+ "private_wall_commented" => ["private","wall","commented"],
+ ]
+ ];
+ $database["tokens"] = [
"comment" => "OAuth usage",
- "fields" => array(
- "id" => array("type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""),
- "secret" => array("type" => "text", "comment" => ""),
- "client_id" => array("type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => array("clients" => "client_id")),
- "expires" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "scope" => array("type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""),
- "uid" => array("type" => "mediumint", "not null" => "1", "default" => "0", "relation" => array("user" => "uid"), "comment" => "User id"),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- )
- );
- $database["user"] = array(
+ "fields" => [
+ "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
+ "secret" => ["type" => "text", "comment" => ""],
+ "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
+ "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
+ "uid" => ["type" => "mediumint", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ ]
+ ];
+ $database["user"] = [
"comment" => "The local users",
- "fields" => array(
- "uid" => array("type" => "mediumint", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "guid" => array("type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""),
- "username" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "password" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "nickname" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "email" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "openid" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "timezone" => array("type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""),
- "language" => array("type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => ""),
- "register_date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "login_date" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "default-location" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "allow_location" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "theme" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "pubkey" => array("type" => "text", "comment" => ""),
- "prvkey" => array("type" => "text", "comment" => ""),
- "spubkey" => array("type" => "text", "comment" => ""),
- "sprvkey" => array("type" => "text", "comment" => ""),
- "verified" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "blocked" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "blockwall" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "hidewall" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "blocktags" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "unkmail" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "cntunkmail" => array("type" => "int", "not null" => "1", "default" => "10", "comment" => ""),
- "notify-flags" => array("type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => ""),
- "page-flags" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "account-type" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""),
- "prvnets" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "pwdreset" => array("type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""),
- "maxreq" => array("type" => "int", "not null" => "1", "default" => "10", "comment" => ""),
- "expire" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "account_removed" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "account_expired" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""),
- "account_expires_on" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "expire_notification_sent" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""),
- "def_gid" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => ""),
- "allow_cid" => array("type" => "mediumtext", "comment" => ""),
- "allow_gid" => array("type" => "mediumtext", "comment" => ""),
- "deny_cid" => array("type" => "mediumtext", "comment" => ""),
- "deny_gid" => array("type" => "mediumtext", "comment" => ""),
- "openidserver" => array("type" => "text", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("uid"),
- "nickname" => array("nickname(32)"),
- )
- );
- $database["userd"] = array(
+ "fields" => [
+ "uid" => ["type" => "mediumint", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
+ "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
+ "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => ""],
+ "register_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "login_date" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "pubkey" => ["type" => "text", "comment" => ""],
+ "prvkey" => ["type" => "text", "comment" => ""],
+ "spubkey" => ["type" => "text", "comment" => ""],
+ "sprvkey" => ["type" => "text", "comment" => ""],
+ "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "cntunkmail" => ["type" => "int", "not null" => "1", "default" => "10", "comment" => ""],
+ "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => ""],
+ "page-flags" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "account-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
+ "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "pwdreset" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "maxreq" => ["type" => "int", "not null" => "1", "default" => "10", "comment" => ""],
+ "expire" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+ "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => ""],
+ "def_gid" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
+ "allow_cid" => ["type" => "mediumtext", "comment" => ""],
+ "allow_gid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_cid" => ["type" => "mediumtext", "comment" => ""],
+ "deny_gid" => ["type" => "mediumtext", "comment" => ""],
+ "openidserver" => ["type" => "text", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["uid"],
+ "nickname" => ["nickname(32)"],
+ ]
+ ];
+ $database["userd"] = [
"comment" => "Deleted usernames",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""),
- "username" => array("type" => "varchar(255)", "not null" => "1", "comment" => ""),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "username" => array("username(32)"),
- )
- );
- $database["workerqueue"] = array(
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
+ "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "username" => ["username(32)"],
+ ]
+ ];
+ $database["workerqueue"] = [
"comment" => "Background tasks queue entries",
- "fields" => array(
- "id" => array("type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"),
- "parameter" => array("type" => "text", "comment" => "Task command"),
- "priority" => array("type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Task priority"),
- "created" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation date"),
- "pid" => array("type" => "int", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"),
- "executed" => array("type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Execution date"),
- "done" => array("type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked when the task was done, will be deleted later"),
- ),
- "indexes" => array(
- "PRIMARY" => array("id"),
- "pid" => array("pid"),
- "parameter" => array("parameter(64)"),
- "priority_created" => array("priority", "created"),
- "executed" => array("executed"),
- )
- );
+ "fields" => [
+ "id" => ["type" => "int", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
+ "parameter" => ["type" => "text", "comment" => "Task command"],
+ "priority" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Task priority"],
+ "created" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Creation date"],
+ "pid" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
+ "executed" => ["type" => "datetime", "not null" => "1", "default" => NULL_DATE, "comment" => "Execution date"],
+ "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked when the task was done, will be deleted later"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["id"],
+ "pid" => ["pid"],
+ "parameter" => ["parameter(64)"],
+ "priority_created" => ["priority", "created"],
+ "executed" => ["executed"],
+ ]
+ ];
return($database);
}
$archive = PConfig::get($contact['uid'], 'system', 'archive_removed_contacts');
if ($archive) {
- dba::update('contact', array('archive' => true, 'network' => 'none', 'writable' => false), array('id' => $id));
+ dba::update('contact', ['archive' => true, 'network' => 'none', 'writable' => false], ['id' => $id]);
return;
}
- dba::delete('contact', array('id' => $id));
+ dba::delete('contact', ['id' => $id]);
// Delete the rest in the background
Worker::add(PRIORITY_LOW, 'RemoveContact', $id);
{
if ($contact['network'] === NETWORK_OSTATUS) {
// create an unfollow slap
- $item = array();
+ $item = [];
$item['verb'] = NAMESPACE_OSTATUS . "/unfollow";
$item['follow'] = $contact["url"];
$slap = OStatus::salmon($item, $user);
}
if ($contact['term-date'] <= NULL_DATE) {
- dba::update('contact', array('term-date' => datetime_convert()), array('id' => $contact['id']));
+ dba::update('contact', ['term-date' => datetime_convert()], ['id' => $contact['id']]);
if ($contact['url'] != '') {
- dba::update('contact', array('term-date' => datetime_convert()), array('`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE));
+ dba::update('contact', ['term-date' => datetime_convert()], ['`nurl` = ? AND `term-date` <= ? AND NOT `self`', normalise_link($contact['url']), NULL_DATE]);
}
} else {
/* @todo
* delete, though if the owner tries to unarchive them we'll start
* the whole process over again.
*/
- dba::update('contact', array('archive' => 1), array('id' => $contact['id']));
+ dba::update('contact', ['archive' => 1], ['id' => $contact['id']]);
if ($contact['url'] != '') {
- dba::update('contact', array('archive' => 1), array('nurl' => normalise_link($contact['url']), 'self' => false));
+ dba::update('contact', ['archive' => 1], ['nurl' => normalise_link($contact['url']), 'self' => false]);
}
}
}
*/
public static function unmarkForArchival(array $contact)
{
- $condition = array('`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], NULL_DATE);
+ $condition = ['`id` = ? AND (`term-date` > ? OR `archive`)', $contact['id'], NULL_DATE];
$exists = dba::exists('contact', $condition);
// We don't need to update, we never marked this contact for archival
}
// It's a miracle. Our dead contact has inexplicably come back to life.
- $fields = array('term-date' => NULL_DATE, 'archive' => false);
- dba::update('contact', $fields, array('id' => $contact['id']));
+ $fields = ['term-date' => NULL_DATE, 'archive' => false];
+ dba::update('contact', $fields, ['id' => $contact['id']]);
if ($contact['url'] != '') {
- dba::update('contact', $fields, array('nurl' => normalise_link($contact['url'])));
+ dba::update('contact', $fields, ['nurl' => normalise_link($contact['url'])]);
}
}
*/
public static function getDetailsByURL($url, $uid = -1, array $default = [])
{
- static $cache = array();
+ static $cache = [];
if ($url == '') {
return $default;
}
if ((($profile["addr"] == "") || ($profile["name"] == "")) && ($profile["gid"] != 0)
- && in_array($profile["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))
+ && in_array($profile["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])
) {
Worker::add(PRIORITY_LOW, "UpdateGContact", $profile["gid"]);
}
*/
public static function getDetailsByAddr($addr, $uid = -1)
{
- static $cache = array();
+ static $cache = [];
if ($addr == '') {
- return array();
+ return [];
}
if ($uid == -1) {
if ($contact['uid'] != $uid) {
if ($uid == 0) {
$profile_link = Profile::zrl($contact['url']);
- $menu = array('profile' => array(t('View Profile'), $profile_link, true));
+ $menu = ['profile' => [t('View Profile'), $profile_link, true]];
return $menu;
}
} else {
$profile_link = Profile::zrl($contact['url']);
$connlnk = 'follow/?url=' . $contact['url'];
- $menu = array(
- 'profile' => array(t('View Profile'), $profile_link, true),
- 'follow' => array(t('Connect/Follow'), $connlnk, true)
- );
+ $menu = [
+ 'profile' => [t('View Profile'), $profile_link, true],
+ 'follow' => [t('Connect/Follow'), $connlnk, true]
+ ];
return $menu;
}
$profile_link = $profile_link . '?url=profile';
}
- if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA))) {
+ if (in_array($contact['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
$pm_url = System::baseUrl() . '/message/new/' . $contact['id'];
}
call_hooks('contact_photo_menu', $args);
- $menucondensed = array();
+ $menucondensed = [];
foreach ($menu as $menuname => $menuitem) {
if ($menuitem[1] != '') {
intval($start),
intval($count)
);
-
+
return $r;
}
$data = Probe::uri($url, "", $uid);
// Last try in gcontact for unsupported networks
- if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_PUMPIO, NETWORK_MAIL))) {
+ if (!in_array($data["network"], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA, NETWORK_PUMPIO, NETWORK_MAIL])) {
if ($uid != 0) {
return 0;
}
if ($data['about'] != '') {
unset($gcontact['about']);
}
- dba::update('contact', $gcontact, array('id' => $contact_id));
+ dba::update('contact', $gcontact, ['id' => $contact_id]);
}
if (count($contacts) > 1 && $uid == 0 && $contact_id != 0 && $data["url"] != "") {
return $contact_id;
}
- $updated = array('addr' => $data['addr'],
+ $updated = ['addr' => $data['addr'],
'alias' => $data['alias'],
'url' => $data['url'],
'nurl' => normalise_link($data['url']),
'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'])) {
$updated['avatar-date'] = datetime_convert();
- dba::update('contact', $updated, array('id' => $contact_id), $contact);
+ dba::update('contact', $updated, ['id' => $contact_id], $contact);
return $contact_id;
}
return '';
}
- if (in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) {
+ if (in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""])) {
$sql = "(`item`.`uid` = 0 OR (`item`.`uid` = %d AND NOT `item`.`global`))";
} else {
$sql = "`item`.`uid` = %d";
if (!DBM::is_result($contact)) {
return false;
} else {
- $data = array($contact["photo"], $contact["thumb"], $contact["micro"]);
+ $data = [$contact["photo"], $contact["thumb"], $contact["micro"]];
}
if (($contact["avatar"] != $avatar) || $force) {
if ($photos) {
dba::update(
'contact',
- array('avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => datetime_convert()),
- array('id' => $cid)
+ ['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => datetime_convert()],
+ ['id' => $cid]
);
// Update the public contact (contact id = 0)
*/
public static function createFromProbe($uid, $url, $interactive = false, $network = '')
{
- $result = array('cid' => -1, 'success' => false, 'message' => '');
+ $result = ['cid' => -1, 'success' => false, 'message' => ''];
$a = get_app();
return $result;
}
- $arr = array('url' => $url, 'contact' => array());
+ $arr = ['url' => $url, 'contact' => []];
call_hooks('follow', $arr);
$hidden = (($ret['network'] === NETWORK_MAIL) ? 1 : 0);
- if (in_array($ret['network'], array(NETWORK_MAIL, NETWORK_DIASPORA))) {
+ if (in_array($ret['network'], [NETWORK_MAIL, NETWORK_DIASPORA])) {
$writeable = 1;
}
// update contact
$new_relation = (($r[0]['rel'] == CONTACT_IS_FOLLOWER) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING);
- $fields = array('rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false);
- dba::update('contact', $fields, array('id' => $r[0]['id']));
+ $fields = ['rel' => $new_relation, 'subhub' => $subhub, 'readonly' => false];
+ dba::update('contact', $fields, ['id' => $r[0]['id']]);
} else {
- $new_relation = ((in_array($ret['network'], array(NETWORK_MAIL))) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING);
+ $new_relation = ((in_array($ret['network'], [NETWORK_MAIL])) ? CONTACT_IS_FRIEND : CONTACT_IS_SHARING);
// create contact record
dba::insert('contact', [
if (DBM::is_result($r)) {
if (($contact['network'] == NETWORK_OSTATUS) && (strlen($contact['notify']))) {
// create a follow slap
- $item = array();
+ $item = [];
$item['verb'] = ACTIVITY_FOLLOW;
$item['follow'] = $contact["url"];
$slap = OStatus::salmon($item, $r[0]);
throw new Exception("This (".$gcontact['url'].") doesn't seem to be an url.");
}
- if (in_array($urlparts["host"], array("www.facebook.com", "facebook.com", "twitter.com", "identi.ca", "alpha.app.net"))) {
+ if (in_array($urlparts["host"], ["www.facebook.com", "facebook.com", "twitter.com", "identi.ca", "alpha.app.net"])) {
throw new Exception('Contact from a non federated network ignored. ('.$gcontact['url'].')');
}
}
// Assure that there are no parameter fragments in the profile url
- if (in_array($gcontact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) {
+ if (in_array($gcontact['network'], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""])) {
$gcontact['url'] = self::cleanContactUrl($gcontact['url']);
}
throw new Exception('No name and photo for URL '.$gcontact['url']);
}
- if (!in_array($gcontact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA))) {
+ if (!in_array($gcontact['network'], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA])) {
throw new Exception('No federated network ('.$gcontact['network'].') detected for URL '.$gcontact['url']);
}
public static function suggestionQuery($uid, $start = 0, $limit = 80)
{
if (!$uid) {
- return array();
+ return [];
}
/*
// return $list;
//}
- $network = array(NETWORK_DFRN);
+ $network = [NETWORK_DFRN];
if (Config::get('system', 'diaspora_enabled')) {
$network[] = NETWORK_DIASPORA;
intval($limit)
);
- $list = array();
+ $list = [];
foreach ($r2 as $suggestion) {
$list[$suggestion["nurl"]] = $suggestion;
}
{
$a = get_app();
- $done = array();
+ $done = [];
/// @TODO Check if it is really neccessary to poll the own server
PortableContact::loadWorker(0, 0, 0, System::baseUrl() . '/poco');
$gcontact_id = 0;
$doprobing = false;
- if (in_array($contact["network"], array(NETWORK_PHANTOM))) {
+ if (in_array($contact["network"], [NETWORK_PHANTOM])) {
logger("Invalid network for contact url ".$contact["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
return false;
}
self::fixAlternateContactAddress($contact);
// Remove unwanted parts from the contact url (e.g. "?zrl=...")
- if (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (in_array($contact["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) {
$contact["url"] = self::cleanContactUrl($contact["url"]);
}
$gcontact_id = $r[0]["id"];
// Update every 90 days
- if (in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""))) {
+ if (in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""])) {
$last_failure_str = $r[0]["last_failure"];
$last_failure = strtotime($r[0]["last_failure"]);
$last_contact_str = $r[0]["last_contact"];
if (DBM::is_result($r)) {
$gcontact_id = $r[0]["id"];
- $doprobing = in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""));
+ $doprobing = in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""]);
}
}
dba::unlock();
);
// Get all field names
- $fields = array();
+ $fields = [];
foreach ($public_contact[0] as $field => $data) {
$fields[$field] = $data;
}
if ($update) {
logger("Update gcontact for ".$contact["url"], LOGGER_DEBUG);
- $condition = array('`nurl` = ? AND (`generation` = 0 OR `generation` >= ?)',
- normalise_link($contact["url"]), $contact["generation"]);
+ $condition = ['`nurl` = ? AND (`generation` = 0 OR `generation` >= ?)',
+ normalise_link($contact["url"]), $contact["generation"]];
$contact["updated"] = DBM::date($contact["updated"]);
- $updated = array('photo' => $contact['photo'], 'name' => $contact['name'],
+ $updated = ['photo' => $contact['photo'], 'name' => $contact['name'],
'nick' => $contact['nick'], 'addr' => $contact['addr'],
'network' => $contact['network'], 'birthday' => $contact['birthday'],
'gender' => $contact['gender'], 'keywords' => $contact['keywords'],
'notify' => $contact['notify'], 'url' => $contact['url'],
'location' => $contact['location'], 'about' => $contact['about'],
'generation' => $contact['generation'], 'updated' => $contact['updated'],
- 'server_url' => $contact['server_url'], 'connect' => $contact['connect']);
+ 'server_url' => $contact['server_url'], 'connect' => $contact['connect']];
dba::update('gcontact', $updated, $condition, $fields);
// Now update the contact entry with the user id "0" as well.
// This is used for the shadow copies of public items.
-
+
$public_contact = dba::selectFirst('contact', ['id'], ['nurl' => normalise_link($contact["url"]), 'uid' => 0]);
if (DBM::is_result($public_contact)) {
logger("Update public contact ".$public_contact["id"], LOGGER_DEBUG);
Contact::updateAvatar($contact["photo"], 0, $public_contact["id"]);
- $fields = array('name', 'nick', 'addr',
+ $fields = ['name', 'nick', 'addr',
'network', 'bd', 'gender',
'keywords', 'alias', 'contact-type',
- 'url', 'location', 'about');
+ 'url', 'location', 'about'];
$old_contact = dba::selectFirst('contact', $fields, ['id' => $public_contact["id"]]);
// Update it with the current values
- $fields = array('name' => $contact['name'], 'nick' => $contact['nick'],
+ $fields = ['name' => $contact['name'], 'nick' => $contact['nick'],
'addr' => $contact['addr'], 'network' => $contact['network'],
'bd' => $contact['birthday'], 'gender' => $contact['gender'],
'keywords' => $contact['keywords'], 'alias' => $contact['alias'],
'contact-type' => $contact['contact-type'], 'url' => $contact['url'],
- 'location' => $contact['location'], 'about' => $contact['about']);
+ 'location' => $contact['location'], 'about' => $contact['about']];
- dba::update('contact', $fields, array('id' => $public_contact["id"]), $old_contact);
+ dba::update('contact', $fields, ['id' => $public_contact["id"]], $old_contact);
}
}
{
$data = Probe::uri($url);
- if (in_array($data["network"], array(NETWORK_PHANTOM))) {
+ if (in_array($data["network"], [NETWORK_PHANTOM])) {
logger("Invalid network for contact url ".$data["url"]." - Called by: ".System::callstack(), LOGGER_DEBUG);
return;
}
);
$location = Profile::formatLocation(
- array("locality" => $r[0]["locality"], "region" => $r[0]["region"], "country-name" => $r[0]["country-name"])
+ ["locality" => $r[0]["locality"], "region" => $r[0]["region"], "country-name" => $r[0]["country-name"]]
);
// The "addr" field was added in 3.4.3 so it can be empty for older users
if ($r[0]["addr"] != "") {
- $addr = $r[0]["nickname"].'@'.str_replace(array("http://", "https://"), "", System::baseUrl());
+ $addr = $r[0]["nickname"].'@'.str_replace(["http://", "https://"], "", System::baseUrl());
} else {
$addr = $r[0]["addr"];
}
- $gcontact = array("name" => $r[0]["name"], "location" => $location, "about" => $r[0]["about"],
+ $gcontact = ["name" => $r[0]["name"], "location" => $location, "about" => $r[0]["about"],
"gender" => $r[0]["gender"], "keywords" => $r[0]["pub_keywords"],
"birthday" => $r[0]["dob"], "photo" => $r[0]["photo"],
"notify" => $r[0]["notify"], "url" => $r[0]["url"],
"hide" => ($r[0]["hidewall"] || !$r[0]["net-publish"]),
"nick" => $r[0]["nickname"], "addr" => $addr,
"connect" => $addr, "server_url" => System::baseUrl(),
- "generation" => 1, "network" => NETWORK_DFRN);
+ "generation" => 1, "network" => NETWORK_DFRN];
self::update($gcontact);
}
foreach ($statistics->users as $nick => $user) {
$profile_url = $server."/".$user->nickname;
- $contact = array("url" => $profile_url,
+ $contact = ["url" => $profile_url,
"name" => $user->fullname,
"addr" => $user->nickname."@".$hostname,
"nick" => $user->nickname,
"about" => $user->bio,
"network" => NETWORK_OSTATUS,
- "photo" => System::baseUrl()."/images/person-175.jpg");
+ "photo" => System::baseUrl()."/images/person-175.jpg"];
self::getId($contact);
}
}
$label = t('Default privacy group for new contacts');
}
- $o = replace_macros(get_markup_template('group_selection.tpl'), array(
+ $o = replace_macros(get_markup_template('group_selection.tpl'), [
'$label' => $label,
'$groups' => $display_groups
- ));
+ ]);
return $o;
}
$stmt = dba::select('group', [], ['deleted' => 0, 'uid' => local_user()], ['order' => ['name']]);
- $member_of = array();
+ $member_of = [];
if ($cid) {
$member_of = self::getIdsByContactId($cid);
}
$micro = System::baseUrl() . '/images/person-48.jpg';
}
- return array($image_url, $thumb, $micro);
+ return [$image_url, $thumb, $micro];
}
/**
$degrees = count($exifCoord) > 0 ? self::gps2Num($exifCoord[0]) : 0;
$minutes = count($exifCoord) > 1 ? self::gps2Num($exifCoord[1]) : 0;
$seconds = count($exifCoord) > 2 ? self::gps2Num($exifCoord[2]) : 0;
-
+
$flip = ($hemi == 'W' || $hemi == 'S') ? -1 : 1;
-
+
return floatval($flip * ($degrees + ($minutes / 60) + ($seconds / 3600)));
}
private static function gps2Num($coordPart)
{
$parts = explode('/', $coordPart);
-
+
if (count($parts) <= 0) {
return 0;
}
-
+
if (count($parts) == 1) {
return $parts[0];
}
-
+
return floatval($parts[0]) / floatval($parts[1]);
}
* @param array $profiledata array
* @param boolean $show_connect Show connect link
*/
- public static function load(App $a, $nickname, $profile = 0, $profiledata = array(), $show_connect = true)
+ public static function load(App $a, $nickname, $profile = 0, $profiledata = [], $show_connect = true)
{
$user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
$a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'),
- array(
+ [
'$editprofile' => t('Edit profile'),
'$profid' => $a->profile['id']
- )
+ ]
);
}
$profile_url = normalise_link(System::baseUrl() . '/profile/' . $profile['nickname']);
}
- if (dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url))) {
+ if (dba::exists('contact', ['pending' => false, 'uid' => local_user(), 'nurl' => $profile_url])) {
$connect = false;
}
}
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = array(System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles'));
+ $profile['edit'] = [System::baseUrl() . '/profiles', t('Profiles'), '', t('Manage/edit profiles')];
$r = q(
"SELECT * FROM `profile` WHERE `uid` = %d",
local_user()
);
- $profile['menu'] = array(
+ $profile['menu'] = [
'chg_photo' => t('Change profile photo'),
'cr_new' => t('Create New Profile'),
- 'entries' => array(),
- );
+ 'entries' => [],
+ ];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
- $profile['menu']['entries'][] = array(
+ $profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
'id' => $rr['id'],
'alt' => t('Profile Image'),
'isdefault' => $rr['is-default'],
'visibile_to_everybody' => t('visible to everybody'),
'edit_visibility' => t('Edit visibility'),
- );
+ ];
}
}
}
if (!$is_contact && $profile['uid'] == local_user() && !Feature::isEnabled(local_user(), 'multi_profiles')) {
- $profile['edit'] = array(System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile'));
- $profile['menu'] = array(
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], t('Edit profile'), '', t('Edit profile')];
+ $profile['menu'] = [
'chg_photo' => t('Change profile photo'),
'cr_new' => null,
- 'entries' => array(),
- );
+ 'entries' => [],
+ ];
}
// Fetch the account type
$lastname = $split_name['last'];
if (x($profile, 'guid')) {
- $diaspora = array(
+ $diaspora = [
'guid' => $profile['guid'],
'podloc' => System::baseUrl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'photo300' => $profile['contact_photo'],
'photo100' => $profile['contact_thumb'],
'photo50' => $profile['contact_micro'],
- );
+ ];
} else {
$diaspora = false;
}
}
}
- $p = array();
+ $p = [];
foreach ($profile as $k => $v) {
$k = str_replace('-', '_', $k);
$p[$k] = $v;
}
$tpl = get_markup_template('profile_vcard.tpl');
- $o .= replace_macros($tpl, array(
+ $o .= replace_macros($tpl, [
'$profile' => $p,
'$xmpp' => $xmpp,
'$connect' => $connect,
'$updated' => $updated,
'$diaspora' => $diaspora,
'$contact_block' => $contact_block,
- ));
+ ]);
- $arr = array('profile' => &$profile, 'entry' => &$o);
+ $arr = ['profile' => &$profile, 'entry' => &$o];
call_hooks('profile_sidebar', $arr);
if (DBM::is_result($r)) {
$total = 0;
$now = strtotime('now');
- $cids = array();
+ $cids = [];
$istoday = false;
foreach ($r as $rr) {
}
}
$tpl = get_markup_template('birthdays_reminder.tpl');
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
'$events' => $r,
'$lbr' => '{', // raw brackets mess up if/endif macro processing
'$rbr' => '}'
- ));
+ ]);
}
public static function getEvents()
datetime_convert('UTC', 'UTC', 'now - 1 days')
);
- $r = array();
+ $r = [];
if (DBM::is_result($s)) {
$istoday = false;
$classtoday = (($istoday) ? 'event-today' : '');
}
$tpl = get_markup_template('events_reminder.tpl');
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => count($r),
'$event_reminders' => t('Event Reminders'),
'$event_title' => t('Events this week:'),
'$events' => $r,
- ));
+ ]);
}
public static function getAdvanced(App $a)
$o .= replace_macros(
get_markup_template('section_title.tpl'),
- array('$title' => t('Profile'))
+ ['$title' => t('Profile')]
);
if ($a->profile['name']) {
$tpl = get_markup_template('profile_advanced.tpl');
- $profile = array();
+ $profile = [];
- $profile['fullname'] = array(t('Full Name:'), $a->profile['name']);
+ $profile['fullname'] = [t('Full Name:'), $a->profile['name']];
if ($a->profile['gender']) {
- $profile['gender'] = array(t('Gender:'), $a->profile['gender']);
+ $profile['gender'] = [t('Gender:'), $a->profile['gender']];
}
if (($a->profile['dob']) && ($a->profile['dob'] > '0001-01-01')) {
day_translate(datetime_convert('UTC', 'UTC', $a->profile['dob'] . ' 00:00 +00:00', $year_bd_format))
: day_translate(datetime_convert('UTC', 'UTC', '2001-' . substr($a->profile['dob'], 5) . ' 00:00 +00:00', $short_bd_format));
- $profile['birthday'] = array(t('Birthday:'), $val);
+ $profile['birthday'] = [t('Birthday:'), $val];
}
if (!empty($a->profile['dob'])
&& $a->profile['dob'] > '0001-01-01'
&& $age = age($a->profile['dob'], $a->profile['timezone'], '')
) {
- $profile['age'] = array(t('Age:'), $age);
+ $profile['age'] = [t('Age:'), $age];
}
if ($a->profile['marital']) {
- $profile['marital'] = array(t('Status:'), $a->profile['marital']);
+ $profile['marital'] = [t('Status:'), $a->profile['marital']];
}
/// @TODO Maybe use x() here, plus below?
}
if ($a->profile['sexual']) {
- $profile['sexual'] = array(t('Sexual Preference:'), $a->profile['sexual']);
+ $profile['sexual'] = [t('Sexual Preference:'), $a->profile['sexual']];
}
if ($a->profile['homepage']) {
- $profile['homepage'] = array(t('Homepage:'), linkify($a->profile['homepage']));
+ $profile['homepage'] = [t('Homepage:'), linkify($a->profile['homepage'])];
}
if ($a->profile['hometown']) {
- $profile['hometown'] = array(t('Hometown:'), linkify($a->profile['hometown']));
+ $profile['hometown'] = [t('Hometown:'), linkify($a->profile['hometown'])];
}
if ($a->profile['pub_keywords']) {
- $profile['pub_keywords'] = array(t('Tags:'), $a->profile['pub_keywords']);
+ $profile['pub_keywords'] = [t('Tags:'), $a->profile['pub_keywords']];
}
if ($a->profile['politic']) {
- $profile['politic'] = array(t('Political Views:'), $a->profile['politic']);
+ $profile['politic'] = [t('Political Views:'), $a->profile['politic']];
}
if ($a->profile['religion']) {
- $profile['religion'] = array(t('Religion:'), $a->profile['religion']);
+ $profile['religion'] = [t('Religion:'), $a->profile['religion']];
}
if ($txt = prepare_text($a->profile['about'])) {
- $profile['about'] = array(t('About:'), $txt);
+ $profile['about'] = [t('About:'), $txt];
}
if ($txt = prepare_text($a->profile['interest'])) {
- $profile['interest'] = array(t('Hobbies/Interests:'), $txt);
+ $profile['interest'] = [t('Hobbies/Interests:'), $txt];
}
if ($txt = prepare_text($a->profile['likes'])) {
- $profile['likes'] = array(t('Likes:'), $txt);
+ $profile['likes'] = [t('Likes:'), $txt];
}
if ($txt = prepare_text($a->profile['dislikes'])) {
- $profile['dislikes'] = array(t('Dislikes:'), $txt);
+ $profile['dislikes'] = [t('Dislikes:'), $txt];
}
if ($txt = prepare_text($a->profile['contact'])) {
- $profile['contact'] = array(t('Contact information and Social Networks:'), $txt);
+ $profile['contact'] = [t('Contact information and Social Networks:'), $txt];
}
if ($txt = prepare_text($a->profile['music'])) {
- $profile['music'] = array(t('Musical interests:'), $txt);
+ $profile['music'] = [t('Musical interests:'), $txt];
}
if ($txt = prepare_text($a->profile['book'])) {
- $profile['book'] = array(t('Books, literature:'), $txt);
+ $profile['book'] = [t('Books, literature:'), $txt];
}
if ($txt = prepare_text($a->profile['tv'])) {
- $profile['tv'] = array(t('Television:'), $txt);
+ $profile['tv'] = [t('Television:'), $txt];
}
if ($txt = prepare_text($a->profile['film'])) {
- $profile['film'] = array(t('Film/dance/culture/entertainment:'), $txt);
+ $profile['film'] = [t('Film/dance/culture/entertainment:'), $txt];
}
if ($txt = prepare_text($a->profile['romance'])) {
- $profile['romance'] = array(t('Love/Romance:'), $txt);
+ $profile['romance'] = [t('Love/Romance:'), $txt];
}
if ($txt = prepare_text($a->profile['work'])) {
- $profile['work'] = array(t('Work/employment:'), $txt);
+ $profile['work'] = [t('Work/employment:'), $txt];
}
if ($txt = prepare_text($a->profile['education'])) {
- $profile['education'] = array(t('School/education:'), $txt);
+ $profile['education'] = [t('School/education:'), $txt];
}
//show subcribed forum if it is enabled in the usersettings
if (Feature::isEnabled($uid, 'forumlist_profile')) {
- $profile['forumlist'] = array(t('Forums:'), ForumManager::profileAdvanced($uid));
+ $profile['forumlist'] = [t('Forums:'), ForumManager::profileAdvanced($uid)];
}
if ($a->profile['uid'] == local_user()) {
- $profile['edit'] = array(System::baseUrl() . '/profiles/' . $a->profile['id'], t('Edit profile'), '', t('Edit profile'));
+ $profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], t('Edit profile'), '', t('Edit profile')];
}
- return replace_macros($tpl, array(
+ return replace_macros($tpl, [
'$title' => t('Profile'),
'$basic' => t('Basic'),
'$advanced' => t('Advanced'),
'$profile' => $profile
- ));
+ ]);
}
return '';
$url = System::baseUrl() . '/profile/' . $nickname;
- $tabs = array(
- array(
+ $tabs = [
+ [
'label' => t('Status'),
'url' => $url,
'sel' => !$tab && $a->argv[0] == 'profile' ? 'active' : '',
'title' => t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
- ),
- array(
+ ],
+ [
'label' => t('Profile'),
'url' => $url . '/?tab=profile',
'sel' => $tab == 'profile' ? 'active' : '',
'title' => t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'r',
- ),
- array(
+ ],
+ [
'label' => t('Photos'),
'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'photos' ? 'active' : '',
'title' => t('Photo Albums'),
'id' => 'photo-tab',
'accesskey' => 'h',
- ),
- array(
+ ],
+ [
'label' => t('Videos'),
'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'videos' ? 'active' : '',
'title' => t('Videos'),
'id' => 'video-tab',
'accesskey' => 'v',
- ),
- );
+ ],
+ ];
// the calendar link for the full featured events calendar
if ($is_owner && $a->theme_events_in_profile) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Events'),
'url' => System::baseUrl() . '/events',
'sel' => !$tab && $a->argv[0] == 'events' ? 'active' : '',
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
- );
+ ];
// if the user is not the owner of the calendar we only show a calendar
// with the public events of the calendar owner
} elseif (!$is_owner) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Events'),
'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'cal' ? 'active' : '',
'title' => t('Events and Calendar'),
'id' => 'events-tab',
'accesskey' => 'e',
- );
+ ];
}
if ($is_owner) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Personal Notes'),
'url' => System::baseUrl() . '/notes',
'sel' => !$tab && $a->argv[0] == 'notes' ? 'active' : '',
'title' => t('Only You Can See This'),
'id' => 'notes-tab',
'accesskey' => 't',
- );
+ ];
}
if ((!$is_owner) && ((count($a->profile)) || (!$a->profile['hide-friends']))) {
- $tabs[] = array(
+ $tabs[] = [
'label' => t('Contacts'),
'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => !$tab && $a->argv[0] == 'viewcontacts' ? 'active' : '',
'title' => t('Contacts'),
'id' => 'viewcontacts-tab',
'accesskey' => 'k',
- );
+ ];
}
- $arr = array('is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => $tab, 'tabs' => $tabs);
+ $arr = ['is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => $tab, 'tabs' => $tabs];
call_hooks('profile_tabs', $arr);
$tpl = get_markup_template('common_tabs.tpl');
- return replace_macros($tpl, array('$tabs' => $arr['tabs']));
+ return replace_macros($tpl, ['$tabs' => $arr['tabs']]);
}
/**
$urlparts = parse_url($my_url);
$result = Cache::get('gprobe:' . $urlparts['host']);
- if ((!is_null($result)) && (in_array($result['network'], array(NETWORK_FEED, NETWORK_PHANTOM)))) {
+ if ((!is_null($result)) && (in_array($result['network'], [NETWORK_FEED, NETWORK_PHANTOM]))) {
logger('DDoS attempt detected for ' . $urlparts['host'] . ' by ' . $_SERVER['REMOTE_ADDR'] . '. server data: ' . print_r($_SERVER, true), LOGGER_DEBUG);
return;
}
Worker::add(PRIORITY_LOW, 'GProbe', $my_url);
- $arr = array('zrl' => $my_url, 'url' => $a->cmd);
+ $arr = ['zrl' => $my_url, 'url' => $a->cmd];
call_hooks('zrl_init', $arr);
}
}
$openid = new \LightOpenID;
$openid->identity = $openid_url;
$openid->returnUrl = System::baseUrl() . '/openid';
- $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson');
- $openid->optional = array('namePerson/first', 'media/image/aspect11', 'media/image/default');
+ $openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
+ $openid->optional = ['namePerson/first', 'media/image/aspect11', 'media/image/default'];
try {
$authurl = $openid->authUrl();
} catch (Exception $e) {
$body = sprintf($body, $username, $sitename);
- return notification(array(
+ return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration at %s'), $sitename),
- 'body' => $body));
+ 'body' => $body]);
}
/**
$preamble = sprintf($preamble, $username, $sitename);
$body = sprintf($body, $email, $sitename, $siteurl, $username, $password);
- return notification(array(
+ return notification([
'type' => SYSTEM_EMAIL,
'to_email' => $email,
'subject'=> sprintf( t('Registration details for %s'), $sitename),
'preamble'=> $preamble,
- 'body' => $body));
+ 'body' => $body]);
}
/**
if (x($_POST, 'auth-params') && $_POST['auth-params'] === 'login') {
$record = null;
- $addon_auth = array(
+ $addon_auth = [
'username' => trim($_POST['username']),
'password' => trim($_POST['password']),
'authenticated' => 0,
'user_record' => null
- );
+ ];
/*
* A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record
$o = '';
$reg = false;
if ($register) {
- $reg = array(
+ $reg = [
'title' => t('Create a New Account'),
'desc' => t('Register')
- );
+ ];
}
$noid = Config::get('system', 'no_openid');
'$logout' => t('Logout'),
'$login' => t('Login'),
- '$lname' => array('username', t('Nickname or Email: ') , '', ''),
- '$lpassword' => array('password', t('Password: '), '', ''),
- '$lremember' => array('remember', t('Remember me'), 0, ''),
+ '$lname' => ['username', t('Nickname or Email: ') , '', ''],
+ '$lpassword' => ['password', t('Password: '), '', ''],
+ '$lremember' => ['remember', t('Remember me'), 0, ''],
'$openid' => !$noid,
- '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''),
+ '$lopenid' => ['openid_url', t('Or login using OpenID: '),'',''],
'$hiddens' => $hiddens,
\r
// Unused form: /oembed/b2h?url=...\r
if ($a->argv[1] == 'b2h') {\r
- $url = array("", trim(hex2bin($_REQUEST['url'])));\r
+ $url = ["", trim(hex2bin($_REQUEST['url']))];\r
echo Content\OEmbed::replaceCallback($url);\r
killme();\r
}\r
{
logger(__function__ . ":" . $consumer_key);
- $s = dba::select('clients', array('client_id', 'pw', 'redirect_uri'), array('client_id' => $consumer_key));
+ $s = dba::select('clients', ['client_id', 'pw', 'redirect_uri'], ['client_id' => $consumer_key]);
$r = dba::inArray($s);
if (DBM::is_result($r)) {
{
logger(__function__ . ":" . $consumer . ", " . $token_type . ", " . $token);
- $s = dba::select('tokens', array('id', 'secret', 'scope', 'expires', 'uid'), array('client_id' => $consumer->key, 'scope' => $token_type, 'id' => $token));
+ $s = dba::select('tokens', ['id', 'secret', 'scope', 'expires', 'uid'], ['client_id' => $consumer->key, 'scope' => $token_type, 'id' => $token]);
$r = dba::inArray($s);
if (DBM::is_result($r)) {
$r = dba::insert(
'tokens',
- array(
+ [
'id' => $key,
'secret' => $sec,
'client_id' => $k,
'scope' => 'request',
- 'expires' => time() + REQUEST_TOKEN_DURATION)
+ 'expires' => time() + REQUEST_TOKEN_DURATION]
);
if (!$r) {
$sec = self::genToken();
$r = dba::insert(
'tokens',
- array(
+ [
'id' => $key,
'secret' => $sec,
'client_id' => $consumer->key,
'scope' => 'access',
'expires' => time() + ACCESS_TOKEN_DURATION,
- 'uid' => $uverifier)
+ 'uid' => $uverifier]
);
if ($r) {
}
}
- dba::delete('tokens', array('id' => $token->key));
+ dba::delete('tokens', ['id' => $token->key]);
if (!is_null($ret) && !is_null($uverifier)) {
Config::delete("oauth", $verifier);
*/
private static function rearrangeData($data)
{
- $fields = array("name", "nick", "guid", "url", "addr", "alias",
+ $fields = ["name", "nick", "guid", "url", "addr", "alias",
"photo", "community", "keywords", "location", "about",
"batch", "notify", "poll", "request", "confirm", "poco",
- "priority", "network", "pubkey", "baseurl");
+ "priority", "network", "pubkey", "baseurl"];
- $newdata = array();
+ $newdata = [];
foreach ($fields as $field) {
if (isset($data[$field])) {
$newdata[$field] = $data[$field];
logger("Probing for ".$host, LOGGER_DEBUG);
- $ret = z_fetch_url($ssl_url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml'));
+ $ret = z_fetch_url($ssl_url, false, $redirects, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
if ($ret['success']) {
$xml = $ret['body'];
$xrd = parse_xml_string($xml, false);
}
if (!is_object($xrd)) {
- $ret = z_fetch_url($url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml'));
+ $ret = z_fetch_url($url, false, $redirects, ['timeout' => $xrd_timeout, 'accept_content' => 'application/xrd+xml']);
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
logger("Probing timeout for ".$url, LOGGER_DEBUG);
return false;
}
if (!is_object($xrd)) {
logger("No xrd object found for ".$host, LOGGER_DEBUG);
- return array();
+ return [];
}
$links = XML::elementToArray($xrd);
if (!isset($links["xrd"]["link"])) {
logger("No xrd data found for ".$host, LOGGER_DEBUG);
- return array();
+ return [];
}
- $lrdd = array();
+ $lrdd = [];
// The following webfinger path is defined in RFC 7033 https://tools.ietf.org/html/rfc7033
// Problem is that Hubzilla currently doesn't provide all data in the JSON webfinger
// compared to the XML webfinger. So this is commented out by now.
$webfinger = null;
if (is_bool($lrdd)) {
- return array();
+ return [];
}
if (!$lrdd) {
$parts = @parse_url($uri);
if (!$parts) {
- return array();
+ return [];
}
$host = $parts["host"];
if (!$lrdd) {
logger("No lrdd data found for ".$uri, LOGGER_DEBUG);
- return array();
+ return [];
}
foreach ($lrdd as $type => $template) {
return false;
}
- $data = array();
+ $data = [];
foreach ($webfinger["links"] as $link) {
- $data[] = array("@attributes" => $link);
+ $data[] = ["@attributes" => $link];
}
if (is_array($webfinger["aliases"])) {
foreach ($webfinger["aliases"] as $alias) {
- $data[] = array("@attributes" =>
- array("rel" => "alias",
- "href" => $alias));
+ $data[] = ["@attributes" =>
+ ["rel" => "alias",
+ "href" => $alias]];
}
}
$data = self::rearrangeData($data);
// Only store into the cache if the value seems to be valid
- if (!in_array($data['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
+ if (!in_array($data['network'], [NETWORK_PHANTOM, NETWORK_MAIL])) {
Cache::set("Probe::uri:".$network.":".$uri, $data, CACHE_DAY);
/// @todo temporary fix - we need a real contact update function that updates only changing fields
&& $data["addr"]
&& $data["poll"]
) {
- $fields = array('name' => $data['name'],
+ $fields = ['name' => $data['name'],
'nick' => $data['nick'],
'url' => $data['url'],
'addr' => $data['addr'],
'about' => $data['about'],
'notify' => $data['notify'],
'network' => $data['network'],
- 'server_url' => $data['baseurl']);
+ 'server_url' => $data['baseurl']];
- $fieldnames = array();
+ $fieldnames = [];
foreach ($fields as $key => $val) {
if (empty($val)) {
$fields['updated'] = DBM::date();
- $condition = array('nurl' => normalise_link($data["url"]));
+ $condition = ['nurl' => normalise_link($data["url"])];
$old_fields = dba::selectFirst('gcontact', $fieldnames, $condition);
dba::update('gcontact', $fields, $condition, $old_fields);
- $fields = array('name' => $data['name'],
+ $fields = ['name' => $data['name'],
'nick' => $data['nick'],
'url' => $data['url'],
'addr' => $data['addr'],
'confirm' => $data['confirm'],
'poco' => $data['poco'],
'network' => $data['network'],
- 'success_update' => DBM::date());
+ 'success_update' => DBM::date()];
- $fieldnames = array();
+ $fieldnames = [];
foreach ($fields as $key => $val) {
if (empty($val)) {
}
}
- $condition = array('nurl' => normalise_link($data["url"]), 'self' => false, 'uid' => 0);
+ $condition = ['nurl' => normalise_link($data["url"]), 'self' => false, 'uid' => 0];
$old_fields = dba::selectFirst('contact', $fieldnames, $condition);
}
if ($host == 'twitter.com') {
- return array("network" => NETWORK_TWITTER);
+ return ["network" => NETWORK_TWITTER];
}
$lrdd = self::hostMeta($host);
if (is_bool($lrdd)) {
- return array();
+ return [];
}
$path_parts = explode("/", trim($parts["path"], "/"));
$nick = substr($uri, 0, strpos($uri, '@'));
if (strpos($uri, '@twitter.com')) {
- return array("network" => NETWORK_TWITTER);
+ return ["network" => NETWORK_TWITTER];
}
$lrdd = self::hostMeta($host);
if (is_bool($lrdd)) {
- return array();
+ return [];
}
if (!$lrdd) {
logger("Probing ".$uri, LOGGER_DEBUG);
- if (in_array($network, array("", NETWORK_DFRN))) {
+ if (in_array($network, ["", NETWORK_DFRN])) {
$result = self::dfrn($webfinger);
}
if ((!$result && ($network == "")) || ($network == NETWORK_DIASPORA)) {
$xrd_timeout = Config::get('system', 'xrd_timeout', 20);
$redirects = 0;
- $ret = z_fetch_url($url, false, $redirects, array('timeout' => $xrd_timeout, 'accept_content' => $type));
+ $ret = z_fetch_url($url, false, $redirects, ['timeout' => $xrd_timeout, 'accept_content' => $type]);
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
return false;
}
return false;
}
- $webfinger = array();
+ $webfinger = [];
if (!empty($xrd_arr["xrd"]["subject"])) {
$webfinger["subject"] = $xrd_arr["xrd"]["subject"];
$webfinger["aliases"] = $xrd_arr["xrd"]["alias"];
}
- $webfinger["links"] = array();
+ $webfinger["links"] = [];
foreach ($xrd_arr["xrd"]["link"] as $value => $data) {
if (!empty($data["@attributes"])) {
*/
public static function profile($profile_link)
{
- $data = array();
+ $data = [];
logger("Check profile ".$profile_link, LOGGER_DEBUG);
// Fetch data via noscrape - this is faster
- $noscrape_url = str_replace(array("/hcard/", "/profile/"), "/noscrape/", $profile_link);
+ $noscrape_url = str_replace(["/hcard/", "/profile/"], "/noscrape/", $profile_link);
$data = self::pollNoscrape($noscrape_url, $data);
if (!isset($data["notify"])
$data = self::pollHcard($profile_link, $data, true);
}
- $prof_data = array();
+ $prof_data = [];
$prof_data["addr"] = $data["addr"];
$prof_data["nick"] = $data["nick"];
$prof_data["dfrn-request"] = $data["request"];
private static function dfrn($webfinger)
{
$hcard_url = "";
- $data = array();
+ $data = [];
foreach ($webfinger["links"] as $link) {
if (($link["rel"] == NAMESPACE_DFRN) && ($link["href"] != "")) {
$data["network"] = NETWORK_DFRN;
}
}
- $avatar = array();
+ $avatar = [];
$photos = $xpath->query("//*[contains(concat(' ', @class, ' '), ' photo ') or contains(concat(' ', @class, ' '), ' avatar ')]", $vcard); // */
foreach ($photos as $photo) {
- $attr = array();
+ $attr = [];
foreach ($photo->attributes as $attribute) {
$attr[$attribute->name] = trim($attribute->value);
}
if ($search->length > 0) {
foreach ($search as $link) {
//$data["request"] = $search->item(0)->nodeValue;
- $attr = array();
+ $attr = [];
foreach ($link->attributes as $attribute) {
$attr[$attribute->name] = trim($attribute->value);
}
private static function diaspora($webfinger)
{
$hcard_url = "";
- $data = array();
+ $data = [];
foreach ($webfinger["links"] as $link) {
if (($link["rel"] == "http://microformats.org/profile/hcard") && ($link["href"] != "")) {
$hcard_url = $link["href"];
*/
private static function ostatus($webfinger, $short = false)
{
- $data = array();
+ $data = [];
if (is_array($webfinger["aliases"])) {
foreach ($webfinger["aliases"] as $alias) {
$xpath = new DomXPath($doc);
- $data = array();
+ $data = [];
// This is ugly - but pump.io doesn't seem to know a better way for it
$data["name"] = trim($xpath->query("//h1[@class='media-header']")->item(0)->nodeValue);
*/
private static function pumpio($webfinger)
{
- $data = array();
+ $data = [];
foreach ($webfinger["links"] as $link) {
if (($link["rel"] == "http://webfinger.net/rel/profile-page")
&& ($link["type"] == "text/html")
$feed_url = "";
foreach ($feeds as $feed) {
- $attr = array();
+ $attr = [];
foreach ($feed->attributes as $attribute) {
$attr[$attribute->name] = trim($attribute->value);
}
$phost = substr($uri, strpos($uri, '@') + 1);
- $data = array();
+ $data = [];
$data["addr"] = $uri;
$data["network"] = NETWORK_MAIL;
$data["name"] = substr($uri, 0, strpos($uri, '@'));
if (class_exists('Imagick')) {
// Imagick::queryFormats won't help us a lot there...
// At least, not yet, other parts of friendica uses this array
- $t = array(
+ $t = [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif'
- );
+ ];
} else {
- $t = array();
+ $t = [];
$t['image/jpeg'] ='jpg';
if (imagetypes() & IMG_PNG) {
$t['image/png'] = 'png';
*/
public static function getFormatsMap()
{
- $m = array(
+ $m = [
'image/jpeg' => 'JPG',
'image/png' => 'PNG',
'image/gif' => 'GIF'
- );
+ ];
return $m;
}
$type = null;
if ($fromcurl) {
$a = get_app();
- $headers=array();
+ $headers=[];
$h = explode("\n", $a->get_curl_headers());
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
*/
public static function getInfoFromURL($url)
{
- $data = array();
+ $data = [];
$data = Cache::get($url);
}
}
}
- return array("width" => $dest_width, "height" => $dest_height);
+ return ["width" => $dest_width, "height" => $dest_height];
}
/**
if (!DBM::is_result($r)) {
logger("Can't detect user data for uid ".$uid, LOGGER_DEBUG);
- return(array());
+ return([]);
}
$page_owner_nick = $r[0]['nickname'];
if ((strlen($imagedata) == 0) && ($url == "")) {
logger("No image data and no url provided", LOGGER_DEBUG);
- return(array());
+ return([]);
} elseif (strlen($imagedata) == 0) {
logger("Uploading picture from ".$url, LOGGER_DEBUG);
if (($maximagesize) && (strlen($imagedata) > $maximagesize)) {
logger("Image exceeds size limit of ".$maximagesize, LOGGER_DEBUG);
- return(array());
+ return([]);
}
$tempfile = tempnam(get_temppath(), "cache");
if (!isset($data["mime"])) {
unlink($tempfile);
logger("File is no picture", LOGGER_DEBUG);
- return(array());
+ return([]);
}
$Image = new Image($imagedata, $data["mime"]);
if (!$Image->isValid()) {
unlink($tempfile);
logger("Picture is no valid picture", LOGGER_DEBUG);
- return(array());
+ return([]);
}
$Image->orient($tempfile);
if (!$r) {
logger("Picture couldn't be stored", LOGGER_DEBUG);
- return(array());
+ return([]);
}
- $image = array("page" => System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash,
- "full" => System::baseUrl()."/photo/{$hash}-0.".$Image->getExt());
+ $image = ["page" => System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash,
+ "full" => System::baseUrl()."/photo/{$hash}-0.".$Image->getExt()];
if ($width > 800 || $height > 800) {
$image["large"] = System::baseUrl()."/photo/{$hash}-0.".$Image->getExt();
*/
class Post extends BaseObject
{
- private $data = array();
+ private $data = [];
private $template = null;
- private $available_templates = array(
+ private $available_templates = [
'wall' => 'wall_thread.tpl',
'wall2wall' => 'wallwall_thread.tpl'
- );
+ ];
private $comment_box_template = 'comment_item.tpl';
private $toplevel = false;
private $writable = false;
- private $children = array();
+ private $children = [];
private $parent = null;
private $thread = null;
private $redirect_url = null;
{
require_once "mod/proxy.php";
- $result = array();
+ $result = [];
$a = self::getApp();
// between creation time and edit time of a second. Thats why we add the notice
// only if the difference is more than 1 second.
if (strtotime($item['edited']) - strtotime($item['created']) > 1) {
- $edited = array(
+ $edited = [
'label' => t('This entry was edited'),
'date' => datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r'),
'relative' => relative_date($item['edited'])
- );
+ ];
}
$commentww = '';
$sparkle = '';
if (local_user() && link_compare($a->contact['url'], $item['author-link'])) {
if ($item["event-id"] != 0) {
- $edpost = array("events/event/" . $item['event-id'], t("Edit"));
+ $edpost = ["events/event/" . $item['event-id'], t("Edit")];
} else {
- $edpost = array("editpost/" . $item['id'], t("Edit"));
+ $edpost = ["editpost/" . $item['id'], t("Edit")];
}
$dropping = in_array($item['uid'], [0, local_user()]);
} else {
$dropping = true;
}
- $drop = array(
+ $drop = [
'dropping' => $dropping,
'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
'select' => t('Select'),
'delete' => t('Delete'),
- );
+ ];
$filer = (($conv->getProfileOwner() == local_user()) ? t("save to folder") : false);
}
}
- $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
+ $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
call_hooks('render_location', $locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
// process action responses - e.g. like/dislike/attend/agree/whatever
- $response_verbs = array('like', 'dislike');
+ $response_verbs = ['like', 'dislike'];
$isevent = false;
$attend = [];
$response_verbs[] = 'attendmaybe';
if ($conv->isWritable()) {
$isevent = true;
- $attend = array(t('I will attend'), t('I will not attend'), t('I might attend'));
+ $attend = [t('I will attend'), t('I will not attend'), t('I might attend')];
}
}
if ($conv->getProfileOwner() == local_user()) {
$isstarred = (($item['starred']) ? "starred" : "unstarred");
- $star = array(
+ $star = [
'do' => t("add star"),
'undo' => t("remove star"),
'toggle' => t("toggle star status"),
'classdo' => $item['starred'] ? "hidden" : "",
'classundo' => $item['starred'] ? "" : "hidden",
'starred' => t('starred'),
- );
+ ];
$thread = dba::selectFirst('thread', ['ignored'], ['uid' => $item['uid'], 'iid' => $item['id']]);
if (DBM::is_result($thread)) {
- $ignore = array(
+ $ignore = [
'do' => t("ignore thread"),
'undo' => t("unignore thread"),
'toggle' => t("toggle ignore status"),
'classdo' => $thread['ignored'] ? "hidden" : "",
'classundo' => $thread['ignored'] ? "" : "hidden",
'ignored' => t('ignored'),
- );
+ ];
}
if (Feature::isEnabled($conv->getProfileOwner(), 'commtag')) {
- $tagger = array(
+ $tagger = [
'add' => t("add tag"),
'class' => "",
- );
+ ];
}
}
} else {
}
if ($conv->isWritable()) {
- $buttons = array(
- 'like' => array(t("I like this \x28toggle\x29"), t("like")),
- 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? array(t("I don't like this \x28toggle\x29"), t("dislike")) : '',
- );
+ $buttons = [
+ 'like' => [t("I like this \x28toggle\x29"), t("like")],
+ 'dislike' => Feature::isEnabled($conv->getProfileOwner(), 'dislike') ? [t("I don't like this \x28toggle\x29"), t("dislike")] : '',
+ ];
if ($shareable) {
- $buttons['share'] = array(t('Share this'), t('share'));
+ $buttons['share'] = [t('Share this'), t('share')];
}
// If a contact isn't writable, we cannot send a like or dislike to it
// Disable features that aren't available in several networks
/// @todo Add NETWORK_DIASPORA when it will pass this information
- if (!in_array($item["item_network"], array(NETWORK_DFRN)) && isset($buttons["dislike"])) {
+ if (!in_array($item["item_network"], [NETWORK_DFRN]) && isset($buttons["dislike"])) {
unset($buttons["dislike"]);
$isevent = false;
$tagger = '';
unset($buttons["like"]);
}
- $tmp_item = array(
+ $tmp_item = [
'template' => $this->getTemplate(),
'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
'tags' => $item['tags'],
'received' => $item['received'],
'commented' => $item['commented'],
'created_date' => $item['created'],
- );
+ ];
- $arr = array('item' => $item, 'output' => $tmp_item);
+ $arr = ['item' => $item, 'output' => $tmp_item];
call_hooks('display_item', $arr);
$result = $arr['output'];
- $result['children'] = array();
+ $result['children'] = [];
$children = $this->getChildren();
$nb_children = count($children);
if ($nb_children > 0) {
}
$template = get_markup_template($this->getCommentBoxTemplate());
- $comment_box = replace_macros($template, array(
+ $comment_box = replace_macros($template, [
'$return_path' => $a->query_string,
'$threaded' => $this->isThreaded(),
'$jsreload' => '',
'$sourceapp' => t($a->sourcename),
'$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => random_digits(12)
- ));
+ ]);
}
return $comment_box;
*/
class Thread extends BaseObject
{
- private $parents = array();
+ private $parents = [];
private $mode = null;
private $writable = false;
private $profile_owner = 0;
public function getTemplateData($conv_responses)
{
$a = self::getApp();
- $result = array();
+ $result = [];
$i = 0;
foreach ($this->parents as $item) {
WHERE `profile` = 1 AND `uid` = %d ORDER BY scale;",
$uid
);
- $photos = array();
+ $photos = [];
$ext = Image::supportedTypes();
foreach ($rp as $p) {
XML::addElement($doc, $root, "id", System::baseUrl()."/profile/".$owner["nick"]);
XML::addElement($doc, $root, "title", $owner["name"]);
- $attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION);
+ $attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION];
XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
- $attributes = array("rel" => "license", "href" => "http://creativecommons.org/licenses/by/3.0/");
+ $attributes = ["rel" => "license", "href" => "http://creativecommons.org/licenses/by/3.0/"];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("rel" => "alternate", "type" => "text/html", "href" => $alternatelink);
+ $attributes = ["rel" => "alternate", "type" => "text/html", "href" => $alternatelink];
XML::addElement($doc, $root, "link", "", $attributes);
// DFRN itself doesn't uses this. But maybe someone else wants to subscribe to the public feed.
OStatus::hublinks($doc, $root, $owner["nick"]);
- $attributes = array("rel" => "salmon", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
+ $attributes = ["rel" => "salmon", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
+ $attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
+ $attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
XML::addElement($doc, $root, "link", "", $attributes);
}
$uridate = datetime_convert('UTC', 'UTC', $owner['uri-date'].'+00:00', ATOM_TIME);
$picdate = datetime_convert('UTC', 'UTC', $owner['avatar-date'].'+00:00', ATOM_TIME);
- $attributes = array();
+ $attributes = [];
if (!$public || !$hidewall) {
- $attributes = array("dfrn:updated" => $namdate);
+ $attributes = ["dfrn:updated" => $namdate];
}
XML::addElement($doc, $author, "name", $owner["name"], $attributes);
XML::addElement($doc, $author, "uri", System::baseUrl().'/profile/'.$owner["nickname"], $attributes);
XML::addElement($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
- $attributes = array("rel" => "photo", "type" => "image/jpeg",
- "media:width" => 175, "media:height" => 175, "href" => $owner['photo']);
+ $attributes = ["rel" => "photo", "type" => "image/jpeg",
+ "media:width" => 175, "media:height" => 175, "href" => $owner['photo']];
if (!$public || !$hidewall) {
$attributes["dfrn:updated"] = $picdate;
/// @Todo
/// - Check real image type and image size
/// - Check which of these boths elements we should use
- $attributes = array(
+ $attributes = [
"rel" => "photo",
"type" => "image/jpeg",
"media:width" => 80,
"media:height" => 80,
- "href" => $contact["photo"]);
+ "href" => $contact["photo"]];
XML::addElement($doc, $author, "link", "", $attributes);
- $attributes = array(
+ $attributes = [
"rel" => "avatar",
"type" => "image/jpeg",
"media:width" => 80,
"media:height" => 80,
- "href" => $contact["photo"]);
+ "href" => $contact["photo"]];
XML::addElement($doc, $author, "link", "", $attributes);
return $author;
$data = parse_xml_string("<dummy>" . $r->link . "</dummy>", false);
if (is_object($data)) {
foreach ($data->link as $link) {
- $attributes = array();
+ $attributes = [];
foreach ($link->attributes() as $parameter => $value) {
$attributes[$parameter] = $value;
}
}
}
} else {
- $attributes = array("rel" => "alternate", "type" => "text/html", "href" => $r->link);
+ $attributes = ["rel" => "alternate", "type" => "text/html", "href" => $r->link];
XML::addElement($doc, $entry, "link", "", $attributes);
}
}
if ($r->content) {
- XML::addElement($doc, $entry, "content", bbcode($r->content), array("type" => "html"));
+ XML::addElement($doc, $entry, "content", bbcode($r->content), ["type" => "html"]);
}
return $entry;
$matches = false;
$cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|', $r, $matches);
if ($cnt) {
- $attributes = array("rel" => "enclosure",
+ $attributes = ["rel" => "enclosure",
"href" => $matches[1],
- "type" => $matches[3]);
+ "type" => $matches[3]];
if (intval($matches[2])) {
$attributes["length"] = intval($matches[2]);
*/
private static function entry($doc, $type, $item, $owner, $comment = false, $cid = 0, $single = false)
{
- $mentioned = array();
+ $mentioned = [];
if (!$item['parent']) {
return;
}
if ($item['deleted']) {
- $attributes = array("ref" => $item['uri'], "when" => datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00', ATOM_TIME));
+ $attributes = ["ref" => $item['uri'], "when" => datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00', ATOM_TIME)];
return XML::createElement($doc, "at:deleted-entry", "", $attributes);
}
if (($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
$parent = q("SELECT `guid`,`plink` FROM `item` WHERE `uri` = '%s' AND `uid` = %d", dbesc($parent_item), intval($item['uid']));
- $attributes = array("ref" => $parent_item, "type" => "text/html",
+ $attributes = ["ref" => $parent_item, "type" => "text/html",
"href" => $parent[0]['plink'],
- "dfrn:diaspora_guid" => $parent[0]['guid']);
+ "dfrn:diaspora_guid" => $parent[0]['guid']];
XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes);
}
}
}
- $attributes = array(
+ $attributes = [
"href" => $conversation_href,
- "ref" => $conversation_uri);
+ "ref" => $conversation_uri];
XML::addElement($doc, $entry, "ostatus:conversation", $conversation_uri, $attributes);
// The "content" field is not read by the receiver. We could remove it when the type is "text"
// We keep it at the moment, maybe there is some old version that doesn't read "dfrn:env"
- XML::addElement($doc, $entry, "content", (($type == 'html') ? $htmlbody : $body), array("type" => $type));
+ XML::addElement($doc, $entry, "content", (($type == 'html') ? $htmlbody : $body), ["type" => $type]);
// We save this value in "plink". Maybe we should read it from there as well?
XML::addElement(
$entry,
"link",
"",
- array("rel" => "alternate", "type" => "text/html",
- "href" => System::baseUrl() . "/display/" . $item["guid"])
+ ["rel" => "alternate", "type" => "text/html",
+ "href" => System::baseUrl() . "/display/" . $item["guid"]]
);
// "comment-allow" is some old fashioned stuff for old Friendica versions.
}
if ($item['app']) {
- XML::addElement($doc, $entry, "statusnet:notice_info", "", array("local_id" => $item['id'], "source" => $item['app']));
+ XML::addElement($doc, $entry, "statusnet:notice_info", "", ["local_id" => $item['id'], "source" => $item['app']]);
}
XML::addElement($doc, $entry, "dfrn:diaspora_guid", $item["guid"]);
// The signed text contains the content in Markdown, the sender handle and the signatur for the content
// It is needed for relayed comments to Diaspora.
if ($item['signed_text']) {
- $sign = base64_encode(json_encode(array('signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer'])));
+ $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']]));
XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign);
}
if (count($tags)) {
foreach ($tags as $t) {
if (($type != 'html') || ($t[0] != "@")) {
- XML::addElement($doc, $entry, "category", "", array("scheme" => "X-DFRN:".$t[0].":".$t[1], "term" => $t[2]));
+ XML::addElement($doc, $entry, "category", "", ["scheme" => "X-DFRN:".$t[0].":".$t[1], "term" => $t[2]]);
}
}
}
$entry,
"link",
"",
- array("rel" => "mentioned",
+ ["rel" => "mentioned",
"ostatus:object-type" => ACTIVITY_OBJ_GROUP,
- "href" => $mention)
+ "href" => $mention]
);
} else {
XML::addElement(
$entry,
"link",
"",
- array("rel" => "mentioned",
+ ["rel" => "mentioned",
"ostatus:object-type" => ACTIVITY_OBJ_PERSON,
- "href" => $mention)
+ "href" => $mention]
);
}
}
return (($res->status) ? $res->status : 3);
}
- $postvars = array();
+ $postvars = [];
$sent_dfrn_id = hex2bin((string) $res->dfrn_id);
$challenge = hex2bin((string) $res->challenge);
$perm = (($res->perm) ? $res->perm : null);
*/
private static function fetchauthor($xpath, $context, $importer, $element, $onlyfetch, $xml = "")
{
- $author = array();
+ $author = [];
$author["name"] = $xpath->evaluate($element."/atom:name/text()", $context)->item(0)->nodeValue;
$author["link"] = $xpath->evaluate($element."/atom:uri/text()", $context)->item(0)->nodeValue;
}
// Until now we aren't serving different sizes - but maybe later
- $avatarlist = array();
+ $avatarlist = [];
/// @todo check if "avatar" or "photo" would be the best field in the specification
$avatars = $xpath->query($element."/atom:link[@rel='avatar']", $context);
foreach ($avatars as $avatar) {
if (DBM::is_result($r) && !$onlyfetch) {
logger("Check if contact details for contact " . $r[0]["id"] . " (" . $r[0]["nick"] . ") have to be updated.", LOGGER_DEBUG);
- $poco = array("url" => $contact["url"]);
+ $poco = ["url" => $contact["url"]];
// When was the last change to name or uri?
$name_element = $xpath->query($element . "/atom:name", $context)->item(0);
}
// Save the keywords into the contact table
- $tags = array();
+ $tags = [];
$tagelements = $xpath->evaluate($element . "/poco:tags/text()", $context);
foreach ($tagelements as $tag) {
$tags[$tag->nodeValue] = $tag->nodeValue;
// "poco:birthday" is the birthday in the format "yyyy-mm-dd"
$value = $xpath->evaluate($element . "/poco:birthday/text()", $context)->item(0)->nodeValue;
- if (!in_array($value, array("", "0000-00-00", "0001-01-01"))) {
+ if (!in_array($value, ["", "0000-00-00", "0001-01-01"])) {
$bdyear = date("Y");
$value = str_replace("0000", $bdyear, $value);
}
// Get all field names
- $fields = array();
+ $fields = [];
foreach ($r[0] as $field => $data) {
$fields[$field] = $data;
}
unset($fields["uri-date"]);
// Update check for this field has to be done differently
- $datefields = array("name-date", "uri-date");
+ $datefields = ["name-date", "uri-date"];
foreach ($datefields as $field) {
if (strtotime($contact[$field]) > strtotime($r[0][$field])) {
logger("Difference for contact " . $contact["id"] . " in field '" . $field . "'. New value: '" . $contact[$field] . "', old value '" . $r[0][$field] . "'", LOGGER_DEBUG);
logger("Processing mails");
/// @TODO Rewrite this to one statement
- $msg = array();
+ $msg = [];
$msg["uid"] = $importer["importer_uid"];
$msg["from-name"] = $xpath->query("dfrn:sender/dfrn:name/text()", $mail)->item(0)->nodeValue;
$msg["from-url"] = $xpath->query("dfrn:sender/dfrn:uri/text()", $mail)->item(0)->nodeValue;
// send notifications.
/// @TODO Arange this mess
- $notif_params = array(
+ $notif_params = [
"type" => NOTIFY_MAIL,
"notify_flags" => $importer["notify-flags"],
"language" => $importer["language"],
"source_photo" => $importer["thumb"],
"verb" => ACTIVITY_POST,
"otype" => "mail"
- );
+ ];
notification($notif_params);
logger("Processing suggestions");
/// @TODO Rewrite this to one statement
- $suggest = array();
+ $suggest = [];
$suggest["uid"] = $importer["importer_uid"];
$suggest["cid"] = $importer["id"];
$suggest["url"] = $xpath->query("dfrn:url/text()", $suggestion)->item(0)->nodeValue;
);
notification(
- array(
+ [
"type" => NOTIFY_SUGGEST,
"notify_flags" => $importer["notify-flags"],
"language" => $importer["language"],
"source_link" => $importer["url"],
"source_photo" => $importer["photo"],
"verb" => ACTIVITY_REQ_FRIEND,
- "otype" => "intro")
+ "otype" => "intro"]
);
return true;
logger("Processing relocations");
/// @TODO Rewrite this to one statement
- $relocate = array();
+ $relocate = [];
$relocate["uid"] = $importer["importer_uid"];
$relocate["cid"] = $importer["id"];
$relocate["url"] = $xpath->query("dfrn:url/text()", $relocation)->item(0)->nodeValue;
// update items
/// @todo This is an extreme performance killer
- $fields = array(
- 'owner-link' => array($old["url"], $relocate["url"]),
- 'author-link' => array($old["url"], $relocate["url"]),
+ $fields = [
+ 'owner-link' => [$old["url"], $relocate["url"]],
+ 'author-link' => [$old["url"], $relocate["url"]],
//'owner-avatar' => array($old["photo"], $relocate["photo"]),
//'author-avatar' => array($old["photo"], $relocate["photo"]),
- );
+ ];
foreach ($fields as $n => $f) {
$r = q(
"SELECT `id` FROM `item` WHERE `%s` = '%s' AND `uid` = %d LIMIT 1",
return false;
}
- $fields = array('title' => $item["title"], 'body' => $item["body"],
+ $fields = ['title' => $item["title"], 'body' => $item["body"],
'tag' => $item["tag"], 'changed' => datetime_convert(),
- 'edited' => datetime_convert("UTC", "UTC", $item["edited"]));
+ 'edited' => datetime_convert("UTC", "UTC", $item["edited"])];
- $condition = array("`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]);
+ $condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
dba::update('item', $fields, $condition);
create_tags_from_itemuri($item["uri"], $importer["importer_uid"]);
if ($Blink && link_compare($Blink, System::baseUrl() . "/profile/" . $importer["nickname"])) {
// send a notification
notification(
- array(
+ [
"type" => NOTIFY_POKE,
"notify_flags" => $importer["notify-flags"],
"language" => $importer["language"],
"verb" => $item["verb"],
"otype" => "person",
"activity" => $verb,
- "parent" => $item["parent"])
+ "parent" => $item["parent"]]
);
}
}
$item["created"] = $xpath->query("atom:published/text()", $entry)->item(0)->nodeValue;
$item["body"] = $xpath->query("dfrn:env/text()", $entry)->item(0)->nodeValue;
- $item["body"] = str_replace(array(' ',"\t","\r","\n"), array('','','',''), $item["body"]);
+ $item["body"] = str_replace([' ',"\t","\r","\n"], ['','','',''], $item["body"]);
// make sure nobody is trying to sneak some html tags by us
$item["body"] = notags(base64url_decode($item["body"]));
$entrytype = self::getEntryType($importer, $item);
// Now assign the rest of the values that depend on the type of the message
- if (in_array($entrytype, array(DFRN_REPLY, DFRN_REPLY_RC))) {
+ if (in_array($entrytype, [DFRN_REPLY, DFRN_REPLY_RC])) {
if (!isset($item["object-type"])) {
$item["object-type"] = ACTIVITY_OBJ_COMMENT;
}
return;
}
- if (in_array($entrytype, array(DFRN_REPLY, DFRN_REPLY_RC))) {
+ if (in_array($entrytype, [DFRN_REPLY, DFRN_REPLY_RC])) {
$posted_id = item_store($item);
$parent = 0;
}
if ($author_remove || $owner_remove) {
$tags = explode(',', $i[0]["tag"]);
- $newtags = array();
+ $newtags = [];
if (count($tags)) {
foreach ($tags as $tag) {
if (trim($tag) !== trim($xo->body)) {
$xpath->registerNamespace("ostatus", NAMESPACE_OSTATUS);
$xpath->registerNamespace("statusnet", NAMESPACE_STATUSNET);
- $header = array();
+ $header = [];
$header["uid"] = $importer["uid"];
$header["network"] = NETWORK_DFRN;
$header["type"] = "remote";
$accounttype = intval($xpath->evaluate("/atom:feed/dfrn:account_type/text()")->item(0)->nodeValue);
if ($accounttype != $importer["contact-type"]) {
- dba::update('contact', array('contact-type' => $accounttype), array('id' => $importer["id"]));
+ dba::update('contact', ['contact-type' => $accounttype], ['id' => $importer["id"]]);
}
}
$forum = intval($xpath->evaluate("/atom:feed/dfrn:community/text()")->item(0)->nodeValue);
if ($forum != $importer["forum"]) {
- $condition = array('`forum` != ? AND `id` = ?', $forum, $importer["id"]);
- dba::update('contact', array('forum' => $forum), $condition);
+ $condition = ['`forum` != ? AND `id` = ?', $forum, $importer["id"]];
+ dba::update('contact', ['forum' => $forum], $condition);
}
// We are processing relocations even if we are ignoring a contact
self::processEntry($header, $xpath, $entry, $importer, $xml);
}
} else {
- $newentries = array();
+ $newentries = [];
$entries = $xpath->query("/atom:feed/atom:entry");
foreach ($entries as $entry) {
$created = $xpath->query("atom:published/text()", $entry)->item(0)->nodeValue;
{
$serverdata = Config::get("system", "relay_server");
if ($serverdata == "") {
- return array();
+ return [];
}
- $relay = array();
+ $relay = [];
$servers = explode(",", $serverdata);
}
$b64url_data = base64url_encode($data);
- $msg = str_replace(array("\n", "\r", " ", "\t"), array("", "", "", ""), $b64url_data);
+ $msg = str_replace(["\n", "\r", " ", "\t"], ["", "", "", ""], $b64url_data);
$signable_data = $msg.".".base64url_encode($type).".".base64url_encode($encoding).".".base64url_encode($alg);
$base = $basedom->children(NAMESPACE_SALMON_ME);
// Not sure if this cleaning is needed
- $data = str_replace(array(" ", "\t", "\r", "\n"), array("", "", "", ""), $base->data);
+ $data = str_replace([" ", "\t", "\r", "\n"], ["", "", "", ""], $base->data);
// Build the signed data
$type = $base->data[0]->attributes()->type[0];
http_status_exit(400);
}
- return array('message' => (string)base64url_decode($base->data),
+ return ['message' => (string)base64url_decode($base->data),
'author' => unxmlify($author_addr),
- 'key' => (string)$key);
+ 'key' => (string)$key];
}
/**
// unpack the data
// strip whitespace so our data element will return to one big base64 blob
- $data = str_replace(array(" ", "\t", "\r", "\n"), array("", "", "", ""), $base->data);
+ $data = str_replace([" ", "\t", "\r", "\n"], ["", "", "", ""], $base->data);
// stash away some other stuff for later
logger('Message verified.');
- return array('message' => (string)$inner_decrypted,
+ return ['message' => (string)$inner_decrypted,
'author' => unxmlify($author_link),
- 'key' => (string)$key);
+ 'key' => (string)$key];
}
// Process item retractions. This has to be done separated from the other stuff,
// since retractions for comments could come even from non followers.
- if (!empty($fields) && in_array($fields->getName(), array('retraction'))) {
+ if (!empty($fields) && in_array($fields->getName(), ['retraction'])) {
$target = notags(unxmlify($fields->target_type));
- if (in_array($target, array("Comment", "Like", "Post", "Reshare", "StatusMessage"))) {
+ if (in_array($target, ["Comment", "Like", "Post", "Reshare", "StatusMessage"])) {
logger('processing retraction for '.$target, LOGGER_DEBUG);
- $importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
+ $importer = ["uid" => 0, "page-flags" => PAGE_FREELOVE];
$message_id = self::dispatch($importer, $msg, $fields);
return $message_id;
}
logger("Unwanted message from ".$msg["author"]." send by ".$_SERVER["REMOTE_ADDR"]." with ".$_SERVER["HTTP_USER_AGENT"].": ".print_r($msg, true), LOGGER_DEBUG);
} else {
// Use a dummy importer to import the data for the public copy
- $importer = array("uid" => 0, "page-flags" => PAGE_FREELOVE);
+ $importer = ["uid" => 0, "page-flags" => PAGE_FREELOVE];
$message_id = self::dispatch($importer, $msg, $fields);
}
// All retractions are handled identically from now on.
// In the new version there will only be "retraction".
- if (in_array($type, array("signed_retraction", "relayable_retraction")))
+ if (in_array($type, ["signed_retraction", "relayable_retraction"]))
$type = "retraction";
if ($type == "request") {
if ($fieldname == "participant_handles") {
$fieldname = "participants";
}
- if (in_array($type, array("like", "participation"))) {
+ if (in_array($type, ["like", "participation"])) {
if ($fieldname == "target_type") {
$fieldname = "parent_type";
}
$author_signature = base64_decode($entry);
} elseif (($fieldname == "parent_author_signature") && ($entry != "")) {
$parent_author_signature = base64_decode($entry);
- } elseif (!in_array($fieldname, array("author_signature", "parent_author_signature", "target_author_signature"))) {
+ } elseif (!in_array($fieldname, ["author_signature", "parent_author_signature", "target_author_signature"])) {
if ($signed_data != "") {
$signed_data .= ";";
}
$signed_data .= $entry;
}
- if (!in_array($fieldname, array("parent_author_signature", "target_author_signature"))
+ if (!in_array($fieldname, ["parent_author_signature", "target_author_signature"])
|| ($orig_type == "relayable_retraction")
) {
XML::copy($entry, $fields, $fieldname);
}
// This is something that shouldn't happen at all.
- if (in_array($type, array("status_message", "reshare", "profile"))) {
+ if (in_array($type, ["status_message", "reshare", "profile"])) {
if ($msg["author"] != $fields->author) {
logger("Message handle is not the same as envelope sender. Quitting this message.");
return false;
}
// Only some message types have signatures. So we quit here for the other types.
- if (!in_array($type, array("comment", "like"))) {
- return array("fields" => $fields, "relayed" => false);
+ if (!in_array($type, ["comment", "like"])) {
+ return ["fields" => $fields, "relayed" => false];
}
// No author_signature? This is a must, so we quit.
if (!isset($author_signature)) {
logger("No valid author signature for author ".$fields->author. " in type ".$type." - signed data: ".$signed_data." - Message: ".$msg["message"]." - Signature ".$author_signature, LOGGER_DEBUG);
return false;
} else {
- return array("fields" => $fields, "relayed" => $relayed);
+ return ["fields" => $fields, "relayed" => $relayed];
}
}
return false;
}
- $msg = array("message" => $x, "author" => $author);
+ $msg = ["message" => $x, "author" => $author];
$msg["key"] = self::key($msg["author"]);
$network = NETWORK_DIASPORA;
}
- return array("cid" => $cid, "network" => $network);
+ return ["cid" => $cid, "network" => $network];
}
/**
return false;
}
- $fields = array('url' => $data['url'], 'nurl' => normalise_link($data['url']),
+ $fields = ['url' => $data['url'], 'nurl' => normalise_link($data['url']),
'name' => $data['name'], 'nick' => $data['nick'],
'addr' => $data['addr'], 'batch' => $data['batch'],
'notify' => $data['notify'], 'poll' => $data['poll'],
- 'network' => $data['network']);
+ 'network' => $data['network']];
- dba::update('contact', $fields, array('addr' => $old_handle));
+ dba::update('contact', $fields, ['addr' => $old_handle]);
- $fields = array('url' => $data['url'], 'nurl' => normalise_link($data['url']),
+ $fields = ['url' => $data['url'], 'nurl' => normalise_link($data['url']),
'name' => $data['name'], 'nick' => $data['nick'],
'addr' => $data['addr'], 'connect' => $data['addr'],
'notify' => $data['notify'], 'photo' => $data['photo'],
- 'server_url' => $data['baseurl'], 'network' => $data['network']);
+ 'server_url' => $data['baseurl'], 'network' => $data['network']];
- dba::update('gcontact', $fields, array('addr' => $old_handle));
+ dba::update('gcontact', $fields, ['addr' => $old_handle]);
logger('Contacts are updated.');
// update items
/// @todo This is an extreme performance killer
- $fields = array(
- 'owner-link' => array($contact["url"], $data["url"]),
- 'author-link' => array($contact["url"], $data["url"]),
- );
+ $fields = [
+ 'owner-link' => [$contact["url"], $data["url"]],
+ 'author-link' => [$contact["url"], $data["url"]],
+ ];
foreach ($fields as $n => $f) {
$r = q(
"SELECT `id` FROM `item` WHERE `%s` = '%s' AND `uid` = %d LIMIT 1",
// Fetch the contact id - if we know this contact
$author_contact = self::authorContactByUrl($contact, $person, $importer["uid"]);
- $datarray = array();
+ $datarray = [];
$datarray["uid"] = $importer["uid"];
$datarray["contact-id"] = $author_contact["cid"];
if ($message_id && $parent_item["origin"]) {
// Formerly we stored the signed text, the signature and the author in different fields.
// We now store the raw data so that we are more flexible.
- dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
+ dba::insert('sign', ['iid' => $message_id, 'signed_text' => json_encode($data)]);
// notify others
Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $message_id);
dba::unlock();
- dba::update('conv', array('updated' => datetime_convert()), array('id' => $conversation["id"]));
+ dba::update('conv', ['updated' => datetime_convert()], ['id' => $conversation["id"]]);
notification(
- array(
+ [
"type" => NOTIFY_MAIL,
"notify_flags" => $importer["notify-flags"],
"language" => $importer["language"],
"to_name" => $importer["username"],
"to_email" => $importer["email"],
"uid" =>$importer["uid"],
- "item" => array("subject" => $subject, "body" => $body),
+ "item" => ["subject" => $subject, "body" => $body],
"source_name" => $person["name"],
"source_link" => $person["url"],
"source_photo" => $person["thumb"],
"verb" => ACTIVITY_POST,
- "otype" => "mail")
+ "otype" => "mail"]
);
return true;
}
$link = '<link rel="alternate" type="text/html" href="'.System::baseUrl()."/display/".$importer["nickname"]."/".$parent_item["id"].'" />';
$parent_body = $parent_item["body"];
- $xmldata = array("object" => array("type" => $objtype,
+ $xmldata = ["object" => ["type" => $objtype,
"local" => "1",
"id" => $parent_item["uri"],
"link" => $link,
"title" => "",
- "content" => $parent_body));
+ "content" => $parent_body]];
return XML::fromArray($xmldata, $xml, true);
}
// likes on comments aren't supported by Diaspora - only on posts
// But maybe this will be supported in the future, so we will accept it.
- if (!in_array($parent_type, array("Post", "Comment"))) {
+ if (!in_array($parent_type, ["Post", "Comment"])) {
return false;
}
$verb = ACTIVITY_DISLIKE;
}
- $datarray = array();
+ $datarray = [];
$datarray["protocol"] = PROTOCOL_DIASPORA;
if ($message_id && $origin) {
// Formerly we stored the signed text, the signature and the author in different fields.
// We now store the raw data so that we are more flexible.
- dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($data)));
+ dba::insert('sign', ['iid' => $message_id, 'signed_text' => json_encode($data)]);
// notify others
Worker::add(PRIORITY_HIGH, "Notifier", "comment-import", $message_id);
dba::unlock();
- dba::update('conv', array('updated' => datetime_convert()), array('id' => $conversation["id"]));
+ dba::update('conv', ['updated' => datetime_convert()], ['id' => $conversation["id"]]);
return true;
}
$tags = explode("#", $tags);
- $keywords = array();
+ $keywords = [];
foreach ($tags as $tag) {
$tag = trim(strtolower($tag));
if ($tag != "") {
intval($importer["uid"])
);
- $gcontact = array("url" => $contact["url"], "network" => NETWORK_DIASPORA, "generation" => 2,
+ $gcontact = ["url" => $contact["url"], "network" => NETWORK_DIASPORA, "generation" => 2,
"photo" => $image_url, "name" => $name, "location" => $location,
"about" => $about, "birthday" => $birthday, "gender" => $gender,
"addr" => $author, "nick" => $nick, "keywords" => $keywords,
- "hide" => !$searchable, "nsfw" => $nsfw);
+ "hide" => !$searchable, "nsfw" => $nsfw];
$gcid = GContact::update($gcontact);
if ($contact["rel"] == CONTACT_IS_SHARING) {
dba::update(
'contact',
- array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
- array('id' => $contact["id"], 'uid' => $importer["uid"])
+ ['rel' => CONTACT_IS_FRIEND, 'writable' => true],
+ ['id' => $contact["id"], 'uid' => $importer["uid"]]
);
}
// send notification
// they are not CONTACT_IS_FOLLOWER anymore but that's what we have in the array
if ($self && $contact["rel"] == CONTACT_IS_FOLLOWER) {
- $arr = array();
+ $arr = [];
$arr["protocol"] = PROTOCOL_DIASPORA;
$arr["uri"] = $arr["parent-uri"] = item_new_uri($a->get_hostname(), $importer["uid"]);
$arr["uid"] = $importer["uid"];
$link = '<link rel="alternate" type="text/html" href="'.$contact["url"].'" />'."\n".
'<link rel="photo" type="image/jpeg" href="'.$contact["thumb"].'" />'."\n";
- $xmldata = array("object" => array("type" => $objtype,
+ $xmldata = ["object" => ["type" => $objtype,
"title" => $contact["name"],
"id" => $contact["url"]."/".$contact["name"],
- "link" => $link));
+ "link" => $link]];
return XML::fromArray($xmldata, $xml, true);
}
// If we are now friends, we are sending a share message.
// Normally we needn't to do so, but the first message could have been vanished.
- if (in_array($contact["rel"], array(CONTACT_IS_FRIEND))) {
+ if (in_array($contact["rel"], [CONTACT_IS_FRIEND])) {
$u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer["uid"]));
if ($u) {
logger("Sending share message to author ".$author." - Contact: ".$contact["id"]." - User: ".$importer["uid"], LOGGER_DEBUG);
}
}
- if (!$following && $sharing && in_array($importer["page-flags"], array(PAGE_SOAPBOX, PAGE_NORMAL))) {
+ if (!$following && $sharing && in_array($importer["page-flags"], [PAGE_SOAPBOX, PAGE_NORMAL])) {
logger("Author ".$author." wants to share with us - but doesn't want to listen. Request is ignored.", LOGGER_DEBUG);
return false;
} elseif (!$following && !$sharing) {
$ret = self::sendShare($u[0], $contact_record);
// Send the profile data, maybe it weren't transmitted before
- self::sendProfile($importer["uid"], array($contact_record));
+ self::sendProfile($importer["uid"], [$contact_record]);
}
}
// Then refetch the content, if it is a reshare from a reshare.
// If it is a reshared post from another network then reformat to avoid display problems with two share elements
if (self::isReshare($r[0]["body"], true)) {
- $r = array();
+ $r = [];
} elseif (self::isReshare($r[0]["body"], false) || strstr($r[0]["body"], "[share")) {
$r[0]["body"] = diaspora2bb(bb2diaspora($r[0]["body"]));
$orig_url = System::baseUrl()."/display/".$original_item["guid"];
- $datarray = array();
+ $datarray = [];
$datarray["uid"] = $importer["uid"];
$datarray["contact-id"] = $contact["id"];
}
// Fetch items that are about to be deleted
- $fields = array('uid', 'id', 'parent', 'parent-uri', 'author-link');
+ $fields = ['uid', 'id', 'parent', 'parent-uri', 'author-link'];
// When we receive a public retraction, we delete every item that we find.
if ($importer['uid'] == 0) {
- $condition = array("`guid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid);
+ $condition = ["`guid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid];
} else {
- $condition = array("`guid` = ? AND `uid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid, $importer['uid']);
+ $condition = ["`guid` = ? AND `uid` = ? AND NOT `file` LIKE '%%[%%' AND NOT `deleted`", $target_guid, $importer['uid']];
}
$r = dba::select('item', $fields, $condition);
if (!DBM::is_result($r)) {
// The function "item_drop" doesn't work for that case
dba::update(
'item',
- array(
+ [
'deleted' => true,
'title' => '',
'body' => '',
'edited' => datetime_convert(),
- 'changed' => datetime_convert()),
- array('id' => $item["id"])
+ 'changed' => datetime_convert()],
+ ['id' => $item["id"]]
);
// Delete the thread - if it is a starting post and not a comment
$target_type = notags(unxmlify($data->target_type));
$contact = self::contactByHandle($importer["uid"], $sender);
- if (!$contact && (in_array($target_type, array("Contact", "Person")))) {
+ if (!$contact && (in_array($target_type, ["Contact", "Person"]))) {
logger("cannot find contact for sender: ".$sender." and user ".$importer["uid"]);
return false;
}
return true;
}
- $address = array();
+ $address = [];
if ($data->location) {
foreach ($data->location->children() as $fieldname => $data) {
$address[$fieldname] = notags(unxmlify($data));
$body = diaspora2bb($text);
- $datarray = array();
+ $datarray = [];
// Attach embedded pictures to the body
if ($data->photo) {
$ciphertext = self::aesEncrypt($aes_key, $iv, $msg);
- $json = json_encode(array("iv" => $b_iv, "key" => $b_aes_key));
+ $json = json_encode(["iv" => $b_iv, "key" => $b_aes_key]);
$encrypted_key_bundle = "";
openssl_public_encrypt($json, $encrypted_key_bundle, $pubkey);
$json_object = json_encode(
- array("aes_key" => base64_encode($encrypted_key_bundle),
- "encrypted_magic_envelope" => base64_encode($ciphertext))
+ ["aes_key" => base64_encode($encrypted_key_bundle),
+ "encrypted_magic_envelope" => base64_encode($ciphertext)]
);
return $json_object;
public static function buildMagicEnvelope($msg, $user)
{
$b64url_data = base64url_encode($msg);
- $data = str_replace(array("\n", "\r", " ", "\t"), array("", "", "", ""), $b64url_data);
+ $data = str_replace(["\n", "\r", " ", "\t"], ["", "", "", ""], $b64url_data);
$key_id = base64url_encode(self::myHandle($user));
$type = "application/xml";
$signature = Crypto::rsaSign($signable_data, $user["uprvkey"]);
$sig = base64url_encode($signature);
- $xmldata = array("me:env" => array("me:data" => $data,
- "@attributes" => array("type" => $type),
+ $xmldata = ["me:env" => ["me:data" => $data,
+ "@attributes" => ["type" => $type],
"me:encoding" => $encoding,
"me:alg" => $alg,
"me:sig" => $sig,
- "@attributes2" => array("key_id" => $key_id)));
+ "@attributes2" => ["key_id" => $key_id]]];
- $namespaces = array("me" => "http://salmon-protocol.org/ns/magic-env");
+ $namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
return XML::fromArray($xmldata, $xml, false, $namespaces);
}
if (!intval(Config::get("system", "diaspora_test"))) {
$content_type = (($public_batch) ? "application/magic-envelope+xml" : "application/json");
- post_url($dest_url."/", $envelope, array("Content-Type: ".$content_type));
+ post_url($dest_url."/", $envelope, ["Content-Type: ".$content_type]);
$return_code = $a->get_curl_code();
} else {
logger("test_mode");
*/
public static function buildPostXml($type, $message)
{
- $data = array($type => $message);
+ $data = [$type => $message];
return XML::fromArray($data, $xml);
}
$author = self::myHandle($owner);
- $message = array("author" => $author,
+ $message = ["author" => $author,
"guid" => get_guid(32),
"parent_type" => "Post",
- "parent_guid" => $item["guid"]);
+ "parent_guid" => $item["guid"]];
logger("Send participation for ".$item["guid"]." by ".$author, LOGGER_DEBUG);
$signed_text = 'AccountMigration:'.$old_handle.':'.$profile['author'];
$signature = base64_encode(Crypto::rsaSign($signed_text, $owner["uprvkey"], "sha256"));
- $message = array("author" => $old_handle,
+ $message = ["author" => $old_handle,
"profile" => $profile,
- "signature" => $signature);
+ "signature" => $signature];
logger("Send account migration ".print_r($message, true), LOGGER_DEBUG);
}
*/
- $message = array("author" => self::myHandle($owner),
+ $message = ["author" => self::myHandle($owner),
"recipient" => $contact["addr"],
"following" => "true",
- "sharing" => "true");
+ "sharing" => "true"];
logger("Send share ".print_r($message, true), LOGGER_DEBUG);
*/
public static function sendUnshare($owner, $contact)
{
- $message = array("author" => self::myHandle($owner),
+ $message = ["author" => self::myHandle($owner),
"recipient" => $contact["addr"],
"following" => "false",
- "sharing" => "false");
+ "sharing" => "false"];
logger("Send unshare ".print_r($message, true), LOGGER_DEBUG);
NETWORK_DIASPORA
);
if ($r) {
- $ret= array();
+ $ret= [];
$ret["root_handle"] = self::handleFromContact($r[0]["contact-id"]);
$ret["root_guid"] = $guid;
return($ret);
$profile = $matches[1];
}
- $ret= array();
+ $ret= [];
$ret["root_handle"] = preg_replace("=https?://(.*)/u/(.*)=ism", "$2@$1", $profile);
if (($ret["root_handle"] == $profile) || ($ret["root_handle"] == "")) {
{
$r = q("SELECT `guid`, `uid`, `start`, `finish`, `nofinish`, `summary`, `desc`, `location`, `adjust` FROM `event` WHERE `id` = %d", intval($event_id));
if (!DBM::is_result($r)) {
- return array();
+ return [];
}
$event = $r[0];
- $eventdata = array();
+ $eventdata = [];
$r = q("SELECT `timezone` FROM `user` WHERE `uid` = %d", intval($event['uid']));
if (!DBM::is_result($r)) {
- return array();
+ return [];
}
$user = $r[0];
$r = q("SELECT `addr`, `nick` FROM `contact` WHERE `uid` = %d AND `self`", intval($event['uid']));
if (!DBM::is_result($r)) {
- return array();
+ return [];
}
$owner = $r[0];
$eventdata['description'] = html_entity_decode(bb2diaspora($event['desc']));
}
if ($event['location']) {
- $location = array();
+ $location = [];
$location["address"] = html_entity_decode(bb2diaspora($event['location']));
$location["lat"] = 0;
$location["lng"] = 0;
// Detect a share element and do a reshare
if (!$item['private'] && ($ret = self::isReshare($item["body"]))) {
- $message = array("author" => $myaddr,
+ $message = ["author" => $myaddr,
"guid" => $item["guid"],
"created_at" => $created,
"root_author" => $ret["root_handle"],
"root_guid" => $ret["root_guid"],
"provider_display_name" => $item["app"],
- "public" => $public);
+ "public" => $public];
$type = "reshare";
} else {
}
}
- $location = array();
+ $location = [];
if ($item["location"] != "")
$location["address"] = $item["location"];
$location["lng"] = $coord[1];
}
- $message = array("author" => $myaddr,
+ $message = ["author" => $myaddr,
"guid" => $item["guid"],
"created_at" => $created,
"public" => $public,
"text" => $body,
"provider_display_name" => $item["app"],
- "location" => $location);
+ "location" => $location];
// Diaspora rejects messages when they contain a location without "lat" or "lng"
if (!isset($location["lat"]) || !isset($location["lng"])) {
$type = "status_message";
}
- $msg = array("type" => $type, "message" => $message);
+ $msg = ["type" => $type, "message" => $message];
Cache::set($cachekey, $msg, CACHE_QUARTER_HOUR);
$positive = "false";
}
- return(array("author" => self::myHandle($owner),
+ return(["author" => self::myHandle($owner),
"guid" => $item["guid"],
"parent_guid" => $parent["guid"],
"parent_type" => $target_type,
"positive" => $positive,
- "author_signature" => ""));
+ "author_signature" => ""]);
}
/**
return false;
}
- return(array("author" => self::myHandle($owner),
+ return(["author" => self::myHandle($owner),
"guid" => $item["guid"],
"parent_guid" => $parent["guid"],
"status" => $attend_answer,
- "author_signature" => ""));
+ "author_signature" => ""]);
}
/**
$text = html_entity_decode(bb2diaspora($item["body"]));
$created = datetime_convert("UTC", "UTC", $item["created"], 'Y-m-d\TH:i:s\Z');
- $comment = array("author" => self::myHandle($owner),
+ $comment = ["author" => self::myHandle($owner),
"guid" => $item["guid"],
"created_at" => $created,
"parent_guid" => $parent["guid"],
"text" => $text,
- "author_signature" => "");
+ "author_signature" => ""];
// Send the thread parent guid only if it is a threaded comment
if ($item['thr-parent'] != $item['parent-uri']) {
*/
public static function sendFollowup($item, $owner, $contact, $public_batch = false)
{
- if (in_array($item['verb'], array(ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE))) {
+ if (in_array($item['verb'], [ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE])) {
$message = self::constructAttend($item, $owner);
$type = "event_participation";
- } elseif (in_array($item["verb"], array(ACTIVITY_LIKE, ACTIVITY_DISLIKE))) {
+ } elseif (in_array($item["verb"], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
$message = self::constructLike($item, $owner);
$type = "like";
} else {
$signed_parts = explode(";", $signature['signed_text']);
if ($item["deleted"]) {
- $message = array("author" => $signature['signer'],
+ $message = ["author" => $signature['signer'],
"target_guid" => $signed_parts[0],
- "target_type" => $signed_parts[1]);
- } elseif (in_array($item["verb"], array(ACTIVITY_LIKE, ACTIVITY_DISLIKE))) {
- $message = array("author" => $signed_parts[4],
+ "target_type" => $signed_parts[1]];
+ } elseif (in_array($item["verb"], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
+ $message = ["author" => $signed_parts[4],
"guid" => $signed_parts[1],
"parent_guid" => $signed_parts[3],
"parent_type" => $signed_parts[2],
"positive" => $signed_parts[0],
"author_signature" => $signature['signature'],
- "parent_author_signature" => "");
+ "parent_author_signature" => ""];
} else {
// Remove the comment guid
$guid = array_shift($signed_parts);
// Glue the parts together
$text = implode(";", $signed_parts);
- $message = array("author" => $handle,
+ $message = ["author" => $handle,
"guid" => $guid,
"parent_guid" => $parent_guid,
"text" => implode(";", $signed_parts),
"author_signature" => $signature['signature'],
- "parent_author_signature" => "");
+ "parent_author_signature" => ""];
}
return $message;
}
{
if ($item["deleted"]) {
return self::sendRetraction($item, $owner, $contact, $public_batch, true);
- } elseif (in_array($item["verb"], array(ACTIVITY_LIKE, ACTIVITY_DISLIKE))) {
+ } elseif (in_array($item["verb"], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
$type = "like";
} else {
$type = "comment";
} else {// New way
$msg = json_decode($signature['signed_text'], true);
- $message = array();
+ $message = [];
if (is_array($msg)) {
foreach ($msg as $field => $data) {
if (!$item["deleted"]) {
if ($item['id'] == $item['parent']) {
$target_type = "Post";
- } elseif (in_array($item["verb"], array(ACTIVITY_LIKE, ACTIVITY_DISLIKE))) {
+ } elseif (in_array($item["verb"], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
$target_type = "Like";
} else {
$target_type = "Comment";
}
- $message = array("author" => $itemaddr,
+ $message = ["author" => $itemaddr,
"target_guid" => $item['guid'],
- "target_type" => $target_type);
+ "target_type" => $target_type];
logger("Got message ".print_r($message, true), LOGGER_DEBUG);
}
$cnv = $r[0];
- $conv = array(
+ $conv = [
"author" => $cnv["creator"],
"guid" => $cnv["guid"],
"subject" => $cnv["subject"],
"created_at" => datetime_convert("UTC", "UTC", $cnv['created'], 'Y-m-d\TH:i:s\Z'),
"participants" => $cnv["recips"]
- );
+ ];
$body = bb2diaspora($item["body"]);
$created = datetime_convert("UTC", "UTC", $item["created"], 'Y-m-d\TH:i:s\Z');
- $msg = array(
+ $msg = [
"author" => $myaddr,
"guid" => $item["guid"],
"conversation_guid" => $cnv["guid"],
"text" => $body,
"created_at" => $created,
- );
+ ];
if ($item["reply"]) {
$message = $msg;
$type = "message";
} else {
- $message = array(
+ $message = [
"author" => $cnv["creator"],
"guid" => $cnv["guid"],
"subject" => $cnv["subject"],
"created_at" => datetime_convert("UTC", "UTC", $cnv['created'], 'Y-m-d\TH:i:s\Z'),
"participants" => $cnv["recips"],
- "message" => $msg);
+ "message" => $msg];
$type = "conversation";
}
);
if (!$r) {
- return array();
+ return [];
}
$profile = $r[0];
$tags = trim($tags);
}
- return array("author" => $handle,
+ return ["author" => $handle,
"first_name" => $first,
"last_name" => $last,
"image_url" => $large,
"location" => $location,
"searchable" => $searchable,
"nsfw" => "false",
- "tag_string" => $tags);
+ "tag_string" => $tags];
}
/**
return false;
}
- if (!in_array($r[0]["verb"], array(ACTIVITY_LIKE, ACTIVITY_DISLIKE))) {
+ if (!in_array($r[0]["verb"], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
return false;
}
* Now store the signature more flexible to dynamically support new fields.
* This will break Diaspora compatibility with Friendica versions prior to 3.5.
*/
- dba::insert('sign', array('iid' => $post_id, 'signed_text' => json_encode($message)));
+ dba::insert('sign', ['iid' => $post_id, 'signed_text' => json_encode($message)]);
logger('Stored diaspora like signature');
return true;
* Now store the signature more flexible to dynamically support new fields.
* This will break Diaspora compatibility with Friendica versions prior to 3.5.
*/
- dba::insert('sign', array('iid' => $message_id, 'signed_text' => json_encode($message)));
+ dba::insert('sign', ['iid' => $message_id, 'signed_text' => json_encode($message)]);
logger('Stored diaspora comment signature');
return true;
public static function poll($mbox, $email_addr)
{
if (!$mbox || !$email_addr) {
- return array();
+ return [];
}
$search1 = @imap_search($mbox, 'FROM "' . $email_addr . '"', SE_UID);
if (!$search1) {
- $search1 = array();
+ $search1 = [];
} else {
logger("Found mails from ".$email_addr, LOGGER_DEBUG);
}
$search2 = @imap_search($mbox, 'TO "' . $email_addr . '"', SE_UID);
if (!$search2) {
- $search2 = array();
+ $search2 = [];
} else {
logger("Found mails to ".$email_addr, LOGGER_DEBUG);
}
$search3 = @imap_search($mbox, 'CC "' . $email_addr . '"', SE_UID);
if (!$search3) {
- $search3 = array();
+ $search3 = [];
} else {
logger("Found mails cc ".$email_addr, LOGGER_DEBUG);
}
*/
public static function messageMeta($mbox, $uid)
{
- $ret = (($mbox && $uid) ? @imap_fetch_overview($mbox, $uid, FT_UID) : array(array())); // POSSIBLE CLEANUP --> array(array()) is probably redundant now
- return (count($ret)) ? $ret : array();
+ $ret = (($mbox && $uid) ? @imap_fetch_overview($mbox, $uid, FT_UID) : [[]]); // POSSIBLE CLEANUP --> array(array()) is probably redundant now
+ return (count($ret)) ? $ret : [];
}
/**
*/
public static function getMessage($mbox, $uid, $reply)
{
- $ret = array();
+ $ret = [];
$struc = (($mbox && $uid) ? @imap_fetchstructure($mbox, $uid, FT_UID) : null);
// PARAMETERS
// get all parameters, like charset, filenames of attachments, etc.
- $params = array();
+ $params = [];
if ($p->parameters) {
foreach ($p->parameters as $x) {
$params[strtolower($x->attribute)] = $x->value;
private static function unifyAttributionLine($message)
{
- $quotestr = array('quote', 'spoiler');
+ $quotestr = ['quote', 'spoiler'];
foreach ($quotestr as $quote) {
$message = self::saveReplace('/----- Original Message -----\s.*?From: "([^<"].*?)" <(.*?)>\s.*?To: (.*?)\s*?Cc: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
$message = self::saveReplace('/----- Original Message -----\s.*?From: "([^<"].*?)" <(.*?)>\s.*?To: (.*?)\s*?Sent: (.*?)\s.*?Subject: ([^\n].*)\s*\['.$quote.'\]/i', "[".$quote."='$1']\n", $message);
$cleaned = trim($result[1].$result[2].$result[3]);
- $cleaned = str_replace(array("\n- --\n", "\n- -"), array("\n-- \n", "\n-"), $cleaned);
+ $cleaned = str_replace(["\n- --\n", "\n- -"], ["\n-- \n", "\n-"], $cleaned);
if ($cleaned == '') {
$cleaned = $message;
// When the signature separator is inside a quote, we don't separate
if (($sigpos < $quotepos) && ($sigpos != 0)) {
- return array('body' => $message, 'sig' => '');
+ return ['body' => $message, 'sig' => ''];
}
$pattern = '/(.*)[\r\n]-- [\r\n](.*)/is';
$sig = '';
}
- return array('body' => $cleaned, 'sig' => $sig);
+ return ['body' => $cleaned, 'sig' => $sig];
}
private static function removeLinebreak($message)
{
$arrbody = explode("\n", trim($message));
- $lines = array();
+ $lines = [];
$lineno = 0;
foreach ($arrbody as $i => $line) {
{
// Convert Quotes
$arrbody = explode("\n", trim($body));
- $arrlevel = array();
+ $arrlevel = [];
for ($i = 0; $i < count($arrbody); $i++) {
$quotelevel = 0;
$quotelevel = 0;
$previousquote = 0;
- $arrbodyquoted = array();
+ $arrbodyquoted = [];
for ($i = 0; $i < count($arrbody); $i++) {
$previousquote = $quotelevel;
$message = str_replace("[/quote][quote]", "", $message);
} while ($message != $oldmessage);
- $quotes = array();
+ $quotes = [];
$startquotes = 0;
$xpath->registerNamespace('media', "http://search.yahoo.com/mrss/");
$xpath->registerNamespace('poco', NAMESPACE_POCO);
- $author = array();
+ $author = [];
// Is it RDF?
if ($xpath->query('/rdf:RDF/rss:channel')->length > 0) {
$author["owner-avatar"] = $contact["thumb"];
}
- $header = array();
+ $header = [];
$header["uid"] = $importer["uid"];
$header["network"] = NETWORK_FEED;
$header["type"] = "remote";
return;
}
- $items = array();
+ $items = [];
- $entrylist = array();
+ $entrylist = [];
foreach ($entries AS $entry) {
$entrylist[] = $entry;
// <category>Ausland</category>
// <media:thumbnail width="152" height="76" url="http://www.taz.de/picture/667875/192/14388767.jpg"/>
- $attachments = array();
+ $attachments = [];
$enclosures = $xpath->query("enclosure", $entry);
foreach ($enclosures AS $enclosure) {
$item["attach"] .= ',';
}
- $attachments[] = array("link" => $href, "type" => $type, "length" => $length);
+ $attachments[] = ["link" => $href, "type" => $type, "length" => $length];
$item["attach"] .= '[attach]href="'.$href.'" length="'.$length.'" type="'.$type.'"[/attach]';
}
}
if ($simulate) {
- return array("header" => $author, "items" => $items);
+ return ["header" => $author, "items" => $items];
}
}
}
class OStatus
{
private static $itemlist;
- private static $conv_list = array();
+ private static $conv_list = [];
/**
* @brief Fetches author data
*/
private static function fetchAuthor($xpath, $context, $importer, &$contact, $onlyfetch)
{
- $author = array();
+ $author = [];
$author["author-link"] = $xpath->evaluate('atom:author/atom:uri/text()', $context)->item(0)->nodeValue;
$author["author-name"] = $xpath->evaluate('atom:author/atom:name/text()', $context)->item(0)->nodeValue;
$addr = $xpath->evaluate('atom:author/atom:email/text()', $context)->item(0)->nodeValue;
}
}
- $avatarlist = array();
+ $avatarlist = [];
$avatars = $xpath->query("atom:author/atom:link[@rel='avatar']", $context);
foreach ($avatars as $avatar) {
$href = "";
$contact['name-date'] = datetime_convert();
- dba::update('contact', $contact, array('id' => $contact["id"]), $current);
+ dba::update('contact', $contact, ['id' => $contact["id"]], $current);
if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) {
logger("Update profile picture for contact ".$contact["id"], LOGGER_DEBUG);
$old_contact = dba::selectFirst('contact', $fields, ['id' => $cid]);
// Update it with the current values
- $fields = array('url' => $author["author-link"], 'name' => $contact["name"],
+ $fields = ['url' => $author["author-link"], 'name' => $contact["name"],
'nurl' => normalise_link($author["author-link"]),
'nick' => $contact["nick"], 'alias' => $contact["alias"],
'about' => $contact["about"], 'location' => $contact["location"],
- 'success_update' => datetime_convert(), 'last-update' => datetime_convert());
+ 'success_update' => datetime_convert(), 'last-update' => datetime_convert()];
- dba::update('contact', $fields, array('id' => $cid), $old_contact);
+ dba::update('contact', $fields, ['id' => $cid], $old_contact);
// Update the avatar
Contact::updateAvatar($author["author-avatar"], 0, $cid);
*/
private static function readAttributes($element)
{
- $attribute = array();
+ $attribute = [];
foreach ($element->attributes as $attributes) {
$attribute[$attributes->name] = $attributes->textContent;
private static function process($xml, $importer, &$contact, &$hub, $stored = false, $initialize = true)
{
if ($initialize) {
- self::$itemlist = array();
- self::$conv_list = array();
+ self::$itemlist = [];
+ self::$conv_list = [];
}
logger("Import OStatus message", LOGGER_DEBUG);
}
}
- $header = array();
+ $header = [];
$header["uid"] = $importer["uid"];
$header["network"] = NETWORK_OSTATUS;
$header["type"] = "remote";
$entry = $xpath->query('/atom:entry');
// Reverse the order of the entries
- $entrylist = array();
+ $entrylist = [];
foreach ($entries as $entry) {
$entrylist[] = $entry;
$item["verb"] = $xpath->query('activity:verb/text()', $entry)->item(0)->nodeValue;
// Delete a message
- if (in_array($item["verb"], array('qvitter-delete-notice', ACTIVITY_DELETE, 'delete'))) {
+ if (in_array($item["verb"], ['qvitter-delete-notice', ACTIVITY_DELETE, 'delete'])) {
self::deleteNotice($item);
continue;
}
- if (in_array($item["verb"], array(NAMESPACE_OSTATUS."/unfavorite", ACTIVITY_UNFAVORITE))) {
+ if (in_array($item["verb"], [NAMESPACE_OSTATUS."/unfavorite", ACTIVITY_UNFAVORITE])) {
// Ignore "Unfavorite" message
logger("Ignore unfavorite message ".print_r($item, true), LOGGER_DEBUG);
continue;
}
// Deletions come with the same uri, so we check for duplicates after processing deletions
- if (dba::exists('item', array('uid' => $importer["uid"], 'uri' => $item["uri"]))) {
+ if (dba::exists('item', ['uid' => $importer["uid"], 'uri' => $item["uri"]])) {
logger('Post with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.', LOGGER_DEBUG);
continue;
} else {
}
// http://activitystrea.ms/schema/1.0/rsvp-yes
- if (!in_array($item["verb"], array(ACTIVITY_POST, ACTIVITY_LIKE, ACTIVITY_SHARE))) {
+ if (!in_array($item["verb"], [ACTIVITY_POST, ACTIVITY_LIKE, ACTIVITY_SHARE])) {
logger("Unhandled verb ".$item["verb"]." ".print_r($item, true), LOGGER_DEBUG);
}
if ($valid) {
// Never post a thread when the only interaction by our contact was a like
$valid = false;
- $verbs = array(ACTIVITY_POST, ACTIVITY_SHARE);
+ $verbs = [ACTIVITY_POST, ACTIVITY_SHARE];
foreach (self::$itemlist as $item) {
if (!empty($item['contact-id']) && in_array($item['verb'], $verbs)) {
$valid = true;
}
} else {
// But we will only import complete threads
- $valid = dba::exists('item', array('uid' => $importer["uid"], 'uri' => self::$itemlist[0]['parent-uri']));
+ $valid = dba::exists('item', ['uid' => $importer["uid"], 'uri' => self::$itemlist[0]['parent-uri']]);
}
if ($valid) {
}
}
foreach (self::$itemlist as $item) {
- $found = dba::exists('item', array('uid' => $importer["uid"], 'uri' => $item["uri"]));
+ $found = dba::exists('item', ['uid' => $importer["uid"], 'uri' => $item["uri"]]);
if ($found) {
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already exists.", LOGGER_DEBUG);
} elseif ($item['contact-id'] < 0) {
}
}
}
- self::$itemlist = array();
+ self::$itemlist = [];
}
logger('Processing done for post with URI '.$item["uri"].' for user '.$importer["uid"].'.', LOGGER_DEBUG);
}
// The function "item_drop" doesn't work for that case
dba::update(
'item',
- array('deleted' => true, 'title' => '', 'body' => '',
- 'edited' => datetime_convert(), 'changed' => datetime_convert()),
- array('id' => $deleted["id"])
+ ['deleted' => true, 'title' => '', 'body' => '',
+ 'edited' => datetime_convert(), 'changed' => datetime_convert()],
+ ['id' => $deleted["id"]]
);
delete_thread($deleted["id"], $deleted["parent-uri"]);
}
if (isset($item["parent-uri"]) && ($related != '')) {
- if (!dba::exists('item', array('uid' => $importer["uid"], 'uri' => $item['parent-uri']))) {
+ if (!dba::exists('item', ['uid' => $importer["uid"], 'uri' => $item['parent-uri']])) {
self::fetchRelated($related, $item["parent-uri"], $importer);
} else {
logger('Reply with URI '.$item["uri"].' already existed for user '.$importer["uid"].'.', LOGGER_DEBUG);
self::$conv_list[$conversation] = true;
- $conversation_data = z_fetch_url($conversation, false, $redirects, array('accept_content' => 'application/atom+xml, text/html'));
+ $conversation_data = z_fetch_url($conversation, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
if (!$conversation_data['success']) {
return;
$doc2->preserveWhiteSpace = false;
$doc2->formatOutput = true;
- $conv_data = array();
+ $conv_data = [];
$conv_data['protocol'] = PROTOCOL_SPLITTED_CONV;
$conv_data['network'] = NETWORK_OSTATUS;
$conv_data['source'] = $doc2->saveXML();
- $condition = array('item-uri' => $conv_data['uri'],'protocol' => PROTOCOL_OSTATUS_FEED);
+ $condition = ['item-uri' => $conv_data['uri'],'protocol' => PROTOCOL_OSTATUS_FEED];
if (dba::exists('conversation', $condition)) {
logger('Delete deprecated entry for URI '.$conv_data['uri'], LOGGER_DEBUG);
- dba::delete('conversation', array('item-uri' => $conv_data['uri']));
+ dba::delete('conversation', ['item-uri' => $conv_data['uri']]);
}
logger('Store conversation data for uri '.$conv_data['uri'], LOGGER_DEBUG);
*/
private static function fetchSelf($self, &$item)
{
- $condition = array('`item-uri` = ? AND `protocol` IN (?, ?)', $self, PROTOCOL_DFRN, PROTOCOL_OSTATUS_SALMON);
+ $condition = ['`item-uri` = ? AND `protocol` IN (?, ?)', $self, PROTOCOL_DFRN, PROTOCOL_OSTATUS_SALMON];
if (dba::exists('conversation', $condition)) {
logger('Conversation '.$item['uri'].' is already stored.', LOGGER_DEBUG);
return;
}
if ($conversation['protocol'] == PROTOCOL_OSTATUS_SALMON) {
logger('Delete invalid cached XML for URI '.$related_uri, LOGGER_DEBUG);
- dba::delete('conversation', array('item-uri' => $related_uri));
+ dba::delete('conversation', ['item-uri' => $related_uri]);
}
}
$stored = false;
- $related_data = z_fetch_url($related, false, $redirects, array('accept_content' => 'application/atom+xml, text/html'));
+ $related_data = z_fetch_url($related, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
if (!$related_data['success']) {
return;
$activityobjects = $xpath->query('activity:object', $entry)->item(0);
if (!is_object($activityobjects)) {
- return array();
+ return [];
}
- $link_data = array();
+ $link_data = [];
$orig_uri = $xpath->query('atom:id/text()', $activityobjects)->item(0)->nodeValue;
*/
private static function processLinks($links, &$item)
{
- $link_data = array('add_body' => '', 'self' => '');
+ $link_data = ['add_body' => '', 'self' => ''];
foreach ($links as $link) {
$attribute = self::readAttributes($link);
$preview = proxy_url($preview, false, PROXY_SIZE_SMALL);
// Is it a local picture? Then make it smaller here
- $preview = str_replace(array("-0.jpg", "-0.png"), array("-2.jpg", "-2.png"), $preview);
- $preview = str_replace(array("-1.jpg", "-1.png"), array("-2.jpg", "-2.png"), $preview);
+ $preview = str_replace(["-0.jpg", "-0.png"], ["-2.jpg", "-2.png"], $preview);
+ $preview = str_replace(["-1.jpg", "-1.png"], ["-2.jpg", "-2.png"], $preview);
if (isset($siteinfo["url"])) {
$url = $siteinfo["url"];
case 'comments': $title = t('%s\'s comments', $owner['name']); break;
}
- $attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION);
+ $attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION];
XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
XML::addElement($doc, $root, "id", System::baseUrl() . "/profile/" . $owner["nick"]);
XML::addElement($doc, $root, "title", $title);
$author = self::addAuthor($doc, $owner);
$root->appendChild($author);
- $attributes = array("href" => $owner["url"], "rel" => "alternate", "type" => "text/html");
+ $attributes = ["href" => $owner["url"], "rel" => "alternate", "type" => "text/html"];
XML::addElement($doc, $root, "link", "", $attributes);
/// @TODO We have to find out what this is
self::hublinks($doc, $root, $owner["nick"]);
- $attributes = array("href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "salmon");
+ $attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "salmon"];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies");
+ $attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies"];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention");
+ $attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"];
XML::addElement($doc, $root, "link", "", $attributes);
- $attributes = array("href" => System::baseUrl() . "/api/statuses/user_timeline/" . $owner["nick"] . ".atom",
- "rel" => "self", "type" => "application/atom+xml");
+ $attributes = ["href" => System::baseUrl() . "/api/statuses/user_timeline/" . $owner["nick"] . ".atom",
+ "rel" => "self", "type" => "application/atom+xml"];
XML::addElement($doc, $root, "link", "", $attributes);
return $root;
public static function hublinks($doc, $root, $nick)
{
$h = System::baseUrl() . '/pubsubhubbub/'.$nick;
- XML::addElement($doc, $root, "link", "", array("href" => $h, "rel" => "hub"));
+ XML::addElement($doc, $root, "link", "", ["href" => $h, "rel" => "hub"]);
}
/**
switch ($siteinfo["type"]) {
case 'photo':
$imgdata = Image::getInfoFromURL($siteinfo["image"]);
- $attributes = array("rel" => "enclosure",
+ $attributes = ["rel" => "enclosure",
"href" => $siteinfo["image"],
"type" => $imgdata["mime"],
- "length" => intval($imgdata["size"]));
+ "length" => intval($imgdata["size"])];
XML::addElement($doc, $root, "link", "", $attributes);
break;
case 'video':
- $attributes = array("rel" => "enclosure",
+ $attributes = ["rel" => "enclosure",
"href" => $siteinfo["url"],
"type" => "text/html; charset=UTF-8",
"length" => "",
- "title" => $siteinfo["title"]);
+ "title" => $siteinfo["title"]];
XML::addElement($doc, $root, "link", "", $attributes);
break;
default:
if (!Config::get('system', 'ostatus_not_attach_preview') && ($siteinfo["type"] != "photo") && isset($siteinfo["image"])) {
$imgdata = Image::getInfoFromURL($siteinfo["image"]);
- $attributes = array("rel" => "enclosure",
+ $attributes = ["rel" => "enclosure",
"href" => $siteinfo["image"],
"type" => $imgdata["mime"],
- "length" => intval($imgdata["size"]));
+ "length" => intval($imgdata["size"])];
XML::addElement($doc, $root, "link", "", $attributes);
}
$matches = false;
$cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"|', $r, $matches);
if ($cnt) {
- $attributes = array("rel" => "enclosure",
+ $attributes = ["rel" => "enclosure",
"href" => $matches[1],
- "type" => $matches[3]);
+ "type" => $matches[3]];
if (intval($matches[2])) {
$attributes["length"] = intval($matches[2]);
XML::addElement($doc, $author, "email", $owner["addr"]);
XML::addElement($doc, $author, "summary", bbcode($owner["about"], false, false, 7));
- $attributes = array("rel" => "alternate", "type" => "text/html", "href" => $owner["url"]);
+ $attributes = ["rel" => "alternate", "type" => "text/html", "href" => $owner["url"]];
XML::addElement($doc, $author, "link", "", $attributes);
- $attributes = array(
+ $attributes = [
"rel" => "avatar",
"type" => "image/jpeg", // To-Do?
"media:width" => 175,
"media:height" => 175,
- "href" => $owner["photo"]);
+ "href" => $owner["photo"]];
XML::addElement($doc, $author, "link", "", $attributes);
if (isset($owner["thumb"])) {
- $attributes = array(
+ $attributes = [
"rel" => "avatar",
"type" => "image/jpeg", // To-Do?
"media:width" => 80,
"media:height" => 80,
- "href" => $owner["thumb"]);
+ "href" => $owner["thumb"]];
XML::addElement($doc, $author, "link", "", $attributes);
}
}
if (count($profile)) {
- XML::addElement($doc, $author, "followers", "", array("url" => System::baseUrl()."/viewcontacts/".$owner["nick"]));
- XML::addElement($doc, $author, "statusnet:profile_info", "", array("local_id" => $owner["uid"]));
+ XML::addElement($doc, $author, "followers", "", ["url" => System::baseUrl()."/viewcontacts/".$owner["nick"]]);
+ XML::addElement($doc, $author, "statusnet:profile_info", "", ["local_id" => $owner["uid"]]);
}
if ($profile["publish"]) {
*/
private static function constructObjecttype($item)
{
- if (in_array($item['object-type'], array(ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT)))
+ if (in_array($item['object-type'], [ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT]))
return $item['object-type'];
return ACTIVITY_OBJ_NOTE;
}
if ($item["verb"] == ACTIVITY_LIKE) {
return self::likeEntry($doc, $item, $owner, $toplevel);
- } elseif (in_array($item["verb"], array(ACTIVITY_FOLLOW, NAMESPACE_OSTATUS."/unfollow"))) {
+ } elseif (in_array($item["verb"], [ACTIVITY_FOLLOW, NAMESPACE_OSTATUS."/unfollow"])) {
return self::followEntry($doc, $item, $owner, $toplevel);
} else {
return self::noteEntry($doc, $item, $owner, $toplevel);
$source = $doc->createElement("source");
XML::addElement($doc, $source, "id", $contact["poll"]);
XML::addElement($doc, $source, "title", $contact["name"]);
- XML::addElement($doc, $source, "link", "", array("rel" => "alternate", "type" => "text/html", "href" => $contact["alias"]));
- XML::addElement($doc, $source, "link", "", array("rel" => "self", "type" => "application/atom+xml", "href" => $contact["poll"]));
+ XML::addElement($doc, $source, "link", "", ["rel" => "alternate", "type" => "text/html", "href" => $contact["alias"]]);
+ XML::addElement($doc, $source, "link", "", ["rel" => "self", "type" => "application/atom+xml", "href" => $contact["poll"]]);
XML::addElement($doc, $source, "icon", $contact["photo"]);
XML::addElement($doc, $source, "updated", datetime_convert("UTC", "UTC", $contact["success_update"]."+00:00", ATOM_TIME));
XML::addElement($doc, $object, "id", $contact["alias"]);
XML::addElement($doc, $object, "title", $contact["nick"]);
- $attributes = array("rel" => "alternate", "type" => "text/html", "href" => $contact["url"]);
+ $attributes = ["rel" => "alternate", "type" => "text/html", "href" => $contact["url"]];
XML::addElement($doc, $object, "link", "", $attributes);
- $attributes = array(
+ $attributes = [
"rel" => "avatar",
"type" => "image/jpeg", // To-Do?
"media:width" => 175,
"media:height" => 175,
- "href" => $contact["photo"]);
+ "href" => $contact["photo"]];
XML::addElement($doc, $object, "link", "", $attributes);
XML::addElement($doc, $object, "poco:preferredUsername", $contact["nick"]);
$body = bbcode($body, false, false, 7);
- XML::addElement($doc, $entry, "content", $body, array("type" => "html"));
+ XML::addElement($doc, $entry, "content", $body, ["type" => "html"]);
- XML::addElement($doc, $entry, "link", "", array("rel" => "alternate", "type" => "text/html",
- "href" => System::baseUrl()."/display/".$item["guid"])
+ XML::addElement($doc, $entry, "link", "", ["rel" => "alternate", "type" => "text/html",
+ "href" => System::baseUrl()."/display/".$item["guid"]]
);
if ($complete && ($item["id"] > 0)) {
- XML::addElement($doc, $entry, "status_net", "", array("notice_id" => $item["id"]));
+ XML::addElement($doc, $entry, "status_net", "", ["notice_id" => $item["id"]]);
}
XML::addElement($doc, $entry, "activity:verb", $verb);
*/
private static function entryFooter($doc, $entry, $item, $owner, $complete = true)
{
- $mentioned = array();
+ $mentioned = [];
if (($item['parent'] != $item['id']) || ($item['parent-uri'] !== $item['uri']) || (($item['thr-parent'] !== '') && ($item['thr-parent'] !== $item['uri']))) {
$parent = q("SELECT `guid`, `author-link`, `owner-link` FROM `item` WHERE `id` = %d", intval($item["parent"]));
$parent_plink = System::baseUrl()."/display/".$parent[0]["guid"];
}
- $attributes = array(
+ $attributes = [
"ref" => $parent_item,
- "href" => $parent_plink);
+ "href" => $parent_plink];
XML::addElement($doc, $entry, "thr:in-reply-to", "", $attributes);
- $attributes = array(
+ $attributes = [
"rel" => "related",
- "href" => $parent_plink);
+ "href" => $parent_plink];
XML::addElement($doc, $entry, "link", "", $attributes);
}
}
}
- XML::addElement($doc, $entry, "link", "", array("rel" => "ostatus:conversation", "href" => $conversation_href));
+ XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:conversation", "href" => $conversation_href]);
- $attributes = array(
+ $attributes = [
"href" => $conversation_href,
"local_id" => $item["parent"],
- "ref" => $conversation_uri);
+ "ref" => $conversation_uri];
XML::addElement($doc, $entry, "ostatus:conversation", $conversation_uri, $attributes);
}
}
// Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS)
- $newmentions = array();
+ $newmentions = [];
foreach ($mentioned as $mention) {
$newmentions[str_replace("http://", "https://", $mention)] = str_replace("http://", "https://", $mention);
$newmentions[str_replace("https://", "http://", $mention)] = str_replace("https://", "http://", $mention);
);
if ($r[0]["forum"] || $r[0]["prv"]) {
XML::addElement($doc, $entry, "link", "",
- array(
+ [
"rel" => "mentioned",
"ostatus:object-type" => ACTIVITY_OBJ_GROUP,
- "href" => $mention)
+ "href" => $mention]
);
} else {
XML::addElement($doc, $entry, "link", "",
- array(
+ [
"rel" => "mentioned",
"ostatus:object-type" => ACTIVITY_OBJ_PERSON,
- "href" => $mention)
+ "href" => $mention]
);
}
}
if (!$item["private"]) {
- XML::addElement($doc, $entry, "link", "", array("rel" => "ostatus:attention",
- "href" => "http://activityschema.org/collection/public"));
- XML::addElement($doc, $entry, "link", "", array("rel" => "mentioned",
+ XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention",
+ "href" => "http://activityschema.org/collection/public"]);
+ XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned",
"ostatus:object-type" => "http://activitystrea.ms/schema/1.0/collection",
- "href" => "http://activityschema.org/collection/public"));
+ "href" => "http://activityschema.org/collection/public"]);
XML::addElement($doc, $entry, "mastodon:scope", "public");
}
if (count($tags)) {
foreach ($tags as $t) {
if ($t[0] != "@") {
- XML::addElement($doc, $entry, "category", "", array("term" => $t[2]));
+ XML::addElement($doc, $entry, "category", "", ["term" => $t[2]]);
}
}
}
$app = "web";
}
- $attributes = array("local_id" => $item["id"], "source" => $app);
+ $attributes = ["local_id" => $item["id"], "source" => $app];
if (isset($parent["id"])) {
$attributes["repeat_of"] = $parent["id"];
$feeddata = trim($doc->saveXML());
- $msg = array('feed' => $feeddata, 'last_update' => $last_update);
+ $msg = ['feed' => $feeddata, 'last_update' => $last_update];
Cache::set($cachekey, $msg, CACHE_QUARTER_HOUR);
logger('Feed duration: ' . number_format(microtime(true) - $stamp, 3) . ' - ' . $owner_nick . ' - ' . $filter . ' - ' . $previous_created, LOGGER_DEBUG);
$contact_type = $entry->contactType;
}
- $gcontact = array("url" => $profile_url,
+ $gcontact = ["url" => $profile_url,
"name" => $name,
"network" => $network,
"photo" => $profile_photo,
"connect" => $connect_url,
"updated" => $updated,
"contact-type" => $contact_type,
- "generation" => $generation);
+ "generation" => $generation];
try {
$gcontact = GContact::sanitize($gcontact);
return false;
}
- $contact = array("url" => $profile);
+ $contact = ["url" => $profile];
if ($gcontacts[0]["created"] <= NULL_DATE) {
$contact['created'] = datetime_convert();
$server_url = normalise_link(self::detectServer($profile));
}
- if (!in_array($gcontacts[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_FEED, NETWORK_OSTATUS, ""))) {
+ if (!in_array($gcontacts[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_FEED, NETWORK_OSTATUS, ""])) {
logger("Profile ".$profile.": Network type ".$gcontacts[0]["network"]." can't be checked", LOGGER_DEBUG);
return false;
}
$contact['server_url'] = $server_url;
}
- if (in_array($gcontacts[0]["network"], array("", NETWORK_FEED))) {
+ if (in_array($gcontacts[0]["network"], ["", NETWORK_FEED])) {
$server = q(
"SELECT `network` FROM `gserver` WHERE `nurl` = '%s' AND `network` != ''",
dbesc(normalise_link($server_url))
return false;
}
- if (($data["poll"] == "") || (in_array($data["network"], array(NETWORK_FEED, NETWORK_PHANTOM)))) {
+ if (($data["poll"] == "") || (in_array($data["network"], [NETWORK_FEED, NETWORK_PHANTOM]))) {
$fields = ['last_failure' => datetime_convert()];
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
foreach ($data->entry[0]->urls as $url) {
if ($url->type == 'zot') {
- $server = array();
+ $server = [];
$server["platform"] = 'Hubzilla';
$server["network"] = NETWORK_DIASPORA;
return $server;
return false;
}
- $server = array();
+ $server = [];
$server['register_policy'] = REGISTER_CLOSED;
$list = $xpath->query("//meta[@name]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
if ($attr['name'] == 'generator') {
$version_part = explode(" ", $attr['content']);
if (count($version_part) == 2) {
- if (in_array($version_part[0], array("Friendika", "Friendica"))) {
- $server = array();
+ if (in_array($version_part[0], ["Friendika", "Friendica"])) {
+ $server = [];
$server["platform"] = $version_part[0];
$server["version"] = $version_part[1];
$server["network"] = NETWORK_DFRN;
$list = $xpath->query("//meta[@property]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
}
}
- if ($attr['property'] == 'generator' && in_array($attr['content'], array("hubzilla", "BlaBlaNet"))) {
- $server = array();
+ if ($attr['property'] == 'generator' && in_array($attr['content'], ["hubzilla", "BlaBlaNet"])) {
+ $server = [];
$server["platform"] = $attr['content'];
$server["version"] = "";
$server["network"] = NETWORK_DIASPORA;
// Mastodon uses the "@" for user profiles.
// But this can be misunderstood.
if (parse_url($server_url, PHP_URL_USER) != '') {
- dba::update('gserver', array('last_failure' => datetime_convert()), array('nurl' => normalise_link($server_url)));
+ dba::update('gserver', ['last_failure' => datetime_convert()], ['nurl' => normalise_link($server_url)]);
return false;
}
$server_url = str_replace("http://", "https://", $server_url);
// We set the timeout to 20 seconds since this operation should be done in no time if the server was vital
- $serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, array('timeout' => 20));
+ $serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, ['timeout' => 20]);
// Quit if there is a timeout.
// But we want to make sure to only quit if we are mostly sure that this server url fits.
if (DBM::is_result($gserver) && ($orig_server_url == $server_url) &&
($serverret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
- dba::update('gserver', array('last_failure' => datetime_convert()), array('nurl' => normalise_link($server_url)));
+ dba::update('gserver', ['last_failure' => datetime_convert()], ['nurl' => normalise_link($server_url)]);
return false;
}
$server_url = str_replace("https://", "http://", $server_url);
// We set the timeout to 20 seconds since this operation should be done in no time if the server was vital
- $serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, array('timeout' => 20));
+ $serverret = z_fetch_url($server_url."/.well-known/host-meta", false, $redirects, ['timeout' => 20]);
// Quit if there is a timeout
if ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT) {
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
- dba::update('gserver', array('last_failure' => datetime_convert()), array('nurl' => normalise_link($server_url)));
+ dba::update('gserver', ['last_failure' => datetime_convert()], ['nurl' => normalise_link($server_url)]);
return false;
}
if (!$serverret["success"] || ($serverret["body"] == "") || (sizeof($xmlobj) == 0) || !is_object($xmlobj)) {
// Workaround for bad configured servers (known nginx problem)
- if (!in_array($serverret["debug"]["http_code"], array("403", "404"))) {
+ if (!in_array($serverret["debug"]["http_code"], ["403", "404"])) {
$failure = true;
}
$possible_failure = true;
// Check for noscrape
// Friendica servers could be detected as OStatus servers
- if (!$failure && in_array($network, array(NETWORK_DFRN, NETWORK_OSTATUS))) {
+ if (!$failure && in_array($network, [NETWORK_DFRN, NETWORK_OSTATUS])) {
$serverret = z_fetch_url($server_url."/friendica/json");
if (!$serverret["success"]) {
}
// Check again if the server exists
- $found = dba::exists('gserver', array('nurl' => normalise_link($server_url)));
+ $found = dba::exists('gserver', ['nurl' => normalise_link($server_url)]);
$version = strip_tags($version);
$site_name = strip_tags($site_name);
$accesstoken = Config::get('system', 'instances_social_key');
if (!empty($accesstoken)) {
$api = 'https://instances.social/api/1.0/instances/list?count=0';
- $header = array('Authorization: Bearer '.$accesstoken);
+ $header = ['Authorization: Bearer '.$accesstoken];
$serverdata = z_fetch_url($api, false, $redirects, ['headers' => $header]);
if ($serverdata['success']) {
$servers = json_decode($serverdata['body']);
logger("Store profile ".$profile_url, LOGGER_DEBUG);
- $gcontact = array("url" => $profile_url,
+ $gcontact = ["url" => $profile_url,
"name" => $name,
"network" => $network,
"photo" => $profile_photo,
"connect" => $connect_url,
"updated" => $updated,
"contact-type" => $contact_type,
- "generation" => $generation);
+ "generation" => $generation];
try {
$gcontact = GContact::sanitize($gcontact);
*/
public static function getKey($uri, $keyhash)
{
- $ret = array();
+ $ret = [];
logger('Fetching salmon key for '.$uri);
$signature3 = base64url_encode(Crypto::rsaSign($data, $owner['sprvkey']));
// At first try the non compliant method that works for GNU Social
- $xmldata = array("me:env" => array("me:data" => $data,
- "@attributes" => array("type" => $data_type),
+ $xmldata = ["me:env" => ["me:data" => $data,
+ "@attributes" => ["type" => $data_type],
"me:encoding" => $encoding,
"me:alg" => $algorithm,
"me:sig" => $signature,
- "@attributes2" => array("key_id" => $keyhash)));
+ "@attributes2" => ["key_id" => $keyhash]]];
- $namespaces = array("me" => "http://salmon-protocol.org/ns/magic-env");
+ $namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, array(
+ post_url($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
- ));
+ ]);
$a = get_app();
$return_code = $a->get_curl_code();
logger('GNU Social salmon failed. Falling back to compliant mode');
// Now try the compliant mode that normally isn't used for GNU Social
- $xmldata = array("me:env" => array("me:data" => $data,
- "@attributes" => array("type" => $data_type),
+ $xmldata = ["me:env" => ["me:data" => $data,
+ "@attributes" => ["type" => $data_type],
"me:encoding" => $encoding,
"me:alg" => $algorithm,
"me:sig" => $signature2,
- "@attributes2" => array("key_id" => $keyhash)));
+ "@attributes2" => ["key_id" => $keyhash]]];
- $namespaces = array("me" => "http://salmon-protocol.org/ns/magic-env");
+ $namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, array(
+ post_url($url, $salmon, [
'Content-type: application/magic-envelope+xml',
'Content-length: ' . strlen($salmon)
- ));
+ ]);
$return_code = $a->get_curl_code();
}
logger('compliant salmon failed. Falling back to old status.net');
// Last try. This will most likely fail as well.
- $xmldata = array("me:env" => array("me:data" => $data,
- "@attributes" => array("type" => $data_type),
+ $xmldata = ["me:env" => ["me:data" => $data,
+ "@attributes" => ["type" => $data_type],
"me:encoding" => $encoding,
"me:alg" => $algorithm,
"me:sig" => $signature3,
- "@attributes2" => array("key_id" => $keyhash)));
+ "@attributes2" => ["key_id" => $keyhash]]];
- $namespaces = array("me" => "http://salmon-protocol.org/ns/magic-env");
+ $namespaces = ["me" => "http://salmon-protocol.org/ns/magic-env"];
$salmon = XML::fromArray($xmldata, $xml, false, $namespaces);
// slap them
- post_url($url, $salmon, array(
+ post_url($url, $salmon, [
'Content-type: application/magic-envelope+xml',
- 'Content-length: ' . strlen($salmon))
+ 'Content-length: ' . strlen($salmon)]
);
$return_code = $a->get_curl_code();
}
$modulus->SetIntBuffer($Modulus);
$publicExponent = new ASNValue(ASNValue::TAG_INTEGER);
$publicExponent->SetIntBuffer($PublicExponent);
- $keySequenceItems = array($modulus, $publicExponent);
+ $keySequenceItems = [$modulus, $publicExponent];
$keySequence = new ASNValue(ASNValue::TAG_SEQUENCE);
$keySequence->SetSequence($keySequenceItems);
//Encode bit string
$modulus->SetIntBuffer($Modulus);
$publicExponent = new ASNValue(ASNValue::TAG_INTEGER);
$publicExponent->SetIntBuffer($PublicExponent);
- $keySequenceItems = array($modulus, $publicExponent);
+ $keySequenceItems = [$modulus, $publicExponent];
$keySequence = new ASNValue(ASNValue::TAG_SEQUENCE);
$keySequence->SetSequence($keySequenceItems);
//Encode bit string
*/
public static function newKeypair($bits)
{
- $openssl_options = array(
+ $openssl_options = [
'digest_alg' => 'sha1',
'private_key_bits' => $bits,
'encrypt_key' => false
- );
+ ];
$conf = Config::get('system', 'openssl_conf_file');
if ($conf) {
}
// Get private key
- $response = array('prvkey' => '', 'pubkey' => '');
+ $response = ['prvkey' => '', 'pubkey' => ''];
openssl_pkey_export($result, $response['prvkey']);
"--" . $mimeBoundary . "--\n"; // message ending
// send the message
- $hookdata = array(
+ $hookdata = [
'to' => $params['toEmail'],
'subject' => $messageSubject,
'body' => $multipartMessageBody,
'headers' => $messageHeader
- );
+ ];
//echo "<pre>"; var_dump($hookdata); killme();
call_hooks("emailer_send", $hookdata);
$res = mail(
$this->setHost($aCommand[2]);
// Now we check if the given user is valid
- $sUser = str_replace(array('%20', '(a)'), array(' ', '@'), $aCommand[1]);
+ $sUser = str_replace(['%20', '(a)'], [' ', '@'], $aCommand[1]);
// Does the hostname match? So we try directly
if ($a->get_hostname() == $aCommand[2]) {
$this->setHost($aCommand[2]);
// We now check if the password match
- $sUser = str_replace(array('%20', '(a)'), array(' ', '@'), $aCommand[1]);
+ $sUser = str_replace(['%20', '(a)'], [' ', '@'], $aCommand[1]);
// Does the hostname match? So we try directly
if ($a->get_hostname() == $aCommand[2]) {
*/
class Lock
{
- private static $semaphore = array();
+ private static $semaphore = [];
/**
* @brief Check for memcache and open a connection if configured
}
}
if (!$lock['locked']) {
- dba::update('locks', array('locked' => true, 'pid' => getmypid()), array('name' => $fn_name));
+ dba::update('locks', ['locked' => true, 'pid' => getmypid()], ['name' => $fn_name]);
$got_lock = true;
}
} elseif (!DBM::is_result($lock)) {
- dba::insert('locks', array('name' => $fn_name, 'locked' => true, 'pid' => getmypid()));
+ dba::insert('locks', ['name' => $fn_name, 'locked' => true, 'pid' => getmypid()]);
$got_lock = true;
}
return;
}
- dba::update('locks', array('locked' => false, 'pid' => 0), array('name' => $fn_name, 'pid' => getmypid()));
+ dba::update('locks', ['locked' => false, 'pid' => 0], ['name' => $fn_name, 'pid' => getmypid()]);
return;
}
return;
}
- dba::update('locks', array('locked' => false, 'pid' => 0), array('pid' => getmypid()));
+ dba::update('locks', ['locked' => false, 'pid' => 0], ['pid' => getmypid()]);
return;
}
}
class Map {
public static function byCoordinates($coord) {
$coord = trim($coord);
- $coord = str_replace(array(',','/',' '),array(' ',' ',' '),$coord);
- $arr = array('lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => '');
+ $coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
+ $arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''];
call_hooks('generate_map',$arr);
return ($arr['html']) ? $arr['html'] : $coord;
}
public static function byLocation($location) {
- $arr = array('location' => $location, 'html' => '');
+ $arr = ['location' => $location, 'html' => ''];
call_hooks('generate_named_map',$arr);
return ($arr['html']) ? $arr['html'] : $location;
}
dba::insert(
'parsed_url',
- array(
+ [
'url' => normalise_link($url), 'guessing' => !$no_guessing,
'oembed' => $do_oembed, 'content' => serialize($data),
- 'created' => datetime_convert()),
+ 'created' => datetime_convert()],
true
);
{
$a = get_app();
- $siteinfo = array();
+ $siteinfo = [];
// Check if the URL does contain a scheme
$scheme = parse_url($url, PHP_URL_SCHEME);
if ($do_oembed) {
$oembed_data = OEmbed::fetchURL($url);
- if (!in_array($oembed_data->type, array("error", "rich", ""))) {
+ if (!in_array($oembed_data->type, ["error", "rich", ""])) {
$siteinfo["type"] = $oembed_data->type;
}
$list = $xpath->query("//meta[@content]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
//$list = $xpath->query("head/meta[@name]");
$list = $xpath->query("//meta[@name]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
}
if (isset($keywords)) {
- $siteinfo["keywords"] = array();
+ $siteinfo["keywords"] = [];
foreach ($keywords as $keyword) {
if (!in_array(trim($keyword), $siteinfo["keywords"])) {
$siteinfo["keywords"][] = trim($keyword);
//$list = $xpath->query("head/meta[@property]");
$list = $xpath->query("//meta[@property]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
if ((@$siteinfo["image"] == "") && !$no_guessing) {
$list = $xpath->query("//img[@src]");
foreach ($list as $node) {
- $attr = array();
+ $attr = [];
if ($node->attributes->length) {
foreach ($node->attributes as $attribute) {
$attr[$attribute->name] = $attribute->value;
$photodata[0] = round($photodata[0] * (300 / $photodata[1]));
$photodata[1] = 300;
}
- $siteinfo["images"][] = array("src" => $src,
+ $siteinfo["images"][] = ["src" => $src,
"width" => $photodata[0],
- "height" => $photodata[1]);
+ "height" => $photodata[1]];
}
}
} elseif ($siteinfo["image"] != "") {
$photodata = Image::getInfoFromURL($src);
if (($photodata) && ($photodata[0] > 10) && ($photodata[1] > 10)) {
- $siteinfo["images"][] = array("src" => $src,
+ $siteinfo["images"][] = ["src" => $src,
"width" => $photodata[0],
- "height" => $photodata[1]);
+ "height" => $photodata[1]];
}
}
}
if ($text != "") {
- $text = trim(str_replace(array("\n", "\r"), array(" ", " "), $text));
+ $text = trim(str_replace(["\n", "\r"], [" ", " "], $text));
while (strpos($text, " ")) {
$text = trim(str_replace(" ", " ", $text));
$arr_tags = str_getcsv($string);
if (count($arr_tags)) {
// add the # sign to every tag
- array_walk($arr_tags, array("self", "arrAddHashes"));
+ array_walk($arr_tags, ["self", "arrAddHashes"]);
return $arr_tags;
}
*
* @return string The created XML
*/
- public static function fromArray($array, &$xml, $remove_header = false, $namespaces = array(), $root = true)
+ public static function fromArray($array, &$xml, $remove_header = false, $namespaces = [], $root = true)
{
if ($root) {
foreach ($array as $key => $value) {
*
* @return object XML element object
*/
- public static function createElement($doc, $element, $value = "", $attributes = array())
+ public static function createElement($doc, $element, $value = "", $attributes = [])
{
$element = $doc->createElement($element, xmlify($value));
* @param array $attributes array containing the attributes
* @return void
*/
- public static function addElement($doc, $parent, $element, $value = "", $attributes = array())
+ public static function addElement($doc, $parent, $element, $value = "", $attributes = [])
{
$element = self::createElement($doc, $element, $value, $attributes);
$parent->appendChild($element);
}
if (is_array($xml_element)) {
- $result_array = array();
+ $result_array = [];
if (count($xml_element) <= 0) {
return (trim(strval($xml_element_copy)));
}
if ($recursion_depth == 0) {
$temp_array = $result_array;
- $result_array = array(
+ $result_array = [
strtolower($xml_element_copy->getName()) => $temp_array,
- );
+ ];
}
return ($result_array);
public static function toArray($contents, $namespaces = true, $get_attributes = 1, $priority = 'attribute')
{
if (!$contents) {
- return array();
+ return [];
}
if (!function_exists('xml_parser_create')) {
logger('Xml::toArray: parser function missing');
- return array();
+ return [];
}
if (! $parser) {
logger('Xml::toArray: xml_parser_create: no resource');
- return array();
+ return [];
}
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
}
//Initializations
- $xml_array = array();
- $parents = array();
- $opened_tags = array();
- $arr = array();
+ $xml_array = [];
+ $parents = [];
+ $opened_tags = [];
+ $arr = [];
$current = &$xml_array; // Reference
// Go through the tags.
- $repeated_tag_index = array(); // Multiple tags with same name will be turned into an array
+ $repeated_tag_index = []; // Multiple tags with same name will be turned into an array
foreach ($xml_values as $data) {
$tag = $data['tag'];
$type = $data['type'];
$attributes = isset($data['attributes']) ? $data['attributes'] : null;
$value = isset($data['value']) ? $data['value'] : null;
- $result = array();
- $attributes_data = array();
+ $result = [];
+ $attributes_data = [];
if (isset($value)) {
if ($priority == 'tag') {
$current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
$repeated_tag_index[$tag.'_'.$level]++;
} else { // This section will make the value an array if multiple tags with the same name appear together
- $current[$tag] = array($current[$tag], $result); // This will combine the existing item and the new item together to make an array
+ $current[$tag] = [$current[$tag], $result]; // This will combine the existing item and the new item together to make an array
$repeated_tag_index[$tag.'_'.$level] = 2;
if (isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well
}
$repeated_tag_index[$tag.'_'.$level]++;
} else { // If it is not an array...
- $current[$tag] = array($current[$tag], $result); //...Make it an array using using the existing value and the new value
+ $current[$tag] = [$current[$tag], $result]; //...Make it an array using using the existing value and the new value
$repeated_tag_index[$tag.'_'.$level] = 1;
if ($priority == 'tag' and $get_attributes) {
if (isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well
Worker::add(PRIORITY_LOW, "CronJobs", "update_photo_albums");
// Delete all done workerqueue entries
- dba::delete('workerqueue', array('`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 12 HOUR'));
+ dba::delete('workerqueue', ['`done` AND `executed` < UTC_TIMESTAMP() - INTERVAL 12 HOUR']);
// check upstream version?
Worker::add(PRIORITY_LOW, 'CheckVersion');
}
// Friendica and OStatus are checked once a day
- if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS))) {
+ if (in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS])) {
$contact['priority'] = 2;
}
- if ($contact['subhub'] && in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS))) {
+ if ($contact['subhub'] && in_array($contact['network'], [NETWORK_DFRN, NETWORK_OSTATUS])) {
/*
* We should be getting everything via a hub. But just to be sure, let's check once a day.
* (You can make this more or less frequent if desired by setting 'pushpoll_frequency' appropriately)
logger("Polling " . $contact["network"] . " " . $contact["id"] . " " . $contact['priority'] . " " . $contact["nick"] . " " . $contact["name"]);
- Worker::add(array('priority' => $priority, 'dont_fork' => true), 'OnePoll', (int)$contact['id']);
+ Worker::add(['priority' => $priority, 'dont_fork' => true], 'OnePoll', (int)$contact['id']);
}
}
}
$r = q("SELECT * FROM `user` WHERE `account_removed` AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
if (DBM::is_result($r)) {
foreach ($r as $user) {
- dba::delete('user', array('uid' => $user['uid']));
+ dba::delete('user', ['uid' => $user['uid']]);
}
}
}
if (!$cachetime) {
$cachetime = PROXY_DEFAULT_TIME;
}
- $condition = array('`uid` = 0 AND `resource-id` LIKE "pic:%" AND `created` < NOW() - INTERVAL ? SECOND', $cachetime);
+ $condition = ['`uid` = 0 AND `resource-id` LIKE "pic:%" AND `created` < NOW() - INTERVAL ? SECOND', $cachetime];
dba::delete('photo', $condition);
}
// Delete the cached OEmbed entries that are older than three month
- dba::delete('oembed', array("`created` < NOW() - INTERVAL 3 MONTH"));
+ dba::delete('oembed', ["`created` < NOW() - INTERVAL 3 MONTH"]);
// Delete the cached "parse_url" entries that are older than three month
- dba::delete('parsed_url', array("`created` < NOW() - INTERVAL 3 MONTH"));
+ dba::delete('parsed_url', ["`created` < NOW() - INTERVAL 3 MONTH"]);
// Maximum table size in megabyte
$max_tablesize = intval(Config::get('system', 'optimize_max_tablesize')) * 1000000;
logger("found global item orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('item', array('id' => $orphan["id"]));
+ dba::delete('item', ['id' => $orphan["id"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 1, $last_id);
} else {
logger("found item orphans without parents: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('item', array('id' => $orphan["id"]));
+ dba::delete('item', ['id' => $orphan["id"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 2, $last_id);
} else {
logger("found thread orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["iid"];
- dba::delete('thread', array('iid' => $orphan["iid"]));
+ dba::delete('thread', ['iid' => $orphan["iid"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 3, $last_id);
} else {
logger("found notify orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('notify', array('iid' => $orphan["iid"]));
+ dba::delete('notify', ['iid' => $orphan["iid"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 4, $last_id);
} else {
logger("found notify-threads orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('notify-threads', array('id' => $orphan["id"]));
+ dba::delete('notify-threads', ['id' => $orphan["id"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 5, $last_id);
} else {
logger("found sign orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('sign', array('iid' => $orphan["iid"]));
+ dba::delete('sign', ['iid' => $orphan["iid"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 6, $last_id);
} else {
logger("found term orphans: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["tid"];
- dba::delete('term', array('oid' => $orphan["oid"]));
+ dba::delete('term', ['oid' => $orphan["oid"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 7, $last_id);
} else {
logger("found expired threads: ".$count);
while ($thread = dba::fetch($r)) {
$last_id = $thread["iid"];
- dba::delete('thread', array('iid' => $thread["iid"]));
+ dba::delete('thread', ['iid' => $thread["iid"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 8, $last_id);
} else {
logger("found global item entries from expired threads: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["id"];
- dba::delete('item', array('id' => $orphan["id"]));
+ dba::delete('item', ['id' => $orphan["id"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 9, $last_id);
} else {
logger("found old conversations: ".$count);
while ($orphan = dba::fetch($r)) {
$last_id = $orphan["received"];
- dba::delete('conversation', array('item-uri' => $orphan["item-uri"]));
+ dba::delete('conversation', ['item-uri' => $orphan["item-uri"]]);
}
Worker::add(PRIORITY_MEDIUM, 'DBClean', 10, $last_id);
} else {
$fsuggest = false;
$relocate = false;
$top_level = false;
- $recipients = array();
- $url_recipients = array();
+ $recipients = [];
+ $url_recipients = [];
$followup = false;
$normal_mode = true;
}
$icontacts = null;
- $contacts_arr = array();
+ $contacts_arr = [];
foreach ($items as $item) {
if (!in_array($item['contact-id'],$contacts_arr)) {
$contacts_arr[] = intval($item['contact-id']);
} elseif ($relocate) {
$atom = DFRN::relocate($owner, $uid);
} elseif ($followup) {
- $msgitems = array();
+ $msgitems = [];
foreach ($items as $item) { // there is only one item
if (!$item['parent']) {
return;
}
$atom = DFRN::entries($msgitems,$owner);
} else {
- $msgitems = array();
+ $msgitems = [];
foreach ($items as $item) {
if (!$item['parent']) {
return;
$dir .= "/submit";
- $arr = array('url' => $url);
+ $arr = ['url' => $url];
call_hooks('globaldir_update', $arr);
continue;
}
- if (in_array($urlparts["host"], array("www.facebook.com", "facebook.com", "twitter.com",
- "identi.ca", "alpha.app.net"))) {
- $networks = array("www.facebook.com" => NETWORK_FACEBOOK,
+ if (in_array($urlparts["host"], ["www.facebook.com", "facebook.com", "twitter.com",
+ "identi.ca", "alpha.app.net"])) {
+ $networks = ["www.facebook.com" => NETWORK_FACEBOOK,
"facebook.com" => NETWORK_FACEBOOK,
"twitter.com" => NETWORK_TWITTER,
"identi.ca" => NETWORK_PUMPIO,
- "alpha.app.net" => NETWORK_APPNET);
+ "alpha.app.net" => NETWORK_APPNET];
q("UPDATE `gcontact` SET `network` = '%s' WHERE `nurl` = '%s'",
dbesc($networks[$urlparts["host"]]), dbesc(normalise_link($user["url"])));
// physically remove anything that has been deleted for more than two months
$r = dba::p("SELECT `id` FROM `item` WHERE `deleted` AND `changed` < UTC_TIMESTAMP() - INTERVAL 60 DAY");
while ($row = dba::fetch($r)) {
- dba::delete('item', array('id' => $row['id']));
+ dba::delete('item', ['id' => $row['id']]);
}
dba::close($r);
logger('expire: start');
- Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'Expire', 'delete');
$r = dba::p("SELECT `uid`, `username` FROM `user` WHERE `expire` != 0");
while ($row = dba::fetch($r)) {
logger('Calling expiry for user '.$row['uid'].' ('.$row['username'].')', LOGGER_DEBUG);
- Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'Expire', (int)$row['uid']);
}
dba::close($r);
if (is_array($a->hooks) && array_key_exists('expire', $a->hooks)) {
foreach ($a->hooks['expire'] as $hook) {
logger("Calling expire hook for '" . $hook[1] . "'", LOGGER_DEBUG);
- Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'Expire', 'hook', $hook[1]);
}
}
$result = Cache::get("gprobe:".$urlparts["host"]);
if (!is_null($result)) {
- if (in_array($result["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
+ if (in_array($result["network"], [NETWORK_FEED, NETWORK_PHANTOM])) {
logger("DDoS attempt detected for ".$urlparts["host"]." by ".$_SERVER["REMOTE_ADDR"].". server data: ".print_r($_SERVER, true), LOGGER_DEBUG);
return;
}
Cache::set("gprobe:".$urlparts["host"], $arr);
}
- if (!in_array($arr["network"], array(NETWORK_FEED, NETWORK_PHANTOM))) {
+ if (!in_array($arr["network"], [NETWORK_FEED, NETWORK_PHANTOM])) {
GContact::update($arr);
}
$fsuggest = false;
$relocate = false;
$top_level = false;
- $recipients = array();
- $url_recipients = array();
+ $recipients = [];
+ $url_recipients = [];
$normal_mode = true;
$followup = true;
$public_message = false; // not public
$conversant_str = dbesc($parent['contact-id']);
- $recipients = array($parent['contact-id']);
- $recipients_followup = array($parent['contact-id']);
+ $recipients = [$parent['contact-id']];
+ $recipients_followup = [$parent['contact-id']];
logger('notifier: followup '.$target_item["guid"].' to '.$conversant_str, LOGGER_DEBUG);
Worker::add($a->queue['priority'], 'Notifier', 'uplink', $item_id);
}
- $conversants = array();
+ $conversants = [];
foreach ($items as $item) {
$recipients[] = $item['contact-id'];
}
logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
- Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'Delivery', $cmd, $item_id, (int)$contact['id']);
}
}
if ($public_message) {
- $r0 = array();
- $r1 = array();
+ $r0 = [];
+ $r1 = [];
if ($diaspora_delivery) {
if (!$followup) {
if (!$mail && !$fsuggest && !$followup) {
logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
- Worker::add(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
'Delivery', $cmd, $item_id, (int)$rr['id']);
}
}
logger('Activating internal PuSH for item '.$item_id, LOGGER_DEBUG);
// Handling the pubsubhubbub requests
- Worker::add(array('priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true],
'PubSubPublish');
}
$last_updated = $contact['last-item'];
}
- $fields = array('last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated);
+ $fields = ['last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated];
self::updateContact($contact, $fields);
Contact::unmarkForArchival($contact);
} else {
- self::updateContact($contact, array('last-update' => $updated, 'failure_update' => $updated));
+ self::updateContact($contact, ['last-update' => $updated, 'failure_update' => $updated]);
Contact::markForArchival($contact);
logger('Contact '.$contact['id'].' is marked for archival', LOGGER_DEBUG);
}
// But this may be our first communication, so set the writable flag if it isn't set already.
if (!intval($contact['writable'])) {
- $fields = array('writable' => true);
- dba::update('contact', $fields, array('id' => $contact['id']));
+ $fields = ['writable' => true];
+ dba::update('contact', $fields, ['id' => $contact['id']]);
}
$url = $contact['poll'] . '?dfrn_id=' . $idtosend
Contact::markForArchival($contact);
// set the last-update so we don't keep polling
- $fields = array('last-update' => datetime_convert(), 'failure_update' => datetime_convert());
+ $fields = ['last-update' => datetime_convert(), 'failure_update' => datetime_convert()];
self::updateContact($contact, $fields);
return;
}
Contact::markForArchival($contact);
- $fields = array('last-update' => datetime_convert(), 'failure_update' => datetime_convert());
+ $fields = ['last-update' => datetime_convert(), 'failure_update' => datetime_convert()];
self::updateContact($contact, $fields);
return;
}
// we may not be friends anymore. Will keep trying for one month.
// set the last-update so we don't keep polling
- $fields = array('last-update' => datetime_convert(), 'failure_update' => datetime_convert());
+ $fields = ['last-update' => datetime_convert(), 'failure_update' => datetime_convert()];
self::updateContact($contact, $fields);
Contact::markForArchival($contact);
}
if (((float)$res->dfrn_version > 2.21) && ($contact['poco'] == '')) {
- $fields = array('poco' => str_replace('/profile/', '/poco/', $contact['url']));
- dba::update('contact', $fields, array('id' => $contact['id']));
+ $fields = ['poco' => str_replace('/profile/', '/poco/', $contact['url'])];
+ dba::update('contact', $fields, ['id' => $contact['id']]);
}
- $postvars = array();
+ $postvars = [];
$sent_dfrn_id = hex2bin((string) $res->dfrn_id);
$challenge = hex2bin((string) $res->challenge);
}
if ($stat_writeable != $contact['writable']) {
- $fields = array('writable' => $stat_writeable);
- dba::update('contact', $fields, array('id' => $contact['id']));
+ $fields = ['writable' => $stat_writeable];
+ dba::update('contact', $fields, ['id' => $contact['id']]);
}
// Are we allowed to import from this person?
}
$cookiejar = tempnam(get_temppath(), 'cookiejar-onepoll-');
- $ret = z_fetch_url($contact['poll'], false, $redirects, array('cookiejar' => $cookiejar));
+ $ret = z_fetch_url($contact['poll'], false, $redirects, ['cookiejar' => $cookiejar]);
unlink($cookiejar);
if ($ret['errno'] == CURLE_OPERATION_TIMEDOUT) {
unset($password);
logger("Mail: Connect to " . $mailconf['user']);
if ($mbox) {
- $fields = array('last_check' => datetime_convert());
- dba::update('mailacct', $fields, array('id' => $mailconf['id']));
+ $fields = ['last_check' => datetime_convert()];
+ dba::update('mailacct', $fields, ['id' => $mailconf['id']]);
logger("Mail: Connected to " . $mailconf['user']);
} else {
logger("Mail: Connection error ".$mailconf['user']." ".print_r(imap_errors(), true));
foreach ($msgs as $msg_uid => $meta) {
logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA);
- $datarray = array();
+ $datarray = [];
$datarray['verb'] = ACTIVITY_POST;
$datarray['object-type'] = ACTIVITY_OBJ_NOTE;
// $meta = Email::messageMeta($mbox, $msg_uid);
// Only delete when mails aren't automatically moved or deleted
if (($mailconf['action'] != 1) && ($mailconf['action'] != 3))
if ($meta->deleted && ! $item['deleted']) {
- $fields = array('deleted' => true, 'changed' => datetime_convert());
- dba::update('item', $fields, array('id' => $item['id']));
+ $fields = ['deleted' => true, 'changed' => datetime_convert()];
+ dba::update('item', $fields, ['id' => $item['id']]);
}
switch ($mailconf['action']) {
$refs_arr = explode(' ', $raw_refs);
if (count($refs_arr)) {
for ($x = 0; $x < count($refs_arr); $x ++) {
- $refs_arr[$x] = "'" . Email::msgid2iri(str_replace(array('<', '>', ' '),array('', '', ''),dbesc($refs_arr[$x]))) . "'";
+ $refs_arr[$x] = "'" . Email::msgid2iri(str_replace(['<', '>', ' '],['', '', ''],dbesc($refs_arr[$x]))) . "'";
}
}
$qstr = implode(',', $refs_arr);
$stored_item = item_store($datarray);
- $condition = array('parent-uri' => $datarray['parent-uri'], 'uid' => $importer_uid);
- dba::update('item', array('last-child' => false), $condition);
+ $condition = ['parent-uri' => $datarray['parent-uri'], 'uid' => $importer_uid];
+ dba::update('item', ['last-child' => false], $condition);
- dba::update('item', array('last-child' => true), array('id' => $stored_item));
+ dba::update('item', ['last-child' => true], ['id' => $stored_item]);
switch ($mailconf['action']) {
case 0:
if (!strstr($xml, '<')) {
logger('post_handshake: response from ' . $url . ' did not contain XML.');
- $fields = array('last-update' => datetime_convert(), 'failure_update' => datetime_convert());
+ $fields = ['last-update' => datetime_convert(), 'failure_update' => datetime_convert()];
self::updateContact($contact, $fields);
Contact::markForArchival($contact);
return;
$updated = datetime_convert();
- self::updateContact($contact, array('last-update' => $updated, 'success_update' => $updated));
- dba::update('gcontact', array('last_contact' => $updated), array('nurl' => $contact['nurl']));
+ self::updateContact($contact, ['last-update' => $updated, 'success_update' => $updated]);
+ dba::update('gcontact', ['last_contact' => $updated], ['nurl' => $contact['nurl']]);
Contact::unmarkForArchival($contact);
- } elseif (in_array($contact["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED))) {
+ } elseif (in_array($contact["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_FEED])) {
$updated = datetime_convert();
- self::updateContact($contact, array('last-update' => $updated, 'failure_update' => $updated));
- dba::update('gcontact', array('last_failure' => $updated), array('nurl' => $contact['nurl']));
+ self::updateContact($contact, ['last-update' => $updated, 'failure_update' => $updated]);
+ dba::update('gcontact', ['last_failure' => $updated], ['nurl' => $contact['nurl']]);
Contact::markForArchival($contact);
} else {
$updated = datetime_convert();
- dba::update('contact', array('last-update' => $updated), array('id' => $contact['id']));
+ dba::update('contact', ['last-update' => $updated], ['id' => $contact['id']]);
}
return;
}
private static function RemoveReply($subject) {
- while (in_array(strtolower(substr($subject, 0, 3)), array("re:", "aw:"))) {
+ while (in_array(strtolower(substr($subject, 0, 3)), ["re:", "aw:"])) {
$subject = trim(substr($subject, 4));
}
* @param array $fields The fields that are updated
*/
private static function updateContact($contact, $fields) {
- dba::update('contact', $fields, array('id' => $contact['id']));
- dba::update('contact', $fields, array('uid' => 0, 'nurl' => $contact['nurl']));
+ dba::update('contact', $fields, ['id' => $contact['id']]);
+ dba::update('contact', $fields, ['uid' => 0, 'nurl' => $contact['nurl']]);
}
}
foreach ($r as $rr) {
logger("Publish feed to ".$rr["callback_url"], LOGGER_DEBUG);
- Worker::add(array('priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true),
+ Worker::add(['priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true],
'PubSubPublish', (int)$rr["id"]);
}
}
$hmac_sig = hash_hmac("sha1", $params, $rr['secret']);
- $headers = array("Content-type: application/atom+xml",
+ $headers = ["Content-type: application/atom+xml",
sprintf("Link: <%s>;rel=hub,<%s>;rel=self",
System::baseUrl().'/pubsubhubbub/'.$rr['nickname'],
$rr['topic']),
- "X-Hub-Signature: sha1=".$hmac_sig);
+ "X-Hub-Signature: sha1=".$hmac_sig];
logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG);
logger('queue: start');
// Handling the pubsubhubbub requests
- Worker::add(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'PubSubPublish');
+ Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'PubSubPublish');
$r = q(
"SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
if (DBM::is_result($r)) {
foreach ($r as $q_item) {
logger('Call queue for id ' . $q_item['id']);
- Worker::add(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "Queue", (int) $q_item['id']);
+ Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], "Queue", (int) $q_item['id']);
}
}
return;
break;
default:
- $params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false);
+ $params = ['owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false];
call_hooks('queue_deliver', $params);
if ($params['result']) {
public static function execute($id) {
// Only delete if the contact doesn't exist (anymore)
- $r = dba::exists('contact', array('id' => $id));
+ $r = dba::exists('contact', ['id' => $id]);
if ($r) {
return;
}
// Now we delete all the depending table entries
- dba::delete('contact', array('id' => $id));
+ dba::delete('contact', ['id' => $id]);
}
}
return;
}
- if (!in_array($r[0]["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (!in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) {
return;
}
$data = Probe::uri($r[0]["url"]);
- if (!in_array($data["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) {
+ if (!in_array($data["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) {
if ($r[0]["server_url"] != "")
PortableContact::checkServer($r[0]["server_url"], $r[0]["network"]);
if (plugin_enabled('forumlist')) {
$plugin = 'forumlist';
$plugins = Config::get('system','addon');
- $plugins_arr = array();
+ $plugins_arr = [];
if ($plugins) {
$plugins_arr = explode(",",str_replace(" ", "",$plugins));
-<?php
+<?php
/**
* When I installed docblox, I had the experience that it does not generate any output at all.
* This script may be used to find that kind of problems with the documentation build process.
* If that list can't be build, it cuts it in two parts and tries both parts independently. If only one of them breaks,
* it takes that one and tries the same independently. If both break, it assumes this is the smallest set. This assumption
* is not necessarily true. Maybe the smallest set consists of two files and both of them were in different parts when
- * the list was divided, but by now it is my best guess. To make this assumption better, the list is shuffled after every step.
+ * the list was divided, but by now it is my best guess. To make this assumption better, the list is shuffled after every step.
*
* After that, the script tries to remove a file from the list. It tests if the list breaks and if so, it
- * assumes that the file it removed belongs to the set of errorneous files.
- * This is done for all files, so, in the end removing one file leads to a working doc build.
+ * assumes that the file it removed belongs to the set of errorneous files.
+ * This is done for all files, so, in the end removing one file leads to a working doc build.
*
* @package util
* @author Alexander Kampmann
/**
* This function generates a comma seperated list of file names.
- *
+ *
* @package util
- *
+ *
* @param array $fileset Set of file names
- *
+ *
* @return string comma-seperated list of the file names
*/
function namesList($fileset) {
/**
* This functions runs phpdoc on the provided list of files
* @package util
- *
+ *
* @param array $fileset Set of filenames
- *
+ *
* @return bool true, if that set can be built
*/
function runs($fileset) {
* it was meant to be recursive, but php's maximum stack size is to small. So it just simulates recursion.
*
* In that version, it does not necessarily generate the smallest set, because it may not alter the elements order enough.
- *
+ *
* @package util
- *
+ *
* @param array $fileset set of filenames
* @param int $ps number of files in subsets
- *
+ *
* @return array a part of $fileset, that crashes
*/
function reduce($fileset, $ps) {
$parts=array_filter($parts, "runs");
//melt remaining parts together
if(is_array($parts)) {
- return array_reduce($parts, "array_merge", array());
+ return array_reduce($parts, "array_merge", []);
}
- return array();
+ return [];
};
//return from util folder to frindica base dir
$dir='..';
//stack for dirs to search
-$dirstack=array();
+$dirstack=[];
//list of source files
-$filelist=array();
+$filelist=[];
//loop over all files in $dir
while($dh=opendir($dir)) {
} while(count($res)<$i);
//check one file after another
-$needed=array();
+$needed=[];
while(count($res)!=0) {
$file=array_pop($res);
<?php
- $arr = array();
+ $arr = [];
- $files = array('index.php','boot.php');
+ $files = ['index.php','boot.php'];
$files = array_merge($files,glob('mod/*'),glob('include/*'),glob('addon/*/*'));
preg_match_all($pat,$str,$matches);
preg_match_all($patt, $str, $matchestt);
-
+
if(count($matches)){
foreach($matches[1] as $match) {
$s .= ");\n";
} else {
if(substr($a,0,1) == '$')
- continue;
+ continue;
$s .= '$a->strings[' . $a . '] = '. $a . ';' . "\n";
}
}
$zones = timezone_identifiers_list();
foreach($zones as $zone)
$s .= '$a->strings[\'' . $zone . '\'] = \'' . $zone . '\';' . "\n";
-
+
echo $s;
\ No newline at end of file
}
if (isset($_POST['submit'])) {
-
+
if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
$acctname = $_POST["friendica_acct_name"];
$tmp_account_array = explode("@", $acctname);
$content = $_POST["content"];
$url = "http://" . $hostname . '/api/statuses/update';
- $data = array('status' => $content);
-
+ $data = ['status' => $content];
+
// echo "posting to: $url<br/>";
$c = curl_init();
- curl_setopt($c, CURLOPT_URL, $url);
+ curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_USERPWD, "$username:$password");
- curl_setopt($c, CURLOPT_POSTFIELDS, $data);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($c, CURLOPT_POSTFIELDS, $data);
+ curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
- $c_result = curl_exec($c);
- if(curl_errno($c)){
+ $c_result = curl_exec($c);
+ if(curl_errno($c)){
$error = curl_error($c);
showForm($error, $content);
}
-
+
curl_close($c);
if (!isset($error)) {
echo '<script language="javascript" type="text/javascript">window.close();</script>';
}
-
+
} else {
$error = "Missing account name and/or password...try again please";
showForm($error, $content);
}
-
+
} else {
showForm(null, $content);
}
function showForm($error, $content) {
$username_cookie = $_COOKIE['username'];
$password_cookie = $_COOKIE['password'];
-
+
echo <<<EOF
<div class='wrap1'>
<h2><img class='logo' src='friendica-32.png' align='middle';/>
<p></p>
</div>
EOF;
-
+
}
?>
* 3. set the flag hidden=1 for the contact entry with the found ID
**/
$net = Probe::uri($argv[1]);
-if (in_array($net['network'], array(NETWORK_PHANTOM, NETWORK_MAIL))) {
+if (in_array($net['network'], [NETWORK_PHANTOM, NETWORK_MAIL])) {
echo "This account seems not to exist.";
echo "\r\n";
exit(1);
$nurl = normalise_link($net['url']);
$contact = dba::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
if (DBM::is_result($contact)) {
- dba::update("contact", array("hidden" => true), array("id" => $contact["id"]));
+ dba::update("contact", ["hidden" => true], ["id" => $contact["id"]]);
echo "NOTICE: The account should be silenced from the global community page\r\n";
} else {
echo "NOTICE: Could not find any entry for this URL (".$nurl.")\r\n";
if(! class_exists('App')) {
class TmpA {
- public $strings = Array();
+ public $strings = [];
}
$a = new TmpA();
}
print "\nLoading base message.po...";
// load base messages.po and extract msgids
-$base_msgids = array();
-$norm_base_msgids = array();
+$base_msgids = [];
+$norm_base_msgids = [];
$base_f = file("util/messages.po") || die("No base messages.po\n");
-$_f = 0; $_mid = ""; $_mids = array();
+$_f = 0; $_mid = ""; $_mids = [];
foreach( $base_f as $l) {
$l = trim($l);
//~ print $l."\n";
$_f = 0;
$_mid = "";
- $_mids = array();
+ $_mids = [];
}
if (startsWith($l, 'msgid ')) {
$_f = 1;
$_mid = str_replace('msgid ', '' , $l);
- $_mids = array($_mid);
+ $_mids = [$_mid];
//~ print "\t mid: $_mid \n";
}
//~ print "\t\t\t\t$_f\n\n";
$l = "";
}
if (substr($l, 0, 15) == '"Plural-Forms: ') {
- $match = array();
+ $match = [];
preg_match("|nplurals=([0-9]*); *plural=(.*)[;\\\\]|", $l, $match);
$cond = str_replace('n', '$n', $match[2]);
// define plural select function if not already defined
if (!$arr) {
$arr=True;
- $out .= "array(\n";
+ $out .= "[\n";
}
- $match = array();
+ $match = [];
preg_match("|\[([0-9]*)\] (.*)|", $l, $match);
$out .= "\t"
. preg_replace_callback($escape_s_exp, 'escape_s', $match[1])
$out .= '"' . $v . '"';
}
if ($k != "") {
- $out .= ($arr) ? ");\n" : ";\n";
+ $out .= ($arr) ? "];\n" : ";\n";
}
$arr = false;
$k = str_replace("msgid ", "", $l);
$out .= '"' . $v . '"';
}
if ($k != "") {
- $out .= ($arr ? ");\n" : ";\n");
+ $out .= ($arr ? "];\n" : ";\n");
}
$out = str_replace(DQ_ESCAPE, '\"', $out);
<?php
;
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "";
$a->strings["Could not locate selected profile."] = "";
$a->strings["Contact updated."] = "";
$a->strings["(Update was not successful)"] = "";
$a->strings["Suggest friends"] = "";
$a->strings["Network type: %s"] = "";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "",
1 => "",
-);
+];
$a->strings["View all contacts"] = "";
$a->strings["Unblock"] = "";
$a->strings["Block"] = "";
$a->strings["%s and You"] = "";
$a->strings["Delete conversation"] = "";
$a->strings["D, d M Y - g:i A"] = "";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Message not available."] = "";
$a->strings["Delete message"] = "";
$a->strings["No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."] = "";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
$a->strings["Registration details for %s"] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "",
1 => "",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "",
1 => "",
-);
+];
$a->strings["User '%s' deleted"] = "";
$a->strings["User '%s' unblocked"] = "";
$a->strings["User '%s' blocked"] = "";
$a->strings["Interesting Links"] = "";
$a->strings["Starred"] = "";
$a->strings["Favourite Posts"] = "";
-$a->strings["Warning: This group contains %s member from an insecure network."] = array(
+$a->strings["Warning: This group contains %s member from an insecure network."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Private messages to this group are at risk of public disclosure."] = "";
$a->strings["No such group"] = "";
$a->strings["Group is empty"] = "";
$a->strings["View %s's profile @ %s"] = "";
$a->strings["%s from %s"] = "";
$a->strings["View in context"] = "";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "",
1 => "",
-);
-$a->strings["comment"] = array(
+];
+$a->strings["comment"] = [
0 => "",
1 => "",
-);
+];
$a->strings["show more"] = "";
$a->strings["Private Message"] = "";
$a->strings["I like this (toggle)"] = "";
$a->strings["Profile location is not valid or does not contain profile information."] = "";
$a->strings["Warning: profile location has no identifiable owner name."] = "";
$a->strings["Warning: profile location has no profile photo."] = "";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Introduction complete."] = "";
$a->strings["Unrecoverable protocol error."] = "";
$a->strings["Profile unavailable."] = "";
$a->strings["Please join us on Friendica"] = "";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "",
1 => "",
-);
+];
$a->strings["You have no more invitations available"] = "";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "";
$a->strings["Add New Contact"] = "";
$a->strings["Enter address or web location"] = "";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Find People"] = "";
$a->strings["Enter name or interest"] = "";
$a->strings["Connect/Follow"] = "";
$a->strings["last"] = "";
$a->strings["next"] = "";
$a->strings["No contacts"] = "";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "",
1 => "",
-);
+];
$a->strings["poke"] = "";
$a->strings["ping"] = "";
$a->strings["pinged"] = "";
$a->strings["User '%s' already exists on this server!"] = "";
$a->strings["User creation error"] = "";
$a->strings["User profile creation error"] = "";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "";
$a->strings["toggle mobile"] = "";
$a->strings["Theme settings"] = "";
$a->strings["Enter address or web location"] = "Въведете местоположение на адрес или уеб";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Пример: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Свързване! ";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Find People"] = "Намерете хора,";
$a->strings["Enter name or interest"] = "Въведете името или интерес";
$a->strings["Connect/Follow"] = "Свържете се / последваща";
$a->strings["Saved Folders"] = "Записани папки";
$a->strings["Everything"] = "Всичко";
$a->strings["Categories"] = "Категории";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "",
1 => "",
-);
+];
$a->strings["show more"] = "покажи още";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Среден род";
$a->strings["Non-specific"] = "Неспецифичен";
$a->strings["Other"] = "Друг";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Мъжките";
$a->strings["Females"] = "Женските";
$a->strings["Gay"] = "Хомосексуалист";
$a->strings["User '%s' already exists on this server!"] = "";
$a->strings["User creation error"] = "Грешка при създаване на потребителя";
$a->strings["User profile creation error"] = "Грешка при създаване профила на потребителя";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "";
$a->strings["Miscellaneous"] = "Разни";
$a->strings["Birthday:"] = "Дата на раждане:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s маркираната %2\$s - %3\$s като предпочитано";
$a->strings["Likes"] = "Харесвания";
$a->strings["Dislikes"] = "Нехаресвания";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "избор";
$a->strings["Message"] = "Съобщение";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "";
$a->strings["Multiple Profiles"] = "";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Няма контакти";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "",
1 => "",
-);
+];
$a->strings["View Contacts"] = "Вижте Контакти";
$a->strings["Save"] = "Запази";
$a->strings["poke"] = "";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "дейност";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "",
-);
+];
$a->strings["post"] = "след";
$a->strings["Item filed"] = "Т. подава";
$a->strings["Passwords do not match. Password unchanged."] = "Паролите не съвпадат. Парола непроменен.";
$a->strings["Please join us on Friendica"] = "Моля, присъединете се към нас на Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "%s : Съобщение доставка не успя.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "",
1 => "",
-);
+];
$a->strings["You have no more invitations available"] = "Имате няма повече покани";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Посетете %s за списък на публичните сайтове, които можете да се присъедините. Friendica членове на други сайтове могат да се свързват един с друг, както и с членовете на много други социални мрежи.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "За да приемете тази покана, моля, посетете и се регистрира в %s или друга публична уебсайт Friendica.";
$a->strings["You and %s"] = "Вие и %s";
$a->strings["%s and You"] = "%s";
$a->strings["D, d M Y - g:i A"] = "D, D MY - Г: А";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Управление на идентичността и / или страници";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Превключвате между различните идентичности или общността / групата страници, които споделят данните на акаунта ви, или които сте получили \"управление\" разрешения";
$a->strings["Select an identity to manage: "] = "Изберете идентичност, за да управлява: ";
$a->strings["No such group"] = "Няма такава група";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "Записът е редактиран";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Private Message"] = "Лично съобщение";
$a->strings["I like this (toggle)"] = "Харесва ми това (смяна)";
$a->strings["like"] = "харесвам";
$a->strings["Attempt to execute this update step automatically"] = "Опита да изпълни тази стъпка се обновяват автоматично";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "",
1 => "",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "",
1 => "",
-);
+];
$a->strings["User '%s' deleted"] = "Потребителят \" %s \"Изтрити";
$a->strings["User '%s' unblocked"] = "Потребителят \" %s \"отблокирани";
$a->strings["User '%s' blocked"] = "Потребителят \" %s \"блокиран";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Не може да бъде достъп до запис за контакт.";
$a->strings["Could not locate selected profile."] = "Не може да намери избрания профил.";
$a->strings["Contact updated."] = "Свържете се актуализират.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Профил местоположение не е валиден или не съдържа информация на профила.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Внимание: профила място има няма установен име на собственика.";
$a->strings["Warning: profile location has no profile photo."] = "Внимание: профила местоположение не е снимката на профила.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Introduction complete."] = "Въведение завърши.";
$a->strings["Unrecoverable protocol error."] = "Невъзстановима протокол грешка.";
$a->strings["Profile unavailable."] = "Профил недостъпни.";
$a->strings["You may visit them online at %s"] = "Можете да ги посетите онлайн на адрес %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Моля, свържете се с подателя, като отговори на този пост, ако не желаете да получавате тези съобщения.";
$a->strings["%s posted an update."] = "%s е публикувал актуализация.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Лични съобщения до това лице, са изложени на риск от публичното оповестяване.";
$a->strings["Invalid contact."] = "Невалиден свържете.";
$a->strings["Enter address or web location"] = "Introdueixi adreça o ubicació web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Exemple: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Connexió";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitació disponible",
1 => "%d invitacions disponibles",
-);
+];
$a->strings["Find People"] = "Trobar Gent";
$a->strings["Enter name or interest"] = "Introdueixi nom o aficions";
$a->strings["Connect/Follow"] = "Connectar/Seguir";
$a->strings["Saved Folders"] = "Carpetes Guardades";
$a->strings["Everything"] = "Tot";
$a->strings["Categories"] = "Categories";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contacte en comú",
1 => "%d contactes en comú",
-);
+];
$a->strings["show more"] = "Mostrar més";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Neutre";
$a->strings["Non-specific"] = "No específicat";
$a->strings["Other"] = "Altres";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Home";
$a->strings["Females"] = "Dona";
$a->strings["Gay"] = "Gay";
$a->strings["User '%s' already exists on this server!"] = "El usuari %s' ja existeix en aquest servidor!";
$a->strings["User creation error"] = "Error en la creació de l'usuari";
$a->strings["User profile creation error"] = "Error en la creació del perfil d'usuari";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contacte no importat",
1 => "%d contactes no importats",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Fet. Ja pots identificar-te amb el teu nom d'usuari i contrasenya";
$a->strings["Miscellaneous"] = "Miscel·lania";
$a->strings["Birthday:"] = "Aniversari:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s marcat %2\$s's %3\$s com favorit";
$a->strings["Likes"] = "Agrada";
$a->strings["Dislikes"] = "No agrada";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Selecionar";
$a->strings["Message"] = "Missatge";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "Característiques Generals";
$a->strings["Multiple Profiles"] = "Perfils Múltiples";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Sense contactes";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d Contacte",
1 => "%d Contactes",
-);
+];
$a->strings["View Contacts"] = "Veure Contactes";
$a->strings["Save"] = "Guardar";
$a->strings["poke"] = "atia";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "activitat";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "comentari",
-);
+];
$a->strings["post"] = "missatge";
$a->strings["Item filed"] = "Element arxivat";
$a->strings["Passwords do not match. Password unchanged."] = "Les contrasenyes no coincideixen. Contrasenya no canviada.";
$a->strings["Please join us on Friendica"] = "Per favor, uneixi's a nosaltres en Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limit d'invitacions excedit. Per favor, Contacti amb l'administrador del lloc.";
$a->strings["%s : Message delivery failed."] = "%s : Ha fallat l'entrega del missatge.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d missatge enviat",
1 => "%d missatges enviats.",
-);
+];
$a->strings["You have no more invitations available"] = "No te més invitacions disponibles";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visita %s per a una llista de llocs públics on unir-te. Els membres de Friendica d'altres llocs poden connectar-se de forma total, així com amb membres de moltes altres xarxes socials.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Per acceptar aquesta invitació, per favor visita i registra't a %s o en qualsevol altre pàgina web pública Friendica.";
$a->strings["You and %s"] = "Tu i %s";
$a->strings["%s and You"] = "%s i Tu";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d missatge",
1 => "%d missatges",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Administrar Identitats i/o Pàgines";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Alternar entre les diferents identitats o les pàgines de comunitats/grups que comparteixen les dades del seu compte o que se li ha concedit els permisos de \"administrar\"";
$a->strings["Select an identity to manage: "] = "Seleccionar identitat a administrar:";
$a->strings["No such group"] = "Cap grup com";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "L'entrada fou editada";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comentari",
1 => "%d comentaris",
-);
+];
$a->strings["Private Message"] = "Missatge Privat";
$a->strings["I like this (toggle)"] = "M'agrada això (canviar)";
$a->strings["like"] = "Agrada";
$a->strings["Attempt to execute this update step automatically"] = "Intentant executar aquest pas d'actualització automàticament";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s usuari bloquejar/desbloquejar",
1 => "%s usuaris bloquejar/desbloquejar",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s usuari esborrat",
1 => "%s usuaris esborrats",
-);
+];
$a->strings["User '%s' deleted"] = "Usuari %s' esborrat";
$a->strings["User '%s' unblocked"] = "Usuari %s' desbloquejat";
$a->strings["User '%s' blocked"] = "L'usuari '%s' és bloquejat";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "No puc accedir al registre del contacte.";
$a->strings["Could not locate selected profile."] = "No puc localitzar el perfil seleccionat.";
$a->strings["Contact updated."] = "Contacte actualitzat.";
$a->strings["Profile location is not valid or does not contain profile information."] = "El perfil de situació no és vàlid o no contè informació de perfil";
$a->strings["Warning: profile location has no identifiable owner name."] = "Atenció: El perfil de situació no te nom de propietari identificable.";
$a->strings["Warning: profile location has no profile photo."] = "Atenció: El perfil de situació no te foto de perfil";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d el paràmetre requerit no es va trobar al lloc indicat",
1 => "%d els paràmetres requerits no es van trobar allloc indicat",
-);
+];
$a->strings["Introduction complete."] = "Completada la presentació.";
$a->strings["Unrecoverable protocol error."] = "Error de protocol irrecuperable.";
$a->strings["Profile unavailable."] = "Perfil no disponible";
$a->strings["You may visit them online at %s"] = "El pot visitar en línia a %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Si us plau, poseu-vos en contacte amb el remitent responent a aquest missatge si no voleu rebre aquests missatges.";
$a->strings["%s posted an update."] = "%s ha publicat una actualització.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Els missatges privats a aquesta persona es troben en risc de divulgació pública.";
$a->strings["Invalid contact."] = "Contacte no vàlid.";
$a->strings["Enter address or web location"] = "Zadejte adresu nebo umístění webu";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Příklad: jan@příklad.cz, http://příklad.cz/jana";
$a->strings["Connect"] = "Spojit";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "Pozvánka %d k dispozici",
1 => "Pozvánky %d k dispozici",
2 => "Pozvánky %d k dispozici",
-);
+];
$a->strings["Find People"] = "Nalézt lidi";
$a->strings["Enter name or interest"] = "Zadejte jméno nebo zájmy";
$a->strings["Connect/Follow"] = "Připojit / Následovat";
$a->strings["Saved Folders"] = "Uložené složky";
$a->strings["Everything"] = "Všechno";
$a->strings["Categories"] = "Kategorie";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d sdílený kontakt",
1 => "%d sdílených kontaktů",
2 => "%d sdílených kontaktů",
-);
+];
$a->strings["show more"] = "zobrazit více";
$a->strings["Forums"] = "Fóra";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Neutrál";
$a->strings["Non-specific"] = "Nespecifikováno";
$a->strings["Other"] = "Jiné";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Males"] = "Muži";
$a->strings["Females"] = "Ženy";
$a->strings["Gay"] = "Gay";
$a->strings["User '%s' already exists on this server!"] = "Uživatel '%s' již na tomto serveru existuje!";
$a->strings["User creation error"] = "Chyba vytváření uživatele";
$a->strings["User profile creation error"] = "Chyba vytváření uživatelského účtu";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d kontakt nenaimporován",
1 => "%d kontaktů nenaimporováno",
2 => "%d kontakty nenaimporovány",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Hotovo. Nyní se můžete přihlásit se svými uživatelským účtem a heslem";
$a->strings["Miscellaneous"] = "Různé";
$a->strings["Birthday:"] = "Narozeniny:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "uživatel %1\$s označil %2\$s's %3\$s jako oblíbeného";
$a->strings["Likes"] = "Libí se mi";
$a->strings["Dislikes"] = "Nelibí se mi";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Vybrat";
$a->strings["Message"] = "Zpráva";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
2 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
2 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "Obecné funkčnosti";
$a->strings["Multiple Profiles"] = "Vícenásobné profily";
$a->strings["Loading more entries..."] = "Načítání více záznamů...";
$a->strings["The end"] = "Konec";
$a->strings["No contacts"] = "Žádné kontakty";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d kontakt",
1 => "%d kontaktů",
2 => "%d kontaktů",
-);
+];
$a->strings["View Contacts"] = "Zobrazit kontakty";
$a->strings["Save"] = "Uložit";
$a->strings["poke"] = "šťouchnout";
$a->strings["View on separate page"] = "Zobrazit na separátní stránce";
$a->strings["view on separate page"] = "Zobrazit na separátní stránce";
$a->strings["activity"] = "aktivita";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "",
2 => "komentář",
-);
+];
$a->strings["post"] = "příspěvek";
$a->strings["Item filed"] = "Položka vyplněna";
$a->strings["Passwords do not match. Password unchanged."] = "Hesla se neshodují. Heslo nebylo změněno.";
$a->strings["Please join us on Friendica"] = "Prosím přidejte se k nám na Friendice";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limit pozvánek byl překročen. Prosím kontaktujte vašeho administrátora webu.";
$a->strings["%s : Message delivery failed."] = "%s : Doručení zprávy se nezdařilo.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d zpráva odeslána.",
1 => "%d zprávy odeslány.",
2 => "%d zprávy odeslány.",
-);
+];
$a->strings["You have no more invitations available"] = "Nemáte k dispozici žádné další pozvánky";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Navštivte %s pro seznam veřejných serverů, na kterých se můžete přidat. Členové Friendica se mohou navzájem propojovat, stejně tak jako se mohou přiopojit se členy mnoha dalších sociálních sítí.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "K akceptaci této pozvánky prosím navštivte a registrujte se na %s nebo na kterékoliv jiném veřejném Friendica serveru.";
$a->strings["You and %s"] = "Vy a %s";
$a->strings["%s and You"] = "%s a Vy";
$a->strings["D, d M Y - g:i A"] = "D M R - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d zpráva",
1 => "%d zprávy",
2 => "%d zpráv",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Správa identit a / nebo stránek";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Přepnutí mezi různými identitami nebo komunitními/skupinovými stránkami, které sdílí Vaše detaily účtu, nebo kterým jste přidělili oprávnění nastavovat přístupová práva.";
$a->strings["Select an identity to manage: "] = "Vyberte identitu pro správu: ";
$a->strings["No such group"] = "Žádná taková skupina";
$a->strings["Group: %s"] = "Skupina: %s";
$a->strings["This entry was edited"] = "Tento záznam byl editován";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d komentář",
1 => "%d komentářů",
2 => "%d komentářů",
-);
+];
$a->strings["Private Message"] = "Soukromá zpráva";
$a->strings["I like this (toggle)"] = "Líbí se mi to (přepínač)";
$a->strings["like"] = "má rád";
$a->strings["Attempt to execute this update step automatically"] = "Pokusit se provést tuto aktualizaci automaticky.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tDrahý %1\$s,\n\t\t\t\tadministrátor webu %2\$s pro Vás vytvořil uživatelský účet.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tVaše přihlašovací údaje jsou následující:\n\n\t\t\tAdresa webu: \t%1\$s\n\t\t\tpřihlašovací jméno:\t\t%2\$s\n\t\t\theslo:\t\t%3\$s\n\n\t\t\tHeslo si můžete změnit na stránce \"Nastavení\" vašeho účtu poté, co se přihlásíte.\n\n\t\t\tProsím věnujte pár chvil revizi dalšího nastavení vašeho účtu na dané stránce.\n\n\t\t\tTaké su můžete přidat nějaké základní informace do svého výchozího profilu (na stránce \"Profily\"), takže ostatní lidé vás snáze najdou. \n\n\t\t\tDoporučujeme Vám uvést celé jméno a i foto. Přidáním nějakých \"klíčových slov\" (velmi užitečné pro hledání nových přátel) a možná také zemi, ve které žijete, pokud nechcete být více konkrétní.\n\n\t\t\tPlně resepktujeme vaše právo na soukromí a nic z výše uvedeného není povinné. Pokud jste zde nový a neznáte zde nikoho, uvedením daných informací můžete získat nové přátele.\n\n\t\t\tDíky a vítejte na %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s uživatel blokován/odblokován",
1 => "%s uživatelů blokováno/odblokováno",
2 => "%s uživatelů blokováno/odblokováno",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s uživatel smazán",
1 => "%s uživatelů smazáno",
2 => "%s uživatelů smazáno",
-);
+];
$a->strings["User '%s' deleted"] = "Uživatel '%s' smazán";
$a->strings["User '%s' unblocked"] = "Uživatel '%s' odblokován";
$a->strings["User '%s' blocked"] = "Uživatel '%s' blokován";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Could not access contact record."] = "Nelze získat přístup k záznamu kontaktu.";
$a->strings["Could not locate selected profile."] = "Nelze nalézt vybraný profil.";
$a->strings["Contact updated."] = "Kontakt aktualizován.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Adresa profilu není platná nebo neobsahuje profilové informace";
$a->strings["Warning: profile location has no identifiable owner name."] = "Varování: umístění profilu nemá žádné identifikovatelné jméno vlastníka";
$a->strings["Warning: profile location has no profile photo."] = "Varování: umístění profilu nemá žádnou profilovou fotografii.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d požadovaný parametr nebyl nalezen na daném místě",
1 => "%d požadované parametry nebyly nalezeny na daném místě",
2 => "%d požadované parametry nebyly nalezeny na daném místě",
-);
+];
$a->strings["Introduction complete."] = "Představení dokončeno.";
$a->strings["Unrecoverable protocol error."] = "Neopravitelná chyba protokolu";
$a->strings["Profile unavailable."] = "Profil není k dispozici.";
$a->strings["You may visit them online at %s"] = "Můžete je navštívit online na adrese %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Pokud nechcete dostávat tyto zprávy, kontaktujte prosím odesilatele odpovědí na tento záznam.";
$a->strings["%s posted an update."] = "%s poslal aktualizaci.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Soukromé zprávy této osobě jsou vystaveny riziku prozrazení.";
$a->strings["Invalid contact."] = "Neplatný kontakt.";
$a->strings["Neuter"] = "Neuter";
$a->strings["Non-specific"] = "Nicht spezifiziert";
$a->strings["Other"] = "Andere";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Unentschieden",
1 => "Unentschieden",
-);
+];
$a->strings["Males"] = "Männer";
$a->strings["Females"] = "Frauen";
$a->strings["Gay"] = "Schwul";
$a->strings["Enter address or web location"] = "Adresse oder Web-Link eingeben";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Beispiel: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Verbinden";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d Einladung verfügbar",
1 => "%d Einladungen verfügbar",
-);
+];
$a->strings["Find People"] = "Leute finden";
$a->strings["Enter name or interest"] = "Name oder Interessen eingeben";
$a->strings["Connect/Follow"] = "Verbinden/Folgen";
$a->strings["Saved Folders"] = "Gespeicherte Ordner";
$a->strings["Everything"] = "Alles";
$a->strings["Categories"] = "Kategorien";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d gemeinsamer Kontakt",
1 => "%d gemeinsame Kontakte",
-);
+];
$a->strings["show more"] = "mehr anzeigen";
$a->strings["event"] = "Event";
$a->strings["status"] = "Status";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s hat %2\$s\\s %3\$s als Favorit markiert";
$a->strings["Likes"] = "Likes";
$a->strings["Dislikes"] = "Dislikes";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Teilnehmend",
1 => "Teilnehmend",
-);
+];
$a->strings["Not attending"] = "Nicht teilnehmend";
$a->strings["Might attend"] = "Eventuell teilnehmend";
$a->strings["Select"] = "Auswählen";
$a->strings["Message"] = "Nachricht";
$a->strings["Browser"] = "Browser";
$a->strings["View all"] = "Zeige alle";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "mag ich",
1 => "Mag ich",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "mag ich nicht",
1 => "Mag ich nicht",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Nicht teilnehmend ",
1 => "Nicht teilnehmend",
-);
+];
$a->strings["Miscellaneous"] = "Verschiedenes";
$a->strings["Birthday:"] = "Geburtstag:";
$a->strings["Age: "] = "Alter: ";
$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"] = array(
+$a->strings["%d Contact"] = [
0 => "%d Kontakt",
1 => "%d Kontakte",
-);
+];
$a->strings["View Contacts"] = "Kontakte anzeigen";
$a->strings["Save"] = "Speichern";
$a->strings["poke"] = "anstupsen";
$a->strings["View on separate page"] = "Auf separater Seite ansehen";
$a->strings["view on separate page"] = "auf separater Seite ansehen";
$a->strings["activity"] = "Aktivität";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "Kommentar",
1 => "Kommentare",
-);
+];
$a->strings["post"] = "Beitrag";
$a->strings["Item filed"] = "Beitrag abgelegt";
$a->strings["Error decoding account file"] = "Fehler beim Verarbeiten der Account Datei";
$a->strings["User '%s' already exists on this server!"] = "Nutzer '%s' existiert bereits auf diesem Server!";
$a->strings["User creation error"] = "Fehler beim Anlegen des Nutzeraccounts aufgetreten";
$a->strings["User profile creation error"] = "Fehler beim Anlegen des Nutzerkontos";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d Kontakt nicht importiert",
1 => "%d Kontakte nicht importiert",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Erledigt. Du kannst Dich jetzt mit Deinem Nutzernamen und Passwort anmelden";
$a->strings["Passwords do not match. Password unchanged."] = "Die Passwörter stimmen nicht überein. Das Passwort bleibt unverändert.";
$a->strings["An invitation is required."] = "Du benötigst eine Einladung.";
$a->strings["Attempt to execute this update step automatically"] = "Versuchen, diesen Schritt automatisch auszuführen";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\nHallo %1\$s,\n\nauf %2\$s wurde ein Account für Dich angelegt.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\nNachfolgend die Anmelde-Details:\n\tAdresse der Seite:\t%1\$s\n\tBenutzername:\t%2\$s\n\tPasswort:\t%3\$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\nNun viel Spaß, gute Begegnungen und willkommen auf %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s Benutzer geblockt/freigegeben",
1 => "%s Benutzer geblockt/freigegeben",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s Nutzer gelöscht",
1 => "%s Nutzer gelöscht",
-);
+];
$a->strings["User '%s' deleted"] = "Nutzer '%s' gelöscht";
$a->strings["User '%s' unblocked"] = "Nutzer '%s' entsperrt";
$a->strings["User '%s' blocked"] = "Nutzer '%s' gesperrt";
$a->strings["Not available."] = "Nicht verfügbar.";
$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 node’s 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["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d Kontakt bearbeitet.",
1 => "%d Kontakte bearbeitet.",
-);
+];
$a->strings["Could not access contact record."] = "Konnte nicht auf die Kontaktdaten zugreifen.";
$a->strings["Could not locate selected profile."] = "Konnte das ausgewählte Profil nicht finden.";
$a->strings["Contact updated."] = "Kontakt aktualisiert.";
$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"] = array(
+$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["Please join us on Friendica"] = "Ich lade Dich zu unserem sozialen Netzwerk Friendica ein";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limit für Einladungen erreicht. Bitte kontaktiere des Administrator der Seite.";
$a->strings["%s : Message delivery failed."] = "%s: Zustellung der Nachricht fehlgeschlagen.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d Nachricht gesendet.",
1 => "%d Nachrichten gesendet.",
-);
+];
$a->strings["You have no more invitations available"] = "Du hast keine weiteren Einladungen";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Besuche %s für eine Liste der öffentlichen Server, denen Du beitreten kannst. Friendica Mitglieder unterschiedlicher Server können sich sowohl alle miteinander verbinden, als auch mit Mitgliedern anderer Sozialer Netzwerke.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Um diese Kontaktanfrage zu akzeptieren, besuche und registriere Dich bitte bei %s oder einer anderen öffentlichen Friendica Website.";
$a->strings["You and %s"] = "Du und %s";
$a->strings["%s and You"] = "%s und Du";
$a->strings["D, d M Y - g:i A"] = "D, d. M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d Nachricht",
1 => "%d Nachrichten",
-);
+];
$a->strings["Mood"] = "Stimmung";
$a->strings["Set your current mood and tell your friends"] = "Wähle Deine aktuelle Stimmung und erzähle sie Deinen Kontakten";
$a->strings["Remove term"] = "Begriff entfernen";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Warnung: Diese Gruppe beinhaltet %s Person aus einem Netzwerk das keine nicht öffentlichen Beiträge empfangen kann.",
1 => "Warnung: Diese Gruppe beinhaltet %s Personen aus Netzwerken die keine nicht-öffentlichen Beiträge empfangen können.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Beiträge in dieser Gruppe werden deshalb nicht an diese Personen zugestellt werden.";
$a->strings["No such group"] = "Es gibt keine solche Gruppe";
$a->strings["Group: %s"] = "Gruppe: %s";
$a->strings["via"] = "via";
$a->strings["Wall-to-Wall"] = "Wall-to-Wall";
$a->strings["via Wall-To-Wall:"] = "via Wall-To-Wall:";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d Kommentar",
1 => "%d Kommentare",
-);
+];
$a->strings["Bold"] = "Fett";
$a->strings["Italic"] = "Kursiv";
$a->strings["Underline"] = "Unterstrichen";
$a->strings["Neuter"] = "Neuter";
$a->strings["Non-specific"] = "Non-specific";
$a->strings["Other"] = "Other";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Undecided",
1 => "Undecided",
-);
+];
$a->strings["Males"] = "Males";
$a->strings["Females"] = "Females";
$a->strings["Gay"] = "Gay";
$a->strings["Enter address or web location"] = "Enter address or web location";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Example: jo@example.com, http://example.com/jo";
$a->strings["Connect"] = "Connect";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitation available",
1 => "%d invitations available",
-);
+];
$a->strings["Find People"] = "Find people";
$a->strings["Enter name or interest"] = "Enter name or interest";
$a->strings["Connect/Follow"] = "Connect/Follow";
$a->strings["Saved Folders"] = "Saved Folders";
$a->strings["Everything"] = "Everything";
$a->strings["Categories"] = "Categories";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contact in common",
1 => "%d contacts in common",
-);
+];
$a->strings["show more"] = "Show more...";
$a->strings["event"] = "event";
$a->strings["status"] = "status";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s marked %2\$s's %3\$s as favourite";
$a->strings["Likes"] = "Likes";
$a->strings["Dislikes"] = "Dislikes";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Attending",
1 => "Attending",
-);
+];
$a->strings["Not attending"] = "Not attending";
$a->strings["Might attend"] = "Might attend";
$a->strings["Select"] = "Select";
$a->strings["Message"] = "Message";
$a->strings["Browser"] = "Browser";
$a->strings["View all"] = "View all";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Like",
1 => "Likes",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Dislike",
1 => "Dislikes",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Not attending",
1 => "Not attending",
-);
+];
$a->strings["Miscellaneous"] = "Miscellaneous";
$a->strings["Birthday:"] = "Birthday:";
$a->strings["Age: "] = "Age: ";
$a->strings["Loading more entries..."] = "Loading more entries...";
$a->strings["The end"] = "The end";
$a->strings["No contacts"] = "No contacts";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contact",
1 => "%d contacts",
-);
+];
$a->strings["View Contacts"] = "View contacts";
$a->strings["Save"] = "Save";
$a->strings["poke"] = "poke";
$a->strings["View on separate page"] = "View on separate page";
$a->strings["view on separate page"] = "view on separate page";
$a->strings["activity"] = "activity";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "comment",
1 => "comments",
-);
+];
$a->strings["post"] = "post";
$a->strings["Item filed"] = "Item filed";
$a->strings["Error decoding account file"] = "Error decoding account file";
$a->strings["User '%s' already exists on this server!"] = "User '%s' already exists on this server!";
$a->strings["User creation error"] = "User creation error";
$a->strings["User profile creation error"] = "User profile creation error";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contact not imported",
1 => "%d contacts not imported",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Done. You can now login with your username and password";
$a->strings["Passwords do not match. Password unchanged."] = "Passwords do not match. Password unchanged.";
$a->strings["An invitation is required."] = "An invitation is required.";
$a->strings["Attempt to execute this update step automatically"] = "Attempt to execute this update step automatically";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tDear %1\$s,\n\t\t\t\tThe administrator of %2\$s has set up an account for you.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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, this may help\n\t\t\tyou to make some new and interesting friends.\n\n\t\t\tThank you and welcome to %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s user blocked/unblocked",
1 => "%s users blocked/unblocked",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s user deleted",
1 => "%s users deleted",
-);
+];
$a->strings["User '%s' deleted"] = "User '%s' deleted";
$a->strings["User '%s' unblocked"] = "User '%s' unblocked";
$a->strings["User '%s' blocked"] = "User '%s' blocked";
$a->strings["Not available."] = "Not available.";
$a->strings["No results."] = "No results.";
$a->strings["This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users."] = "This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contact edited.",
1 => "%d contacts edited.",
-);
+];
$a->strings["Could not access contact record."] = "Could not access contact record.";
$a->strings["Could not locate selected profile."] = "Could not locate selected profile.";
$a->strings["Contact updated."] = "Contact updated.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profile location is not valid or does not contain profile information.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Warning: profile location has no identifiable owner name.";
$a->strings["Warning: profile location has no profile photo."] = "Warning: profile location has no profile photo.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d required parameter was not found at the given location",
1 => "%d required parameters were not found at the given location",
-);
+];
$a->strings["Introduction complete."] = "Introduction complete.";
$a->strings["Unrecoverable protocol error."] = "Unrecoverable protocol error.";
$a->strings["Profile unavailable."] = "Profile unavailable.";
$a->strings["Please join us on Friendica"] = "Please join us on Friendica.";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Invitation limit is exceeded. Please contact your site administrator.";
$a->strings["%s : Message delivery failed."] = "%s : Message delivery failed";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d message sent.",
1 => "%d messages sent.",
-);
+];
$a->strings["You have no more invitations available"] = "You have no more invitations available.";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "To accept this invitation, please sign up at %s or any other public Friendica website.";
$a->strings["You and %s"] = "Me and %s";
$a->strings["%s and You"] = "%s and me";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d message",
1 => "%d messages",
-);
+];
$a->strings["Mood"] = "Mood";
$a->strings["Set your current mood and tell your friends"] = "Set your current mood and tell your friends";
$a->strings["Remove term"] = "Remove term";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Warning: This group contains %s member from a network that doesn't allow non public messages.",
1 => "Warning: This group contains %s members from a network that doesn't allow non public messages.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Messages in this group won't be send to these receivers.";
$a->strings["No such group"] = "No such group";
$a->strings["Group: %s"] = "Group: %s";
$a->strings["via"] = "via";
$a->strings["Wall-to-Wall"] = "Wall-to-wall";
$a->strings["via Wall-To-Wall:"] = "via wall-to-wall:";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comment",
1 => "%d comments -",
-);
+];
$a->strings["Bold"] = "Bold";
$a->strings["Italic"] = "Italic";
$a->strings["Underline"] = "Underline";
$a->strings["Neuter"] = "Neuter";
$a->strings["Non-specific"] = "Non-specific";
$a->strings["Other"] = "Other";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Undecided",
1 => "Undecided",
-);
+];
$a->strings["Males"] = "Males";
$a->strings["Females"] = "Females";
$a->strings["Gay"] = "Gay";
$a->strings["Enter address or web location"] = "Enter address or web location";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Example: jo@example.com, http://example.com/jo";
$a->strings["Connect"] = "Connect";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitation available",
1 => "%d invitations available",
-);
+];
$a->strings["Find People"] = "Find people";
$a->strings["Enter name or interest"] = "Enter name or interest";
$a->strings["Connect/Follow"] = "Connect/Follow";
$a->strings["Saved Folders"] = "Saved Folders";
$a->strings["Everything"] = "Everything";
$a->strings["Categories"] = "Categories";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contact in common",
1 => "%d contacts in common",
-);
+];
$a->strings["show more"] = "Show more...";
$a->strings["event"] = "event";
$a->strings["status"] = "status";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s marked %2\$s's %3\$s as favorite";
$a->strings["Likes"] = "Likes";
$a->strings["Dislikes"] = "Dislikes";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Attending",
1 => "Attending",
-);
+];
$a->strings["Not attending"] = "Not attending";
$a->strings["Might attend"] = "Might attend";
$a->strings["Select"] = "Select";
$a->strings["Message"] = "Message";
$a->strings["Browser"] = "Browser";
$a->strings["View all"] = "View all";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Like",
1 => "Likes",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Dislike",
1 => "Dislikes",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Not attending",
1 => "Not attending",
-);
+];
$a->strings["Miscellaneous"] = "Miscellaneous";
$a->strings["Birthday:"] = "Birthday:";
$a->strings["Age: "] = "Age: ";
$a->strings["Loading more entries..."] = "Loading more entries...";
$a->strings["The end"] = "The end";
$a->strings["No contacts"] = "No contacts";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contact",
1 => "%d contacts",
-);
+];
$a->strings["View Contacts"] = "View contacts";
$a->strings["Save"] = "Save";
$a->strings["poke"] = "poke";
$a->strings["View on separate page"] = "View on separate page";
$a->strings["view on separate page"] = "view on separate page";
$a->strings["activity"] = "activity";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "comment",
1 => "comments",
-);
+];
$a->strings["post"] = "post";
$a->strings["Item filed"] = "Item filed";
$a->strings["Error decoding account file"] = "Error decoding account file";
$a->strings["User '%s' already exists on this server!"] = "User '%s' already exists on this server!";
$a->strings["User creation error"] = "User creation error";
$a->strings["User profile creation error"] = "User profile creation error";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contact not imported",
1 => "%d contacts not imported",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Done. You can now login with your username and password";
$a->strings["Passwords do not match. Password unchanged."] = "Passwords do not match. Password unchanged.";
$a->strings["An invitation is required."] = "An invitation is required.";
$a->strings["Attempt to execute this update step automatically"] = "Attempt to execute this update step automatically";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tDear %1\$s,\n\t\t\t\tThe administrator of %2\$s has set up an account for you.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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, this may help\n\t\t\tyou to make some new and interesting friends.\n\n\t\t\tThank you and welcome to %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s user blocked/unblocked",
1 => "%s users blocked/unblocked",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s user deleted",
1 => "%s users deleted",
-);
+];
$a->strings["User '%s' deleted"] = "User '%s' deleted";
$a->strings["User '%s' unblocked"] = "User '%s' unblocked";
$a->strings["User '%s' blocked"] = "User '%s' blocked";
$a->strings["Not available."] = "Not available.";
$a->strings["No results."] = "No results.";
$a->strings["This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users."] = "This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users.";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contact edited.",
1 => "%d contacts edited.",
-);
+];
$a->strings["Could not access contact record."] = "Could not access contact record.";
$a->strings["Could not locate selected profile."] = "Could not locate selected profile.";
$a->strings["Contact updated."] = "Contact updated.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profile location is not valid or does not contain profile information.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Warning: profile location has no identifiable owner name.";
$a->strings["Warning: profile location has no profile photo."] = "Warning: profile location has no profile photo.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d required parameter was not found at the given location",
1 => "%d required parameters were not found at the given location",
-);
+];
$a->strings["Introduction complete."] = "Introduction complete.";
$a->strings["Unrecoverable protocol error."] = "Unrecoverable protocol error.";
$a->strings["Profile unavailable."] = "Profile unavailable.";
$a->strings["Please join us on Friendica"] = "Please join us on Friendica.";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Invitation limit is exceeded. Please contact your site administrator.";
$a->strings["%s : Message delivery failed."] = "%s : Message delivery failed";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d message sent.",
1 => "%d messages sent.",
-);
+];
$a->strings["You have no more invitations available"] = "You have no more invitations available.";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "To accept this invitation, please sign up at %s or any other public Friendica website.";
$a->strings["You and %s"] = "Me and %s";
$a->strings["%s and You"] = "%s and me";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d message",
1 => "%d messages",
-);
+];
$a->strings["Mood"] = "Mood";
$a->strings["Set your current mood and tell your friends"] = "Set your current mood and tell your friends";
$a->strings["Remove term"] = "Remove term";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Warning: This group contains %s member from a network that doesn't allow non public messages.",
1 => "Warning: This group contains %s members from a network that doesn't allow non public messages.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Messages in this group won't be send to these receivers.";
$a->strings["No such group"] = "No such group";
$a->strings["Group: %s"] = "Group: %s";
$a->strings["via"] = "via";
$a->strings["Wall-to-Wall"] = "Wall-to-wall";
$a->strings["via Wall-To-Wall:"] = "via wall-to-wall:";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comment",
1 => "%d comments -",
-);
+];
$a->strings["Bold"] = "Bold";
$a->strings["Italic"] = "Italic";
$a->strings["Underline"] = "Underline";
$a->strings["Enter address or web location"] = "Entajpu adreson aŭ retlokon";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Ekzemple: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Konekti";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "Disponeblas %d invito",
1 => "Disponeblas %d invitoj",
-);
+];
$a->strings["Find People"] = "Trovi Homojn";
$a->strings["Enter name or interest"] = "Entajpu nomon aŭ intereson";
$a->strings["Connect/Follow"] = "Konekti/Aboni";
$a->strings["Saved Folders"] = "Konservitaj Dosierujoj";
$a->strings["Everything"] = "Ĉio";
$a->strings["Categories"] = "Kategorioj";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d komuna kontakto",
1 => "%d komunaj kontaktoj",
-);
+];
$a->strings["show more"] = "montri pli";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Neŭtra";
$a->strings["Non-specific"] = "Nespecifa";
$a->strings["Other"] = "Alia";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Viroj";
$a->strings["Females"] = "Inoj";
$a->strings["Gay"] = "Geja";
$a->strings["User '%s' already exists on this server!"] = "";
$a->strings["User creation error"] = "";
$a->strings["User profile creation error"] = "";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "";
$a->strings["Miscellaneous"] = "Diversaj";
$a->strings["Birthday:"] = "Naskiĝtago:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s markis la %3\$s de %2\$s kiel preferita.";
$a->strings["Likes"] = "Ŝatoj";
$a->strings["Dislikes"] = "Malŝatoj";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Elekti";
$a->strings["Message"] = "Mesaĝo";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "";
$a->strings["Multiple Profiles"] = "";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Neniu kontaktoj";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d Kontakto",
1 => "%d Kontaktoj",
-);
+];
$a->strings["View Contacts"] = "Vidi Kontaktojn";
$a->strings["Save"] = "Konservi";
$a->strings["poke"] = "";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "aktiveco";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "komento",
-);
+];
$a->strings["post"] = "afiŝo";
$a->strings["Item filed"] = "Enarkivigis elementon ";
$a->strings["Passwords do not match. Password unchanged."] = "La pasvortoj ne estas egala. Pasvorto ne ŝanĝita.";
$a->strings["Please join us on Friendica"] = "Bonvolu aliĝi kun ni ĉe Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "%s: La livero de la mesaĝo malsukcesis.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "Sendis %d mesaĝon.",
1 => "Sendis %d mesaĝojn.",
-);
+];
$a->strings["You have no more invitations available"] = "Vi ne plu disponeblas invitaĵojn";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Vizitu %s por listo de publikaj retejoj kie vi povas aliĝi. Anoj de Friendica ĉe aliaj retejoj povas konekti unu kun la alian, kaj ankaŭ kun membroj de multaj aliaj retejoj.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Por akcepti ĉi tiu invito, bonvolu viziti kaj registriĝi ĉe %s au alia publika Friendica retejo.";
$a->strings["You and %s"] = "Vi kaj %s";
$a->strings["%s and You"] = "%s kaj vi";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d mesaĝo",
1 => "%d mesaĝoj",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Administri identecojn kaj/aŭ paĝojn.";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Ŝalti inter aliaj identecojn aj komunumaj/grupaj paĝoj kiuj kunhavas viajn kontajn detalojn au por kiuj vi havas \"administranto\" permesojn.";
$a->strings["Select an identity to manage: "] = "Elektu identencon por administrado:";
$a->strings["No such group"] = "Grupo ne estas trovita";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d komento",
1 => "%d komentoj",
-);
+];
$a->strings["Private Message"] = "Privata mesaĝo";
$a->strings["I like this (toggle)"] = "Mi ŝatas tion (ŝalti)";
$a->strings["like"] = "ŝati";
$a->strings["Attempt to execute this update step automatically"] = "Provi automate plenumi ĉi tian paŝon de la ĝisdatigo.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "Blokis/malblokis %s uzanton",
1 => "Blokis/malblokis %s uzantojn",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s uzanto forviŝita",
1 => "%s uzanto forviŝitaj",
-);
+];
$a->strings["User '%s' deleted"] = "Uzanto '%s' forviŝita";
$a->strings["User '%s' unblocked"] = "Uzanto '%s' malblokita";
$a->strings["User '%s' blocked"] = "Uzanto '%s' blokita";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Ne eblis atingi kontaktrikordo.";
$a->strings["Could not locate selected profile."] = "Ne trovis elektitan profilon.";
$a->strings["Contact updated."] = "Kontakto estas ĝisdatigita.";
$a->strings["Profile location is not valid or does not contain profile information."] = "La adreso de la profilo ne validas aŭ ne enhavas profilinformojn.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Averto: La adreso de la profilo ne enhavas identeblan personan nomon.";
$a->strings["Warning: profile location has no profile photo."] = "Averto: La adreso de la profilo ne enhavas bildon.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d bezonataj parametroj ne trovita ĉe la donata adreso.",
1 => "%d bezonataj parametroj ne trovita ĉe la donata adreso.",
-);
+];
$a->strings["Introduction complete."] = "Prezento sukcesis.";
$a->strings["Unrecoverable protocol error."] = "Neĝustigebla eraro en protokolo.";
$a->strings["Profile unavailable."] = "Profilo ne estas disponebla.";
$a->strings["You may visit them online at %s"] = "Vi povas viziti ilin rete ĉe %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Bonvolu rispondi al ĉi mesaĝo kaj kontaktu la sendinto se vi ne volas ricevi tiujn mesaĝojn.";
$a->strings["%s posted an update."] = "%s publikigis afiŝon.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "La privateco de privataj mesaĝoj al ĉi tiu persono ne ĉiam estas garantita.";
$a->strings["Invalid contact."] = "Nevalida kontakto.";
$a->strings["Neuter"] = "Neutro";
$a->strings["Non-specific"] = "Sin especificar";
$a->strings["Other"] = "Otro";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Indeciso",
1 => "Indeciso",
-);
+];
$a->strings["Males"] = "Hombres";
$a->strings["Females"] = "Mujeres";
$a->strings["Gay"] = "Gay";
$a->strings["Enter address or web location"] = "Escribe la dirección o página web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Ejemplo: miguel@ejemplo.com, http://ejemplo.com/miguel";
$a->strings["Connect"] = "Conectar";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitación disponible",
1 => "%d invitaviones disponibles",
-);
+];
$a->strings["Find People"] = "Buscar personas";
$a->strings["Enter name or interest"] = "Introduzce nombre o intereses";
$a->strings["Connect/Follow"] = "Conectar/Seguir";
$a->strings["All Networks"] = "Todas las redes";
$a->strings["Everything"] = "Todo";
$a->strings["Categories"] = "Categorías";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contacto en común",
1 => "%d contactos en común",
-);
+];
$a->strings["Friendica Notification"] = "Notificación de Friendica";
$a->strings["Thank You,"] = "Gracias,";
$a->strings["%s Administrator"] = "%s Administrador";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s ha marcado %3\$s de %2\$s como Favorito";
$a->strings["Likes"] = "Me gusta";
$a->strings["Dislikes"] = "No me gusta";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Atendiendo",
1 => "Atendiendo",
-);
+];
$a->strings["Not attending"] = "No atendiendo";
$a->strings["Might attend"] = "Puede que atienda";
$a->strings["Select"] = "Seleccionar";
$a->strings["Message"] = "Mensaje";
$a->strings["Browser"] = "Navegador";
$a->strings["View all"] = "Ver todos los contactos";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Me gusta",
1 => "Me gusta",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "No me gusta",
1 => "No me gusta",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "No atendiendo",
1 => "No atendiendo",
-);
+];
$a->strings["Cannot locate DNS info for database server '%s'"] = "No se puede encontrar información DNS para la base de datos del servidor '%s'";
$a->strings["There are no tables on MyISAM."] = "No hay tablas en MyISAM";
$a->strings["\n\t\t\tThe friendica developers released update %s recently,\n\t\t\tbut when I tried to install it, something went terribly wrong.\n\t\t\tThis needs to be fixed soon and I can't do it alone. Please contact a\n\t\t\tfriendica developer if you can not help me on your own. My database might be invalid."] = "\n\t\t\tLos desarolladores de friendica publicaron una actualización %s recientemente\n\t\t\tpero cuando intento de instalarla,algo salio terriblemente mal.\n\t\t\tEsto necesita ser arreglado pronto y no puedo hacerlo solo. Por favor contacta\n\t\t\tlos desarolladores de friendica si no me podes ayudar por ti solo. Mi base de datos puede estar invalido.";
$a->strings["Loading more entries..."] = "Cargar mas entradas ..";
$a->strings["The end"] = "El fin";
$a->strings["No contacts"] = "Sin contactos";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d Contacto",
1 => "%d Contactos",
-);
+];
$a->strings["View Contacts"] = "Ver contactos";
$a->strings["Save"] = "Guardar";
$a->strings["poke"] = "tocar";
$a->strings["View on separate page"] = "Ver en pagina aparte";
$a->strings["view on separate page"] = "ver en pagina aparte";
$a->strings["activity"] = "Actividad";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "Comentario",
-);
+];
$a->strings["post"] = "Publicación";
$a->strings["Item filed"] = "Elemento archivado";
$a->strings["Error decoding account file"] = "Error decodificando el archivo de cuenta";
$a->strings["User '%s' already exists on this server!"] = "La cuenta '%s' ya existe en este servidor!";
$a->strings["User creation error"] = "Error al crear la cuenta";
$a->strings["User profile creation error"] = "Error de creación del perfil de la cuenta";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contactos no encontrado",
1 => "%d contactos no importado",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Hecho. Ahora podes ingresar con tu nombre de cuenta y la contraseña.";
$a->strings["Passwords do not match. Password unchanged."] = "Las contraseñas no coinciden. La contraseña no ha sido modificada.";
$a->strings["An invitation is required."] = "Se necesita invitación.";
$a->strings["Profile location is not valid or does not contain profile information."] = "La dirección del perfil no es válida o no contiene información del perfil.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Aviso: La dirección del perfil no tiene un nombre de propietario identificable.";
$a->strings["Warning: profile location has no profile photo."] = "Aviso: la dirección del perfil no tiene foto de perfil.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "no se encontró %d parámetro requerido en el lugar determinado",
1 => "no se encontraron %d parámetros requeridos en el lugar determinado",
-);
+];
$a->strings["Introduction complete."] = "Presentación completa.";
$a->strings["Unrecoverable protocol error."] = "Error de protocolo irrecuperable.";
$a->strings["Profile unavailable."] = "Perfil no disponible.";
$a->strings["Please join us on Friendica"] = "Únete a nosotros en Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Límite de invitaciones sobrepasado. Contacta con el administrador del sitio.";
$a->strings["%s : Message delivery failed."] = "%s : Ha fallado la entrega del mensaje.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d mensaje enviado.",
1 => "%d mensajes enviados.",
-);
+];
$a->strings["You have no more invitations available"] = "No tienes más invitaciones disponibles";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visita %s para ver una lista de servidores públicos donde puedes darte de alta. Los miembros de otros servidores de Friendica pueden conectarse entre ellos, así como con miembros de otras redes sociales diferentes.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Para aceptar la invitación visita y regístrate en %s o en cualquier otro servidor público de Friendica.";
$a->strings["You and %s"] = "Tú y %s";
$a->strings["%s and You"] = "%s y Tú";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d mensaje",
1 => "%d mensajes",
-);
+];
$a->strings["Invalid request identifier."] = "Solicitud de identificación no válida.";
$a->strings["Discard"] = "Descartar";
$a->strings["Ignore"] = "Ignorar";
$a->strings["Attempt to execute this update step automatically"] = "Intentando ejecutar este paso automáticamente";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tEstimado %1\$s,\n\t\t\t\tel administrador de %2\$s ha creado una cuenta para usted.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tLos detalles de acceso son las siguientes:\n\n\t\t\tDirección del sitio:\t%1\$s\n\t\t\tNombre de la cuenta:\t\t%2\$s\n\t\t\tContraseña:\t\t%3\$s\n\n\t\t\tPodrá cambiar la contraseña desde la pagina de configuración de su cuenta después de acceder a la misma\n\t\t\ten.\n\n\t\t\tPor favor tome unos minutos para revisar las opciones demás de la cuenta en dicha pagina de configuración.\n\n\t\t\tTambién podrá agregar informaciones adicionales a su pagina de perfil predeterminado. \n\t\t\t(en la pagina \"Perfiles\") para que otras personas pueden encontrarlo fácilmente.\n\n\t\t\tRecomendamos que elija un nombre apropiado, agregando una imagen de perfil,\n\t\t\tagregando algunas palabras claves de la cuenta (muy útil para hacer nuevos amigos) - y \n\t\t\tquizás el país en donde vive; si no quiere ser mas especifico\n\t\t\tque eso.\n\n\t\t\tRespetamos absolutamente su derecho a la privacidad y ninguno de estos detalles es necesario.\n\t\t\tSi eres nuevo aquí y no conoces a nadie, estos detalles pueden ayudarte\n\t\t\tpara hacer nuevas e interesantes amistades.\n\n\t\t\tGracias y bienvenido a %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s usuario bloqueado/desbloqueado",
1 => "%s usuarios bloqueados/desbloqueados",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s usuario eliminado",
1 => "%s usuarios eliminados",
-);
+];
$a->strings["User '%s' deleted"] = "Usuario '%s' eliminado";
$a->strings["User '%s' unblocked"] = "Usuario '%s' desbloqueado";
$a->strings["User '%s' blocked"] = "Usuario '%s' bloqueado'";
$a->strings["On"] = "Encendido";
$a->strings["Lock feature %s"] = "Trancar opción %s ";
$a->strings["Manage Additional Features"] = "Administrar opciones adicionales";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contacto editado.",
1 => "%d contacts edited.",
-);
+];
$a->strings["Could not access contact record."] = "No se pudo acceder a los datos del contacto.";
$a->strings["Could not locate selected profile."] = "No se pudo encontrar el perfil seleccionado.";
$a->strings["Contact updated."] = "Contacto actualizado.";
$a->strings["%s posted an update."] = "%s ha publicado una actualización.";
$a->strings["Mood"] = "Ánimo";
$a->strings["Set your current mood and tell your friends"] = "Coloca tu ánimo actual y cuéntaselo a tus amigos";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Aviso: Este grupo contiene %s miembro de una red que no permite mensajes públicos.",
1 => "Aviso: Este grupo contiene %s miembros de una red que no permite mensajes públicos.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Los mensajes de este grupo no se enviarán a estos receptores.";
$a->strings["No such group"] = "Ningún grupo";
$a->strings["Group: %s"] = "Grupo: %s";
$a->strings["via"] = "vía";
$a->strings["Wall-to-Wall"] = "Muro-A-Muro";
$a->strings["via Wall-To-Wall:"] = "via Muro-A-Muro:";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comentario",
1 => "%d comentarios",
-);
+];
$a->strings["Bold"] = "Negrita";
$a->strings["Italic"] = "Cursiva";
$a->strings["Underline"] = "Subrayado";
$a->strings["Neuter"] = "Neutre";
$a->strings["Non-specific"] = "Non-spécifique";
$a->strings["Other"] = "Autre";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Indécis",
1 => "Indécis",
-);
+];
$a->strings["Males"] = "Hommes";
$a->strings["Females"] = "Femmes";
$a->strings["Gay"] = "Gay";
$a->strings["Enter address or web location"] = "Entrez son adresse ou sa localisation web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Exemple : bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Se connecter";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitation disponible",
1 => "%d invitations disponibles",
-);
+];
$a->strings["Find People"] = "Trouver des personnes";
$a->strings["Enter name or interest"] = "Entrez un nom ou un centre d'intérêt";
$a->strings["Connect/Follow"] = "Se connecter/Suivre";
$a->strings["Saved Folders"] = "Dossiers sauvegardés";
$a->strings["Everything"] = "Tout";
$a->strings["Categories"] = "Catégories";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contact en commun",
1 => "%d contacts en commun",
-);
+];
$a->strings["show more"] = "montrer plus";
$a->strings["event"] = "événement";
$a->strings["status"] = "le statut";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s a marqué le %3\$s de %2\$s comme favori";
$a->strings["Likes"] = "Derniers \"J'aime\"";
$a->strings["Dislikes"] = "Derniers \"Je n'aime pas\"";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Participe",
1 => "Participent",
-);
+];
$a->strings["Not attending"] = "Ne participe pas";
$a->strings["Might attend"] = "Participera peut-être";
$a->strings["Select"] = "Sélectionner";
$a->strings["Message"] = "Message";
$a->strings["Browser"] = "Navigateur";
$a->strings["View all"] = "Voir tout";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Like",
1 => "Likes",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Dislike",
1 => "Dislikes",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Ne participe pas",
1 => "Ne participent pas",
-);
+];
$a->strings["Miscellaneous"] = "Divers";
$a->strings["Birthday:"] = "Anniversaire :";
$a->strings["Age: "] = "Age : ";
$a->strings["Loading more entries..."] = "Chargement de résultats supplémentaires...";
$a->strings["The end"] = "Fin";
$a->strings["No contacts"] = "Aucun contact";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contact",
1 => "%d contacts",
-);
+];
$a->strings["View Contacts"] = "Voir les contacts";
$a->strings["Save"] = "Sauver";
$a->strings["poke"] = "titiller";
$a->strings["View on separate page"] = "Voir dans une nouvelle page";
$a->strings["view on separate page"] = "voir dans une nouvelle page";
$a->strings["activity"] = "activité";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "commentaire",
-);
+];
$a->strings["post"] = "publication";
$a->strings["Item filed"] = "Élément classé";
$a->strings["Error decoding account file"] = "Une erreur a été détecté en décodant un fichier utilisateur";
$a->strings["User '%s' already exists on this server!"] = "L'utilisateur '%s' existe déjà sur ce serveur!";
$a->strings["User creation error"] = "Erreur de création d'utilisateur";
$a->strings["User profile creation error"] = "Erreur de création du profil utilisateur";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contacts non importés",
1 => "%d contacts non importés",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Action réalisée. Vous pouvez désormais vous connecter avec votre nom d'utilisateur et votre mot de passe";
$a->strings["Passwords do not match. Password unchanged."] = "Les mots de passe ne correspondent pas. Aucun changement appliqué.";
$a->strings["An invitation is required."] = "Une invitation est requise.";
$a->strings["Attempt to execute this update step automatically"] = "Tenter d'éxecuter cette étape automatiquement";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tChère/Cher %1\$s,\n\t\t\t\tL’administrateur de %2\$s vous a ouvert un compte.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tVoici vos informations de connexion :\n\n\t\t\tAdresse :\t%1\$s\n\t\t\tIdentifiant :\t\t%2\$s\n\t\t\tMot de passe :\t\t%3\$s\n\n\t\t\tVous pourrez changer votre mot de passe dans les paramètres de votre compte une fois connecté.\n\n\t\t\tProfitez-en pour prendre le temps de passer en revue les autres paramètres de votre compte.\n\n\t\t\tVous pourrez aussi ajouter quelques informations élémentaires à votre profil par défaut (sur la page « Profils ») pour permettre à d’autres personnes de vous trouver facilement.\n\n\t\t\tNous recommandons de préciser votre nom complet, d’ajouter une photo et quelques mots-clefs (c’est très utile pour découvrir de nouveaux amis), et peut-être aussi d’indiquer au moins le pays dans lequel vous vivez, à défaut d’être plus précis.\n\n\t\t\tNous respectons pleinement votre droit à une vie privée, et vous n’avez aucune obligation de donner toutes ces informations. Mais si vous êtes nouveau et ne connaissez encore personne ici, cela peut vous aider à vous faire de nouveaux amis intéressants.\n\n\t\t\tMerci et bienvenu sur %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s utilisateur a (dé)bloqué",
1 => "%s utilisateurs ont (dé)bloqué",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s utilisateur supprimé",
1 => "%s utilisateurs supprimés",
-);
+];
$a->strings["User '%s' deleted"] = "Utilisateur '%s' supprimé";
$a->strings["User '%s' unblocked"] = "Utilisateur '%s' débloqué";
$a->strings["User '%s' blocked"] = "Utilisateur '%s' bloqué";
$a->strings["Not available."] = "Indisponible.";
$a->strings["No results."] = "Aucun résultat.";
$a->strings["This community stream shows all public posts received by this node. They may not reflect the opinions of this node’s users."] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contact mis à jour.",
1 => "%d contacts mis à jour.",
-);
+];
$a->strings["Could not access contact record."] = "Impossible d'accéder à l'enregistrement du contact.";
$a->strings["Could not locate selected profile."] = "Impossible de localiser le profil séléctionné.";
$a->strings["Contact updated."] = "Contact mis à jour.";
$a->strings["Profile location is not valid or does not contain profile information."] = "L'emplacement du profil est invalide ou ne contient pas de profil valide.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Attention: l'emplacement du profil n'a pas de nom identifiable.";
$a->strings["Warning: profile location has no profile photo."] = "Attention: l'emplacement du profil n'a pas de photo de profil.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d paramètre requis n'a pas été trouvé à l'endroit indiqué",
1 => "%d paramètres requis n'ont pas été trouvés à l'endroit indiqué",
-);
+];
$a->strings["Introduction complete."] = "Phase d'introduction achevée.";
$a->strings["Unrecoverable protocol error."] = "Erreur de protocole non-récupérable.";
$a->strings["Profile unavailable."] = "Profil indisponible.";
$a->strings["Please join us on Friendica"] = "Rejoignez-nous sur Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limite d'invitation exédée. Veuillez contacter l'administrateur de votre site.";
$a->strings["%s : Message delivery failed."] = "%s : L'envoi du message a échoué.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d message envoyé.",
1 => "%d messages envoyés.",
-);
+];
$a->strings["You have no more invitations available"] = "Vous n'avez plus d'invitations disponibles";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visitez %s pour une liste des sites publics que vous pouvez rejoindre. Les membres de Friendica appartenant à d'autres sites peuvent s'interconnecter, ainsi qu'avec les membres de plusieurs autres réseaux sociaux.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Pour accepter cette invitation, merci d'aller vous inscrire sur %s, ou n'importe quel autre site Friendica public.";
$a->strings["You and %s"] = "Vous et %s";
$a->strings["%s and You"] = "%s et vous";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d message",
1 => "%d messages",
-);
+];
$a->strings["Mood"] = "Humeur";
$a->strings["Set your current mood and tell your friends"] = "Spécifiez votre humeur du moment, et informez vos amis";
$a->strings["Remove term"] = "Retirer le terme";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Les messages dans ce groupe ne seront pas envoyés à ces destinataires.";
$a->strings["No such group"] = "Groupe inexistant";
$a->strings["Group: %s"] = "Group : %s";
$a->strings["via"] = "via";
$a->strings["Wall-to-Wall"] = "Inter-mur";
$a->strings["via Wall-To-Wall:"] = "en Inter-mur :";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d commentaire",
1 => "%d commentaires",
-);
+];
$a->strings["Bold"] = "Gras";
$a->strings["Italic"] = "Italique";
$a->strings["Underline"] = "Souligné";
$a->strings["Enter address or web location"] = "Settu inn slóð";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Dæmi: gudmundur@simnet.is, http://simnet.is/gudmundur";
$a->strings["Connect"] = "Tengjast";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d boðskort í boði",
1 => "%d boðskort í boði",
-);
+];
$a->strings["Find People"] = "Finna fólk";
$a->strings["Enter name or interest"] = "Settu inn nafn eða áhugamál";
$a->strings["Connect/Follow"] = "Tengjast/fylgja";
$a->strings["Saved Folders"] = "Vistaðar möppur";
$a->strings["Everything"] = "Allt";
$a->strings["Categories"] = "Flokkar";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d tengiliður sameiginlegur",
1 => "%d tengiliðir sameiginlegir",
-);
+];
$a->strings["show more"] = "birta meira";
$a->strings["Forums"] = "Spjallsvæði";
$a->strings["External link to forum"] = "Ytri tengill á spjallsvæði";
$a->strings["Neuter"] = "Hvorukyn";
$a->strings["Non-specific"] = "Ekki ákveðið";
$a->strings["Other"] = "Annað";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Óviss",
1 => "Óvissir",
-);
+];
$a->strings["Males"] = "Karlar";
$a->strings["Females"] = "Konur";
$a->strings["Gay"] = "Hommi";
$a->strings["User '%s' already exists on this server!"] = "";
$a->strings["User creation error"] = "";
$a->strings["User profile creation error"] = "";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "";
$a->strings["Miscellaneous"] = "Ýmislegt";
$a->strings["Birthday:"] = "Afmælisdagur:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "";
$a->strings["Likes"] = "Líkar";
$a->strings["Dislikes"] = "Mislíkar";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Mætir",
1 => "Mæta",
-);
+];
$a->strings["Not attending"] = "Mætir ekki";
$a->strings["Might attend"] = "Gæti mætt";
$a->strings["Select"] = "Velja";
$a->strings["Message"] = "Skilaboð";
$a->strings["Browser"] = "Vafri";
$a->strings["View all"] = "Skoða allt";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Líkar",
1 => "Líkar",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Mislíkar",
1 => "Mislíkar",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Mæti ekki",
1 => "Mæta ekki",
-);
+];
$a->strings["%s\\'s birthday"] = "Afmælisdagur %s";
$a->strings["General Features"] = "Almennir eiginleikar";
$a->strings["Multiple Profiles"] = "";
$a->strings["Loading more entries..."] = "Hleð inn fleiri færslum...";
$a->strings["The end"] = "Endir";
$a->strings["No contacts"] = "Engir tengiliðir";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d tengiliður",
1 => "%d tengiliðir",
-);
+];
$a->strings["View Contacts"] = "Skoða tengiliði";
$a->strings["Save"] = "Vista";
$a->strings["poke"] = "pota";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "virkni";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "athugasemd",
1 => "athugasemdir",
-);
+];
$a->strings["post"] = "";
$a->strings["Item filed"] = "";
$a->strings["Passwords do not match. Password unchanged."] = "Aðgangsorð ber ekki saman. Aðgangsorð óbreytt.";
$a->strings["Please join us on Friendica"] = "";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "%s : Skilaboð komust ekki til skila.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d skilaboð send.",
1 => "%d skilaboð send",
-);
+];
$a->strings["You have no more invitations available"] = "Þú hefur ekki fleiri boðskort.";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "";
$a->strings["You and %s"] = "";
$a->strings["%s and You"] = "";
$a->strings["D, d M Y - g:i A"] = "";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Sýsla með notendur og/eða síður";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Skipta á milli auðkenna eða hópa- / stjörnunotanda sem deila þínum aðgangs upplýsingum eða þér verið úthlutað \"umsýslu\" réttindum.";
$a->strings["Select an identity to manage: "] = "Veldu notanda til að sýsla með:";
$a->strings["No such group"] = "Hópur ekki til";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d ummæli",
1 => "%d ummæli",
-);
+];
$a->strings["Private Message"] = "Einkaskilaboð";
$a->strings["I like this (toggle)"] = "Mér líkar þetta (kveikja/slökkva)";
$a->strings["like"] = "líkar";
$a->strings["Attempt to execute this update step automatically"] = "Framkvæma þessa uppfærslu sjálfkrafa";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "",
1 => "",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s notenda eytt",
1 => "%s notendum eytt",
-);
+];
$a->strings["User '%s' deleted"] = "Notanda '%s' eytt";
$a->strings["User '%s' unblocked"] = "Notanda '%s' gefið frelsi";
$a->strings["User '%s' blocked"] = "Notanda '%s' settur í bann";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Tókst ekki að ná í uppl. um tengilið";
$a->strings["Could not locate selected profile."] = "Tókst ekki að staðsetja valinn forsíðu";
$a->strings["Contact updated."] = "Tengiliður uppfærður";
$a->strings["Profile location is not valid or does not contain profile information."] = "Forsíðu slóð er ekki í lagi eða inniheldur ekki forsíðu upplýsingum.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Aðvörun: forsíðu staðsetning hefur ekki aðgreinanlegt eigendanafn.";
$a->strings["Warning: profile location has no profile photo."] = "Aðvörun: forsíðu slóð hefur ekki forsíðu mynd.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d skilyrt breyta fannst ekki á uppgefinni staðsetningu",
1 => "%d skilyrtar breytur fundust ekki á uppgefninni staðsetningu",
-);
+];
$a->strings["Introduction complete."] = "Kynning tilbúinn.";
$a->strings["Unrecoverable protocol error."] = "Alvarleg samskipta villa.";
$a->strings["Profile unavailable."] = "Ekki hægt að sækja forsíðu";
$a->strings["You may visit them online at %s"] = "Þú getur heimsótt þau á netinu á %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Hafðu samband við sendanda með því að svara á þessari færslu ef þú villt ekki fá þessi skilaboð.";
$a->strings["%s posted an update."] = "%s hefur sent uppfærslu.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Einka skilaboð send á þennan notanda eiga á hættu að verða opinber.";
$a->strings["Invalid contact."] = "Ógildur tengiliður.";
$a->strings["Neuter"] = "Neutro";
$a->strings["Non-specific"] = "Non specificato";
$a->strings["Other"] = "Altro";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "Indeciso",
1 => "Indecisi",
-);
+];
$a->strings["Males"] = "Maschi";
$a->strings["Females"] = "Femmine";
$a->strings["Gay"] = "Gay";
$a->strings["Enter address or web location"] = "Inserisci posizione o indirizzo web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Esempio: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Connetti";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invito disponibile",
1 => "%d inviti disponibili",
-);
+];
$a->strings["Find People"] = "Trova persone";
$a->strings["Enter name or interest"] = "Inserisci un nome o un interesse";
$a->strings["Connect/Follow"] = "Connetti/segui";
$a->strings["All Networks"] = "Tutte le Reti";
$a->strings["Everything"] = "Tutto";
$a->strings["Categories"] = "Categorie";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contatto in comune",
1 => "%d contatti in comune",
-);
+];
$a->strings["Friendica Notification"] = "Notifica Friendica";
$a->strings["Thank You,"] = "Grazie,";
$a->strings["%s Administrator"] = "Amministratore %s";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s ha segnato il/la %3\$s di %2\$s come preferito";
$a->strings["Likes"] = "Mi piace";
$a->strings["Dislikes"] = "Non mi piace";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "Partecipa",
1 => "Partecipano",
-);
+];
$a->strings["Not attending"] = "Non partecipa";
$a->strings["Might attend"] = "Forse partecipa";
$a->strings["Select"] = "Seleziona";
$a->strings["Message"] = "Messaggio";
$a->strings["Browser"] = "Browser";
$a->strings["View all"] = "Mostra tutto";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Mi piace",
1 => "Mi piace",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Non mi piace",
1 => "Non mi piace",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Non partecipa",
1 => "Non partecipano",
-);
+];
$a->strings["Cannot locate DNS info for database server '%s'"] = "Non trovo le informazioni DNS per il database server '%s'";
$a->strings["There are no tables on MyISAM."] = "Non ci sono tabelle MyISAM";
$a->strings["\n\t\t\tThe friendica developers released update %s recently,\n\t\t\tbut when I tried to install it, something went terribly wrong.\n\t\t\tThis needs to be fixed soon and I can't do it alone. Please contact a\n\t\t\tfriendica developer if you can not help me on your own. My database might be invalid."] = "\nGli sviluppatori di Friendica hanno rilasciato l'aggiornamento %s\nrecentemente, ma quando ho provato a installarlo, qualcosa è \nandato terribilmente storto.\nBisogna sistemare le cose e non posso farlo da solo.\nContatta uno sviluppatore se non puoi aiutarmi da solo. Il mio database potrebbe essere invalido.";
$a->strings["Loading more entries..."] = "Carico più elementi...";
$a->strings["The end"] = "Fine";
$a->strings["No contacts"] = "Nessun contatto";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contatto",
1 => "%d contatti",
-);
+];
$a->strings["View Contacts"] = "Visualizza i contatti";
$a->strings["Save"] = "Salva";
$a->strings["poke"] = "stuzzica";
$a->strings["View on separate page"] = "Vedi in una pagina separata";
$a->strings["view on separate page"] = "vedi in una pagina separata";
$a->strings["activity"] = "attività";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "commento ",
1 => "commenti",
-);
+];
$a->strings["post"] = "messaggio";
$a->strings["Item filed"] = "Messaggio salvato";
$a->strings["Error decoding account file"] = "Errore decodificando il file account";
$a->strings["User '%s' already exists on this server!"] = "L'utente '%s' esiste già su questo server!";
$a->strings["User creation error"] = "Errore creando l'utente";
$a->strings["User profile creation error"] = "Errore creando il profilo dell'utente";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contatto non importato",
1 => "%d contatti non importati",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Fatto. Ora puoi entrare con il tuo nome utente e la tua password";
$a->strings["Passwords do not match. Password unchanged."] = "Le password non corrispondono. Password non cambiata.";
$a->strings["An invitation is required."] = "E' richiesto un invito.";
$a->strings["Profile location is not valid or does not contain profile information."] = "L'indirizzo del profilo non è valido o non contiene un profilo.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Attenzione: l'indirizzo del profilo non riporta il nome del proprietario.";
$a->strings["Warning: profile location has no profile photo."] = "Attenzione: l'indirizzo del profilo non ha una foto.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d parametro richiesto non è stato trovato all'indirizzo dato",
1 => "%d parametri richiesti non sono stati trovati all'indirizzo dato",
-);
+];
$a->strings["Introduction complete."] = "Presentazione completa.";
$a->strings["Unrecoverable protocol error."] = "Errore di comunicazione.";
$a->strings["Profile unavailable."] = "Profilo non disponibile.";
$a->strings["Please join us on Friendica"] = "Unisciti a noi su Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limite degli inviti superato. Contatta l'amministratore del tuo sito.";
$a->strings["%s : Message delivery failed."] = "%s: la consegna del messaggio fallita.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d messaggio inviato.",
1 => "%d messaggi inviati.",
-);
+];
$a->strings["You have no more invitations available"] = "Non hai altri inviti disponibili";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visita %s per una lista di siti pubblici a cui puoi iscriverti. I membri Friendica su altri siti possono collegarsi uno con l'altro, come con membri di molti altri social network.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Per accettare questo invito, visita e registrati su %s o su un'altro sito web Friendica aperto al pubblico.";
$a->strings["You and %s"] = "Tu e %s";
$a->strings["%s and You"] = "%s e Tu";
$a->strings["D, d M Y - g:i A"] = "D d M Y - G:i";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d messaggio",
1 => "%d messaggi",
-);
+];
$a->strings["Invalid request identifier."] = "L'identificativo della richiesta non è valido.";
$a->strings["Discard"] = "Scarta";
$a->strings["Ignore"] = "Ignora";
$a->strings["Attempt to execute this update step automatically"] = "Cerco di eseguire questo aggiornamento in automatico";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\nGentile %1\$s,\n l'amministratore di %2\$s ha impostato un account per te.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\nI dettagli del tuo utente sono:\n Indirizzo del sito: %1\$s\n Nome utente: %2\$s\n Password: %3\$s\n\nPuoi cambiare la tua password dalla pagina delle impostazioni del tuo account dopo esserti autenticato.\n\nPer favore, prenditi qualche momento per esaminare tutte le impostazioni presenti.\n\nPotresti voler aggiungere qualche informazione di base al tuo profilo predefinito (nella pagina \"Profili\"), così che le altre persone possano trovarti più facilmente.\n\nTi raccomandiamo di inserire il tuo nome completo, aggiungere una foto, aggiungere qualche parola chiave del profilo (molto utili per trovare nuovi contatti), e magari in quale nazione vivi, se non vuoi essere più specifico di così.\n\nNoi rispettiamo appieno la tua privacy, e nessuna di queste informazioni è necessaria o obbligatoria.\nSe sei nuovo e non conosci nessuno qui, possono aiutarti a trovare qualche nuovo e interessante contatto.\n\nGrazie e benvenuto su %4\$s";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s utente bloccato/sbloccato",
1 => "%s utenti bloccati/sbloccati",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s utente cancellato",
1 => "%s utenti cancellati",
-);
+];
$a->strings["User '%s' deleted"] = "Utente '%s' cancellato";
$a->strings["User '%s' unblocked"] = "Utente '%s' sbloccato";
$a->strings["User '%s' blocked"] = "Utente '%s' bloccato";
$a->strings["On"] = "Acceso";
$a->strings["Lock feature %s"] = "Blocca funzionalità %s";
$a->strings["Manage Additional Features"] = "Gestisci Funzionalità Aggiuntive";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contatto modificato.",
1 => "%d contatti modificati",
-);
+];
$a->strings["Could not access contact record."] = "Non è possibile accedere al contatto.";
$a->strings["Could not locate selected profile."] = "Non riesco a trovare il profilo selezionato.";
$a->strings["Contact updated."] = "Contatto aggiornato.";
$a->strings["%s posted an update."] = "%s ha inviato un aggiornamento.";
$a->strings["Mood"] = "Umore";
$a->strings["Set your current mood and tell your friends"] = "Condividi il tuo umore con i tuoi amici";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Attenzione: Questo gruppo contiene %s membro da una rete che non permette la ricezione di messaggi non pubblici.",
1 => "Attenzione: Questo gruppo contiene %s membri da reti che non permettono la ricezione di messaggi non pubblici.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "I messaggi in questo gruppo non saranno inviati ai quei contatti.";
$a->strings["No such group"] = "Nessun gruppo";
$a->strings["Group: %s"] = "Gruppo: %s";
$a->strings["via"] = "via";
$a->strings["Wall-to-Wall"] = "Da bacheca a bacheca";
$a->strings["via Wall-To-Wall:"] = "da bacheca a bacheca";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d commento",
1 => "%d commenti",
-);
+];
$a->strings["Bold"] = "Grassetto";
$a->strings["Italic"] = "Corsivo";
$a->strings["Underline"] = "Sottolineato";
return ($n != 1);;
}}
;
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d kontakt redigert.",
1 => "%d kontakter redigert",
-);
+];
$a->strings["Could not access contact record."] = "Fikk ikke tilgang til kontaktposten.";
$a->strings["Could not locate selected profile."] = "Kunne ikke lokalisere valgt profil.";
$a->strings["Contact updated."] = "Kontakt oppdatert.";
$a->strings["(Update was not successful)"] = "(Oppdatering mislykket)";
$a->strings["Suggest friends"] = "Foreslå venner";
$a->strings["Network type: %s"] = "Nettverkstype: %s";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d felles kontakt",
1 => "%d felles kontakter",
-);
+];
$a->strings["View all contacts"] = "Vis alle kontakter";
$a->strings["Unblock"] = "Ikke blokker";
$a->strings["Block"] = "Blokker";
$a->strings["%s and You"] = "%s og du";
$a->strings["Delete conversation"] = "Slett samtale";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d melding",
1 => "%d meldinger",
-);
+];
$a->strings["Message not available."] = "Melding utilgjengelig.";
$a->strings["Delete message"] = "Slett melding";
$a->strings["No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."] = "Ingen sikker kommunikasjon tilgjengelig. Du <strong>kan kanskje</strong> svare fra senderens profilside.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
$a->strings["Registration details for %s"] = "Registeringsdetaljer for %s";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s bruker blokkert/ikke blokkert",
1 => "%s brukere blokkert/ikke blokkert",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s bruker slettet",
1 => "%s brukere slettet",
-);
+];
$a->strings["User '%s' deleted"] = "Brukeren '%s' er slettet";
$a->strings["User '%s' unblocked"] = "Brukeren '%s' er ikke blokkert";
$a->strings["User '%s' blocked"] = "Brukeren '%s' er blokkert";
$a->strings["Interesting Links"] = "Interessante lenker";
$a->strings["Starred"] = "Med stjerne";
$a->strings["Favourite Posts"] = "Favorittinnlegg";
-$a->strings["Warning: This group contains %s member from an insecure network."] = array(
+$a->strings["Warning: This group contains %s member from an insecure network."] = [
0 => "Advarsel: denne gruppen inneholder %s medlem fra et usikkert nettverk.",
1 => "Advarsel: denne gruppe inneholder %s medlemmer fra et usikkert nettverk.",
-);
+];
$a->strings["Private messages to this group are at risk of public disclosure."] = "Private meldinger til denne gruppen risikerer å bli offentliggjort.";
$a->strings["No such group"] = "Gruppen finnes ikke";
$a->strings["Group is empty"] = "Gruppen er tom";
$a->strings["View %s's profile @ %s"] = "Besøk %ss profil [%s]";
$a->strings["%s from %s"] = "%s fra %s";
$a->strings["View in context"] = "Vis i sammenheng";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d kommentar",
1 => "%d kommentarer",
-);
-$a->strings["comment"] = array(
+];
+$a->strings["comment"] = [
0 => "kommentar",
1 => "kommentarer",
-);
+];
$a->strings["show more"] = "vis mer";
$a->strings["Private Message"] = "Privat melding";
$a->strings["I like this (toggle)"] = "Jeg liker dette (skru på/av)";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profilstedet er ikke gyldig og inneholder ikke profilinformasjon.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Advarsel: profilstedet har ikke identifiserbart eiernavn.";
$a->strings["Warning: profile location has no profile photo."] = "Advarsel: profilstedet har ikke noe profilbilde.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "one: %d nødvendig parameter ble ikke funnet på angitt sted",
1 => "other: %d nødvendige parametre ble ikke funnet på angitt sted",
-);
+];
$a->strings["Introduction complete."] = "Introduksjon ferdig.";
$a->strings["Unrecoverable protocol error."] = "Uopprettelig protokollfeil.";
$a->strings["Profile unavailable."] = "Profil utilgjengelig.";
$a->strings["Please join us on Friendica"] = "Vær med oss på Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Invitasjonsgrense overskredet. Vennligst kontakt administrator på ditt nettsted.";
$a->strings["%s : Message delivery failed."] = "%s: Mislyktes med å levere meldingen.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "one: %d melding sendt.",
1 => "other: %d meldinger sendt.",
-);
+];
$a->strings["You have no more invitations available"] = "Du har ingen flere tilgjengelige invitasjoner";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Besøk %s for en liste med offentlige nettsteder du kan bli med i. Friendica-medlemmer ved andre nettsteder kan alle opprette forbindelse til hverandre, og i tillegg til medlemmer av mange andre sosiale nettverk.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "For å akseptere denne invitasjonen, vær så snill å besøk og registrer deg hos %s eller et hvilket som helst annet offentlig Friendica-nettsted.";
$a->strings["Add New Contact"] = "Legg til ny kontakt";
$a->strings["Enter address or web location"] = "Skriv adresse eller web-plassering";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Eksempel: ole@eksempel.no, http://eksempel.no/kari";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitasjon tilgjengelig",
1 => "%d invitasjoner tilgjengelig",
-);
+];
$a->strings["Find People"] = "Finn personer";
$a->strings["Enter name or interest"] = "Skriv navn eller interesse";
$a->strings["Connect/Follow"] = "Koble/Følg";
$a->strings["last"] = "siste";
$a->strings["next"] = "neste";
$a->strings["No contacts"] = "Ingen kontakter";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d kontakt",
1 => "%d kontakter",
-);
+];
$a->strings["poke"] = "dytt";
$a->strings["ping"] = "ping";
$a->strings["pinged"] = "pinget";
$a->strings["User '%s' already exists on this server!"] = "Brukeren '%s' finnes allerede på denne tjeneren!";
$a->strings["User creation error"] = "Feil ved oppretting av bruker";
$a->strings["User profile creation error"] = "Feil ved opprettelsen av brukerprofil";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d kontakt ikke importert",
1 => "%d kontakter ikke importert",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Ferdig. Du kan nå logge inn med ditt brukernavn og passord";
$a->strings["toggle mobile"] = "Velg mobilvisning";
$a->strings["Theme settings"] = "Temainnstillinger";
$a->strings["Enter address or web location"] = "Voeg een webadres of -locatie in:";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Voorbeeld: jan@voorbeeld.be, http://voorbeeld.nl/barbara";
$a->strings["Connect"] = "Verbinden";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d uitnodiging beschikbaar",
1 => "%d uitnodigingen beschikbaar",
-);
+];
$a->strings["Find People"] = "Zoek mensen";
$a->strings["Enter name or interest"] = "Vul naam of interesse in";
$a->strings["Connect/Follow"] = "Verbind/Volg";
$a->strings["Saved Folders"] = "Bewaarde Mappen";
$a->strings["Everything"] = "Alles";
$a->strings["Categories"] = "Categorieën";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d gedeeld contact",
1 => "%d gedeelde contacten",
-);
+];
$a->strings["show more"] = "toon meer";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Genderneutraal";
$a->strings["Non-specific"] = "Niet-specifiek";
$a->strings["Other"] = "Anders";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Mannen";
$a->strings["Females"] = "Vrouwen";
$a->strings["Gay"] = "Homo";
$a->strings["User '%s' already exists on this server!"] = "Gebruiker '%s' bestaat al op deze server!";
$a->strings["User creation error"] = "Fout bij het aanmaken van de gebruiker";
$a->strings["User profile creation error"] = "Fout bij het aanmaken van het gebruikersprofiel";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contact werd niet geïmporteerd",
1 => "%d contacten werden niet geïmporteerd",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Gebeurd. Je kunt nu inloggen met je gebruikersnaam en wachtwoord";
$a->strings["Miscellaneous"] = "Diversen";
$a->strings["Birthday:"] = "Verjaardag:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s markeerde %2\$s's %3\$s als favoriet";
$a->strings["Likes"] = "Houdt van";
$a->strings["Dislikes"] = "Houdt niet van";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Kies";
$a->strings["Message"] = "Bericht";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "Algemene functies";
$a->strings["Multiple Profiles"] = "Meerdere profielen";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Geen contacten";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contact",
1 => "%d contacten",
-);
+];
$a->strings["View Contacts"] = "Bekijk contacten";
$a->strings["Save"] = "Bewaren";
$a->strings["poke"] = "aanstoten";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "activiteit";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "reactie",
1 => "reacties",
-);
+];
$a->strings["post"] = "bericht";
$a->strings["Item filed"] = "Item bewaard";
$a->strings["Passwords do not match. Password unchanged."] = "Wachtwoorden komen niet overeen. Wachtwoord niet gewijzigd.";
$a->strings["Please join us on Friendica"] = "Kom bij ons op Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Uitnodigingslimiet overschreden. Neem contact op met de beheerder van je website.";
$a->strings["%s : Message delivery failed."] = "%s : Aflevering van bericht mislukt.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d bericht verzonden.",
1 => "%d berichten verzonden.",
-);
+];
$a->strings["You have no more invitations available"] = "Je kunt geen uitnodigingen meer sturen";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Bezoek %s voor een lijst van openbare sites waar je je kunt aansluiten. Friendica leden op andere sites kunnen allemaal met elkaar verbonden worden, en ook met leden van verschillende andere sociale netwerken.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Om deze uitnodiging te accepteren kan je je op %s registreren of op een andere vrij toegankelijke Friendica-website.";
$a->strings["You and %s"] = "Jij en %s";
$a->strings["%s and You"] = "%s en jij";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d bericht",
1 => "%d berichten",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Beheer Identiteiten en/of Pagina's";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "Wissel tussen verschillende identiteiten of forum/groeppagina's die jouw accountdetails delen of waar je \"beheerdersrechten\" hebt gekregen.";
$a->strings["Select an identity to manage: "] = "Selecteer een identiteit om te beheren:";
$a->strings["No such group"] = "Zo'n groep bestaat niet";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d reactie",
1 => "%d reacties",
-);
+];
$a->strings["Private Message"] = "Privébericht";
$a->strings["I like this (toggle)"] = "Vind ik leuk";
$a->strings["like"] = "leuk";
$a->strings["Attempt to execute this update step automatically"] = "Probeer deze stap automatisch uit te voeren";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s gebruiker geblokkeerd/niet geblokkeerd",
1 => "%s gebruikers geblokkeerd/niet geblokkeerd",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s gebruiker verwijderd",
1 => "%s gebruikers verwijderd",
-);
+];
$a->strings["User '%s' deleted"] = "Gebruiker '%s' verwijderd";
$a->strings["User '%s' unblocked"] = "Gebruiker '%s' niet meer geblokkeerd";
$a->strings["User '%s' blocked"] = "Gebruiker '%s' geblokkeerd";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Kon geen toegang krijgen tot de contactgegevens";
$a->strings["Could not locate selected profile."] = "Kon het geselecteerde profiel niet vinden.";
$a->strings["Contact updated."] = "Contact bijgewerkt.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profiel is ongeldig of bevat geen informatie";
$a->strings["Warning: profile location has no identifiable owner name."] = "Waarschuwing: de profiellocatie heeft geen identificeerbare eigenaar.";
$a->strings["Warning: profile location has no profile photo."] = "Waarschuwing: Profieladres heeft geen profielfoto.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "De %d vereiste parameter is niet op het gegeven adres gevonden",
1 => "De %d vereiste parameters zijn niet op het gegeven adres gevonden",
-);
+];
$a->strings["Introduction complete."] = "Verzoek voltooid.";
$a->strings["Unrecoverable protocol error."] = "Onherstelbare protocolfout. ";
$a->strings["Profile unavailable."] = "Profiel onbeschikbaar";
$a->strings["You may visit them online at %s"] = "Je kunt ze online bezoeken op %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Contacteer de afzender door op dit bericht te antwoorden als je deze berichten niet wilt ontvangen.";
$a->strings["%s posted an update."] = "%s heeft een wijziging geplaatst.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Privéberichten naar deze persoon kunnen openbaar gemaakt worden.";
$a->strings["Invalid contact."] = "Ongeldig contact.";
$a->strings["Enter address or web location"] = "Wpisz adres lub lokalizację sieciową";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Przykład: bob@przykład.com, http://przykład.com/barbara";
$a->strings["Connect"] = "Połącz";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d zaproszenie dostępne",
1 => "%d zaproszeń dostępnych",
2 => "%d zaproszenia dostępne",
-);
+];
$a->strings["Find People"] = "Znajdź ludzi";
$a->strings["Enter name or interest"] = "Wpisz nazwę lub zainteresowanie";
$a->strings["Connect/Follow"] = "Połącz/Obserwuj";
$a->strings["Saved Folders"] = "Zapisane foldery";
$a->strings["Everything"] = "Wszystko";
$a->strings["Categories"] = "Kategorie";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["show more"] = "Pokaż więcej";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Bezpłciowy";
$a->strings["Non-specific"] = "Niespecyficzne";
$a->strings["Other"] = "Inne";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Males"] = "Mężczyźni";
$a->strings["Females"] = "Kobiety";
$a->strings["Gay"] = "Gej";
$a->strings["User '%s' already exists on this server!"] = "Użytkownik '%s' już istnieje na tym serwerze!";
$a->strings["User creation error"] = "";
$a->strings["User profile creation error"] = "";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "Nie zaimportowano %d kontaktu.",
1 => "Nie zaimportowano %d kontaktów.",
2 => "Nie zaimportowano %d kontaktów.",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Wykonano. Teraz możesz się zalogować z użyciem loginu i hasła.";
$a->strings["Miscellaneous"] = "Różny";
$a->strings["Birthday:"] = "Urodziny:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "";
$a->strings["Likes"] = "Polubień";
$a->strings["Dislikes"] = "Nie lubień";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Wybierz";
$a->strings["Message"] = "Wiadomość";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
2 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
2 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "";
$a->strings["Multiple Profiles"] = "";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Brak kontaktów";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d kontakt",
1 => "%d kontaktów",
2 => "%d kontakty",
-);
+];
$a->strings["View Contacts"] = "widok kontaktów";
$a->strings["Save"] = "Zapisz";
$a->strings["poke"] = "zaczep";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "aktywność";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "",
2 => "komentarz",
-);
+];
$a->strings["post"] = "post";
$a->strings["Item filed"] = "";
$a->strings["Passwords do not match. Password unchanged."] = "Hasło nie pasuje. Hasło nie zmienione.";
$a->strings["Please join us on Friendica"] = "Dołącz do nas na Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "%s : Dostarczenie wiadomości nieudane.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d wiadomość wysłana.",
1 => "%d wiadomości wysłane.",
2 => "%d wysłano .",
-);
+];
$a->strings["You have no more invitations available"] = "Nie masz więcej zaproszeń";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "";
$a->strings["You and %s"] = "Ty i %s";
$a->strings["%s and You"] = "%s i ty";
$a->strings["D, d M Y - g:i A"] = "D, d M R - g:m AM/PM";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => " %d wiadomość",
1 => " %d wiadomości",
2 => " %d wiadomości",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Zarządzaj Tożsamościami i/lub Stronami.";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "";
$a->strings["Select an identity to manage: "] = "Wybierz tożsamość do zarządzania:";
$a->strings["No such group"] = "Nie ma takiej grupy";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "Ten wpis został zedytowany";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => " %d komentarz",
1 => " %d komentarzy",
2 => " %d komentarzy",
-);
+];
$a->strings["Private Message"] = "Wiadomość prywatna";
$a->strings["I like this (toggle)"] = "Lubię to (zmień)";
$a->strings["like"] = "polub";
$a->strings["Attempt to execute this update step automatically"] = "";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "",
1 => "",
2 => "",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => " %s użytkownik usunięty",
1 => " %s użytkownicy usunięci",
2 => " %s usuniętych użytkowników ",
-);
+];
$a->strings["User '%s' deleted"] = "Użytkownik '%s' usunięty";
$a->strings["User '%s' unblocked"] = "Użytkownik '%s' odblokowany";
$a->strings["User '%s' blocked"] = "Użytkownik '%s' zablokowany";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Could not access contact record."] = "Nie można uzyskać dostępu do rejestru kontaktów.";
$a->strings["Could not locate selected profile."] = "Nie można znaleźć wybranego profilu.";
$a->strings["Contact updated."] = "Kontakt zaktualizowany";
$a->strings["Profile location is not valid or does not contain profile information."] = "Położenie profilu jest niepoprawne lub nie zawiera żadnych informacji.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Ostrzeżenie: położenie profilu ma taką samą nazwę jak użytkownik.";
$a->strings["Warning: profile location has no profile photo."] = "Ostrzeżenie: położenie profilu nie zawiera zdjęcia.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d wymagany parametr nie został znaleziony w podanej lokacji",
1 => "%d wymagane parametry nie zostały znalezione w podanej lokacji",
2 => "%d wymagany parametr nie został znaleziony w podanej lokacji",
-);
+];
$a->strings["Introduction complete."] = "wprowadzanie zakończone.";
$a->strings["Unrecoverable protocol error."] = "Nieodwracalny błąd protokołu.";
$a->strings["Profile unavailable."] = "Profil niedostępny.";
$a->strings["You may visit them online at %s"] = "Możesz ich odwiedzić online u %s";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Skontaktuj się z nadawcą odpowiadając na ten post jeśli nie chcesz otrzymywać tych wiadomości.";
$a->strings["%s posted an update."] = "%s zaktualizował wpis.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
2 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Prywatne wiadomości do tej osoby mogą zostać publicznie ujawnione ";
$a->strings["Invalid contact."] = "Zły kontakt";
$a->strings["Neuter"] = "Neutro";
$a->strings["Non-specific"] = "Não específico";
$a->strings["Other"] = "Outro";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Homens";
$a->strings["Females"] = "Mulheres";
$a->strings["Gay"] = "Gays";
$a->strings["Enter address or web location"] = "Forneça endereço ou localização web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Por exemplo: joao@exemplo.com, http://exemplo.com/maria";
$a->strings["Connect"] = "Conectar";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d convite disponível",
1 => "%d convites disponíveis",
-);
+];
$a->strings["Find People"] = "Pesquisar por pessoas";
$a->strings["Enter name or interest"] = "Fornecer nome ou interesse";
$a->strings["Connect/Follow"] = "Conectar-se/acompanhar";
$a->strings["All Networks"] = "Todas as redes";
$a->strings["Everything"] = "Tudo";
$a->strings["Categories"] = "Categorias";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contato em comum",
1 => "%d contatos em comum",
-);
+];
$a->strings["event"] = "evento";
$a->strings["status"] = "status";
$a->strings["photo"] = "foto";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s marcou %3\$s de %2\$s como favorito";
$a->strings["Likes"] = "Gosta de";
$a->strings["Dislikes"] = "Não gosta de";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Selecionar";
$a->strings["Message"] = "Mensagem";
$a->strings["Browser"] = "Navegador";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Curtida",
1 => "Curtidas",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Não curtiu",
1 => "Não curtiram",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "Não vai",
1 => "Não vão",
-);
+];
$a->strings["There are no tables on MyISAM."] = "";
$a->strings["\n\t\t\tThe friendica developers released update %s recently,\n\t\t\tbut when I tried to install it, something went terribly wrong.\n\t\t\tThis needs to be fixed soon and I can't do it alone. Please contact a\n\t\t\tfriendica developer if you can not help me on your own. My database might be invalid."] = "\n\t\t\tOs desenvolvedores de Friendica lançaram recentemente uma atualização %s,\n\t\t\tmas quando tentei instalá-la, algo deu terrivelmente errado.\n\t\t\tIsso precisa ser corrigido em breve e eu não posso fazer isso sozinho. Por favor, contate um\n\t\t\tdesenvolvedor da Friendica se você não pode me ajudar sozinho. Meu banco de dados pode ser inválido.";
$a->strings["The error message is\n[pre]%s[/pre]"] = "A mensagem de erro é\n[pre]%s[/pre]";
$a->strings["Loading more entries..."] = "Baixando mais entradas...";
$a->strings["The end"] = "Fim";
$a->strings["No contacts"] = "Nenhum contato";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d contato",
1 => "%d contatos",
-);
+];
$a->strings["View Contacts"] = "Ver contatos";
$a->strings["Save"] = "Salvar";
$a->strings["poke"] = "cutucar";
$a->strings["View on separate page"] = "Ver em uma página separada";
$a->strings["view on separate page"] = "ver em uma página separada";
$a->strings["activity"] = "atividade";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "comentário",
1 => "comentários",
-);
+];
$a->strings["post"] = "publicação";
$a->strings["Item filed"] = "O item foi arquivado";
$a->strings["Error decoding account file"] = "Erro ao decodificar arquivo de conta";
$a->strings["User '%s' already exists on this server!"] = "User '%s' já existe nesse servidor!";
$a->strings["User creation error"] = "Erro na criação do usuário";
$a->strings["User profile creation error"] = "Erro na criação do perfil do Usuário";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contato não foi importado",
1 => "%d contatos não foram importados",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Feito. Você agora pode entrar com seu nome de usuário e senha.";
$a->strings["Passwords do not match. Password unchanged."] = "As senhas não correspondem. A senha não foi modificada.";
$a->strings["An invitation is required."] = "É necessário um convite.";
$a->strings["Group is empty"] = "O grupo está vazio";
$a->strings["Group: %s"] = "Grupo: %s";
$a->strings["This entry was edited"] = "Essa entrada foi editada";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comentário",
1 => "%d comentários",
-);
+];
$a->strings["Private Message"] = "Mensagem privada";
$a->strings["I like this (toggle)"] = "Eu gostei disso (alternar)";
$a->strings["like"] = "gostei";
$a->strings["Profile location is not valid or does not contain profile information."] = "A localização do perfil não é válida ou não contém uma informação de perfil.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Aviso: a localização do perfil não possui nenhum nome identificável do seu dono.";
$a->strings["Warning: profile location has no profile photo."] = "Aviso: a localização do perfil não possui nenhuma foto do perfil.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "O parâmetro requerido %d não foi encontrado na localização fornecida",
1 => "Os parâmetros requeridos %d não foram encontrados na localização fornecida",
-);
+];
$a->strings["Introduction complete."] = "A apresentação foi finalizada.";
$a->strings["Unrecoverable protocol error."] = "Ocorreu um erro irrecuperável de protocolo.";
$a->strings["Profile unavailable."] = "O perfil não está disponível.";
$a->strings["Please join us on Friendica"] = "Por favor, junte-se à nós na Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limite de convites ultrapassado. Favor contactar o administrador do sítio.";
$a->strings["%s : Message delivery failed."] = "%s : Não foi possível enviar a mensagem.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d mensagem enviada.",
1 => "%d mensagens enviadas.",
-);
+];
$a->strings["You have no more invitations available"] = "Você não possui mais convites disponíveis";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Visite %s para obter uma lista de sites públicos onde você pode se cadastrar. Membros da friendica podem se conectar, mesmo que estejam em sites separados. Além disso você também pode se conectar com membros de várias outras redes sociais.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Para aceitar esse convite, por favor cadastre-se em %s ou qualquer outro site friendica público.";
$a->strings["You and %s"] = "Você e %s";
$a->strings["%s and You"] = "%s e você";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d mensagem",
1 => "%d mensagens",
-);
+];
$a->strings["Mood"] = "Humor";
$a->strings["Set your current mood and tell your friends"] = "Defina o seu humor e conte aos seus amigos";
$a->strings["Remove term"] = "Remover o termo";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Mensagens privadas para esta pessoa correm o risco de sofrerem divulgação pública.";
$a->strings["Invalid contact."] = "Contato inválido.";
$a->strings["Attempt to execute this update step automatically"] = "Tentar executar esse passo da atualização automaticamente";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "\n\t\t\tCaro %1\$s,\n\t\t\t\to administrador de %2\$s criou uma conta para você.";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "\n\t\t\tOs dados de login são os seguintes:\n\n\t\t\tLocal do Site:\t%1\$s\n\t\t\tNome de Login:\t\t%2\$s\n\t\t\tSenha:\t\t%3\$s\n\n\t\t\tVocê pode alterar sua senha na página de \"Configurações\" da sua conta após fazer o login.\n\n\t\t\tPor favor, dedique alguns minutos na página para rever as outras configurações da sua conta.\n\n\t\t\tTalvez você também queira incluir algumas informações básicas adicionais ao seu perfil padrão\n\t\t\t(na página de \"Perfis\") para que outras pessoas possam encontrá-lo com facilidade.\n\n\t\t\tRecomendamos que inclua seu nome completo, adicione uma foto do perfil,\n\t\t\tadicionar algumas \"palavras-chave\" (muito útil para fazer novas amizades) - e\n\t\t\ttalvez em que pais você mora; se você não quiser ser mais específico\n\t\t\tdo que isso.\n\n\t\t\tNós respeitamos plenamente seu direito à privacidade, e nenhum desses itens são necessários.\n\t\t\tSe você é novo por aqui e não conheço ninguém, eles podem ajuda-lo\n\t\t\ta fazer novas e interessantes amizades.\n\n\t\t\tObrigado e bem-vindo a %4\$s.";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s usuário bloqueado/desbloqueado",
1 => "%s usuários bloqueados/desbloqueados",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s usuário excluído",
1 => "%s usuários excluídos",
-);
+];
$a->strings["User '%s' deleted"] = "O usuário '%s' foi excluído";
$a->strings["User '%s' unblocked"] = "O usuário '%s' foi desbloqueado";
$a->strings["User '%s' blocked"] = "O usuário '%s' foi bloqueado";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "Bloquear funcionalidade %s";
$a->strings["Manage Additional Features"] = "Gerenciar funcionalidades adicionais";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Não foi possível acessar o registro do contato.";
$a->strings["Could not locate selected profile."] = "Não foi possível localizar o perfil selecionado.";
$a->strings["Contact updated."] = "O contato foi atualizado.";
return ($n==1?0:((($n%100>19)||(($n%100==0)&&($n!=0)))?2:1));;
}}
;
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "%d contact editat.",
1 => "%d contacte editate.",
2 => "%d de contacte editate.",
-);
+];
$a->strings["Could not access contact record."] = "Nu se poate accesa registrul contactului.";
$a->strings["Could not locate selected profile."] = "Nu se poate localiza profilul selectat.";
$a->strings["Contact updated."] = "Contact actualizat.";
$a->strings["(Update was not successful)"] = "(Actualizare nu a reuşit)";
$a->strings["Suggest friends"] = "Sugeraţi prieteni";
$a->strings["Network type: %s"] = "Tipul rețelei: %s";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d contact în comun",
1 => "%d contacte în comun",
2 => "%d de contacte în comun",
-);
+];
$a->strings["View all contacts"] = "Vezi toate contactele";
$a->strings["Unblock"] = "Deblochează";
$a->strings["Block"] = "Blochează";
$a->strings["%s and You"] = "%s şi dvs";
$a->strings["Delete conversation"] = "Ștergeți conversaţia";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d mesaj",
1 => "%d mesaje",
2 => "%d mesaje",
-);
+];
$a->strings["Message not available."] = "Mesaj nedisponibil";
$a->strings["Delete message"] = "Şterge mesaj";
$a->strings["No secure communications available. You <strong>may</strong> be able to respond from the sender's profile page."] = "Nici-o comunicaţie securizată disponibilă. <strong>Veți putea</strong> răspunde din pagina de profil a expeditorului.";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
$a->strings["Registration details for %s"] = "Detaliile de înregistrare pentru %s";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s utilizator blocat/deblocat",
1 => "%s utilizatori blocați/deblocați",
2 => "%s de utilizatori blocați/deblocați",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s utilizator şters",
1 => "%s utilizatori şterşi",
2 => "%s utilizatori şterşi",
-);
+];
$a->strings["User '%s' deleted"] = "Utilizator %s şters";
$a->strings["User '%s' unblocked"] = "Utilizator %s deblocat";
$a->strings["User '%s' blocked"] = "Utilizator %s blocat";
$a->strings["Interesting Links"] = "Legături Interesante";
$a->strings["Starred"] = "Cu steluță";
$a->strings["Favourite Posts"] = "Postări Favorite";
-$a->strings["Warning: This group contains %s member from an insecure network."] = array(
+$a->strings["Warning: This group contains %s member from an insecure network."] = [
0 => "Atenție: Acest grup conţine %s membru dintr-o reţea nesigură.",
1 => "Atenție: Acest grup conţine %s membrii dintr-o reţea nesigură.",
2 => "Atenție: Acest grup conţine %s de membrii dintr-o reţea nesigură.",
-);
+];
$a->strings["Private messages to this group are at risk of public disclosure."] = "Mesajele private către acest grup sunt supuse riscului de divulgare publică.";
$a->strings["No such group"] = "Membrii";
$a->strings["Group is empty"] = "Grupul este gol";
$a->strings["View %s's profile @ %s"] = "Vizualizaţi profilul %s @ %s";
$a->strings["%s from %s"] = "%s de la %s";
$a->strings["View in context"] = "Vizualizare în context";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d comentariu",
1 => "%d comentarii",
2 => "%d comentarii",
-);
-$a->strings["comment"] = array(
+];
+$a->strings["comment"] = [
0 => "comentariu",
1 => "comentarii",
2 => "comentarii",
-);
+];
$a->strings["show more"] = "mai mult";
$a->strings["Private Message"] = " Mesaj Privat";
$a->strings["I like this (toggle)"] = "I like asta (toggle)";
$a->strings["Profile location is not valid or does not contain profile information."] = "Locaţia profilului nu este validă sau nu conţine informaţii de profil.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Atenţie: locaţia profilului nu are un nume de deţinător identificabil.";
$a->strings["Warning: profile location has no profile photo."] = "Atenţie: locaţia profilului nu are fotografie de profil.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d parametru necesar nu a fost găsit în locaţia specificată",
1 => "%d parametrii necesari nu au fost găsiţi în locaţia specificată",
2 => "%d de parametrii necesari nu au fost găsiţi în locaţia specificată",
-);
+];
$a->strings["Introduction complete."] = "Prezentare completă.";
$a->strings["Unrecoverable protocol error."] = "Eroare de protocol nerecuperabilă.";
$a->strings["Profile unavailable."] = "Profil nedisponibil.";
$a->strings["Please join us on Friendica"] = "Vă rugăm să veniți alături de noi pe Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Limita invitațiilor a fost depăşită. Vă rugăm să vă contactați administratorul de sistem.";
$a->strings["%s : Message delivery failed."] = "%s : Livrarea mesajului a eşuat.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d mesaj trimis.",
1 => "%d mesaje trimise.",
2 => "%d de mesaje trimise.",
-);
+];
$a->strings["You have no more invitations available"] = "Nu mai aveți invitaţii disponibile";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Vizitaţi %s pentru o lista de site-uri publice la care puteţi alătura. Membrii Friendica de pe alte site-uri se pot conecta cu toții între ei, precum şi cu membri ai multor alte reţele sociale.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Pentru a accepta această invitaţie, vă rugăm să vizitaţi şi să vă înregistraţi pe %s sau orice alt site public Friendica.";
$a->strings["Add New Contact"] = "Add Contact Nou";
$a->strings["Enter address or web location"] = "Introduceţi adresa sau locaţia web";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Exemplu: bob@example.com, http://example.com/barbara";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d invitație disponibilă",
1 => "%d invitații disponibile",
2 => "%d de invitații disponibile",
-);
+];
$a->strings["Find People"] = "Căutați Persoane";
$a->strings["Enter name or interest"] = "Introduceţi numele sau interesul";
$a->strings["Connect/Follow"] = "Conectare/Urmărire";
$a->strings["last"] = "ultima";
$a->strings["next"] = "următor";
$a->strings["No contacts"] = "Nici-un contact";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d Contact",
1 => "%d Contacte",
2 => "%d de Contacte",
-);
+];
$a->strings["poke"] = "abordare";
$a->strings["ping"] = "ping";
$a->strings["pinged"] = "i s-a trimis ping";
$a->strings["User '%s' already exists on this server!"] = "Utilizatorul '%s' există deja pe acest server!";
$a->strings["User creation error"] = "Eroare la crearea utilizatorului";
$a->strings["User profile creation error"] = "Eroare la crearea profilului utilizatorului";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d contact neimportat",
1 => "%d contacte neimportate",
2 => "%d de contacte neimportate",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Realizat. Vă puteţi conecta acum cu parola şi numele dumneavoastră de utilizator";
$a->strings["toggle mobile"] = "comutare mobil";
$a->strings["Theme settings"] = "Configurări Temă";
$a->strings["Neuter"] = "Средний род";
$a->strings["Non-specific"] = "Не определен";
$a->strings["Other"] = "Другой";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
2 => "",
3 => "",
-);
+];
$a->strings["Males"] = "Мужчины";
$a->strings["Females"] = "Женщины";
$a->strings["Gay"] = "Гей";
$a->strings["User '%s' already exists on this server!"] = "Пользователь '%s' уже существует на этом сервере!";
$a->strings["User creation error"] = "Ошибка создания пользователя";
$a->strings["User profile creation error"] = "Ошибка создания профиля пользователя";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d контакт не импортирован",
1 => "%d контакты не импортированы",
2 => "%d контакты не импортированы",
3 => "%d контакты не импортированы",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "Завершено. Теперь вы можете войти с вашим логином и паролем";
$a->strings["View Profile"] = "Просмотреть профиль";
$a->strings["Connect/Follow"] = "Подключиться/Следовать";
$a->strings["Enter address or web location"] = "Введите адрес или веб-местонахождение";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Пример: bob@example.com, http://example.com/barbara";
$a->strings["Connect"] = "Подключить";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d приглашение доступно",
1 => "%d приглашений доступно",
2 => "%d приглашений доступно",
3 => "%d приглашений доступно",
-);
+];
$a->strings["Find People"] = "Поиск людей";
$a->strings["Enter name or interest"] = "Введите имя или интерес";
$a->strings["Examples: Robert Morgenstein, Fishing"] = "Примеры: Роберт Morgenstein, Рыбалка";
$a->strings["Saved Folders"] = "Сохранённые папки";
$a->strings["Everything"] = "Всё";
$a->strings["Categories"] = "Категории";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d Контакт",
1 => "%d Контактов",
2 => "%d Контактов",
3 => "%d Контактов",
-);
+];
$a->strings["%1\$s attends %2\$s's %3\$s"] = "%1\$s уделил внимание %2\$s's %3\$s";
$a->strings["%1\$s doesn't attend %2\$s's %3\$s"] = "";
$a->strings["%1\$s attends maybe %2\$s's %3\$s"] = "";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s пометил %2\$s %3\$s как Фаворит";
$a->strings["Likes"] = "Лайки";
$a->strings["Dislikes"] = "Не нравится";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
2 => "",
3 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "Выберите";
$a->strings["Message"] = "Сообщение";
$a->strings["Browser"] = "Браузер";
$a->strings["View all"] = "Посмотреть все";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "Нравится",
1 => "Нравится",
2 => "Нравится",
3 => "Нравится",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "Не нравится",
1 => "Не нравится",
2 => "Не нравится",
3 => "Не нравится",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
2 => "",
3 => "",
-);
+];
$a->strings["Miscellaneous"] = "Разное";
$a->strings["Birthday:"] = "День рождения:";
$a->strings["Age: "] = "Возраст: ";
$a->strings["Loading more entries..."] = "Загружаю больше сообщений...";
$a->strings["The end"] = "Конец";
$a->strings["No contacts"] = "Нет контактов";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d контакт",
1 => "%d контактов",
2 => "%d контактов",
3 => "%d контактов",
-);
+];
$a->strings["View Contacts"] = "Просмотр контактов";
$a->strings["Save"] = "Сохранить";
$a->strings["poke"] = "poke";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "активность";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "",
2 => "комментарий",
3 => "комментарий",
-);
+];
$a->strings["post"] = "сообщение";
$a->strings["Item filed"] = "";
$a->strings["No friends to display."] = "Нет друзей.";
$a->strings["The post was created"] = "Пост был создан";
$a->strings["No contacts in common."] = "Нет общих контактов.";
$a->strings["Common Friends"] = "Общие друзья";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
2 => "",
3 => "",
-);
+];
$a->strings["Could not access contact record."] = "Не удалось получить доступ к записи контакта.";
$a->strings["Could not locate selected profile."] = "Не удалось найти выбранный профиль.";
$a->strings["Contact updated."] = "Контакт обновлен.";
$a->strings["Group is empty"] = "Группа пуста";
$a->strings["Group: %s"] = "Группа: %s";
$a->strings["This entry was edited"] = "Эта запись была отредактирована";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d комментарий",
1 => "%d комментариев",
2 => "%d комментариев",
3 => "%d комментариев",
-);
+];
$a->strings["Private Message"] = "Личное сообщение";
$a->strings["I like this (toggle)"] = "Нравится";
$a->strings["like"] = "нравится";
$a->strings["Please join us on Friendica"] = "Пожалуйста, присоединяйтесь к нам на Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "Лимит приглашений превышен. Пожалуйста, свяжитесь с администратором сайта.";
$a->strings["%s : Message delivery failed."] = "%s: Доставка сообщения не удалась.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d сообщение отправлено.",
1 => "%d сообщений отправлено.",
2 => "%d сообщений отправлено.",
3 => "%d сообщений отправлено.",
-);
+];
$a->strings["You have no more invitations available"] = "У вас нет больше приглашений";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "Посетите %s со списком общедоступных сайтов, к которым вы можете присоединиться. Все участники Friendica на других сайтах могут соединиться друг с другом, а также с участниками многих других социальных сетей.";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "Для одобрения этого приглашения, пожалуйста, посетите и зарегистрируйтесь на %s ,или любом другом публичном сервере Friendica";
$a->strings["Profile location is not valid or does not contain profile information."] = "Местоположение профиля является недопустимым или не содержит информацию о профиле.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Внимание: местоположение профиля не имеет идентифицируемого имени владельца.";
$a->strings["Warning: profile location has no profile photo."] = "Внимание: местоположение профиля не имеет еще фотографии профиля.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d требуемый параметр не был найден в заданном месте",
1 => "%d требуемых параметров не были найдены в заданном месте",
2 => "%d требуемых параметров не были найдены в заданном месте",
3 => "%d требуемых параметров не были найдены в заданном месте",
-);
+];
$a->strings["Introduction complete."] = "Запрос создан.";
$a->strings["Unrecoverable protocol error."] = "Неисправимая ошибка протокола.";
$a->strings["Profile unavailable."] = "Профиль недоступен.";
$a->strings["You and %s"] = "Вы и %s";
$a->strings["%s and You"] = "%s и Вы";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d сообщение",
1 => "%d сообщений",
2 => "%d сообщений",
3 => "%d сообщений",
-);
+];
$a->strings["Remove term"] = "Удалить элемент";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "Внимание: в группе %s пользователь из сети, которая не поддерживает непубличные сообщения.",
1 => "Внимание: в группе %s пользователя из сети, которая не поддерживает непубличные сообщения.",
2 => "Внимание: в группе %s пользователей из сети, которая не поддерживает непубличные сообщения.",
3 => "Внимание: в группе %s пользователей из сети, которая не поддерживает непубличные сообщения.",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "Сообщения в этой группе не будут отправлены следующим получателям.";
$a->strings["Private messages to this person are at risk of public disclosure."] = "Личные сообщения этому человеку находятся под угрозой обнародования.";
$a->strings["Invalid contact."] = "Недопустимый контакт.";
$a->strings["Attempt to execute this update step automatically"] = "Попытаться выполнить этот шаг обновления автоматически";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s пользователь заблокирован/разблокирован",
1 => "%s пользователей заблокировано/разблокировано",
2 => "%s пользователей заблокировано/разблокировано",
3 => "%s пользователей заблокировано/разблокировано",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s человек удален",
1 => "%s чел. удалено",
2 => "%s чел. удалено",
3 => "%s чел. удалено",
-);
+];
$a->strings["User '%s' deleted"] = "Пользователь '%s' удален";
$a->strings["User '%s' unblocked"] = "Пользователь '%s' разблокирован";
$a->strings["User '%s' blocked"] = "Пользователь '%s' блокирован";
$a->strings["Enter address or web location"] = "";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "Exempel: adam@exempel.com, http://exempel.com/bertil";
$a->strings["Connect"] = "Skicka kontaktförfrågan";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Find People"] = "";
$a->strings["Enter name or interest"] = "";
$a->strings["Connect/Follow"] = "Gör till kontakt/Följ";
$a->strings["Saved Folders"] = "";
$a->strings["Everything"] = "";
$a->strings["Categories"] = "";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "",
1 => "",
-);
+];
$a->strings["show more"] = "";
$a->strings["Forums"] = "";
$a->strings["External link to forum"] = "";
$a->strings["Neuter"] = "Könslös";
$a->strings["Non-specific"] = "Oklart";
$a->strings["Other"] = "Annat";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Males"] = "Män";
$a->strings["Females"] = "Kvinnor";
$a->strings["Gay"] = "Bög";
$a->strings["User '%s' already exists on this server!"] = "";
$a->strings["User creation error"] = "";
$a->strings["User profile creation error"] = "";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "";
$a->strings["Miscellaneous"] = "Blandat";
$a->strings["Birthday:"] = "Födelsedatum:";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "";
$a->strings["Likes"] = "";
$a->strings["Dislikes"] = "";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Not attending"] = "";
$a->strings["Might attend"] = "";
$a->strings["Select"] = "";
$a->strings["Message"] = "";
$a->strings["Browser"] = "";
$a->strings["View all"] = "";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "",
1 => "",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "",
1 => "",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "",
1 => "",
-);
+];
$a->strings["%s\\'s birthday"] = "";
$a->strings["General Features"] = "";
$a->strings["Multiple Profiles"] = "";
$a->strings["Loading more entries..."] = "";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "Inga kontakter";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d kontakt",
1 => "%d kontakter",
-);
+];
$a->strings["View Contacts"] = "Visa kontakter";
$a->strings["Save"] = "";
$a->strings["poke"] = "";
$a->strings["View on separate page"] = "";
$a->strings["view on separate page"] = "";
$a->strings["activity"] = "";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "",
1 => "",
-);
+];
$a->strings["post"] = "";
$a->strings["Item filed"] = "";
$a->strings["Passwords do not match. Password unchanged."] = "Lösenorden skiljer sig åt. Lösenordet ändras inte.";
$a->strings["Please join us on Friendica"] = "";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "";
$a->strings["%s : Message delivery failed."] = "%s : Meddelandet kom inte fram.";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d meddelande har skickats.",
1 => "%d meddelanden har skickats.",
-);
+];
$a->strings["You have no more invitations available"] = "";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "";
$a->strings["You and %s"] = "";
$a->strings["%s and You"] = "";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Manage Identities and/or Pages"] = "Hantera identiteter eller sidor";
$a->strings["Toggle between different identities or community/group pages which share your account details or which you have been granted \"manage\" permissions"] = "";
$a->strings["Select an identity to manage: "] = "Välj vilken identitet du vill hantera: ";
$a->strings["No such group"] = "Gruppen finns inte";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "",
1 => "",
-);
+];
$a->strings["Private Message"] = "Personligt meddelande";
$a->strings["I like this (toggle)"] = "Jag gillar det här (växla)";
$a->strings["like"] = "";
$a->strings["Attempt to execute this update step automatically"] = "";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "",
1 => "",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "",
1 => "",
-);
+];
$a->strings["User '%s' deleted"] = "";
$a->strings["User '%s' unblocked"] = "";
$a->strings["User '%s' blocked"] = "";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Could not access contact record."] = "Hittar inte information om kontakten.";
$a->strings["Could not locate selected profile."] = "Hittar inte vald profil.";
$a->strings["Contact updated."] = "Kontakten har uppdaterats.";
$a->strings["Profile location is not valid or does not contain profile information."] = "Profiladressen är ogiltig eller innehåller ingen profilinformation.";
$a->strings["Warning: profile location has no identifiable owner name."] = "Varning! Hittar inget namn som identifierar profilen.";
$a->strings["Warning: profile location has no profile photo."] = "Varning! Profilen innehåller inte någon profilbild.";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d required parameter was not found at the given location",
1 => "%d required parameters were not found at the given location",
-);
+];
$a->strings["Introduction complete."] = "Kontaktförfrågan/Presentationen är klar.";
$a->strings["Unrecoverable protocol error."] = "Protokollfel.";
$a->strings["Profile unavailable."] = "Profilen är inte tillgänglig.";
$a->strings["You may visit them online at %s"] = "";
$a->strings["Please contact the sender by replying to this post if you do not wish to receive these messages."] = "Kontakta avsändaren genom att svara på det här meddelandet om du inte vill ha sådana här meddelanden.";
$a->strings["%s posted an update."] = "%s har gjort ett inlägg.";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "",
1 => "",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "";
$a->strings["Private messages to this person are at risk of public disclosure."] = "";
$a->strings["Invalid contact."] = "";
$a->strings["Neuter"] = "中性的";
$a->strings["Non-specific"] = "不明确的";
$a->strings["Other"] = "别的";
-$a->strings["Undecided"] = array(
+$a->strings["Undecided"] = [
0 => "未决定的",
-);
+];
$a->strings["Males"] = "男人";
$a->strings["Females"] = "女人";
$a->strings["Gay"] = "男同性恋的";
$a->strings["Enter address or web location"] = "输入地址或网络位置";
$a->strings["Example: bob@example.com, http://example.com/barbara"] = "比如:li@example.com, http://example.com/li";
$a->strings["Connect"] = "连接";
-$a->strings["%d invitation available"] = array(
+$a->strings["%d invitation available"] = [
0 => "%d邀请可用的",
-);
+];
$a->strings["Find People"] = "找人物";
$a->strings["Enter name or interest"] = "输入名字或兴趣";
$a->strings["Connect/Follow"] = "连接/关注";
$a->strings["All Networks"] = "所有网络";
$a->strings["Everything"] = "一切";
$a->strings["Categories"] = "种类";
-$a->strings["%d contact in common"] = array(
+$a->strings["%d contact in common"] = [
0 => "%d共同熟人",
-);
+];
$a->strings["event"] = "项目";
$a->strings["status"] = "现状";
$a->strings["photo"] = "照片";
$a->strings["%1\$s marked %2\$s's %3\$s as favorite"] = "%1\$s标注%2\$s的%3\$s为偏爱";
$a->strings["Likes"] = "喜欢";
$a->strings["Dislikes"] = "不喜欢";
-$a->strings["Attending"] = array(
+$a->strings["Attending"] = [
0 => "正在参加",
-);
+];
$a->strings["Not attending"] = "不在参加";
$a->strings["Might attend"] = "可以参加";
$a->strings["Select"] = "选择";
$a->strings["Message"] = "通知";
$a->strings["Browser"] = "浏览器";
$a->strings["View all"] = "查看全部";
-$a->strings["Like"] = array(
+$a->strings["Like"] = [
0 => "喜欢",
-);
-$a->strings["Dislike"] = array(
+];
+$a->strings["Dislike"] = [
0 => "不喜欢",
-);
-$a->strings["Not Attending"] = array(
+];
+$a->strings["Not Attending"] = [
0 => "不在参加",
-);
+];
$a->strings["There are no tables on MyISAM."] = "";
$a->strings["\n\t\t\tThe friendica developers released update %s recently,\n\t\t\tbut when I tried to install it, something went terribly wrong.\n\t\t\tThis needs to be fixed soon and I can't do it alone. Please contact a\n\t\t\tfriendica developer if you can not help me on your own. My database might be invalid."] = "";
$a->strings["The error message is\n[pre]%s[/pre]"] = "";
$a->strings["Loading more entries..."] = "没有项目...";
$a->strings["The end"] = "";
$a->strings["No contacts"] = "没有熟人";
-$a->strings["%d Contact"] = array(
+$a->strings["%d Contact"] = [
0 => "%d熟人",
-);
+];
$a->strings["View Contacts"] = "看熟人";
$a->strings["Save"] = "保存";
$a->strings["poke"] = "戳";
$a->strings["View on separate page"] = "在另一页面中查看";
$a->strings["view on separate page"] = "在另一页面中查看";
$a->strings["activity"] = "活动";
-$a->strings["comment"] = array(
+$a->strings["comment"] = [
0 => "评论",
-);
+];
$a->strings["post"] = "文章";
$a->strings["Item filed"] = "把项目归档了";
$a->strings["Error decoding account file"] = "解码账户文件出错误";
$a->strings["User '%s' already exists on this server!"] = "用户「%s」已经存在这个服务器!";
$a->strings["User creation error"] = "用户创造错误";
$a->strings["User profile creation error"] = "用户简介创造错误";
-$a->strings["%d contact not imported"] = array(
+$a->strings["%d contact not imported"] = [
0 => "%d熟人没进口了",
-);
+];
$a->strings["Done. You can now login with your username and password"] = "完了。您现在会用您用户名和密码登录";
$a->strings["Passwords do not match. Password unchanged."] = "密码们不相配。密码没未改变的。";
$a->strings["An invitation is required."] = "邀请必要的。";
$a->strings["Group is empty"] = "组没有成员";
$a->strings["Group: %s"] = "";
$a->strings["This entry was edited"] = "这个条目被编辑了";
-$a->strings["%d comment"] = array(
+$a->strings["%d comment"] = [
0 => "%d评论",
-);
+];
$a->strings["Private Message"] = "私人的新闻";
$a->strings["I like this (toggle)"] = "我喜欢这(交替)";
$a->strings["like"] = "喜欢";
$a->strings["Profile location is not valid or does not contain profile information."] = "简介位置失效或不包含简介信息。";
$a->strings["Warning: profile location has no identifiable owner name."] = "警告:简介位置没有可设别的主名。";
$a->strings["Warning: profile location has no profile photo."] = "警告:简介位置没有简介图。";
-$a->strings["%d required parameter was not found at the given location"] = array(
+$a->strings["%d required parameter was not found at the given location"] = [
0 => "%d需要的参数没找到在输入的位置。",
-);
+];
$a->strings["Introduction complete."] = "介绍完成的。";
$a->strings["Unrecoverable protocol error."] = "不能恢复的协议错误";
$a->strings["Profile unavailable."] = "简介无效";
$a->strings["Please join us on Friendica"] = "请加入我们再Friendica";
$a->strings["Invitation limit exceeded. Please contact your site administrator."] = "邀请限超过了。请联系您的网站管理员。";
$a->strings["%s : Message delivery failed."] = "%s : 送消息失败了。";
-$a->strings["%d message sent."] = array(
+$a->strings["%d message sent."] = [
0 => "%d消息传送了。",
-);
+];
$a->strings["You have no more invitations available"] = "您没有别的邀请";
$a->strings["Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks."] = "参观%s看一单公开网站您会加入。Friendica成员在别的网站都会互相连接,再跟很多别的社会网络。";
$a->strings["To accept this invitation, please visit and register at %s or any other public Friendica website."] = "为接受这个邀请,请再%s或什么别的Friendica网站注册。";
$a->strings["You and %s"] = "您和%s";
$a->strings["%s and You"] = "%s和您";
$a->strings["D, d M Y - g:i A"] = "D, d M Y - g:i A";
-$a->strings["%d message"] = array(
+$a->strings["%d message"] = [
0 => "%d通知",
-);
+];
$a->strings["Mood"] = "心情";
$a->strings["Set your current mood and tell your friends"] = "选择现在的心情而告诉朋友们";
$a->strings["Remove term"] = "删除关键字";
-$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = array(
+$a->strings["Warning: This group contains %s member from a network that doesn't allow non public messages."] = [
0 => "警告:这个组包含 %s 来自不允许非公开消息的网络的成员。",
-);
+];
$a->strings["Messages in this group won't be send to these receivers."] = "这个组中的消息不会被发送至这些接收者。";
$a->strings["Private messages to this person are at risk of public disclosure."] = "私人通信给这个人回被公开。";
$a->strings["Invalid contact."] = "无效熟人。";
$a->strings["Attempt to execute this update step automatically"] = "试图自动地把这步更新实行";
$a->strings["\n\t\t\tDear %1\$s,\n\t\t\t\tthe administrator of %2\$s has set up an account for you."] = "";
$a->strings["\n\t\t\tThe login details are as follows:\n\n\t\t\tSite Location:\t%1\$s\n\t\t\tLogin Name:\t\t%2\$s\n\t\t\tPassword:\t\t%3\$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\tThank you and welcome to %4\$s."] = "";
-$a->strings["%s user blocked/unblocked"] = array(
+$a->strings["%s user blocked/unblocked"] = [
0 => "%s用户拦/不拦了",
-);
-$a->strings["%s user deleted"] = array(
+];
+$a->strings["%s user deleted"] = [
0 => "%s用户删除了",
-);
+];
$a->strings["User '%s' deleted"] = "用户「%s」删除了";
$a->strings["User '%s' unblocked"] = "用户「%s」无拦了";
$a->strings["User '%s' blocked"] = "用户「%s」拦了";
$a->strings["To enable logging of PHP errors and warnings you can add the following to the .htconfig.php file of your installation. The filename set in the 'error_log' line is relative to the friendica top-level directory and must be writeable by the web server. The option '1' for 'log_errors' and 'display_errors' is to enable these options, set to '0' to disable them."] = "";
$a->strings["Lock feature %s"] = "";
$a->strings["Manage Additional Features"] = "";
-$a->strings["%d contact edited."] = array(
+$a->strings["%d contact edited."] = [
0 => "",
-);
+];
$a->strings["Could not access contact record."] = "用不了熟人记录。";
$a->strings["Could not locate selected profile."] = "找不到选择的简介。";
$a->strings["Contact updated."] = "熟人更新了。";
/// @TODO $a is no longer used
function clean_form(App $a, &$colorset, $user) {
- $colorset = array(
+ $colorset = [
'default' =>t('default'),
'greenzero' =>t('greenzero'),
'purplezero' =>t('purplezero'),
'darkzero' =>t('darkzero'),
'comix' =>t('comix'),
'slackr' =>t('slackr'),
- );
+ ];
if ($user) {
$color = PConfig::get(local_user(), 'duepuntozero', 'colorset');
$t = get_markup_template("theme_settings.tpl" );
/// @TODO No need for adding string here, $o is not defined
- $o .= replace_macros($t, array(
+ $o .= replace_macros($t, [
'$submit' => t('Submit'),
'$baseurl' => System::baseUrl(),
'$title' => t("Theme settings"),
- '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
- ));
+ '$colorset' => ['duepuntozero_colorset', t('Variations'), $color, '', $colorset],
+ ]);
return $o;
}
if (!local_user()) {
return;
}
- $arr = array();
+ $arr = [];
$arr["schema"] = PConfig::get(local_user(), 'frio', 'schema');
$arr["nav_bg"] = PConfig::get(local_user(), 'frio', 'nav_bg');
if (!local_user()) {
return;
}
- $arr = array();
+ $arr = [];
$arr["schema"] = Config::get('frio', 'schema');
$arr["nav_bg"] = Config::get('frio', 'nav_bg');
$scheme_info = get_schema_info($arr["schema"]);
$disable = $scheme_info["overwrites"];
if (!is_array($disable)) {
- $disable = array();
+ $disable = [];
}
- $scheme_choices = array();
+ $scheme_choices = [];
$scheme_choices["---"] = t("Default");
$files = glob('view/theme/frio/schema/*.php');
if ($files) {
$background_image_help = "<strong>" . t("Note"). ": </strong>".t("Check image permissions if all users are allowed to visit the image");
$t = get_markup_template('theme_settings.tpl');
- $ctx = array(
+ $ctx = [
'$submit' => t('Submit'),
'$baseurl' => System::baseUrl(),
'$title' => t("Theme settings"),
- '$schema' => array('frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices),
- '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : array('frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),
- '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : array('frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']),
- '$link_color' => array_key_exists("link_color", $disable) ? "" : array('frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors),
- '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : array('frio_background_color', t('Set the background color'), $arr['bgcolor']),
- '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : array('frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)),
- '$background_image' => array_key_exists("background_image", $disable ) ? "" : array('frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help),
+ '$schema' => ['frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices],
+ '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : ['frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']],
+ '$nav_icon_color' => array_key_exists("nav_icon_color", $disable) ? "" : ['frio_nav_icon_color', t('Navigation bar icon color '), $arr['nav_icon_color']],
+ '$link_color' => array_key_exists("link_color", $disable) ? "" : ['frio_link_color', t('Link color'), $arr['link_color'], '', $link_colors],
+ '$bgcolor' => array_key_exists("bgcolor", $disable) ? "" : ['frio_background_color', t('Set the background color'), $arr['bgcolor']],
+ '$contentbg_transp' => array_key_exists("contentbg_transp", $disable) ? "" : ['frio_contentbg_transp', t("Content background transparency"), ((isset($arr["contentbg_transp"]) && $arr["contentbg_transp"] != "") ? $arr["contentbg_transp"] : 100)],
+ '$background_image' => array_key_exists("background_image", $disable ) ? "" : ['frio_background_image', t('Set the background image'), $arr['background_image'], $background_image_help],
'$bg_image_options' => Image::get_options($arr),
- );
+ ];
- if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
- $ctx['$login_bg_image'] = array('frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help);
+ if ( array_key_exists("login_bg_image", $arr ) && !array_key_exists("login_bg_image", $disable ) ) {
+ $ctx['$login_bg_image'] = ['frio_login_bg_image', t('Login page background image'), $arr['login_bg_image'], $background_image_help];
}
$o .= replace_macros($t, $ctx);
/**
* @brief Give all available options for the background image
- *
+ *
* @param array $arr Array with the present user settings
- *
+ *
* @return array Array with the immage options
*/
public static function get_options($arr) {
- $bg_image_options = array(
- 'repeat' => array(
- 'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")),
- 'stretch' => array(
- 'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")),
- 'cover' => array(
- 'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")),
- 'contain' => array(
- 'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")),
- );
+ $bg_image_options = [
+ 'repeat' => [
+ 'frio_bg_image_option', t("Repeat the image"), "repeat", t("Will repeat your image to fill the background."), ($arr["bg_image_option"] == "repeat")],
+ 'stretch' => [
+ 'frio_bg_image_option', t("Stretch"), "stretch", t("Will stretch to width/height of the image."), ($arr["bg_image_option"] == "stretch")],
+ 'cover' => [
+ 'frio_bg_image_option', t("Resize fill and-clip"), "cover", t("Resize to fill and retain aspect ratio."), ($arr["bg_image_option"] == "cover")],
+ 'contain' => [
+ 'frio_bg_image_option', t("Resize best fit"), "contain", t("Resize to best fit and retain aspect ratio."), ($arr["bg_image_option"] == "contain")],
+ ];
return $bg_image_options;
}
$G = hexdec($color[2].$color[3]);
$B = hexdec($color[4].$color[5]);
- $HSL = array();
+ $HSL = [];
$var_R = ($R / 255);
$var_G = ($G / 255);
* @return string HEX string
* @throws Exception "Bad HSL Array"
*/
- public static function hslToHex( $hsl = array() ){
+ public static function hslToHex( $hsl = [] ){
// Make sure it's HSL
if(empty($hsl) || !isset($hsl["H"]) || !isset($hsl["S"]) || !isset($hsl["L"]) ) {
throw new Exception("Param was not an HSL array");
}
- list($H,$S,$L) = array( $hsl['H']/360,$hsl['S'],$hsl['L'] );
+ list($H,$S,$L) = [ $hsl['H']/360,$hsl['S'],$hsl['L'] ];
if( $S == 0 ) {
$r = $L * 255;
* @return string RGB string
* @throws Exception "Bad RGB Array"
*/
- public static function rgbToHex( $rgb = array() ){
+ public static function rgbToHex( $rgb = [] ){
// Make sure it's RGB
if(empty($rgb) || !isset($rgb["R"]) || !isset($rgb["G"]) || !isset($rgb["B"]) ) {
throw new Exception("Param was not an RGB array");
}
// Return our gradient array
- return array( "light" => $lightColor, "dark" => $darkColor );
+ return [ "light" => $lightColor, "dark" => $darkColor ];
}
// Return the new value in HEX
return self::hslToHex($hsl);
}
-
+
/**
* Returns your color's HSL array
*/
public function getRgb() {
return $this->_rgb;
}
-
+
/**
* Returns the cross browser CSS3 gradient
* @param int $amount Optional: percentage amount to light/darken the gradient
$gmix = (($rgb1['G'] * $r1) + ($rgb2['G'] * $r2)) / 2;
$bmix = (($rgb1['B'] * $r1) + ($rgb2['B'] * $r2)) / 2;
- return array('R' => $rmix, 'G' => $gmix, 'B' => $bmix);
+ return ['R' => $rmix, 'G' => $gmix, 'B' => $bmix];
}
/**
*/
function get_modalpage_list() {
//Arry of pages wich getting bootstrap modal dialogs
- $modalpages = array('poke/',
+ $modalpages = ['poke/',
'message/new',
'settings/oauth/add',
'events/new',
// 'fbrowser/image/'
- );
+ ];
return $modalpages;
}
*/
function get_standard_page_list() {
//Arry of pages wich getting the standard page template
- $standardpages = array(//'profile',
+ $standardpages = [//'profile',
// 'fbrowser/image/'
- );
+ ];
return $standardpages;
}
/**
* @brief: Get info header of the shema
- *
+ *
* This function parses the header of the shemename.php file for inormations like
* Author, Description and Overwrites. Most of the code comes from the get_plugin_info()
* function. We use this to get the variables which get overwritten through the shema.
* All color variables which get overwritten through the theme have to be
* listed (comma seperated) in the shema header under Overwrites:
* This seemst not to be the best solution. We need to investigate further.
- *
+ *
* @param string $schema Name of the shema
* @return array With theme information
* 'author' => Author Name
$themepath = "view/theme/" . $theme . "/";
$schema = PConfig::get(local_user(),'frio', 'schema');
- $info=Array(
+ $info=[
'name' => $schema,
'description' => "",
- 'author' => array(),
+ 'author' => [],
'version' => "",
'overwrites' => ""
- );
+ ];
if (!is_file($themepath . "schema/" . $schema . ".php")) return $info;
if ($k=="author"){
$r=preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if ($r) {
- $info['author'][] = array('name'=>$m[1], 'link'=>$m[2]);
+ $info['author'][] = ['name'=>$m[1], 'link'=>$m[2]];
} else {
- $info['author'][] = array('name'=>$v);
+ $info['author'][] = ['name'=>$v];
}
} elseif ($k == "overwrites") {
$theme_settings = explode(',',str_replace(' ','', $v));
// Convert transparency level from percentage to opacity value.
$contentbg_transp = $contentbg_transp / 100;
-$options = array (
+$options = [
'$nav_bg' => $nav_bg,
'$nav_icon_color' => $nav_icon_color,
'$nav_icon_hover_color' => $nav_icon_hover_color,
'$background_image' => $background_image,
'$background_size_img' => $background_size_img,
'$login_bg_image' => $login_bg_image,
-);
+];
$css_tpl = file_get_contents('view/theme/frio/css/style.css');
// Only send the CSS file if it was changed.
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
$cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
- $cached_etag = str_replace(array('"', "-gzip"), array('', ''),
+ $cached_etag = str_replace(['"', "-gzip"], ['', ''],
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
if (($cached_modified == $modified) && ($cached_etag == $etag)) {
while ($p !== false && ($occurence++ < 500)) {
$link = substr($body_info['html'], $p['start'], $p['end'] - $p['start']);
- $matches = array();
+ $matches = [];
preg_match("/\/photos\/[\w]+\/image\/([\w]+)/", $link, $matches);
if ($matches) {
}
if (DBM::is_result($r)) {
- $nav['userinfo'] = array(
+ $nav['userinfo'] = [
'icon' => (DBM::is_result($r) ? $r[0]['photo'] : "images/person-48.jpg"),
'name' => $r[0]['name'],
- );
+ ];
}
if (!local_user() && !empty($server_url)) {
- $nav['logout'] = Array($server_url . '/logout', t('Logout'), "", t('End this session'));
+ $nav['logout'] = [$server_url . '/logout', t('Logout'), "", t('End this session')];
// user menu
- $nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations'));
- $nav['usermenu'][] = Array($server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page'));
- $nav['usermenu'][] = Array($server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos'));
- $nav['usermenu'][] = Array($server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos'));
- $nav['usermenu'][] = Array($server_url . '/events/', t('Events'), "", t('Your events'));
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'], t('Status'), "", t('Your posts and conversations')];
+ $nav['usermenu'][] = [$server_url . '/profile/' . $a->user['nickname'] . '?tab=profile', t('Profile'), "", t('Your profile page')];
+ $nav['usermenu'][] = [$server_url . '/photos/' . $a->user['nickname'], t('Photos'), "", t('Your photos')];
+ $nav['usermenu'][] = [$server_url . '/videos/' . $a->user['nickname'], t('Videos'), "", t('Your videos')];
+ $nav['usermenu'][] = [$server_url . '/events/', t('Events'), "", t('Your events')];
// navbar links
- $nav['network'] = array($server_url . '/network', t('Network'), "", t('Conversations from your friends'));
- $nav['events'] = Array($server_url . '/events', t('Events'), "", t('Events and Calendar'));
- $nav['messages'] = array($server_url . '/message', t('Messages'), "", t('Private mail'));
- $nav['settings'] = array($server_url . '/settings', t('Settings'), "", t('Account settings'));
- $nav['contacts'] = array($server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts'));
+ $nav['network'] = [$server_url . '/network', t('Network'), "", t('Conversations from your friends')];
+ $nav['events'] = [$server_url . '/events', t('Events'), "", t('Events and Calendar')];
+ $nav['messages'] = [$server_url . '/message', t('Messages'), "", t('Private mail')];
+ $nav['settings'] = [$server_url . '/settings', t('Settings'), "", t('Account settings')];
+ $nav['contacts'] = [$server_url . '/contacts', t('Contacts'), "", t('Manage/edit friends and contacts')];
$nav['sitename'] = $a->config['sitename'];
}
}
intval($_SESSION['uid'])
);
- $contacts = array();
+ $contacts = [];
if (DBM::is_result($r)) {
foreach ($r as $rr) {
function frio_display_item(App $a, &$arr)
{
// Add subthread to the item menu
- $subthread = array();
+ $subthread = [];
if (local_user() == $arr['item']['uid'] && $arr['item']['parent'] == $arr['item']['id'] && !$arr['item']['self']) {
- $subthread = array(
+ $subthread = [
'menu' => 'follow_thread',
'title' => t('Follow Thread'),
'action' => 'dosubthread(' . $arr['item']['id'] . '); return false;',
'href' => '#'
- );
+ ];
}
$arr['output']['subthread'] = $subthread;
}
while($p !== false && ($occurence++ < 500)) {
$link = substr($body_info['html'], $p['start'], $p['end'] - $p['start']);
- $matches = array();
+ $matches = [];
preg_match("/\/photos\/[\w]+\/image\/([\w]+)/", $link, $matches);
if($matches) {
/// @TODO $a is no longer used here
function quattro_form(App $a, $align, $color, $tfs, $pfs) {
- $colors = array(
+ $colors = [
"dark" => "Quattro",
"lilac" => "Lilac",
"green" => "Green",
- );
+ ];
if ($tfs === false) {
$tfs = "20";
}
$t = get_markup_template("theme_settings.tpl" );
- $o .= replace_macros($t, array(
+ $o .= replace_macros($t, [
'$submit' => t('Submit'),
'$baseurl' => System::baseUrl(),
'$title' => t("Theme settings"),
- '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))),
- '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors),
- '$pfs' => array('quattro_pfs', t('Posts font size'), $pfs),
- '$tfs' => array('quattro_tfs', t('Textareas font size'), $tfs),
- ));
+ '$align' => ['quattro_align', t('Alignment'), $align, '', ['left'=>t('Left'), 'center'=>t('Center')]],
+ '$color' => ['quattro_color', t('Color scheme'), $color, '', $colors],
+ '$pfs' => ['quattro_pfs', t('Posts font size'), $pfs],
+ '$tfs' => ['quattro_tfs', t('Textareas font size'), $tfs],
+ ]);
return $o;
}
$helperlist = "https://forum.friendi.ca/profile/helpers";
$t = get_markup_template("theme_admin_settings.tpl");
- $o .= replace_macros($t, array(
- '$helperlist' => array('vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''),
- ));
+ $o .= replace_macros($t, [
+ '$helperlist' => ['vier_helperlist', t('Comma separated list of helper forums'), $helperlist, '', ''],
+ ]);
$show_pages = get_vier_config('show_pages', true, true);
$show_profiles = get_vier_config('show_profiles', true, true);
/// @TODO $a is no longer used
function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $show_services, $show_friends, $show_lastusers) {
- $styles = array(
+ $styles = [
"breathe"=>"Breathe",
"netcolour"=>"Coloured Networks",
"dark"=>"Dark",
"plus"=>"Plus",
"plusminus"=>"Plus Minus",
"shadow"=>"Shadow"
- );
+ ];
- $show_or_not = array('0'=>t("don't show"), '1'=>t("show"),);
+ $show_or_not = ['0'=>t("don't show"), '1'=>t("show"),];
$t = get_markup_template("theme_settings.tpl");
- $o .= replace_macros($t, array(
+ $o .= replace_macros($t, [
'$submit' => t('Submit'),
'$baseurl' => System::baseUrl(),
'$title' => t("Theme settings"),
- '$style' => array('vier_style',t ('Set style'),$style,'',$styles),
- '$show_pages' => array('vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not),
- '$show_profiles' => array('vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not),
- '$show_helpers' => array('vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not),
- '$show_services' => array('vier_show_services', t('Connect Services'), $show_services, '', $show_or_not),
- '$show_friends' => array('vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not),
- '$show_lastusers' => array('vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not)
- ));
+ '$style' => ['vier_style',t ('Set style'),$style,'',$styles],
+ '$show_pages' => ['vier_show_pages', t('Community Pages'), $show_pages, '', $show_or_not],
+ '$show_profiles' => ['vier_show_profiles', t('Community Profiles'), $show_profiles, '', $show_or_not],
+ '$show_helpers' => ['vier_show_helpers', t('Help or @NewHere ?'), $show_helpers, '', $show_or_not],
+ '$show_services' => ['vier_show_services', t('Connect Services'), $show_services, '', $show_or_not],
+ '$show_friends' => ['vier_show_friends', t('Find Friends'), $show_friends, '', $show_or_not],
+ '$show_lastusers' => ['vier_show_lastusers', t('Last users'), $show_lastusers, '', $show_or_not]
+ ]);
return $o;
}
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
$cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
- $cached_etag = str_replace(array('"', "-gzip"), array('', ''),
+ $cached_etag = str_replace(['"', "-gzip"], ['', ''],
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
if (($cached_modified == $modified) && ($cached_etag == $etag)) {
// Hide the left menu bar
/// @TODO maybe move this static array out where it should belong?
- if (($a->page['aside'] == "") && in_array($a->argv[0], array("community", "events", "help", "manage", "notifications",
- "probe", "webfinger", "login", "invite", "credits"))) {
+ if (($a->page['aside'] == "") && in_array($a->argv[0], ["community", "events", "help", "manage", "notifications",
+ "probe", "webfinger", "login", "invite", "credits"])) {
$a->page['htmlhead'] .= "<link rel='stylesheet' href='view/theme/vier/hide.css' />";
}
}
if (DBM::is_result($r)) {
$aside['$comunity_profiles_title'] = t('Community Profiles');
- $aside['$comunity_profiles_items'] = array();
+ $aside['$comunity_profiles_items'] = [];
foreach ($r as $rr) {
- $entry = replace_macros($tpl,array(
+ $entry = replace_macros($tpl,[
'$id' => $rr['id'],
//'$profile_link' => Profile::zrl($rr['url']),
'$profile_link' => 'follow/?url='.urlencode($rr['url']),
'$photo' => proxy_url($rr['photo'], false, PROXY_SIZE_MICRO),
'$alt_text' => $rr['name'],
- ));
+ ]);
$aside['$comunity_profiles_items'][] = $entry;
}
}
if (DBM::is_result($r)) {
$aside['$lastusers_title'] = t('Last users');
- $aside['$lastusers_items'] = array();
+ $aside['$lastusers_items'] = [];
foreach ($r as $rr) {
$profile_link = 'profile/' . ((strlen($rr['nickname'])) ? $rr['nickname'] : $rr['profile_uid']);
- $entry = replace_macros($tpl,array(
+ $entry = replace_macros($tpl,[
'$id' => $rr['id'],
'$profile_link' => $profile_link,
'$photo' => $a->remove_baseurl($rr['thumb']),
- '$alt_text' => $rr['name']));
+ '$alt_text' => $rr['name']]);
$aside['$lastusers_items'][] = $entry;
}
}
//right_aside FIND FRIENDS
if ($show_friends && local_user()) {
- $nv = array();
- $nv['title'] = array("", t('Find Friends'), "", "");
- $nv['directory'] = array('directory', t('Local Directory'), "", "");
- $nv['global_directory'] = Array(get_server(), t('Global Directory'), "", "");
- $nv['match'] = array('match', t('Similar Interests'), "", "");
- $nv['suggest'] = array('suggest', t('Friend Suggestions'), "", "");
- $nv['invite'] = array('invite', t('Invite Friends'), "", "");
+ $nv = [];
+ $nv['title'] = ["", t('Find Friends'), "", ""];
+ $nv['directory'] = ['directory', t('Local Directory'), "", ""];
+ $nv['global_directory'] = [get_server(), t('Global Directory'), "", ""];
+ $nv['match'] = ['match', t('Similar Interests'), "", ""];
+ $nv['suggest'] = ['suggest', t('Friend Suggestions'), "", ""];
+ $nv['invite'] = ['invite', t('Invite Friends'), "", ""];
$nv['search'] = '<form name="simple_bar" method="get" action="dirfind">
<span class="sbox_l"></span>
foreach ($contacts as $contact) {
$selected = (($cid == $contact['id']) ? ' forum-selected' : '');
- $entry = array(
+ $entry = [
'url' => 'network?f=&cid=' . $contact['id'],
'external_url' => 'redir/' . $contact['id'],
'name' => $contact['name'],
'selected' => $selected,
'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id,
- );
+ ];
$entries[] = $entry;
}
$page .= replace_macros(
$tpl,
- array(
+ [
'$title' => t('Forums'),
'$forums' => $entries,
'$link_desc' => t('External link to forum'),
'$total' => $total,
'$visible_forums' => $visible_forums,
- '$showmore' => t('show more'))
+ '$showmore' => t('show more')]
);
$aside['$page'] = $page;
// helpers
if ($show_helpers) {
- $r = array();
+ $r = [];
$helperlist = Config::get("vier", "helperlist");
foreach ($r AS $index => $helper)
$r[$index]["url"] = Profile::zrl($helper["url"]);
- $r[] = array("url" => "help/Quick-Start-guide", "name" => t("Quick Start"));
+ $r[] = ["url" => "help/Quick-Start-guide", "name" => t("Quick Start")];
$tpl = get_markup_template('ch_helpers.tpl');
if ($r) {
- $helpers = array();
- $helpers['title'] = array("", t('Help'), "", "");
+ $helpers = [];
+ $helpers['title'] = ["", t('Help'), "", ""];
- $aside['$helpers_items'] = array();
+ $aside['$helpers_items'] = [];
foreach ($r as $rr) {
- $entry = replace_macros($tpl,array(
+ $entry = replace_macros($tpl,[
'$url' => $rr['url'],
'$title' => $rr['name'],
- ));
+ ]);
$aside['$helpers_items'][] = $entry;
}
if ($show_services) {
/// @TODO This whole thing is hard-coded, better rewrite to Intercepting Filter Pattern (future-todo)
- $r = array();
+ $r = [];
if (plugin_enabled("appnet")) {
- $r[] = array("photo" => "images/appnet.png", "name" => "App.net");
+ $r[] = ["photo" => "images/appnet.png", "name" => "App.net"];
}
if (plugin_enabled("buffer")) {
- $r[] = array("photo" => "images/buffer.png", "name" => "Buffer");
+ $r[] = ["photo" => "images/buffer.png", "name" => "Buffer"];
}
if (plugin_enabled("blogger")) {
- $r[] = array("photo" => "images/blogger.png", "name" => "Blogger");
+ $r[] = ["photo" => "images/blogger.png", "name" => "Blogger"];
}
if (plugin_enabled("dwpost")) {
- $r[] = array("photo" => "images/dreamwidth.png", "name" => "Dreamwidth");
+ $r[] = ["photo" => "images/dreamwidth.png", "name" => "Dreamwidth"];
}
if (plugin_enabled("fbpost")) {
- $r[] = array("photo" => "images/facebook.png", "name" => "Facebook");
+ $r[] = ["photo" => "images/facebook.png", "name" => "Facebook"];
}
if (plugin_enabled("ifttt")) {
- $r[] = array("photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT");
+ $r[] = ["photo" => "addon/ifttt/ifttt.png", "name" => "IFTTT"];
}
if (plugin_enabled("statusnet")) {
- $r[] = array("photo" => "images/gnusocial.png", "name" => "GNU Social");
+ $r[] = ["photo" => "images/gnusocial.png", "name" => "GNU Social"];
}
if (plugin_enabled("gpluspost")) {
- $r[] = array("photo" => "images/googleplus.png", "name" => "Google+");
+ $r[] = ["photo" => "images/googleplus.png", "name" => "Google+"];
}
/// @TODO old-lost code (and below)?
//}
if (plugin_enabled("libertree")) {
- $r[] = array("photo" => "images/libertree.png", "name" => "Libertree");
+ $r[] = ["photo" => "images/libertree.png", "name" => "Libertree"];
}
//if (plugin_enabled("ljpost")) {
//}
if (plugin_enabled("pumpio")) {
- $r[] = array("photo" => "images/pumpio.png", "name" => "pump.io");
+ $r[] = ["photo" => "images/pumpio.png", "name" => "pump.io"];
}
if (plugin_enabled("tumblr")) {
- $r[] = array("photo" => "images/tumblr.png", "name" => "Tumblr");
+ $r[] = ["photo" => "images/tumblr.png", "name" => "Tumblr"];
}
if (plugin_enabled("twitter")) {
- $r[] = array("photo" => "images/twitter.png", "name" => "Twitter");
+ $r[] = ["photo" => "images/twitter.png", "name" => "Twitter"];
}
if (plugin_enabled("wppost")) {
- $r[] = array("photo" => "images/wordpress.png", "name" => "Wordpress");
+ $r[] = ["photo" => "images/wordpress.png", "name" => "Wordpress"];
}
if (function_exists("imap_open") && !Config::get("system","imap_disabled") && !Config::get("system","dfrn_only")) {
- $r[] = array("photo" => "images/mail.png", "name" => "E-Mail");
+ $r[] = ["photo" => "images/mail.png", "name" => "E-Mail"];
}
$tpl = get_markup_template('ch_connectors.tpl');
if (DBM::is_result($r)) {
- $con_services = array();
- $con_services['title'] = array("", t('Connect Services'), "", "");
+ $con_services = [];
+ $con_services['title'] = ["", t('Connect Services'), "", ""];
$aside['$con_services'] = $con_services;
foreach ($r as $rr) {
- $entry = replace_macros($tpl,array(
+ $entry = replace_macros($tpl,[
'$url' => $url,
'$photo' => $rr['photo'],
'$alt_text' => $rr['name'],
- ));
+ ]);
$aside['$connector_items'][] = $entry;
}
}