X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdirectory.php;h=41a3dd784c0b1876807ab81a9d9e06cd83098843;hb=7f1c71c9fd2dbcc8c85c0042602766bc8767f744;hp=2ca367d369442dc1a31bed67ad81cc1f64659a7e;hpb=df28f99caa7770235ce0e4f3901c7e9a77f70478;p=friendica.git diff --git a/include/directory.php b/include/directory.php index 2ca367d369..41a3dd784c 100644 --- a/include/directory.php +++ b/include/directory.php @@ -1,36 +1,18 @@ 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 +21,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) { + proc_run(PRIORITY_LOW, 'include/directory.php', $user['url']); + } + } }