aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Suggestions.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-23 11:52:11 +0000
committerMario <mario@mariovavti.com>2022-02-23 11:52:11 +0000
commita520063265459a6a02c7e39b64aa7fd83bc0b246 (patch)
treed7938d1626f51085568bc402564d6939034183ad /Zotlabs/Widget/Suggestions.php
parent1e171a72a03bfff06888c275b4fc88286ae20c8f (diff)
downloadvolse-hubzilla-a520063265459a6a02c7e39b64aa7fd83bc0b246.tar.gz
volse-hubzilla-a520063265459a6a02c7e39b64aa7fd83bc0b246.tar.bz2
volse-hubzilla-a520063265459a6a02c7e39b64aa7fd83bc0b246.zip
widget descriptions and add content region to all pdl files for convenience
Diffstat (limited to 'Zotlabs/Widget/Suggestions.php')
-rw-r--r--Zotlabs/Widget/Suggestions.php13
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;