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

ntzthanh

MasterCorporal
Tham gia
07/08/2015
Bài viết
399
Được Like
129
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 .
 

ntzthanh

MasterCorporal
Tham gia
07/08/2015
Bài viết
399
Được Like
129
Lên top để mọi người giúp
 

PhuongBinzz

Moderator
Thành viên BQT
Tham gia
21/07/2016
Bài viết
1,159
Được Like
429
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

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom