How to Increase Character Limit for Forum Nodes and Titles in Xenforo 2

Tutoriel How to Increase Character Limit for Forum Nodes and Titles in Xenforo 2

Add-on xenforo 2

Ressources et modules complémentaires pour XenForo 2

Styles xenforo 2

Styles / Thèmes et apparence pour xenforo 2

Templates xenforo 2

Codes pour modifier les templates sur xenforo 2

Section Premium

Add-on et Styles pour membre Premium
How to Increase Character Limit for Forum Nodes and Titles in Xenforo 2

Tutoriel How to Increase Character Limit for Forum Nodes and Titles in Xenforo 2

Catégorie Catégorie Tutoriel
Titre du sujet Titre du sujet How to Increase Character Limit for Forum Nodes and Titles in Xenforo 2
Auteur de la discussion Auteur de la discussion laurent68
Date de début Date de début
Réponses Réponses 0
Affichages Affichages 170
Réaction Réaction 0
Dernier message par Dernier message par laurent68

laurent68

Fondateur

Staff
fondateur
Réputation: 100%
Discussions
4 855
Messages
12 608
Solutions
85
J'aime
7 890
Points
198
Hello everyone, today I'm going to guide you on how to increase the character limit for categories and post titles in Xenforo.

By default, Xenforo only supports 50 characters for categories and 150 characters for post titles. If you exceed these limits, an error will be displayed

Oops! We ran into some problems. Please enter a value using 50 characters or fewer.

To increase the character limit, you'll need to go to phpMyAdmin, navigate to the SQL tab, and execute the following command:

SQL:
ALTER TABLE `xf_node` CHANGE COLUMN `title` `title` VARCHAR(500), CHANGE COLUMN `node_name` `node_name` VARCHAR(500);
ALTER TABLE `xf_thread` MODIFY title varchar(500);
ALTER TABLE `xf_forum` MODIFY last_thread_title varchar(500);

1.png


Go to /src/XF/Entity/Node.php
Search for
PHP:
$structure->columns = [
            'node_id' => ['type' => self::UINT, 'autoIncrement' => true, 'nullable' => true],
            'title' => ['type' => self::STR, 'maxLength' => 50,
                'required' => 'please_enter_valid_title', 'api' => true
            ],
            'node_name' => ['type' => self::STR, 'maxLength' => 50, 'nullable' => true, 'default' => null,
                'unique' => 'node_names_must_be_unique',
                'match' => self::MATCH_ALPHANUMERIC_HYPHEN,
                'api' => true
            ],

And change 50 to 500

Go to /src/XF/Entity/Thread.php

Search for:
PHP:
$structure->columns = [
            'thread_id' => ['type' => self::UINT, 'autoIncrement' => true, 'nullable' => true],
            'node_id' => ['type' => self::UINT, 'required' => true, 'api' => true],
            'title' => ['type' => self::STR, 'maxLength' => 150,
                'required' => 'please_enter_valid_title',
                'censor' => true,
                'api' => true,
            ],

And change 150 to 500.

Go to /src/XF/Entity/Forum.php
Search for:
PHP:
'last_thread_title'           => ['type' => self::STR, 'maxLength' => 150, 'default' => ''],

And change 150 to 500.
That's it, you're done!
Wishing you success!
 
Contenu similaire Les plus vues Voir plus
Retour
Haut Bas