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(-) (limited to 'include') 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 20:10:49 -0800 Subject: simplify dir_tagadelic dramatically --- include/taxonomy.php | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'include') 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 53e353abf2abe43b14f05fbf38e232a68f0689ad Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 18 Jan 2018 12:44:40 +0100 Subject: consolidate navbar tucson and some javascript cleanup --- include/nav.php | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'include') diff --git a/include/nav.php b/include/nav.php index 8566cc58c..9c88541d1 100644 --- a/include/nav.php +++ b/include/nav.php @@ -100,38 +100,6 @@ EOT; if(local_channel()) { - - - $nav['network'] = array('network', t('Activity'), "", t('Network Activity'),'network_nav_btn'); - $nav['network']['all'] = [ 'network', t('View your network activity'), '','' ]; - $nav['network']['mark'] = array('', t('Mark all activity notifications seen'), '',''); - - $nav['home'] = array('channel/' . $channel['channel_address'], t('Channel Home'), "", t('Channel home'),'home_nav_btn'); - $nav['home']['all'] = [ 'channel/' . $channel['channel_address'], t('View your channel home'), '' , '' ]; - $nav['home']['mark'] = array('', t('Mark all channel notifications seen'), '',''); - - - $nav['intros'] = array('connections/ifpending', t('Connections'), "", t('Connections'),'connections_nav_btn'); - if(is_site_admin()) - $nav['registrations'] = array('admin/accounts', t('Registrations'), "", t('Registrations'),'registrations_nav_btn'); - - - $nav['notifications'] = array('notifications/system', t('Notices'), "", t('Notifications'),'notifications_nav_btn'); - $nav['notifications']['all']=array('notifications/system', t('View all notifications'), "", ""); - $nav['notifications']['mark'] = array('', t('Mark all system notifications seen'), '',''); - - $nav['messages'] = array('mail/combined', t('Mail'), "", t('Private mail'),'mail_nav_btn'); - $nav['messages']['all']=array('mail/combined', t('View your private messages'), "", ""); - $nav['messages']['mark'] = array('', t('Mark all private messages seen'), '',''); - $nav['messages']['inbox'] = array('mail/inbox', t('Inbox'), "", t('Inbox')); - $nav['messages']['outbox']= array('mail/outbox', t('Outbox'), "", t('Outbox')); - $nav['messages']['new'] = array('mail/new', t('New Message'), "", t('New Message')); - - - $nav['all_events'] = array('events', t('Events'), "", t('Event Calendar'),'events_nav_btn'); - $nav['all_events']['all']=array('events', t('View events'), "", ""); - $nav['all_events']['mark'] = array('', t('Mark all events seen'), '',''); - if(! $_SESSION['delegate']) { $nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn'); } -- cgit v1.2.3 From 0fba1bb868254c3731d03d9bf5d1b19a8b71b265 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 18 Jan 2018 14:11:15 -0800 Subject: simplify interactions with the get_features hook by calling it before any filtering takes place --- include/features.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/features.php b/include/features.php index 36eb74a9d..839faff67 100644 --- a/include/features.php +++ b/include/features.php @@ -190,6 +190,16 @@ function get_features($filtered = true) { feature_level('event_tz_select',2), ], + + [ + 'premium_channel', + t('Premium Channel'), + t('Allows you to set restrictions and terms on those that connect with your channel'), + false, + get_config('feature_lock','premium_channel'), + feature_level('premium_channel',4), + ], + [ 'advanced_dirsearch', t('Advanced Directory Search'), @@ -438,16 +448,10 @@ function get_features($filtered = true) { ], ]; + $x = [ 'features' => $arr, ]; + call_hooks('get_features',$x); - $arr['general'][] = [ - 'premium_channel', - t('Premium Channel'), - t('Allows you to set restrictions and terms on those that connect with your channel'), - false, - get_config('feature_lock','premium_channel'), - feature_level('premium_channel',4), - ]; - + $arr = $x['features']; $techlevel = get_account_techlevel(); @@ -482,7 +486,5 @@ function get_features($filtered = true) { $narr = $arr; } - $x = [ 'features' => $narr, 'filtered' => $filtered, 'techlevel' => $techlevel ]; - call_hooks('get_features',$x); - return $x['features']; + return $narr; } -- cgit v1.2.3 From 8a60bb461913c59cd65bfaa28c3d40af32a59304 Mon Sep 17 00:00:00 2001 From: Klaus Weidenbach Date: Thu, 18 Jan 2018 23:46:49 +0100 Subject: Change dsn port handling in dba_pdo. --- include/dba/dba_pdo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php index f119d8926..7b58561a7 100755 --- a/include/dba/dba_pdo.php +++ b/include/dba/dba_pdo.php @@ -15,7 +15,7 @@ class dba_pdo extends dba_driver { $dsn = $server; } else { - $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? '' : ';port=' . $port); + $dsn = $this->driver_dbtype . ':host=' . $server . (intval($port) ? ';port=' . $port : ''); } $dsn .= ';dbname=' . $db; @@ -154,4 +154,4 @@ class dba_pdo extends dba_driver { return 'pdo'; } -} \ No newline at end of file +} -- cgit v1.2.3 From 764d6e3407f75cbe7a6f9635dd40cd2cca0f2b4f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 18 Jan 2018 17:20:30 -0800 Subject: zot api: provide channel list function (list all channel usernames [e.g. channel_address] associated with the logged in account) --- include/api_zot.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include') diff --git a/include/api_zot.php b/include/api_zot.php index 54f905b4c..1d30a0845 100644 --- a/include/api_zot.php +++ b/include/api_zot.php @@ -6,6 +6,8 @@ api_register_func('api/export/basic','api_export_basic', true); api_register_func('api/red/channel/export/basic','api_export_basic', true); api_register_func('api/z/1.0/channel/export/basic','api_export_basic', true); + api_register_func('api/red/channel/list','api_channel_list', true); + api_register_func('api/z/1.0/channel/list','api_channel_list', true); api_register_func('api/red/channel/stream','api_channel_stream', true); api_register_func('api/z/1.0/channel/stream','api_channel_stream', true); api_register_func('api/red/files','api_attach_list', true); @@ -111,9 +113,31 @@ } } + function api_channel_list($type) { + if(api_user() === false) { + logger('api_channel_stream: no user'); + return false; + } + + $channel = channelx_by_n(api_user()); + if(! $channel) + return false; + $ret = []; + $r = q("select channel_address from channel where channel_account_id = %d", + intval($channel['channel_account_id']) + ); + + if($r) { + foreach($r as $rv) { + $ret[] = $rv['channel_address']; + } + } + + json_return_and_die($ret); + } function api_channel_stream($type) { -- cgit v1.2.3