diff options
author | Mario Vavti <mario@mariovavti.com> | 2022-03-29 11:42:53 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2022-03-29 11:42:53 +0200 |
commit | 0784cd593a39a4fc297e8a82f7e79bc8019a0868 (patch) | |
tree | 22182afb37cf460f8208fff9d276a0672add3185 /Zotlabs/Widget/Suggestions.php | |
parent | 0e2e9321025f87fe9587f3d183adaea6185e4e20 (diff) | |
parent | 9c5d2ee5630dd7033904039dcd1e92db8821b644 (diff) | |
download | volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.gz volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.tar.bz2 volse-hubzilla-0784cd593a39a4fc297e8a82f7e79bc8019a0868.zip |
Merge branch '7.2RC'7.2
Diffstat (limited to 'Zotlabs/Widget/Suggestions.php')
-rw-r--r-- | Zotlabs/Widget/Suggestions.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Zotlabs/Widget/Suggestions.php b/Zotlabs/Widget/Suggestions.php index b4f384e9d..e7d23bda4 100644 --- a/Zotlabs/Widget/Suggestions.php +++ b/Zotlabs/Widget/Suggestions.php @@ -1,5 +1,10 @@ <?php +/** + * * Name: Suggestions + * * Description: Display suggestions for new contacts + */ + namespace Zotlabs\Widget; use Zotlabs\Lib\Apps; @@ -12,7 +17,7 @@ class Suggestions { function widget($arr) { - if((! local_channel()) || (! Apps::system_app_installed(local_channel(), 'Suggest Channels'))) + if(! local_channel()) return EMPTY_STR; $r = suggestion_query(local_channel(),get_observer_hash(),0,20); @@ -23,14 +28,14 @@ class Suggestions { $arr = array(); - // Get two random entries from the top 20 returned. + // Get four random entries from the top 20 returned. // We'll grab the first one and the one immediately following. // This will throw some entropy intot he situation so you won't // be looking at the same two mug shots every time the widget runs - $index = ((count($r) > 2) ? mt_rand(0,count($r) - 2) : 0); + $index = ((count($r) > 4) ? mt_rand(0,count($r) - 4) : 0); - for($x = $index; $x <= ($index+1); $x ++) { + for($x = $index; $x <= ($index+3); $x ++) { $rr = $r[$x]; if(! $rr['xchan_url']) break; |