mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
r470
Reindex search from admin (sphinx) git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@470 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
371563bdd4
commit
9ecab92971
5 changed files with 25 additions and 5 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
if (!defined('IN_AJAX')) die(basename(__FILE__));
|
||||
|
||||
global $userdata, $lang;
|
||||
global $userdata, $lang, $bb_cfg;
|
||||
|
||||
$mode = (string) $this->request['mode'];
|
||||
$user_id = $this->request['user_id'];
|
||||
|
@ -93,6 +93,20 @@ switch($mode)
|
|||
|
||||
$this->response['info'] = $lang['USER_ACTIVATE_OFF'];
|
||||
break;
|
||||
case "indexer":
|
||||
exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result);
|
||||
if(!is_file($bb_cfg['sphinx_config_path'].".log")){
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "####Logger from dimka3210.####".date("H:i:s", time())."##############################\r\n\r\n\r\n\r\n", FILE_APPEND);
|
||||
}
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "##############################".date("H:i:s", time())."##############################\r\n", FILE_APPEND);
|
||||
foreach($result as $row){
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", $row."\r\n", FILE_APPEND);
|
||||
}
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "\r\n", FILE_APPEND);
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "\r\n", FILE_APPEND);
|
||||
|
||||
$this->response['indexer'] = '<span class="seed bold">'.$lang['INDEXER']."</span>";
|
||||
break;
|
||||
}
|
||||
|
||||
$this->response['mode'] = $mode;
|
||||
|
|
|
@ -56,8 +56,9 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.5 Beta';
|
||||
$bb_cfg['tp_release_state'] = 'R469';
|
||||
$bb_cfg['tp_release_date'] = '05-11-2012';
|
||||
|
||||
$bb_cfg['tp_release_date'] = '07-11-2012';
|
||||
$bb_cfg['tp_release_state'] = 'R470';
|
||||
|
||||
// Database
|
||||
$charset = 'utf8';
|
||||
|
@ -433,6 +434,7 @@ $bb_cfg['use_ajax_posts'] = true;
|
|||
$bb_cfg['search_engine_type'] = 'mysql'; // none, mysql, sphinx
|
||||
$bb_cfg['sphinx_topic_titles_host'] = '127.0.0.1';
|
||||
$bb_cfg['sphinx_topic_titles_port'] = 3312;
|
||||
$bb_cfg['sphinx_config_path'] = realpath("../install/sphinx/sphinx.conf");
|
||||
$bb_cfg['disable_ft_search_in_posts'] = false; // disable searching in post bodies
|
||||
$bb_cfg['disable_search_for_guest'] = true;
|
||||
$bb_cfg['allow_search_in_bool_mode'] = true;
|
||||
|
|
|
@ -1742,3 +1742,4 @@ $lang['PROFILE_EDIT_RETURN'] = 'Return to editing';
|
|||
$lang['PROFILE_RETURN'] = 'Go to the Profile';
|
||||
|
||||
$lang['WARNING'] = 'Warning';
|
||||
$lang['INDEXER'] = "Reindex search";
|
|
@ -1754,3 +1754,4 @@ $lang['PROFILE_EDIT_RETURN'] = 'Вернуться к редактировани
|
|||
$lang['PROFILE_RETURN'] = 'Перейти к просмотру профиля';
|
||||
|
||||
$lang['WARNING'] = 'Предупреждение';
|
||||
$lang['INDEXER'] = "Переиндексировать поиск";
|
|
@ -66,12 +66,13 @@ ajax.manage_user = function(mode) {
|
|||
ajax.exec({
|
||||
action : 'manage_user',
|
||||
mode : mode,
|
||||
user_id : '',
|
||||
user_id : ''
|
||||
});
|
||||
}
|
||||
ajax.callback.manage_user = function(data) {
|
||||
$('#cache').html(data.cache_html);
|
||||
$('#datastore').html(data.datastore_html);
|
||||
$('#indexer').html(data.indexer);
|
||||
}
|
||||
</script>
|
||||
<br />
|
||||
|
@ -88,7 +89,8 @@ ajax.callback.manage_user = function(data) {
|
|||
<tr>
|
||||
<td><b>{L_UPDATE}:</b></td>
|
||||
<td>
|
||||
<a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>
|
||||
<a href="{U_UPDATE_USER_LEVEL}">{L_USER_LEVELS}</a>,
|
||||
<!-- IF $bb_cfg['search_engine_type'] == "sphinx" --><a href="#" id="indexer" onclick="ajax.manage_user('indexer'); return false;">{L_INDEXER}</a><!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue