mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 14:23:57 -07:00
Function update_atom
Переходим на использование функции для минимизации кода.
This commit is contained in:
parent
5874e3383e
commit
1969c6c57e
3 changed files with 13 additions and 15 deletions
|
@ -59,10 +59,7 @@ switch($this->request['type'])
|
|||
post_delete($post_id);
|
||||
|
||||
// Update user atom feed
|
||||
require_once(INC_DIR .'functions_atom.php');
|
||||
$topic_id = (int) $this->request['topic_id'];
|
||||
$topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster');
|
||||
update_user_feed($topic_poster, get_username($topic_poster));
|
||||
update_atom((int) $this->request['topic_id']);
|
||||
|
||||
$this->response['hide'] = true;
|
||||
$this->response['post_id'] = $post_id;
|
||||
|
@ -166,10 +163,7 @@ switch($this->request['type'])
|
|||
else $this->ajax_die($lang['EMPTY_MESSAGE']);
|
||||
|
||||
// Update user atom feed
|
||||
require_once(INC_DIR .'functions_atom.php');
|
||||
$topic_id = (int) $this->request['topic_id'];
|
||||
$topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster');
|
||||
update_user_feed($topic_poster, get_username($topic_poster));
|
||||
update_atom((int) $this->request['topic_id']);
|
||||
|
||||
$this->response['html'] = bbcode2html($text);
|
||||
}
|
||||
|
@ -323,10 +317,7 @@ switch($this->request['type'])
|
|||
}
|
||||
|
||||
// Update user atom feed
|
||||
require_once(INC_DIR .'functions_atom.php');
|
||||
$topic_id = (int) $this->request['topic_id'];
|
||||
$topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster');
|
||||
update_user_feed($topic_poster, get_username($topic_poster));
|
||||
update_atom((int) $this->request['topic_id']);
|
||||
|
||||
$this->response['redirect'] = make_url(POST_URL . "$post_id#$post_id");
|
||||
break;
|
||||
|
|
|
@ -2836,4 +2836,13 @@ function is_gold ($type)
|
|||
}
|
||||
|
||||
return $is_gold;
|
||||
}
|
||||
|
||||
function update_atom ($topic_id)
|
||||
{
|
||||
require_once(INC_DIR .'functions_atom.php');
|
||||
|
||||
// Update user atom feed
|
||||
$topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster');
|
||||
update_user_feed($topic_poster, get_username($topic_poster));
|
||||
}
|
|
@ -445,9 +445,7 @@ elseif ( ($submit || $confirm) && !$topic_has_new_posts )
|
|||
}
|
||||
|
||||
// Update user atom feed
|
||||
require_once(INC_DIR .'functions_atom.php');
|
||||
$topic_poster = (int) DB()->fetch_row("SELECT topic_poster FROM ". BB_TOPICS ." WHERE topic_id = $topic_id LIMIT 1", 'topic_poster');
|
||||
update_user_feed($topic_poster, get_username($topic_poster));
|
||||
update_atom($topic_id);
|
||||
|
||||
if ($mode == 'reply' && $post_info['topic_status'] == TOPIC_LOCKED)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue