mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
add followers/following to directory
This commit is contained in:
parent
31fa60f6eb
commit
6fce212780
3 changed files with 20 additions and 7 deletions
|
@ -459,6 +459,10 @@ class Directory extends Controller
|
|||
'keywords' => $out,
|
||||
'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '',
|
||||
'ignore_label' => t('Don\'t suggest'),
|
||||
'followers_label' => t('Followers:'),
|
||||
'following_label' => t('Following:'),
|
||||
'followers' => (($rr['followers'] === 'unset') ? '' : $rr['followers']),
|
||||
'following' => (($rr['following'] === 'unset') ? '' : $rr['following']),
|
||||
'common_friends' => (($common[$rr['hash']]) ? intval($common[$rr['hash']]) : ''),
|
||||
'common_label' => t('Suggestion ranking:'),
|
||||
'common_count' => intval($common[$rr['hash']]),
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Code\Module;
|
|||
|
||||
use App;
|
||||
use Code\Lib\Time;
|
||||
use Code\Lib\XConfig;
|
||||
use Code\Web\Controller;
|
||||
|
||||
// This is the primary endpoint for communicating with Zot directory services.
|
||||
|
@ -203,12 +204,6 @@ class Dirsearch extends Controller
|
|||
|
||||
if ($sort_order == 'normal') {
|
||||
$order = " order by xchan_name asc ";
|
||||
|
||||
// Start the alphabetic search at 'A'
|
||||
// This will make a handful of channels whose names begin with
|
||||
// punctuation un-searchable in this mode
|
||||
|
||||
$safesql .= " and ascii(substring(xchan_name FROM 1 FOR 1)) > 64 ";
|
||||
} elseif ($sort_order == 'reverse') {
|
||||
$order = " order by xchan_name desc ";
|
||||
} elseif ($sort_order == 'reversedate') {
|
||||
|
@ -268,6 +263,7 @@ class Dirsearch extends Controller
|
|||
continue;
|
||||
}
|
||||
|
||||
$follows = explode('/', XConfig::Get($rr['xchan_hash'], 'activitypub', 'follows', 'unset/unset'));
|
||||
|
||||
$entry = [];
|
||||
|
||||
|
@ -295,7 +291,8 @@ class Dirsearch extends Controller
|
|||
$entry['homepage'] = $rr['xprof_homepage'];
|
||||
$entry['hometown'] = $rr['xprof_hometown'];
|
||||
$entry['keywords'] = $rr['xprof_keywords'];
|
||||
|
||||
$entry['followers'] = $follows[0];
|
||||
$entry['following'] = $follows[1];
|
||||
$entries[] = $entry;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,18 @@
|
|||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{if $entry.followers}}
|
||||
<div class="contact-info-element">
|
||||
<span class="contact-info-label">{{$entry.followers_label}}</span> {{$entry.followers}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{if $entry.following}}
|
||||
<div class="contact-info-element">
|
||||
<span class="contact-info-label">{{$entry.following_label}}</span> {{$entry.following}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{if $entry.common_friends}}
|
||||
<div id="dir-common" class="contact-info-element">
|
||||
<span class="contact-info-label">{{$entry.common_label}}</span> {{$entry.common_count}}
|
||||
|
|
Loading…
Reference in a new issue