mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 22:35:18 +00:00
affinity tool -> friend zoom; alter xchan_query to return results in hubloc_primary desc order; as hublocs have been seen in the wild with no primary
This commit is contained in:
parent
c741420bb8
commit
4e87935fda
7 changed files with 20 additions and 20 deletions
|
@ -313,7 +313,7 @@ class Apps {
|
||||||
static public function translate_system_apps(&$arr) {
|
static public function translate_system_apps(&$arr) {
|
||||||
$apps = array(
|
$apps = array(
|
||||||
'Apps' => t('Apps'),
|
'Apps' => t('Apps'),
|
||||||
'Affinity Tool' => t('Affinity Tool'),
|
'Friend Zoom' => t('Friend Zoom'),
|
||||||
'Articles' => t('Articles'),
|
'Articles' => t('Articles'),
|
||||||
'Cards' => t('Cards'),
|
'Cards' => t('Cards'),
|
||||||
'Calendar' => t('Calendar'),
|
'Calendar' => t('Calendar'),
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Affinity extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function post() {
|
function post() {
|
||||||
|
|
||||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Affinity Tool'))) {
|
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Friend Zoom'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class Affinity extends \Zotlabs\Web\Controller {
|
||||||
set_pconfig(local_channel(),'affinity','cmin',0);
|
set_pconfig(local_channel(),'affinity','cmin',0);
|
||||||
set_pconfig(local_channel(),'affinity','cmax',$cmax);
|
set_pconfig(local_channel(),'affinity','cmax',$cmax);
|
||||||
|
|
||||||
info( t('Affinity Tool settings updated.') . EOL);
|
info( t('Friend Zoom settings updated.') . EOL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,11 +34,11 @@ class Affinity extends \Zotlabs\Web\Controller {
|
||||||
|
|
||||||
function get() {
|
function get() {
|
||||||
|
|
||||||
$desc = t('This app (when installed) presents a slider control in your connection editor and also on your network page. The slider represents your degree of friendship or <em>affinity</em> with each connection. It allows you to zoom in or out and display conversations from only your closest friends or everybody in your stream.');
|
$desc = t('This app (when installed) presents a slider control in your connection editor and also on your network page. The slider represents your degree of friendship with each connection. It allows you to zoom in or out and display conversations from only your closest friends or everybody in your stream.');
|
||||||
|
|
||||||
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
||||||
|
|
||||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Affinity Tool'))) {
|
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Friend Zoom'))) {
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class Affinity extends \Zotlabs\Web\Controller {
|
||||||
// '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99'))
|
// '$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99'))
|
||||||
// ));
|
// ));
|
||||||
|
|
||||||
if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
|
if(Apps::system_app_installed(local_channel(),'Friend Zoom')) {
|
||||||
|
|
||||||
$labels = array(
|
$labels = array(
|
||||||
0 => t('Me'),
|
0 => t('Me'),
|
||||||
|
@ -80,7 +80,7 @@ class Affinity extends \Zotlabs\Web\Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= replace_macros(get_markup_template('generic_app_settings.tpl'), array(
|
$s .= replace_macros(get_markup_template('generic_app_settings.tpl'), array(
|
||||||
'$addon' => array('affinity', '' . t('Affinity Tool Settings'), '', t('Submit')),
|
'$addon' => array('affinity', '' . t('Friend Zoom Settings'), '', t('Submit')),
|
||||||
'$content' => $setting_fields
|
'$content' => $setting_fields
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -637,13 +637,13 @@ class Connedit extends Controller {
|
||||||
|
|
||||||
$tpl = get_markup_template("abook_edit.tpl");
|
$tpl = get_markup_template("abook_edit.tpl");
|
||||||
|
|
||||||
if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
|
if(Apps::system_app_installed(local_channel(),'Friend Zoom')) {
|
||||||
|
|
||||||
$sections['affinity'] = [
|
$sections['affinity'] = [
|
||||||
'label' => t('Affinity'),
|
'label' => t('Friend Zoom'),
|
||||||
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/?f=§ion=affinity',
|
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/?f=§ion=affinity',
|
||||||
'sel' => '',
|
'sel' => '',
|
||||||
'title' => t('Open Set Affinity section by default'),
|
'title' => t('Open Friend Zoom section by default'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$labels = [
|
$labels = [
|
||||||
|
@ -714,13 +714,13 @@ class Connedit extends Controller {
|
||||||
$multiprofs = ((feature_enabled(local_channel(),'multi_profiles')) ? true : false);
|
$multiprofs = ((feature_enabled(local_channel(),'multi_profiles')) ? true : false);
|
||||||
|
|
||||||
if($slide && !$multiprofs)
|
if($slide && !$multiprofs)
|
||||||
$affinity = t('Set Affinity');
|
$affinity = t('Set Friend Zoom');
|
||||||
|
|
||||||
if(!$slide && $multiprofs)
|
if(!$slide && $multiprofs)
|
||||||
$affinity = t('Set Profile');
|
$affinity = t('Set Profile');
|
||||||
|
|
||||||
if($slide && $multiprofs)
|
if($slide && $multiprofs)
|
||||||
$affinity = t('Set Affinity & Profile');
|
$affinity = t('Set Friend Zoom & Profile');
|
||||||
|
|
||||||
|
|
||||||
$theirs = get_abconfig(local_channel(),$contact['abook_xchan'],'system','their_perms',EMPTY_STR);
|
$theirs = get_abconfig(local_channel(),$contact['abook_xchan'],'system','their_perms',EMPTY_STR);
|
||||||
|
|
|
@ -122,8 +122,8 @@ class Network extends Controller {
|
||||||
$def_acl = [ 'allow_gid' => '<' . $r[0]['hash'] . '>' ];
|
$def_acl = [ 'allow_gid' => '<' . $r[0]['hash'] . '>' ];
|
||||||
}
|
}
|
||||||
|
|
||||||
$default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
|
$default_cmin = ((Apps::system_app_installed(local_channel(),'Friend Zoom')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
|
||||||
$default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
|
$default_cmax = ((Apps::system_app_installed(local_channel(),'Friend Zoom')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
|
||||||
|
|
||||||
$cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
|
$cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
|
||||||
$star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
|
$star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
|
||||||
|
|
|
@ -11,14 +11,14 @@ class Affinity {
|
||||||
if(! local_channel())
|
if(! local_channel())
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
|
$default_cmin = ((Apps::system_app_installed(local_channel(),'Friend Zoom')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
|
||||||
$default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
|
$default_cmax = ((Apps::system_app_installed(local_channel(),'Friend Zoom')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
|
||||||
|
|
||||||
$cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin);
|
$cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin);
|
||||||
$cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax);
|
$cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax);
|
||||||
|
|
||||||
|
|
||||||
if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
|
if(Apps::system_app_installed(local_channel(),'Friend Zoom')) {
|
||||||
|
|
||||||
$labels = array(
|
$labels = array(
|
||||||
0 => t('Me'),
|
0 => t('Me'),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
version: 1
|
version: 1
|
||||||
url: $baseurl/affinity
|
url: $baseurl/affinity
|
||||||
requires: local_channel
|
requires: local_channel
|
||||||
name: Affinity Tool
|
name: Friend Zoom
|
||||||
photo: icon:arrows-h
|
photo: icon:arrows-h
|
||||||
categories: Networking
|
categories: Networking
|
||||||
|
|
|
@ -2120,13 +2120,13 @@ function xchan_query(&$items, $abook = true, $effective_uid = 0) {
|
||||||
if(count($arr)) {
|
if(count($arr)) {
|
||||||
if($abook) {
|
if($abook) {
|
||||||
$chans = q("select * from xchan left join hubloc on hubloc_hash = xchan_hash left join abook on abook_xchan = xchan_hash and abook_channel = %d
|
$chans = q("select * from xchan left join hubloc on hubloc_hash = xchan_hash left join abook on abook_xchan = xchan_hash and abook_channel = %d
|
||||||
where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1",
|
where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") order by hubloc_primary desc",
|
||||||
intval($item['uid'])
|
intval($item['uid'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
||||||
where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1");
|
where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") order by hubloc_primary desc");
|
||||||
}
|
}
|
||||||
$xchans = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$arr)) . ") and xchan_network in ('rss','unknown', 'anon')");
|
$xchans = q("select * from xchan where xchan_hash in (" . protect_sprintf(implode(',',$arr)) . ") and xchan_network in ('rss','unknown', 'anon')");
|
||||||
if(! $chans)
|
if(! $chans)
|
||||||
|
|
Loading…
Reference in a new issue