Help Xin cách làm tăng số ký tự của chuyên mục

ntzthanh

Sergeant
Tham gia
07/08/2015
Bài viết
405
Được Like
130
Em tạo chuyên mục , có nhiều chuyên mục rất dài , mà ký tự chuyên mục bị giới hạn ở 50 ký tự . Có cách nào làm tăng số ký tự của chuyên mục lên không ạ , em xin cảm ơn .
 

PhuongBinzz

Moderator
Thành viên BQT
Tham gia
21/07/2016
Bài viết
1,194
Được Like
443
First off, I would always recommend that if you can't write file edits for yourself, don't use file edits. Same goes for queries.

That said if you have a clone of your site to test things on....


Do both bullets:

  • MySQL Query:

Mã:
ALTER TABLE `xf_node` MODIFY title varchar(100), MODIFY node_name varchar(100);

- - - - - - - - - - - - - - - - - - - - - - - - - - - -

  • File Edit:

library/XenForo/DataWriter/Node.php
@ line: 59

Find:​
PHP:
  'title'              => array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 50,


Replace/Edit: ('maxLength' => NUMERIC_VALUE)
PHP:
  'title'              => array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 100,



@ line: 62
Find:​
PHP:
  'node_name'          => array('type' => self::TYPE_STRING, 'default' => null, 'verification' => array('$this', '_verifyNodeName'), 'maxLength' => 50),

Replace/Edit: ('maxLength' => NUMERIC_VALUE)
PHP:
  'node_name'          => array('type' => self::TYPE_STRING, 'default' => null, 'verification' => array('$this', '_verifyNodeName'), 'maxLength' => 100),


I have not tested it through an upgrade but when you do update xf you will have to redo the file edit with the possibility of having to redo the query as well (not sure if XF upgrades touch that).​
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mobile/Zalo: 0906081284

Telegram: anhanhxf

Chỉ nhận web nội dung lành mạnh

Nhà Tài Trợ

Mút Xốp Không Gian
Mút Sofa Không Gian
Top Bottom