From: Melanie Gauthier of trisotech.com
Date: Fri, 11 Mar 2011 16:44:29 -0500
To: Gideon Greenspan [edited by me]


[...snip...]


You'll find all the modified files in order to integrate external categories and external tags for auto-completion. It is a lot of files, but most of them have small modifications. The major changes is the qa-app-categories.php which is used instead of directly going with qa-db-selects. The other major change (though it has only limited impact on code) is that that I've prevented categories modifications once the external one are used. For tags, the changes are a lot lighter since the integration isn't as deep. I've simply added a qa-external-tags that returns a list of tags and those are only uses to suggest auto-completion tags to user. All remaining tags functionalities stays the same. I've put comments everywhere that I made changes (START OF MODIFICATIONS/END OF MODIFICATIONS).

 

Here's some instructions to make that work that could be used on your website:

 

Installation instruction:

Unzip Question2Answer 1.3.1

Unzip this archive at the same location

Configure external categories and tags if desired (see Using external categories and Using external tags)

Proceed as usual

 

Using external categories

In config.php, change  define('QA_EXTERNAL_CATEGORIES', false); to  define('QA_EXTERNAL_CATEGORIES', true);  and  define('QA_EXTERNAL_CATEGORIES_USE_QCOUNT ', false); to  define('QA_EXTERNAL_CATEGORIES_USE_QCOUNT',true); if you can provide a question count for each categories. You can also changes the value of define('QA_AVERAGE_QCOUNT_BY_CATEGORY', 10); for a value closer to your site.

Next, modifiy qa-external-categories.php to define the type of the category id field and move it from qa-external-example to a folder named qa-external. You can modified the remainning of that file to fetch your categories now or after the data base has been created following the instruction in the comments. You will be notified each time an item is assigned to a category in the method qa_ifcategory_qcount_update which you may decide to implement or not.

 

Using external tags

External tags are used to propose auto-completion to users. To enable that feature, change define('QA_PROPOSE_EXTERNAL_TAGS', false); to define('QA_PROPOSE_EXTERNAL_TAGS', true);. Next, you'll have to move qa-external-tags.php to qa-external folder. Modify the function “qa_get_external_tags” to return your tags that will be suggest to users. Everytime questions are created or modified, you'll be notified in qa_tags_assigned($tags) with the list of tags that are related to the current post. You may implement this method to keep track of tags.