ソースを参照

Resubmit all profiles on directory change

tags/3.5.2
Michael 3年前
コミット
47fd9226c3
2個のファイルの変更25行の追加5行の削除
  1. +19
    -4
      include/directory.php
  2. +6
    -1
      mod/admin.php

+ 19
- 4
include/directory.php ファイルの表示

@@ -2,16 +2,17 @@
use \Friendica\Core\Config;

function directory_run(&$argv, &$argc){
if ($argc != 2) {
return;
}

$dir = get_config('system', 'directory');

if (!strlen($dir)) {
return;
}

if ($argc < 2) {
directory_update_all();
return;
}

$dir .= "/submit";

$arr = array('url' => $argv[1]);
@@ -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']);
}
}
}

+ 6
- 1
mod/admin.php ファイルの表示

@@ -668,6 +668,12 @@ function admin_page_site_post(App $a) {
$worker_fastlane = ((x($_POST,'worker_fastlane')) ? True : False);
$worker_frontend = ((x($_POST,'worker_frontend')) ? True : False);

// Has the directory url changed? If yes, then resubmit the existing profiles there
if ($global_directory != Config::get('system', 'directory') AND ($global_directory != '')) {
Config::set('system', 'directory', $global_directory);
proc_run(PRIORITY_LOW, 'include/directory.php');
}

if ($a->get_path() != "") {
$diaspora_enabled = false;
}
@@ -771,7 +777,6 @@ function admin_page_site_post(App $a) {
set_config('system', 'allowed_email', $allowed_email);
set_config('system', 'block_public', $block_public);
set_config('system', 'publish_all', $force_publish);
set_config('system', 'directory', $global_directory);
set_config('system', 'thread_allow', $thread_allow);
set_config('system', 'newuser_private', $newuser_private);
set_config('system', 'enotify_no_content', $enotify_no_content);


読み込み中…
キャンセル
保存