X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdirectory.php;h=e507a939f8cd36ef37e3ed7cceec44bd49253b99;hb=ce866ad39beee9bc0fa856152c21ea745da5ee81;hp=aed700fa8ac2ac593ad9f10a1e0b506bdf6865e5;hpb=e03a5ec76172bc007dd25068c0f162cc42ad4234;p=friendica.git diff --git a/include/directory.php b/include/directory.php index aed700fa8a..e507a939f8 100644 --- a/include/directory.php +++ b/include/directory.php @@ -1,51 +1,43 @@ set_baseurl(get_config('system','url')); - - $dir = get_config('system','directory_submit_url'); - - if(! strlen($dir)) - return; + $dir .= "/submit"; $arr = array('url' => $argv[1]); 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']); + } + } }