diff --git a/boot.php b/boot.php index 070dcf7266..ed4fe10a3a 100644 --- a/boot.php +++ b/boot.php @@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_VERSION', '3.5.2-dev' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1216 ); +define ( 'DB_UPDATE_VERSION', 1217 ); /** * @brief Constant with a HTML line break. diff --git a/database.sql b/database.sql index 7ed19f439c..9d56957100 100644 --- a/database.sql +++ b/database.sql @@ -159,7 +159,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `writable` tinyint(1) NOT NULL DEFAULT 0, `forum` tinyint(1) NOT NULL DEFAULT 0, `prv` tinyint(1) NOT NULL DEFAULT 0, - `contact-type` int(11) unsigned NOT NULL DEFAULT 0, + `contact-type` int(11) NOT NULL DEFAULT 0, `hidden` tinyint(1) NOT NULL DEFAULT 0, `archive` tinyint(1) NOT NULL DEFAULT 0, `pending` tinyint(1) NOT NULL DEFAULT 1, diff --git a/doc/KeyboardShortcuts.md b/doc/KeyboardShortcuts.md new file mode 100644 index 0000000000..cf783b0da1 --- /dev/null +++ b/doc/KeyboardShortcuts.md @@ -0,0 +1,10 @@ +Keyboard shortcuts in Friendica +======================= + +* [Home](help) + +General +------- + +* j: Scroll to next thread +* k: Scroll to previous thread diff --git a/doc/Settings.md b/doc/Settings.md index 5055ed7d23..3652562720 100644 --- a/doc/Settings.md +++ b/doc/Settings.md @@ -6,12 +6,10 @@ If you are the admin of a Friendica node, you have access to the so called **Adm On the front page of the admin panel you will see a summary of information about your node. These information include the amount of messages currently being processed in the queues. -The first number is the number of messages being actively sent. -This number should decrease quickly. -The second is the messages which could for various reasons not being delivered. +The first number is the number of messages which could not been delivered for various reasons. They will be resend later. You can have a quick glance into that second queus in the "Inspect Queue" section of the admin panel. -If you have activated the background workers, there is a third number representing the count of jobs queued for the workers. +The second number represents the current number of jobs for the background workers. These worker tasks are prioritised and are done accordingly. Then you get an overview of the accounts on your node, which can be moderated in the "Users" section of the panel. diff --git a/doc/database.md b/doc/database.md index f48404c17d..4c61505202 100644 --- a/doc/database.md +++ b/doc/database.md @@ -14,7 +14,6 @@ Database Tables | [config](help/database/db_config) | main configuration storage | | [contact](help/database/db_contact) | contact table | | [conv](help/database/db_conv) | private messages | -| [deliverq](help/database/db_deliverq) | | | [event](help/database/db_event) | Events | | [fcontact](help/database/db_fcontact) | friend suggestion stuff | | [ffinder](help/database/db_ffinder) | friend suggestion stuff | diff --git a/doc/database/db_deliverq.md b/doc/database/db_deliverq.md deleted file mode 100644 index 5335899571..0000000000 --- a/doc/database/db_deliverq.md +++ /dev/null @@ -1,12 +0,0 @@ -Table deliverq -============== - -| Field | Description | Type | Null | Key | Default | Extra | -|---------|------------------|------------------|------|-----|---------|----------------| -| id | sequential ID | int(10) unsigned | NO | PRI | NULL | auto_increment | -| cmd | | varchar(32) | NO | | | | -| item | | int(11) | NO | | 0 | | -| contact | | int(11) | NO | | 0 | | - - -Return to [database documentation](help/database) diff --git a/doc/de/Settings.md b/doc/de/Settings.md index 2b7e89a52c..68e17adc78 100644 --- a/doc/de/Settings.md +++ b/doc/de/Settings.md @@ -5,17 +5,14 @@ Wenn du der Administrator einer Friendica Instanz bist, hast du Zugriff auf das so genannte **Admin Panel** in dem du die Friendica Instanz konfigurieren kannst, Auf der Startseite des Admin Panels werden die Informationen zu der Instanz zusammengefasst. -Diese Informationen beinhalten die Anzahl der Nachrichten, die sich aktuell in den Warteschlangen befinden. -Hierbei ist die erste Zahl die Zahl der Nachrichten die gerade aktiv verteilt werden. -Diese Zahl sollte sich relativ schnell sinken. -Die zweite Zahl gibt die Anzahl von Nachrichten an, die nicht zugestellt werden konnten. +Die erste Zahl gibt die Anzahl von Nachrichten an, die nicht zugestellt werden konnten. Die Zustellung wird zu einem späteren Zeitpunkt noch einmal versucht. Unter dem Punkt "Warteschlange Inspizieren" kannst du einen schnellen Blick auf die zweite Warteschlange werfen. -Solltest du für die Hintergrundprozesse die Worker aktiviert haben, wird eine dritte Zahl angezeigt. -Diese repräsentiert die Anzahl der Aufgaben, die die Worker noch vor sich haben. +Die zweite Zahl steht für die Anzahl der Aufgaben, die die Worker noch vor sich haben. +Die Worker arbeiten Hintergrundprozesse ab. Die Aufgaben der Worker sind priorisiert und werden anhand dieser Prioritäten abgearbeitet. -Des weiteren findest du eine Übersicht über die Accounts auf dem Friendica Knoten, die unter dem Punkt "Nutzer" moderiert werden können. +Desweiteren findest du eine Übersicht über die Accounts auf dem Friendica Knoten, die unter dem Punkt "Nutzer" moderiert werden können. Sowie eine Liste der derzeit aktivierten Addons. Diese Liste ist verlinkt, so dass du schnellen Zugriff auf die Informationsseiten der einzelnen Addons hast. Abschließend findest du auf der Startseite des Admin Panels die installierte Version von Friendica. diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 87230a1409..f2d2999ba6 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -610,12 +610,18 @@ function acl_lookup(App $a, $out_type = 'json') { $items = array_merge($groups, $contacts); if ($conv_id) { - /* if $conv_id is set, get unknow contacts in thread */ - /* but first get know contacts url to filter them out */ - function _contact_link($i){ return dbesc($i['link']); } - $known_contacts = array_map(_contact_link, $contacts); - $unknow_contacts=array(); - $r = q("SELECT `author-avatar`,`author-name`,`author-link` + /* + * if $conv_id is set, get unknown contacts in thread + * but first get known contacts url to filter them out + */ + $known_contacts = array_map( + function ($i) { + return dbesc($i['link']); + } + , $contacts); + + $unknown_contacts = array(); + $r = q("SELECT `author-link` FROM `item` WHERE `parent` = %d AND (`author-name` LIKE '%%%s%%' OR `author-link` LIKE '%%%s%%') AND `author-link` NOT IN ('%s') @@ -625,31 +631,29 @@ function acl_lookup(App $a, $out_type = 'json') { intval($conv_id), dbesc($search), dbesc($search), - implode("','", $known_contacts) + implode("', '", $known_contacts) ); - if (dbm::is_result($r)){ + if (dbm::is_result($r)) { foreach ($r as $row) { - // nickname.. - $up = parse_url($row['author-link']); - $nick = explode("/",$up['path']); - $nick = $nick[count($nick)-1]; - $nick .= "@".$up['host']; - // /nickname - $unknow_contacts[] = array( - 'type' => 'c', - 'photo' => proxy_url($row['author-avatar'], false, PROXY_SIZE_MICRO), - 'name' => htmlentities($row['author-name']), - 'id' => '', - 'network' => 'unknown', - 'link' => $row['author-link'], - 'nick' => htmlentities($nick), - 'forum' => false - ); + $contact = get_contact_details_by_url($row['author-link']); + + if (count($contact) > 0) { + $unknown_contacts[] = array( + 'type' => 'c', + 'photo' => proxy_url($contact['micro'], false, PROXY_SIZE_MICRO), + 'name' => htmlentities($contact['name']), + 'id' => intval($contact['cid']), + 'network' => $contact['network'], + 'link' => $contact['url'], + 'nick' => htmlentities($contact['nick'] ? : $contact['addr']), + 'forum' => $contact['forum'] + ); + } } } - $items = array_merge($items, $unknow_contacts); - $tot += count($unknow_contacts); + $items = array_merge($items, $unknown_contacts); + $tot += count($unknown_contacts); } $results = array( diff --git a/include/dbstructure.php b/include/dbstructure.php index 48cc02d2d1..406ad6c93d 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -671,7 +671,7 @@ function db_definition($charset) { "writable" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "forum" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "prv" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), - "contact-type" => array("type" => "int(11) unsigned", "not null" => "1", "default" => "0"), + "contact-type" => array("type" => "int(11)", "not null" => "1", "default" => "0"), "hidden" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "archive" => array("type" => "tinyint(1)", "not null" => "1", "default" => "0"), "pending" => array("type" => "tinyint(1)", "not null" => "1", "default" => "1"), diff --git a/include/photos.php b/include/photos.php index b273c1726b..e872532a48 100644 --- a/include/photos.php +++ b/include/photos.php @@ -58,10 +58,9 @@ function photo_albums($uid, $update = false) { ); } else { // This query doesn't do the count and is much faster - $albums = qu("SELECT DISTINCT(`album`), '' AS `total`, ANY_VALUE(`created`) AS `created` - FROM `photo` - WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra - GROUP BY `album` ORDER BY `created` DESC", + $albums = qu("SELECT DISTINCT(`album`), '' AS `total` + FROM `photo` USE INDEX (`uid_album_scale_created`) + WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' $sql_extra", intval($uid), dbesc('Contact Photos'), dbesc(t('Contact Photos')) diff --git a/include/socgraph.php b/include/socgraph.php index 642d03d891..66533e1511 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -2096,7 +2096,7 @@ function update_gcontact($contact) { fix_alternate_contact_address($contact); if (!isset($contact["updated"])) - $contact["updated"] = datetime_convert(); + $contact["updated"] = dbm::date(); if ($contact["server_url"] == "") { $server_url = $contact["url"]; @@ -2151,7 +2151,7 @@ function update_gcontact($contact) { dbesc($contact["gender"]), dbesc($contact["keywords"]), intval($contact["hide"]), intval($contact["nsfw"]), intval($contact["contact-type"]), dbesc($contact["alias"]), dbesc($contact["notify"]), dbesc($contact["url"]), dbesc($contact["location"]), - dbesc($contact["about"]), intval($contact["generation"]), dbesc($contact["updated"]), + dbesc($contact["about"]), intval($contact["generation"]), dbesc(dbm::date($contact["updated"])), dbesc($contact["server_url"]), dbesc($contact["connect"]), dbesc(normalise_link($contact["url"])), intval($contact["generation"])); diff --git a/js/main.js b/js/main.js index 556e4ed8cf..c85aab4a27 100644 --- a/js/main.js +++ b/js/main.js @@ -322,6 +322,30 @@ } }); + // Scroll to the next/previous thread when pressing J and K + $(document).keydown(function (event) { + var threads = $('.thread_level_1'); + if ((event.keyCode === 74 || event.keyCode === 75) && !$(event.target).is('textarea, input')) { + var scrollTop = $(window).scrollTop(); + if (event.keyCode === 75) { + threads = $(threads.get().reverse()); + } + threads.each(function(key, item) { + var comparison; + var top = $(item).offset().top - 100; + if (event.keyCode === 74) { + comparison = top > scrollTop + 1; + } else if (event.keyCode === 75) { + comparison = top < scrollTop - 1; + } + if (comparison) { + $('html, body').animate({ scrollTop: top }, 200); + return false; + } + }); + } + }); + // Set an event listener for infinite scroll if(typeof infinite_scroll !== 'undefined') { $(window).scroll(function(e){ diff --git a/mod/acl.php b/mod/acl.php index 04aa9f50a6..9220bc77a9 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -1,7 +1,7 @@ t('Message queues'), 'deliverq' => $deliverq, 'queue' => $queue, 'workerq' => $workerqueue); + $queues = array('label' => t('Message queues'), 'queue' => $queue, 'workerq' => $workerqueue); $t = get_markup_template("admin_summary.tpl"); diff --git a/mod/manifest.php b/mod/manifest.php new file mode 100644 index 0000000000..6dc0d10a21 --- /dev/null +++ b/mod/manifest.php @@ -0,0 +1,26 @@ + App::get_baseurl(), + '$touch_icon' => $touch_icon, + '$title' => Config::get('config', 'sitename', 'Friendica'), + )); + + echo $o; + + killme(); + + } +?> diff --git a/update.php b/update.php index 8404f5bf26..4e945d2091 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@