X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdirectory.php;h=a2ccacf125d623894a374a83a2f69f494e31e279;hb=478e363967165980eb826e8d109dd15770e2c784;hp=2ca367d369442dc1a31bed67ad81cc1f64659a7e;hpb=f852f7aac0b44f243d3cd812aa92122f7b38067b;p=friendica.git diff --git a/include/directory.php b/include/directory.php index 2ca367d369..a2ccacf125 100644 --- a/include/directory.php +++ b/include/directory.php @@ -1,36 +1,19 @@ set_baseurl(get_config('system','url')); - - $dir = get_config('system','directory'); - - if(! strlen($dir)) + if ($argc < 2) { + directory_update_all(); return; + } $dir .= "/submit"; @@ -39,13 +22,23 @@ function directory_run(&$argv, &$argc){ call_hooks('globaldir_update', $arr); logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG); - if(strlen($arr['url'])) + if (strlen($arr['url'])) { fetch_url($dir . '?url=' . bin2hex($arr['url'])); + } return; } -if (array_search(__file__,get_included_files())===0){ - directory_run($_SERVER["argv"],$_SERVER["argc"]); - killme(); +function directory_update_all() { + $r = q("SELECT `url` FROM `contact` + INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid` + INNER JOIN `user` ON `user`.`uid` = `contact`.`uid` + WHERE `contact`.`self` AND `profile`.`net-publish` AND `profile`.`is-default` AND + NOT `user`.`account_expired` AND `user`.`verified`"); + + if (dbm::is_result($r)) { + foreach ($r AS $user) { + Worker::add(PRIORITY_LOW, 'directory', $user['url']); + } + } }