From 4ff2b8ed1bf565fbc1c011698781e282bcdd31e5 Mon Sep 17 00:00:00 2001 From: Galette Saucisse Date: Sat, 26 May 2018 09:17:04 +0200 Subject: [PATCH 01/38] Update hmessages.po --- view/fr/hmessages.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view/fr/hmessages.po b/view/fr/hmessages.po index a830d06ef..c5263c2df 100644 --- a/view/fr/hmessages.po +++ b/view/fr/hmessages.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: Redmatrix\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-23 11:34+0200\n" -"PO-Revision-Date: 2018-05-06 07:46+0000\n" +"PO-Revision-Date: 2018-05-26 07:06+0000\n" "Last-Translator: Philip Wittamore \n" "Language-Team: French (http://www.transifex.com/Friendica/red-matrix/language/fr/)\n" "MIME-Version: 1.0\n" @@ -6943,7 +6943,7 @@ msgstr "À propos :" #: ../../include/conversation.php:1052 ../../include/channel.php:1376 #: ../../include/connections.php:110 msgid "Connect" -msgstr "Ajouter/Suivre" +msgstr "Lier" #: ../../Zotlabs/Module/Directory.php:339 msgid "Public Forum:" @@ -12750,7 +12750,7 @@ msgstr "Saisir nom ou centre d'intérêt" #: ../../include/contact_widgets.php:21 msgid "Connect/Follow" -msgstr "Ajouter/Suivre" +msgstr "Lier et suivre" #: ../../include/contact_widgets.php:22 msgid "Examples: Robert Morgenstein, Fishing" From 89d97c556a9bcb9b5f08032c6835d08ecb8e693e Mon Sep 17 00:00:00 2001 From: Galette Saucisse Date: Sat, 26 May 2018 09:18:41 +0200 Subject: [PATCH 02/38] Update hstrings.php --- view/fr/hstrings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/fr/hstrings.php b/view/fr/hstrings.php index f7fd25224..cdf233584 100644 --- a/view/fr/hstrings.php +++ b/view/fr/hstrings.php @@ -1485,7 +1485,7 @@ App::$strings["Location:"] = "Emplacement :"; App::$strings["Description:"] = "Description :"; App::$strings["Hometown:"] = "Ville natale :"; App::$strings["About:"] = "À propos :"; -App::$strings["Connect"] = "Ajouter/Suivre"; +App::$strings["Connect"] = "Lier"; App::$strings["Public Forum:"] = "Forum public :"; App::$strings["Keywords: "] = "Mots-clefs :"; App::$strings["Don't suggest"] = "Ne pas suggérer"; @@ -2868,7 +2868,7 @@ App::$strings["%d invitation available"] = array( ); App::$strings["Find Channels"] = "Trouver des canaux"; App::$strings["Enter name or interest"] = "Saisir nom ou centre d'intérêt"; -App::$strings["Connect/Follow"] = "Ajouter/Suivre"; +App::$strings["Connect/Follow"] = "Lier et suivre"; App::$strings["Examples: Robert Morgenstein, Fishing"] = "Exemples: Guillaume Martin, Course à pieds"; App::$strings["Random Profile"] = "Un profil au hasard"; App::$strings["Invite Friends"] = "Inviter des amis"; From 2bf76928ccc60a7dace548ec7d326e15b78d47b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Jim=C3=A9nez=20Friaza?= Date: Sat, 26 May 2018 18:09:22 +0200 Subject: [PATCH 03/38] Some stuff of the Spanish Hubzilla --- doc/context/es-es/articles/help.html | 20 ++++++++++++++++++++ doc/es | 1 + 2 files changed, 21 insertions(+) create mode 100644 doc/context/es-es/articles/help.html create mode 120000 doc/es diff --git a/doc/context/es-es/articles/help.html b/doc/context/es-es/articles/help.html new file mode 100644 index 000000000..0bf176fdd --- /dev/null +++ b/doc/context/es-es/articles/help.html @@ -0,0 +1,20 @@ +
+
General
+
El artículo es un tipo de documento de una naturaleza un poco especial, a mitad de camino entre las fichas de organización de trabajo ("cards") y las entradas normales, pero que está separado del stream social. Son muy adecuados para ayudar a escribir y organizar textos, con un formateo básico, pero completo, sobre cualquier tema, especialmente sobre documentación seriada, de forma más amplia que un wiki pero menos que un página web. Al no formar parte del stream social, para acceder a él hace falta conocer su dirección: [URL del sitio]/articles/[nombre del usuario, sin dominio]. Ahí estarán disponibles los distintas artículos que escriba, por orden de publicación.
+
Crear un artículo
+
+ Crear un artículo nuevo es muy parecido a componer un nuevo post.

+
    +
  • + Nombre del enlace de la página: Este nombre es el del nombre del artículo para una URL estática +
  • +
  • + Título: El título se muestra en la parte de arriba del artículo +
  • +
  • + Temas o Categorías: Si tiene activada la opción Temas de las entradas en su canal, entonces puede añadirlos al artículo. Estas categorías o temas se despliegan en la lista Temas en el panel de la izquierda y permiten filtrar su colección de artículos. +
  • +
  • Sumario: Es el espacio, entre las etiquetas predefinidas [summary][/summary], reservado para redactar un resumen del artículo, que aparecerá en su encabezado. El espacio disponible a continuación del sumario, en la ventana de composición, es el adecuado para la redacción del artículo en sí. +
+
+
\ No newline at end of file diff --git a/doc/es b/doc/es new file mode 120000 index 000000000..c8ba7666b --- /dev/null +++ b/doc/es @@ -0,0 +1 @@ +es-es \ No newline at end of file From 5a475453ab2939836ab8a541de6ca9608781a0c8 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 27 May 2018 12:20:07 +0200 Subject: [PATCH 04/38] fix js error with catalan language (unescaped strings) --- view/tpl/jot-header.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 22413f350..365a922f9 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -365,12 +365,12 @@ var activeCommentText = ''; if($('#jot-nocomment').val() > 0) { $('#jot-nocomment').val(0); $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments'); - $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled}}'); + $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled|escape:'javascript'}}'); } else { $('#jot-nocomment').val(1); $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o'); - $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled}}'); + $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled|escape:'javascript'}}'); } } From 4f3be92a0d8b9b8555647d3086e13dd3530c6463 Mon Sep 17 00:00:00 2001 From: Herbert Thielen Date: Sun, 27 May 2018 17:57:35 +0200 Subject: [PATCH 05/38] include photos.php required for photo_calculate_scale() --- Zotlabs/Module/Cover_photo.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 9adfa2209..88fd4485d 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -9,6 +9,7 @@ namespace Zotlabs\Module; require_once('include/photo/photo_driver.php'); require_once('include/channel.php'); +require_once('include/photos.php'); From ddebbcc0a08aae9cd33bb3105ce1f2c8863b544c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 27 May 2018 17:46:25 -0700 Subject: [PATCH 06/38] hubzilla issue #1200 --- Zotlabs/Module/Network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 82c88e565..942b48109 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -131,7 +131,7 @@ class Network extends \Zotlabs\Web\Controller { if(x($_GET,'search') || x($_GET,'file')) $nouveau = true; if($cid) { - $r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1", + $r = q("SELECT abook_xchan, xchan_addr, xchan_url FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_id = %d AND abook_channel = %d LIMIT 1", intval($cid), intval(local_channel()) ); @@ -144,7 +144,7 @@ class Network extends \Zotlabs\Web\Controller { // NOTREACHED } if($_GET['pf'] === '1') - $deftag = '!' . t('forum') . '+' . intval($cid); + $deftag = '!{' . (($r[0]['xchan_addr']) ? $r[0]['xchan_addr'] : $r[0]['xchan_url']) . '}'; else $def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ]; } From 139c39c2ce270ca1e95d86b517ebe0ad4182ecfa Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 28 May 2018 22:23:40 -0700 Subject: [PATCH 07/38] we probably don't need to delivery local items more than once --- Zotlabs/Daemon/Deliver.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Zotlabs/Daemon/Deliver.php b/Zotlabs/Daemon/Deliver.php index 394a7bf3e..b809cba91 100644 --- a/Zotlabs/Daemon/Deliver.php +++ b/Zotlabs/Daemon/Deliver.php @@ -75,6 +75,8 @@ class Deliver { q("delete from dreport where dreport_queue = '%s'", dbesc($argv[$x]) ); + + continue; } } From ed3d3b6f27452969164f35fee3cf7955733b503e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 29 May 2018 17:35:44 -0700 Subject: [PATCH 08/38] provide possibility of using different orderings (post, commented) on channel page --- Zotlabs/Module/Channel.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 327ca53db..9108f6841 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -82,6 +82,7 @@ class Channel extends \Zotlabs\Web\Controller { $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : ''); $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); + $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post'); $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); $groups = array(); @@ -244,6 +245,7 @@ class Channel extends \Zotlabs\Web\Controller { if($datequery) { $sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery)))); + $order = 'post'; } if($datequery2) { $sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2)))); @@ -253,6 +255,12 @@ class Channel extends \Zotlabs\Web\Controller { $sql_extra2 .= " and item.item_thread_top != 0 "; } + if($order === 'post') + $ordering = "created"; + else + $ordering = "commented"; + + $itemspage = get_pconfig(local_channel(),'system','itemspage'); \App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); @@ -275,7 +283,7 @@ class Channel extends \Zotlabs\Web\Controller { AND (abook.abook_blocked = 0 or abook.abook_flags is null) AND item.item_wall = 1 $sql_extra $sql_extra2 - ORDER BY created DESC, id $pager_sql ", + ORDER BY $ordering DESC, id $pager_sql ", intval(\App::$profile['profile_uid']) ); } @@ -284,7 +292,6 @@ class Channel extends \Zotlabs\Web\Controller { $r = array(); } } - if($r) { $parents_str = ids_to_querystr($r,'item_id'); @@ -300,7 +307,7 @@ class Channel extends \Zotlabs\Web\Controller { xchan_query($items); $items = fetch_post_tags($items, true); - $items = conv_sort($items,'created'); + $items = conv_sort($items,$ordering); if($load && $mid && (! count($items))) { // This will happen if we don't have sufficient permissions @@ -345,7 +352,7 @@ class Channel extends \Zotlabs\Web\Controller { '$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1), '$search' => $search, '$xchan' => '', - '$order' => '', + '$order' => $order, '$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0), '$file' => '', '$cats' => (($category) ? urlencode($category) : ''), From 9fcb3bf2e8fab84f9144eecceaf984b2026e6d08 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 14:02:58 +0200 Subject: [PATCH 09/38] first cut on restructuring the previously called network tabs --- Zotlabs/Module/Network.php | 21 +++++++++++++++++---- include/features.php | 22 +++++++++++----------- include/group.php | 2 +- include/text.php | 22 +++++++++++++++++++++- view/pdl/mod_network.pdl | 2 ++ 5 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 942b48109..060179217 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -57,13 +57,26 @@ class Network extends \Zotlabs\Web\Controller { $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : ''); - $nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0); $static = ((x($_GET,'static')) ? intval($_GET['static']) : 0); $gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0); $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : ''); $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); $verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : ''); - + + + $order = get_pconfig(local_channel(), 'mod_network', 'order', 0); + switch($order) { + case 0: + $order = 'comment'; + break; + case 1: + $order = 'post'; + break; + case 2: + $nouveau = true; + break; + } + $search = (($_GET['search']) ? $_GET['search'] : ''); if($search) { $_GET['netsearch'] = escape_tags($search); @@ -84,7 +97,7 @@ class Network extends \Zotlabs\Web\Controller { } if($datequery) - $_GET['order'] = 'post'; + $order = 'post'; // filter by collection (e.g. group) @@ -150,7 +163,7 @@ class Network extends \Zotlabs\Web\Controller { } if(! $update) { - $tabs = network_tabs(); + $tabs = ''; //network_tabs(); $o .= $tabs; // search terms header diff --git a/include/features.php b/include/features.php index 616e3f6c5..3d3e41a05 100644 --- a/include/features.php +++ b/include/features.php @@ -386,23 +386,23 @@ function get_features($filtered = true, $level = (-1)) { ], [ - 'personal_tab', - t('Network Personal Tab'), + 'order_tab', + t('Alternate Stream Order'), + t('Ability to order the stream by last post date, last comment date or unthreaded activities'), + false, + get_config('feature_lock','order_tab'), + feature_level('order_tab',2), + ], + + [ + 'personal_tab', + t('Network Personal Tab'), t('Enable tab to display only Network posts that you\'ve interacted on'), false, get_config('feature_lock','personal_tab'), feature_level('personal_tab',1), ], - [ - 'new_tab', - t('Network New Tab'), - t('Enable tab to display all new Network activity'), - false, - get_config('feature_lock','new_tab'), - feature_level('new_tab',2), - ], - [ 'affinity', t('Affinity Tool'), diff --git a/include/group.php b/include/group.php index 8c95f6224..03ebf7ee5 100644 --- a/include/group.php +++ b/include/group.php @@ -284,7 +284,7 @@ function group_side($every="connections",$each="group",$edit = false, $group_id 'text' => t('All Channels'), 'id' => 0, 'selected' => (($group_id == 0) ? 'group-selected' : ''), - 'href' => $every . (($every === 'network') ? '?f=&gid=0' : '') . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : ''), + 'href' => $every . (($every === 'network') ? '?f=&gid=0' : ''), ); diff --git a/include/text.php b/include/text.php index 34063cdd7..319de67a8 100644 --- a/include/text.php +++ b/include/text.php @@ -3333,4 +3333,24 @@ function unique_multidim_array($array, $key) { $i++; } return $temp_array; -} +} + +function network_qstring($req) { + + $ret = '?f='; + + if(x($req, 'cid')) + $ret .= '&cid=' . $req['cid']; + + if(x($req, 'gid')) + $ret .= '&gid=' . $req['gid']; + + if(x($req, 'star')) + $ret .= '&star=' . $req['star']; + + if(x($req, 'conv')) + $ret .= '&conv=' . $req['conv']; + + return $ret; + +} diff --git a/view/pdl/mod_network.pdl b/view/pdl/mod_network.pdl index 09fdba573..f93a6c66d 100644 --- a/view/pdl/mod_network.pdl +++ b/view/pdl/mod_network.pdl @@ -1,5 +1,7 @@ [region=aside] +[widget=activity_order][/widget] [widget=collections][/widget] +[widget=activity_filter][/widget] [widget=forums][/widget] [widget=suggestions][/widget] [widget=savedsearch][/widget] From 8d6441704bdc8d0628149dbb32321b6921f097ba Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 14:06:18 +0200 Subject: [PATCH 10/38] add widget files and templates --- Zotlabs/Widget/Activity_filter.php | 66 +++++++++++++++++ Zotlabs/Widget/Activity_order.php | 111 +++++++++++++++++++++++++++++ view/tpl/common_pills.tpl | 8 +++ 3 files changed, 185 insertions(+) create mode 100644 Zotlabs/Widget/Activity_filter.php create mode 100644 Zotlabs/Widget/Activity_order.php create mode 100755 view/tpl/common_pills.tpl diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php new file mode 100644 index 000000000..a60144239 --- /dev/null +++ b/Zotlabs/Widget/Activity_filter.php @@ -0,0 +1,66 @@ + t('Personal Posts'), + 'icon' => 'user-circle', + 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&conv=1', + 'sel' => $conv_active, + 'title' => t('Posts that mention or involve you'), + ); + } + + if(feature_enabled(local_channel(),'star_posts')) { + $tabs[] = array( + 'label' => t('Starred Posts'), + 'icon' => 'star', + 'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&star=1', + 'sel'=>$starred_active, + 'title' => t('Favourite Posts'), + ); + } + + + $arr = ['tabs' => $tabs]; + + call_hooks('network_tabs', $arr); + + $tpl = get_markup_template('common_pills.tpl'); + + if($arr['tabs']) { + return replace_macros($tpl, [ + '$title' => t('Additional Filters'), + '$tabs' => $arr['tabs'], + ]); + } + else { + return ''; + } + } + +} diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php new file mode 100644 index 000000000..ba288965f --- /dev/null +++ b/Zotlabs/Widget/Activity_order.php @@ -0,0 +1,111 @@ + t('Commented Date'), + 'url'=>z_root() . '/' . $cmd . '?f=&order=comment' . $filter, + 'sel'=> $commentord_active, + 'title' => t('Sort by Comment Date'), + ]; + $tabs[] = [ + 'label' => t('Posted Date'), + 'url'=>z_root() . '/' . $cmd . '?f=&order=post' . $filter, + 'sel'=> $postord_active, + 'title' => t('Sort by Post Date'), + ]; + $tabs[] = array( + 'label' => t('Date Unthreaded'), + 'url' => z_root() . '/' . $cmd . '?f=&order=unthreaded' . $filter, + 'sel' => $unthreaded_active, + 'title' => t('Activity Stream - by date'), + ); + + $arr = ['tabs' => $tabs]; + + call_hooks('network_tabs', $arr); + + $tpl = get_markup_template('common_pills.tpl'); + + if($arr['tabs']) { + return replace_macros($tpl, [ + '$title' => t('Order Activity by'), + '$tabs' => $arr['tabs'], + ]); + } + else { + return ''; + } + } + +} diff --git a/view/tpl/common_pills.tpl b/view/tpl/common_pills.tpl new file mode 100755 index 000000000..d10aa365b --- /dev/null +++ b/view/tpl/common_pills.tpl @@ -0,0 +1,8 @@ +
+

