Hướng Dẫn Tăng Giới Hạn Tin Nhắn Profile Thành Viên Xenforo

Thảo luận trong 'Website' bắt đầu bởi Admin, 8 Tháng bảy 2016.

  1. Admin Nothing to lose.. your love to win..

    Bài viết:
    4,094
    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.

    [​IMG]

    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: 17 Tháng mười hai 2018
  2. Đăng ký Binance
Từ Khóa:
Trả lời qua Facebook
Đang tải...