Bạn được Mục Cẩn mời tham gia diễn đàn viết bài kiếm tiền VNO, bấm vào đây để đăng ký.

Admin

Nothing to lose.. your love to win..
23,180 ❤︎ Bài viết: 4177 Tìm chủ đề
43241 2
Mặc định diễn đàn Xenforo giới hạn 140 ký tự tin nhắn vào profile thành viên.

Viết nhiều quá sẽ báo lỗi: Please enter a message with no more than 140 characters.

QSBg0ph.png


Cách fix:

Bước 1: Mở file library/XenForo/DataWriter/DiscussionMessage/ProfilePost.php

Bước 2: Tìm & sửa $maxLength = 140; bằng số ký tự bạn muốn giới hạn trong tin nhắn

Mã:
protected function _messagePreSave()
    {
        if ($this->get('user_id') == $this->get('profile_user_id') && $this->isChanged('message'))
        {
            // statuses are more limited than other posts
            $message = $this->get('message');
            $maxLength = 140;
            $message = preg_replace('/\r?\n/', ' ', $message);
            if (utf8_strlen($message) > $maxLength)
            {
                $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
            }
            $this->set('message', $message);
        }
    }


Bước 3: Mở file xenforo.js tìm this.charLimit và thay thế 140 bằng số ký tự giới hạn mới.
 
Chỉnh sửa cuối:
Từ khóa: Sửa

Những người đang xem chủ đề này

Xu hướng nội dung

Back