From 3ab92ba9d95c837b352330c8c53e19773c440474 Mon Sep 17 00:00:00 2001 From: Einer von Vielen Date: Sun, 14 Jan 2018 18:33:08 +0100 Subject: Fixed poller. Use Master.php --- .homeinstall/hubzilla-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.homeinstall/hubzilla-setup.sh b/.homeinstall/hubzilla-setup.sh index 635bb3518..3ad9aa37f 100755 --- a/.homeinstall/hubzilla-setup.sh +++ b/.homeinstall/hubzilla-setup.sh @@ -641,7 +641,7 @@ function configure_cron_daily { # every 10 min for poller.php if [ -z "`grep 'poller.php' /etc/crontab`" ] then - echo "*/10 * * * * www-data cd /var/www/html; php include/poller.php >> /dev/null 2>&1" >> /etc/crontab + echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab fi # Run external script daily at 05:30 # - stop apache and mysql-server -- cgit v1.2.3 From c331e585b8ada2c281815193df0d3e1b172ebe0e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 17 Jan 2018 15:25:30 -0800 Subject: remove sendzid core code from core (put in plugin where it belongs) --- include/import.php | 3 ++- include/zid.php | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/import.php b/include/import.php index 51791347a..9920df8be 100644 --- a/include/import.php +++ b/include/import.php @@ -82,7 +82,8 @@ function import_channel($channel, $account_id, $seize) { 'channel_r_storage', 'channel_r_pages', 'channel_w_stream', 'channel_w_wall', 'channel_w_comment', 'channel_w_mail', 'channel_w_like', 'channel_w_tagwall', 'channel_w_chat', 'channel_w_storage', 'channel_w_pages', 'channel_a_republish', - 'channel_a_delegate', 'perm_limits', 'channel_password', 'channel_salt' + 'channel_a_delegate', 'perm_limits', 'channel_password', 'channel_salt', + 'channel_moved' ]; $clean = array(); diff --git a/include/zid.php b/include/zid.php index 6ebc9a6ab..b3a7d1e6a 100644 --- a/include/zid.php +++ b/include/zid.php @@ -127,8 +127,11 @@ function clean_query_string($s = '') { * @return string */ function zidify_callback($match) { - $is_zid = ((feature_enabled(local_channel(), 'sendzid')) || (strpos($match[1], 'zrl')) ? true : false); - $replace = ' ((strpos($match[1],'zrl')) ? true : false), 'url' => $match[2] ]; + call_hooks('zidify', $arr); + + $replace = ' ((strpos($match[1],'zrl')) ? true : false), 'url' => $match[2] ]; + call_hooks('zidify', $arr); + + $replace = ' Date: Wed, 17 Jan 2018 18:28:13 -0800 Subject: use mid/parent_mid to trigger $top_level_post --- Zotlabs/Daemon/Notifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index ca6a7c08a..cb1eb7b79 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -315,7 +315,7 @@ class Notifier { } - if($target_item['id'] == $target_item['parent']) { + if($target_item['mid'] === $target_item['parent_mid']) { $parent_item = $target_item; $top_level_post = true; } -- cgit v1.2.3 From f1afb0ddfec8ed90332e5f6b2f0c74e338727094 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 17 Jan 2018 20:10:49 -0800 Subject: simplify dir_tagadelic dramatically --- Zotlabs/Module/Dirsearch.php | 5 ++++- include/taxonomy.php | 22 ++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 53ec1a850..08f1f7a13 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -97,7 +97,10 @@ class Dirsearch extends \Zotlabs\Web\Controller { else $sync = false; - + if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) { + $hub = \App::get_hostname(); + } + if($hub) $hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') "; else diff --git a/include/taxonomy.php b/include/taxonomy.php index 278925391..393b8718e 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -313,39 +313,25 @@ function dir_tagadelic($count = 0, $hub = '') { $count = intval($count); - $dirmode = get_config('system','directory_mode'); - - if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) { - $hub = \App::get_hostname(); - } - - if($hub) - $hub_query = " and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') "; - else - $hub_query = ''; - - if($hub_query) { - // Fetch tags + if($hub) { $r = q("select xtag_term as term, count(xtag_term) as total from xtag left join hubloc on xtag_hash = hubloc_hash - where xtag_flags = 0 $hub_query + where xtag_flags = 0 and xtag_hash in (select hubloc_hash from hubloc where hubloc_host = '%s' ) group by xtag_term order by total desc %s", + dbesc($hub), ((intval($count)) ? "limit $count" : '') ); } else { - // Fetch tags $r = q("select xtag_term as term, count(xtag_term) as total from xtag where xtag_flags = 0 group by xtag_term order by total desc %s", ((intval($count)) ? "limit $count" : '') ); } if(! $r) - return array(); - + return []; return Zotlabs\Text\Tagadelic::calc($r); - } -- cgit v1.2.3 From eb86ffefbfb38cf76316940a6aa164530f9b9348 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 17 Jan 2018 21:30:19 -0800 Subject: provide local pubstream option (content from this site only). --- Zotlabs/Module/Admin/Site.php | 4 ++++ Zotlabs/Module/Pubstream.php | 15 +++++++++++---- view/tpl/admin_site.tpl | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 60cb39277..e04625c22 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -43,6 +43,7 @@ class Site { $allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : ''); $force_publish = ((x($_POST,'publish_all')) ? True : False); $disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True); + $site_firehose = ((x($_POST,'site_firehose')) ? True : False); $login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False); $enable_context_help = ((x($_POST,'enable_context_help')) ? True : False); $global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : ''); @@ -135,6 +136,7 @@ class Site { set_config('system','allowed_sites', $allowed_sites); set_config('system','publish_all', $force_publish); set_config('system','disable_discover_tab', $disable_discover_tab); + set_config('system','site_firehose', $site_firehose); set_config('system','force_queue_threshold', $force_queue); if ($global_directory == '') { del_config('system', 'directory_submit_url'); @@ -314,6 +316,8 @@ class Site { '$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")), '$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")), '$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')), + '$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')), + '$login_on_homepage' => array('login_on_homepage', t("Login on Homepage"),((intval($homelogin) || $homelogin === false) ? 1 : '') , t("Present a login box to visitors on the home page if no other content has been configured.")), '$enable_context_help' => array('enable_context_help', t("Enable context help"),((intval($enable_context_help) === 1 || $enable_context_help === false) ? 1 : 0) , t("Display contextual help for the current page when the help button is pressed.")), diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index c469a0eca..2c25e2ce0 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -17,9 +17,16 @@ class Pubstream extends \Zotlabs\Web\Controller { return login(); } - $disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false; - if($disable_discover_tab) - return; + $site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false); + $net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true); + + if(! ($site_firehose || $net_firehose)) { + return ''; + } + + if($net_firehose) { + $site_firehose = false; + } $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); @@ -142,7 +149,7 @@ class Pubstream extends \Zotlabs\Web\Controller { require_once('include/channel.php'); require_once('include/security.php'); - if(get_config('system','site_firehose')) { + if($site_firehose) { $uids = " and item.uid in ( " . stream_perms_api_uids(PERMS_PUBLIC) . " ) and item_private = 0 and item_wall = 1 "; } else { diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index 97c14b6e3..50482f03d 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -82,6 +82,7 @@ {{include file="field_checkbox.tpl" field=$feed_contacts}} {{include file="field_checkbox.tpl" field=$force_publish}} {{include file="field_checkbox.tpl" field=$disable_discover_tab}} + {{include file="field_checkbox.tpl" field=$site_firehose}}
-- cgit v1.2.3 From 21d081e175ccc3201fe58f44b5aabb98a3c15671 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jan 2018 11:22:30 +0100 Subject: implement notifications name filter and slightly change the way we load notification to the ui --- view/css/widgets.css | 8 ++++++++ view/js/main.js | 29 ++++++++++++++++++++++------- view/tpl/notifications_widget.tpl | 30 ++++++++++++++++++++++++++---- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/view/css/widgets.css b/view/css/widgets.css index 76e829b04..576445dd6 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -178,6 +178,14 @@ a.wikilist { max-height: 70vh; overflow: auto; } +.notifications-textinput input { + font-family: FontAwesome, sans-serif; +} + + +.notifications-textinput { + padding: .75rem 0.85rem; +} .notification-content.collapsing { overflow: hidden; diff --git a/view/js/main.js b/view/js/main.js index 77b8e91e7..52b836936 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -881,10 +881,11 @@ function notify_popup_loader(notifyType) { /* notifications template - different for navbar and notifications widget */ var navbar_notifications_tpl= unescape($("#navbar-notifications-template[rel=template]").html()); var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html()); - var notifications_all = unescape($('
').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack - var notifications_mark = unescape($('
').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack - var notifications_tt_only = unescape($('
').append( $("#tt-" + notifyType + "-only").clone() ).html()); //outerHtml hack - var notifications_empty = unescape($("#nav-" + notifyType + "-menu").html()); + //var notifications_all = unescape($('
').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack + //var notifications_mark = unescape($('
').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack + //var notifications_tt_only = unescape($('
').append( $("#tt-" + notifyType + "-only").clone() ).html()); //outerHtml hack + //var notifications_cn_only = unescape($('
').append( $("#cn-" + notifyType + "-only").clone() ).html()); //outerHtml hack + //var notifications_empty = unescape($("#nav-" + notifyType + "-menu").html()); var notify_menu = $("#nav-" + notifyType + "-menu"); @@ -895,11 +896,13 @@ function notify_popup_loader(notifyType) { window.location.href=window.location.href; } - $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only); - $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only); + //$("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only + notifications_cn_only); + //$("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark + notifications_tt_only + notifications_cn_only); $("." + notifyType + "-update").html(data.notify.length); + notify_menu.html(''); + $(data.notify).each(function() { html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top); $("#navbar-" + notifyType + "-menu").append(html); @@ -915,11 +918,23 @@ function notify_popup_loader(notifyType) { if($('#tt-' + notifyType + '-only').hasClass('active')) $('#nav-' + notifyType + '-menu [data-thread_top=false]').hide(); + + var filter = $('#cn-' + notifyType + '-input').val(); + + if(filter) { + $('#nav-' + notifyType + '-menu .notification').each(function(i, el){ + var cn = $(el).data('contact_name').toLowerCase(); + if(cn.indexOf(filter) === -1) + $(this).addClass('d-none'); + else + $(this).removeClass('d-none'); + }); + } }); setTimeout(function() { - if(notify_menu.hasClass('show')) { + if($('#nav-' + notifyType + '-sub').hasClass('show')) { console.log('updating ' + notifyType + ' notifications...'); setTimeout(notify_popup_loader, updateInterval, notifyType); } diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 9d2e08c41..9489e850c 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -65,6 +65,23 @@ $('#nav-{{$notification.type}}-menu [data-thread_top=false]').toggle(); $(this).toggleClass('active sticky-top'); }); + $(document).on('keyup', '#cn-{{$notification.type}}-input', function(e) { + var val = $('#cn-{{$notification.type}}-input').val().toLowerCase(); + + if(val) + $('#cn-{{$notification.type}}-only').addClass('active sticky-top'); + else + $('#cn-{{$notification.type}}-only').removeClass('active sticky-top'); + + $("#nav-{{$notification.type}}-menu .notification").each(function(i, el){ + var cn = $(el).data('contact_name').toLowerCase(); + + if(cn.indexOf(val) === -1) + $(this).addClass('d-none'); + else + $(this).removeClass('d-none'); + }); + }); {{/if}} {{/foreach}} @@ -90,7 +107,7 @@