aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-30 14:30:37 -0800
committerfriendica <info@friendica.com>2015-01-30 14:30:37 -0800
commitef04d21a8f00d2b9623c7fc7f5a5b49f44a7f1d5 (patch)
treece8fa47181482a19aa4ac57877687eea140e3e31 /include
parentb18fe85fb86bd09639c5eccfddcad05024a52663 (diff)
downloadvolse-hubzilla-ef04d21a8f00d2b9623c7fc7f5a5b49f44a7f1d5.tar.gz
volse-hubzilla-ef04d21a8f00d2b9623c7fc7f5a5b49f44a7f1d5.tar.bz2
volse-hubzilla-ef04d21a8f00d2b9623c7fc7f5a5b49f44a7f1d5.zip
fix random profiles
Diffstat (limited to 'include')
-rw-r--r--include/Contact.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 66062c279..de3a75bb7 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -584,12 +584,13 @@ function contact_remove($channel_id, $abook_id) {
function random_profile() {
$randfunc = db_getfunc('rand');
-
+
$checkrandom = get_config('randprofile','check'); // False by default
$retryrandom = intval(get_config('randprofile','retry'));
- if($retryrandom === false) $retryrandom = 5;
+ if($retryrandom == 0) $retryrandom = 5;
for($i = 0; $i < $retryrandom; $i++) {
+
$r = q("select xchan_url from xchan left join hubloc on hubloc_hash = xchan_hash where hubloc_connected > %s - interval %s order by $randfunc limit 1",
db_utcnow(), db_quoteinterval('30 day')
);