fix random profiles

This commit is contained in:
friendica 2015-01-30 14:30:37 -08:00
parent b18fe85fb8
commit ef04d21a8f

View File

@ -587,9 +587,10 @@ function random_profile() {
$checkrandom = get_config('randprofile','check'); // False by default $checkrandom = get_config('randprofile','check'); // False by default
$retryrandom = intval(get_config('randprofile','retry')); $retryrandom = intval(get_config('randprofile','retry'));
if($retryrandom === false) $retryrandom = 5; if($retryrandom == 0) $retryrandom = 5;
for($i = 0; $i < $retryrandom; $i++) { 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", $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') db_utcnow(), db_quoteinterval('30 day')
); );