{{$title}}

+ +
From 293e405f5b9761ade0c621c3696b93439b2440bf Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 14:09:24 +0200 Subject: [PATCH 11/38] just query for data we actually need --- Zotlabs/Daemon/Poller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php index e4bc9c143..49151437c 100644 --- a/Zotlabs/Daemon/Poller.php +++ b/Zotlabs/Daemon/Poller.php @@ -71,14 +71,18 @@ class Poller { $randfunc = db_getfunc('RAND'); - $contacts = q("SELECT * FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash + $contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed, + abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending, + abook.abook_ignored, abook.abook_blocked, + xchan.xchan_network, + account.account_lastlog, account.account_flags + FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash LEFT JOIN account on abook_account = account_id where abook_self = 0 $sql_extra AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc", intval(ACCOUNT_OK), intval(ACCOUNT_UNVERIFIED) // FIXME - ); if($contacts) { From 881406f82b455cbd78eb64570a0a41937814a444 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 14:54:39 +0200 Subject: [PATCH 12/38] remove redundant reference for order --- Zotlabs/Module/Network.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 060179217..5e7492fd4 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -120,16 +120,11 @@ class Network extends \Zotlabs\Web\Controller { $def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>'); } - $default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0); $default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99); - - // if no tabs are selected, defaults to comments - $cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0); $star = ((x($_GET,'star')) ? intval($_GET['star']) : 0); - $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment'); $liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0); $conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0); $spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0); From e1a55ba471a2de5dd31e51c2471f8c3122ad2919 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 20:18:13 +0200 Subject: [PATCH 13/38] remove redundant css from default.css --- view/css/default.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/view/css/default.css b/view/css/default.css index fc6da54f9..765a197d9 100644 --- a/view/css/default.css +++ b/view/css/default.css @@ -1,11 +1,3 @@ -header #banner { - position: fixed; - top: 0px; - width: 33%; - margin-left: 33%; - margin-right: 33%; -} - main { display: table; table-layout: fixed; From 6349a7417f41cd697ba2dea82653911a1abaaf94 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 22:40:22 +0200 Subject: [PATCH 14/38] make navbar search use the module search function in /network and /channel --- Zotlabs/Module/Channel.php | 29 ++++++++++++++++------------- Zotlabs/Module/Network.php | 4 ++++ Zotlabs/Widget/Activity_order.php | 7 +++++++ include/nav.php | 14 +++++++++++++- view/tpl/navbar_default.tpl | 2 +- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 9108f6841..dac177c9e 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -84,6 +84,7 @@ class Channel extends \Zotlabs\Web\Controller { $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); $order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post'); $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); + $search = ((x($_GET,'search')) ? $_GET['search'] : EMPTY_STR); $groups = array(); @@ -119,9 +120,12 @@ class Channel extends \Zotlabs\Web\Controller { $static = channel_manual_conv_update(\App::$profile['profile_uid']); - //$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']); - - // $o .= common_friends_visitor_widget(\App::$profile['profile_uid']); + // search terms header + if($search) { + $o .= replace_macros(get_markup_template("section_title.tpl"),array( + '$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8') + )); + } if($channel && $is_owner) { $channel_acl = array( @@ -180,15 +184,13 @@ class Channel extends \Zotlabs\Web\Controller { $simple_update = (($update) ? " AND item_unseen = 1 " : ''); - - $search = EMPTY_STR; - if(x($_GET,'search')) { - $search = escape_tags($_GET['search']); + if($search) { + $search = escape_tags($search); if(strpos($search,'#') === 0) { - $sql_extra2 .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG); + $sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG); } else { - $sql_extra2 .= sprintf(" AND item.body like '%s' ", + $sql_extra .= sprintf(" AND item.body like '%s' ", dbesc(protect_sprintf('%' . $search . '%')) ); } @@ -255,7 +257,7 @@ class Channel extends \Zotlabs\Web\Controller { $sql_extra2 .= " and item.item_thread_top != 0 "; } - if($order === 'post') + if($order === 'post') $ordering = "created"; else $ordering = "commented"; @@ -282,7 +284,7 @@ class Channel extends \Zotlabs\Web\Controller { WHERE true and item.uid = %d $item_normal AND (abook.abook_blocked = 0 or abook.abook_flags is null) AND item.item_wall = 1 - $sql_extra $sql_extra2 + $sql_extra $sql_extra2 ORDER BY $ordering DESC, id $pager_sql ", intval(\App::$profile['profile_uid']) ); @@ -398,12 +400,13 @@ class Channel extends \Zotlabs\Web\Controller { } } + $mode = (($search) ? 'search' : 'channel'); if($checkjs->disabled()) { - $o .= conversation($items,'channel',$update,'traditional'); + $o .= conversation($items,$mode,$update,'traditional'); } else { - $o .= conversation($items,'channel',$update,$page_mode); + $o .= conversation($items,$mode,$update,$page_mode); } if((! $update) || ($checkjs->disabled())) { diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 5e7492fd4..acd12158c 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -138,6 +138,7 @@ class Network extends \Zotlabs\Web\Controller { if(x($_GET,'search') || x($_GET,'file')) $nouveau = true; + if($cid) { $r = q("SELECT abook_xchan, xchan_addr, xchan_url FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_id = %d AND abook_channel = %d LIMIT 1", intval($cid), @@ -567,6 +568,9 @@ class Network extends \Zotlabs\Web\Controller { } $mode = (($nouveau) ? 'network-new' : 'network'); + + if($search) + $mode = 'search'; $o .= conversation($items,$mode,$update,$page_mode); diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php index ba288965f..edeef2c20 100644 --- a/Zotlabs/Widget/Activity_order.php +++ b/Zotlabs/Widget/Activity_order.php @@ -53,6 +53,12 @@ class Activity_order { } } + // override order for search results and filer results + if(x($_GET,'search') || x($_GET,'file')) { + $unthreaded_active = 'active'; + $commentord_active = $postord_active = ''; + } + $cmd = \App::$cmd; $filter = ''; @@ -69,6 +75,7 @@ class Activity_order { if(x($_GET,'conv')) $filter .= '&conv=' . $_GET['conv']; + // tabs $tabs = []; diff --git a/include/nav.php b/include/nav.php index c5ceb97c5..994819ed4 100644 --- a/include/nav.php +++ b/include/nav.php @@ -168,7 +168,19 @@ function nav($template = 'default') { $nav['help'] = [$help_url, t('Help'), "", t('Help and documentation'), 'help_nav_btn', $context_help, $enable_context_help]; } - $nav['search'] = ['search', t('Search'), "", t('Search site @name, !forum, #tag, ?docs, content')]; + switch(App::$module) { + case 'network': + $search_form_action = 'network'; + break; + case 'channel': + $search_form_action = 'channel'; + break; + default: + $search_form_action = 'search'; + } + + + $nav['search'] = ['search', t('Search'), "", t('Search site @name, !forum, #tag, ?docs, content'), $search_form_action]; /** diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl index 7bc8df8d5..ebcadf365 100755 --- a/view/tpl/navbar_default.tpl +++ b/view/tpl/navbar_default.tpl @@ -119,7 +119,7 @@