Правка ссылок сообщений от бота git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@479 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2012-12-04 18:13:26 +00:00
commit 396873606a
5 changed files with 23 additions and 22 deletions

View file

@ -319,7 +319,7 @@ class ajax_common
}
DB()->query("UPDATE ". BB_USERS ." SET user_rank = $rank_id WHERE user_id = $user_id LIMIT 1");
cache_rm_user_sessions($user_id);
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> '. $ranks[$rank_id]['rank_title'] .'</b>' : $lang['SHOT_RANK'];
@ -451,7 +451,7 @@ class ajax_common
function post_mod_comment ()
{
global $lang, $user;
global $lang, $userdata;
$post_id = (int) $this->request['post_id'];
$post = DB()->fetch_row("SELECT t.*, f.*, p.*, pt.post_text
@ -466,12 +466,12 @@ class ajax_common
$text = (string) $this->request['mc_text'];
$text = prepare_message($text);
if (!$text) $this->ajax_die('no text');
DB()->query("UPDATE ". BB_POSTS ." SET post_mod_comment = '". DB()->escape($text) ."', post_mod_comment_type = $type, post_mc_mod_id = ". $user->id .", post_mc_mod_name = '". $user->data['username'] ."' WHERE post_id = $post_id LIMIT 1");
DB()->query("UPDATE ". BB_POSTS ." SET post_mod_comment = '". DB()->escape($text) ."', post_mod_comment_type = $type, post_mc_mod_id = ". $userdata['user_id'] .", post_mc_mod_name = '". $userdata['username'] ."' WHERE post_id = $post_id LIMIT 1");
$this->response['type'] = $type;
$this->response['post_id'] = $post_id;
if ($type == 0) $this->response['html'] = '';
else if ($type == 1) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1C">K</td><td class="mcTd2C"><a href="profile.php?mode=viewprofile&u='. $user->id .'">'. $user->data['username'] .'</a> '. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
else if ($type == 2) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1W">!</td><td class="mcTd2W"><a href="profile.php?mode=viewprofile&u='. $user->id .'">'. $user->data['username'] .'</a> '. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
else if ($type == 1) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1C">K</td><td class="mcTd2C">'. profile_url($userdata) .'&nbsp;'. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
else if ($type == 2) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1W">!</td><td class="mcTd2W">'. profile_url($userdata) .'&nbsp;'. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
}
function view_post ()
@ -518,7 +518,7 @@ class ajax_common
{
require(AJAX_DIR .'topic_tpl.php');
}
function index_data()
{
require(AJAX_DIR .'index_data.php');

View file

@ -95,18 +95,20 @@ switch($mode)
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);
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", TIMENOW)."##############################\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", "##############################".date("H:i:s", TIMENOW)."##############################\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['indexer'] = '<span class="seed bold">'. $lang['INDEXER'] ."</span>";
break;
}
$this->response['mode'] = $mode;

View file

@ -663,14 +663,14 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new
}
if (!$forum_names) return;
$post_text = sprintf($lang['BOT_TOPIC_MOVED_FROM_TO'], "<a class=\"gen\" href=\"viewforum.php?f=$old_forum_id\">$forum_names[$old_forum_id]</a>", "<a class=\"gen\" href=\"viewforum.php?f=$forum_id\">$forum_names[$forum_id]</a>", profile_url($userdata));
$post_text = sprintf($lang['BOT_TOPIC_MOVED_FROM_TO'], '[url='. make_url(FORUM_URL . $old_forum_id) .']'. $forum_names[$old_forum_id] .'[/url]', '[url='. make_url(FORUM_URL . $forum_id) .']'. $forum_names[$forum_id] .'[/url]', profile_url($userdata));
$poster_id = BOT_UID;
$poster_ip = '7f000001';
}
else if ($mode == 'after_split_to_old')
{
$post_text = sprintf($lang['BOT_MESS_SPLITS'], "<a class=\"gen\" href=\"viewtopic.php?t=$new_topic_id\">". htmlCHR($new_topic_title) ."</a>", profile_url($userdata));
$post_text = sprintf($lang['BOT_MESS_SPLITS'], '[url='. make_url(TOPIC_URL . $new_topic_id) .']'. htmlCHR($new_topic_title) .'[/url]', profile_url($userdata));
$poster_id = BOT_UID;
$poster_ip = '7f000001';
@ -684,10 +684,9 @@ function insert_post ($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new
if ($row = DB()->fetch_row($sql))
{
$old_topic_title = $row['topic_title'];
$post_time = $row['post_time'] - 1;
$post_text = sprintf($lang['BOT_TOPIC_SPLITS'], "<a class=\"gen\" href=\"viewtopic.php?t=$old_topic_id\">$old_topic_title</a>", profile_url($userdata));
$post_text = sprintf($lang['BOT_TOPIC_SPLITS'], '[url='. make_url(TOPIC_URL . $old_topic_id) .']'. $row['topic_title'] .'[/url]', profile_url($userdata));
$poster_id = BOT_UID;
$poster_ip = '7f000001';

View file

@ -1,5 +1,5 @@
<?php
$lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Topic has been moved from forum <b>%s</b> to forum <b>%s</b><br /><br />%s';
$lang['BOT_MESS_SPLITS'] = 'Topic has been split. New topic - <b>%s</b><br /><br />%s';
$lang['BOT_TOPIC_SPLITS'] = 'Topic has been split from <b>%s</b><br /><br />%s';
$lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Topic has been moved from forum [b]%s[/b] to forum [b]%s[/b][br][br]%s';
$lang['BOT_MESS_SPLITS'] = 'Topic has been split. New topic - [b]%s[/b][br][br]%s';
$lang['BOT_TOPIC_SPLITS'] = 'Topic has been split from [b]%s[/b][br][br]%s';

View file

@ -1,5 +1,5 @@
<?php
$lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Топик был перенесен из форума <b>%s</b> в форум <b>%s</b><br /><br />%s';
$lang['BOT_MESS_SPLITS'] = 'Сообщения из этой темы были выделены в отдельный топик <b>%s</b><br /><br />%s';
$lang['BOT_TOPIC_SPLITS'] = 'Тема была выделена из <b>%s</b><br /><br />%s';
$lang['BOT_TOPIC_MOVED_FROM_TO'] = 'Топик был перенесен из форума [b]%s[/b] в форум [b]%s[/b][br][br]%s';
$lang['BOT_MESS_SPLITS'] = 'Сообщения из этой темы были выделены в отдельный топик [b]%s[/b][br][br]%s';
$lang['BOT_TOPIC_SPLITS'] = 'Тема была выделена из [b]%s[/b][br][br]%s';