<commit_before><?php
class Member extends Base
{
    public function __construct()
    {
        parent::__construct();
    }

    public function home($username)
    {
        if ($this->model->User->validateUser('username', $username)) {
            $user_id = $this->model->User->getUserId('username', $username);
            $recent_activity = $this->model->User->getRecentActivity($user_id);
            $comment_keys = array_keys($recent_activity['comment']);
            $comment_last_key = end($comment_keys);
            $this->view->assign('username', $username)->assign('comment_last_key', $comment_last_key)->assign('recent_comments', $recent_activity['comment'])->assign('recent_topics', $recent_activity['topic'])->display();
        } else {
            $this->response->setStatus(404);
            $this->view->display('Member/memberNotFound');
        }
    }

    public function viewMemberComment($username)
    {
        if ($this->model->User->validateUser('username', $username)) {
            $user_id = $this->model->User->getUserId('username', $username);
            $member_comment_count = $this->model->User->getUserCommentCount($user_id);
            $pagination_rows = 6;
            $page_rows = ceil($member_comment_count / $pagination_rows);
            $p = $this->request->input('get.p');
            if (!is_numeric($p) || $p < 1 || $p > $page_rows) {
                $p = '';
            }
            $current_page = empty($p) ? 1 : $p;
            $member_comment = $this->model->Comment->getUserComment($user_id, $current_page, $pagination_rows);
            $comment_keys = array_keys($member_comment);<commit_msg>修复个人记录里评论提醒显示不正确的bug<commit_after><?php
class Member extends Base
{
    public function __construct()
    {
        parent::__construct();
    }

    public function home($username)
    {
        if ($this->model->User->validateUser('username', $username)) {
            $user_id = $this->model->User->getUserId('username', $username);
            $recent_activity = $this->model->User->getRecentActivity($user_id);
            foreach ($recent_activity['comment'] as $key => $value) {
                $recent_activity['comment'][$key] = preg_replace('/@%([a-z0-9]+)%/i', '@<a href="' . $this->route->url('member/' . '$1') . '" title="$1">$1</a>', $value);
            }
            $comment_keys = array_keys($recent_activity['comment']);
            $comment_last_key = end($comment_keys);
            $this->view->assign('username', $username)->assign('comment_last_key', $comment_last_key)->assign('recent_comments', $recent_activity['comment'])->assign('recent_topics', $recent_activity['topic'])->display();
        } else {
            $this->response->setStatus(404);
            $this->view->display('Member/memberNotFound');
        }
    }

    public function viewMemberComment($username)
    {
        if ($this->model->User->validateUser('username', $username)) {
            $user_id = $this->model->User->getUserId('username', $username);
            $member_comment_count = $this->model->User->getUserCommentCount($user_id);
            $pagination_rows = 6;
            $page_rows = ceil($member_comment_count / $pagination_rows);
            $p = $this->request->input('get.p');
            if (!is_numeric($p) || $p < 1 || $p > $page_rows) {
                $p = '';
            }
            $current_page = empty($p) ? 1 : $p;
            $member_comment = $this->model->Comment->getUserComment($user_id, $current_page, $pagination_rows);
            $comment_keys = array_keys($member_comment);
{'fraction_non_alphanumeric': 0.1769316909294513, 'fraction_numerical': 0.004759238521836506, 'mean_word_length': 2.829581993569132, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 76, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4007852', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1047, 'n_words': 146}