diff options
author | friendica <info@friendica.com> | 2013-12-06 22:48:06 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-06 22:48:06 -0800 |
commit | 39536f6b7d7e7484c560b0584d2fb58e9925737d (patch) | |
tree | 7c4ddb624839e96a1e0ca9b896986b049270bf23 /include | |
parent | 4123d3aa54e1655300ae7aac8cd8860524178e41 (diff) | |
download | volse-hubzilla-39536f6b7d7e7484c560b0584d2fb58e9925737d.tar.gz volse-hubzilla-39536f6b7d7e7484c560b0584d2fb58e9925737d.tar.bz2 volse-hubzilla-39536f6b7d7e7484c560b0584d2fb58e9925737d.zip |
add some entropy
Diffstat (limited to 'include')
-rw-r--r-- | include/contact_widgets.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php index a6e66eb17..6d90abb01 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -157,7 +157,7 @@ function suggest_widget() { require_once('include/socgraph.php'); - $r = suggestion_query(local_user(),get_observer_hash(),0,2); + $r = suggestion_query(local_user(),get_observer_hash(),0,20); if(! $r) { return; @@ -165,7 +165,18 @@ function suggest_widget() { $arr = array(); - foreach($r as $rr) { + // Get two 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 = mt_rand(0,count($r) - 2); + + + + for($x = $index; $x <= ($index+1); $x ++) { + + $rr = $r[$x]; $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr']; |