X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdirectory.php;h=4a221fac0c3565ca2b598403e8131c0f084d7a6b;hb=d3cdfa610852f5dbda9bc3e29df6524eb504d068;hp=057c156ad7abb99b46867deef5d1dfcdd3e7f990;hpb=48209f0ecd1e61cabfbf1eb5454197974807e441;p=friendica.git diff --git a/include/directory.php b/include/directory.php index 057c156ad7..4a221fac0c 100644 --- a/include/directory.php +++ b/include/directory.php @@ -2,13 +2,14 @@ use \Friendica\Core\Config; function directory_run(&$argv, &$argc){ - if ($argc != 2) { + $dir = get_config('system', 'directory'); + + if (!strlen($dir)) { return; } - $dir = get_config('system','directory'); - - if (!strlen($dir)) { + if ($argc < 2) { + directory_update_all(); return; } @@ -24,3 +25,17 @@ function directory_run(&$argv, &$argc){ } return; } + +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']); + } + } +}