Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
1.3k views
in Q2A Core by
If I want to add special tags they are not working.

Examples:

.htaccess

.net

c++

etc...

 

how can I make them work ?
Q2A version: 1.5.4

2 Answers

+2 votes
by
selected by
 
Best answer
There's an option 'Use comma as the only tag separator' in the 'Posting' panel of the admin section. This allows all special characters in tags (except comma, of course).
by
I did not see that option.

Thank you!
+1 vote
by

Search answers of this site is your friend ;)

look in the related questions on the side bar

http://www.question2answer.org/qa/803/special-chars-are-not-accepted-in-tags

by
That link says something for version 1.2 and 2010. I have 1.5.4.

Is there an actual example or code to know how to do it ?

Can you please share that ?
by
In 1.5.4, there is a constant which is defined in "qa-util-string.php" (line 711), which by defaut is defined with the following content.

@define('QA_PREG_INDEX_WORD_SEPARATOR', '[\n\r\t\ \!\"\\\'\(\)\*\+\,\.\/\:\;\<\=\>\?\[\\\\\]\^\`\{\|\}\~]');

These are characters used as word separators as I understand it.

Say you want to be able to use tag 'C++', you then need to remove the character '+' from the word separator list, that is you need to remove it from the entries (along with the antislash escape), i.e you remove '\+'

The constant definition becomes:

@define('QA_PREG_INDEX_WORD_SEPARATOR', '[\n\r\t\ \!\"\\\'\(\)\*\,\.\/\:\;\<\=\>\?\[\\\\\]\^\`\{\|\}\~]');

Same applies to the dot character if you need it for '.htacces'

I would remove characters only when needed and cautiosly though.
by
Thank you yves, that really helped.
by
I have to remove them in QA_PREG_INDEX_WORD_SEPARATOR and QA_PREG_BLOCK_WORD_SEPARATOR right ?
by
QA_PREG_INDEX_WORD_SEPARATOR seems to be enough for the tags to show up in questions with the special character.
The less the tweak the better.
I would only modify this one unless you find out in the future that tags don't show up as you expect elsewhere
by
Thank you ! :)
by
In the admin panel I have access to settings
- Maximum number of tags:
But I do not have access to a set
- Maximum number of characters in the tags
 
The default is 800 characters in question.
I want to increase this number. how can I do this?
Tags are saved to the db table qa_posts the column (tags varchar (800). However increase of 800 does not work.
The database localhost "information_schema" COLUMNS is a record:
qa_widgets - tags - 4 - NULL - NO - varchar - 800 - 800 - null - null - ascii - ascii_general_ci - varchar (800),
who probably defines the maximum number of characters, but I can not change that.
...