I am currently unable to answer support quries

I am currently (untill september) unable to answer support quries because of other commitments.

Posted in Uncategorized | Comments Off

Capabilities for questions

I recently added a user capabilities feature into the plugin. However, in doing so I broke the plugin for people who didn’t have their installation set up to use capabilities of the type “question” and since I only announced this in a reply to a forum post this was most users.

I have now fixed this issue so that the plugin works once again :) . However if you want to give questions their own capabilities you can edit the global variable in the config.php file in the plugins directory. Do so will change the capability type for the the custom post type from “post” to whatever you define giving you greater control over the plugin and allowing you to make use of even more of the great features in wordpress!

Posted in Features, Updates | Comments Off

Sport Relief

Nothing to do with the plugin but I’ve run 6 miles for sport relief so it would be great if you could sponsor me and give to this great cause.

https://my.sportrelief.com/sponsor/davidwoodford

Thanks

Posted in Uncategorized | Comments Off

Create a question list sidebar widget

Several people have requested a widget that they can place in the side bar which displays the “question list”. I plan to include this in the next update but if you want to use it before then here is what you need to do.

First you need to find somewhere to add the code. You can do this in the plugin say before the closing ?> in questions.php or you can put it in the functions.php file in your theme.

We first need to register a new siderbar widget. The code I’m using for that is

add_action('plugins_loaded','qanda_plugins_loaded');
function qanda_plugins_loaded(){
register_sidebar_widget('Recent Questions', 'qanda_recent_questions_widget');
}

This means that after the plugins are loaded a new siderbar widget called “Recent Questions” will be registered. When this widget is to be displayed the function qanda_recent_questions_widget will be called. Next we need to define this function. To do this add the following code:

function qanda_recent_questions_widget($args){
extract($args);
echo $before_widget . $before_title;
echo "Recent Questions";
echo $after_title;
$atts['questions'] = 5;
echo q_list_questions($atts,"");
echo $after_widget;
}

This uses the function q_list_questions which generates the output for the list_questions shortcode but calls it in a way which means it can be used as a widget.

Now all the coding is done. You just need to go into the widgets page in the wordpress admin and add the widget to your side bar.

The complete code you need to add is

add_action('plugins_loaded','qanda_plugins_loaded');
function qanda_plugins_loaded(){
register_sidebar_widget('Recent Questions', 'qanda_recent_questions_widget');
}
function qanda_recent_questions_widget($args){
extract($args);
echo $before_widget . $before_title;
echo "Recent Questions";
echo $after_title;

$atts['questions'] = 5;
echo q_list_questions($atts,"");
echo $after_widget;
}


which you can place before the last ?> in questions.php in the plugins folder or in functions.php in your theme.

Posted in Docs, Tutorials | Tagged , , | Comments Off

WordPress 3.3 Compatibility

WordPress 3.3 is out and it looks great. I have tested most of the features of the plugin with the new version and haven’t found anything which doesn’t work which is great.

However, your installation and uses will be different from mine so there may be problems I haven’t yet found. If you find any please ask questions under the “bugs” category in the support forum or email me directly from inside the plugin.

Posted in Docs, Help | 3 Comments

Update version 2.1.2

Version 2.1.2 contains two minor changes that deal with two errors that have been occurring since the most recent release. Continue reading

Posted in Docs, Updates | Comments Off

Version 2.1.1 Released

This next version of the plugin adds the ability for users to leave an email address and name when asking a question (if you allow unregistered users to ask questions) so that they can be contacted when the question is answered. Most of the code for this feature was produced by Tristan Petersen (though I made a couple of tweaks so if it doesn’t work it probably because I broke it)

I have also made improvements to the backend. You can now hold questions for moderation before they are made visible on the site. If you go on the “Questions” page from the admin menu (below comments) you will be able to see all the questions that have been asked as before. Now however, questions held for moderation will have “pending” alongside them and you can use the links underneath to approve a question or mark it as spam in a similar way to a comment.

The frontend of the plugin is translated into French (by Romain Varnier), Spanish (by Gabriel Gil) and Russian (by Yuriy Petrovskiy who also helped with the internationalisation)

If you find any bugs please use the Support forum of this site or the email form in the plugin to inform me of them so I can try to fix them.

Posted in Docs, Updates | Tagged , , , | Comments Off

The Question and Answer site is back!

Sorry about the last few days and the errors the failure of the site caused on the backend of the plugin. I have now finished with unreliable free php hosting and have decided to purchase cheap but paid for shared hosting. Hopefully this will mean that the site will now stay online most of the time (no more suspended accounts) and I will also have access to the  mail php functions so the site can demonstrate the full capabilities of the plugin.

Posted in Uncategorized | Comments Off

Avoiding the answermail.php bug

A commonly occuring bug with the plugin as the moment is to get the errors

Warning: Missing argument 2 for q_answeremail_message() in /hermes/web07/b2549/moo.newmodcity/nmc/wp-content/plugins/question-and-answer-forum/answeremail.php on line 4

Warning: Missing argument 2 for q_answeremail_subject() in /hermes/web07/b2549/moo.newmodcity/nmc/wp-content/plugins/question-and-answer-forum/answeremail.php on line 18

Warning: Cannot modify header information - headers already sent

This only seems to be happening on a minority of installations and I have yet to find out what is causing it.

However it is easily disabled. The functions which cause it are those which email the author of a question if they were logged in when they asked it. If your forum isn’t set up to require users to log in then it doesn’t matter so you can simply disable the feature.

To disable it open up the answermail.php file in the plugin folder and comment out (place // at the start) or delete lines 2 and 3 ie the lines

add_filter(‘comment_notification_text’,'q_answeremail_message’);
add_filter(‘comment_notification_subject’,'q_answeremail_subject’);

Then save the file and the plugin should be working correctly although it won’t send email to question authors when they get new answers.

Posted in Help | Tagged , | Comments Off