Add Word Count for Question2Answer – CKEditor

Are you using Question2Answer and Want your users to see how many words they have typed? Then you are at the right place.

These steps are only applicable if you are using CKEditor as on your website. If not these steps does not help you. If you are using CKEditor, keep following the steps, else post a question here. Someone would jump to help.

If you are not a programmer, the manual steps are not recommended. I have made this plugin for you, scroll directly to the bottom of this post for the download link.

1. Download the WordCount Plugin from CKEditor site

First of all you need to download word count add-on from CK Editor website. Click this link to download the plugin. If this link does not work, you can directly download from this link. Once you download the plugin, extract the plugin.

This would look somewhat like this.

2. Install the plugins to your Editor

Once you download and extract, copy the extracted folder under /qa-plugin/wysiwyg-editor/ckeditor/plugins path

3. Configure the Editor

Once you have placed the plugins, open up this file — qa-plugin/wysiwyg-editor/ckeditor/config.js
And then place below line of code, right after this line –> CKEDITOR.editorConfig = function( config ) {

It should look something like this —

Well done….

Now you have successfully activated the word count in your CK Editor.. And now if you open your editor to ask or answer a question then it would look like this –

Download This plugin

Don't want this mess? Subscribe to get this plugin for FREE

* Your email address is private and wont be sold to third parties by any means.

Thank you for reading this post. If was helpful to you, then let us know in the comment section below.

How to Hide Down votes on Your Question2Answer website

Do you own a forum and want not to discourage your users by giving them a thumb down? There is a simple way to do this.

To hide the downvotes from your end users you can do small modifications in your theme file.

Open up your theme css file and add the below few lines of code to hide the down vote buttons.

Well done. Now the Down votes wont be visible to your users.

How to Change the Home Page on your Question2Answer forum

If you want to change the home page of q2a website, you can do it very easily.

Open up the qa-config.php file and add the below lines at line number 109 as required.

If you are using blog tool plugin you can set the blogs as your home page

$QA_CONST_PATH_MAP=array(
    'blogs' => '',
);

To keep questions as home page ,

$QA_CONST_PATH_MAP=array(
    'questions' => '',
);

To keep answers as home page ,

$QA_CONST_PATH_MAP=array(
    'questions' => '',
);

To keep categories as home page ,

$QA_CONST_PATH_MAP=array(
    'categories' => '',
);

To keep tags as home page ,

$QA_CONST_PATH_MAP=array(
    'tags' => '',
);

To keep unanswered page as home page ,

$QA_CONST_PATH_MAP=array(
    'unanswered' => '',
);

To keep activity page as home page ,

$QA_CONST_PATH_MAP=array(
    'activity' => '',
);

That’s it. You are ready to go. Now when your users open the website q2awebsite.com, the configured page will appear on the front page.

If you are using Blog Tool then, you can also set the blogs as your home page.

How to set Blogs as Q2A home page

If you are using blog tool plugin you can set the blogs as your home page with just few easy steps.

Open up the qa-config.php file and add the below lines at line number 109.

$QA_CONST_PATH_MAP=array(
    'blogs' => '',
);

That’s it. You are ready to go. Now when your users open the website q2awebsite.com, the blogs will appear on the front page.

How to change Base URL of the Blog Plugin

If you wish to change the base URL from the default url ,

e.g. you wanted to change the URL from site.com/blog to site.com/note
Openup qa-plugin/blog-tool/qa-plugin.php file , line number 27 ,

How to Install Q2A Blog Plugin

  1. Download plugin and place it inside qa-plugin folder
  2. Go to admin panel , Plugins , then initialize database module
  3. Enjoy. You are done. You can see other menus in the admin section
  4. Now navigate site.com/blog/new to create a new blog, site.com/blogs to view all blogs ,
    site.com/blog/tags for all blog tags , site.com/blog/categories for all blog categories
  5. If you need any help / customization feel free to contact us .

How to remove the ‘powered by: Question2Answer’ from the footer

Though it is not recommended for doing this as you are using a free script and it is always good to give some credit to the author and also this increases the popularity of the software .

But still if you wish to do , There are several ways for doing this .

1. By an Advanced Theme

You’ll need an advanced theme. Follow the steps on that page, then override the attribution function by putting the below function in the theme file .

class qa_html_theme extends qa_html_theme_base
{
        /* Override the attribution function */
	function attribution() { /*Empty Body*/ }
}

2. Via simple core hack ( though not recommended )

  1. Open up the qa-include\qa-theme-base.php
  2. Find the attribution() function
  3. You can find the Powered By ... link there . You can change as you wish .

How to Enable comments on Questions in Q2A

Question2Answer (Q2A) default installation does not enables the comment feature on Questions .

To enable this follow the below steps .

  1. Navigate to Admin > Posting
  2. Check the check box saying “Allow comments on questions:
  3. You are done 🙂

How to change Question title to a link to the same Question

To change question’s title in the question page into a link to the same question , you can use the below function is a advanced theme .

How to remove “Deprecated: mysql_connect(): ” warning in q2a 1.6.3

If you are using the Question2Answer 1.6 or lower along side of PHP5 you might get the warning like this –

“Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /xxxx/xxxx/htdocs/qa-include/qa-db.php on line 66.” 

You can suppress this warning by following up with the below steps .

1. Open up the qa-include/qa-db.php file

2. add the below line after the licence comment (before the actual functions starts )

3. This should solve your issue .