Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
in Plugins by
hello guys, i want to create new variable as qa_opt('site_titlex') and this will be "test forum forum home page title"
Q2A version: 1.8

1 Answer

+1 vote

The function qa_opt() can be used for both setting and getting an option value.

qa_opt('site_titlex', 'test forum ...')  # set value
$var = qa_opt('site_titlex')             # get value

Options are stored in the database table qa_options:

MariaDB [db]> describe qa_options;
| Field   | Type           | Null | Key | Default | Extra |
| title   | varchar(40)    | NO   | PRI | NULL    |       |
| content | varchar(12000) | NO   |     | NULL    |       |
2 rows in set (0.01 sec)

so you could also manually add an option to the database

INSERT INTO qa_options VALUES ('site_titlex', 'test forum ...');

and then just use qa_opt('site_titlex') in Q2A.

Welcome to the Q&A site for Question2Answer.

If you have a question about Q2A, please ask here, in English.

To report a bug, please create a new issue on Github or ask a question here with the bug tag.

If you just want to try Q2A, please use the demo site.