Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
617 views
in Q2A Core by
where is the configurations in the code that define the max length of the characters of the name of the categories?

and what defines that setup on the title value on table in the database?

thanks
by
that is because when i try import to other web host , phpmyadmin showed errors related to the lenght of the tile items.
on the other host i increase varchar but nothing show different.

1 Answer

+1 vote
by
selected by
 
Best answer

The length of category names is limited by the size of the title field in the respective database table:

MariaDB [dbname]> describe qa_categories;
+------------+----------------------+------+-----+---------+----------------+
| Field      | Type                 | Null | Key | Default | Extra          |
+------------+----------------------+------+-----+---------+----------------+
| categoryid | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| parentid   | int(10) unsigned     | YES  | MUL | NULL    |                |
| title      | varchar(80)          | NO   |     | NULL    |                |
| tags       | varchar(200)         | NO   |     | NULL    |                |
| content    | varchar(800)         | NO   |     |         |                |
| qcount     | int(10) unsigned     | NO   |     | 0       |                |
| position   | smallint(5) unsigned | NO   |     | NULL    |                |
| backpath   | varchar(804)         | NO   | MUL |         |                |
+------------+----------------------+------+-----+---------+----------------+

The size limit is set when the table is created and the value for the limit is defined in qa-include/db/maxima.php:

$maximaDefaults = array(
  ...
  'QA_DB_MAX_CAT_PAGE_TITLE_LENGTH' => 80,
  ...
};

...