Skip to content
Browse files

fixing

  • Loading branch information...
1 parent a868807 commit 2d4fed8ef93f3ac98902d64ffa2899510c563092 @NoahY committed Apr 16, 2012
Showing with 35 additions and 14 deletions.
  1. +1 −1 README.rst
  2. +12 −12 qa-expert-admin.php
  3. +0 −1 qa-expert-check.php
  4. +11 −0 qa-expert-layer.php
  5. +11 −0 qa-expert-overrides.php
View
2 README.rst
@@ -25,7 +25,7 @@ Installation
#. Get the source code for this plugin from github_, either using git_, or downloading directly:
- To download using git, install git and then type
- ``git clone git://github.com/NoahY/q2a-expert-questions.git poll``
+ ``git clone git://github.com/NoahY/q2a-expert-questions.git expert``
at the command prompt (on Linux, Windows is a bit different)
- To download directly, go to the `project page`_ and click **Download**
View
24 qa-expert-admin.php
@@ -60,17 +60,17 @@ function admin_form(&$qa_content)
$ok = null;
if (qa_clicked('expert_question_save')) {
- qa_db_query_sub(
- 'CREATE TABLE IF NOT EXISTS ^postmeta (
- meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
- post_id bigint(20) unsigned NOT NULL,
- meta_key varchar(255) DEFAULT \'\',
- meta_value longtext,
- PRIMARY KEY (meta_id),
- KEY post_id (post_id),
- KEY meta_key (meta_key)
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8'
- );
+ qa_db_query_sub(
+ 'CREATE TABLE IF NOT EXISTS ^postmeta (
+ meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ post_id bigint(20) unsigned NOT NULL,
+ meta_key varchar(255) DEFAULT \'\',
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY post_id (post_id),
+ KEY meta_key (meta_key)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8'
+ );
qa_opt('expert_question_enable',(bool)qa_post_text('expert_question_enable'));
qa_opt('expert_question_disable_voting',(bool)qa_post_text('expert_question_disable_voting'));
qa_opt('expert_question_type',qa_post_text('expert_question_type'));
@@ -129,7 +129,7 @@ function admin_form(&$qa_content)
$fields[] = array(
'id' => 'expert_question_type',
'label' => 'Type of questions to consider expert',
- 'tags' => 'NAME="expert_question_type" ID="expert_question_roles"',
+ 'tags' => 'NAME="expert_question_type" ID="expert_question_type"',
'type' => 'select',
'options' => $question_types,
'value' => @$question_types[qa_opt('expert_question_type')],
View
1 qa-expert-check.php
@@ -7,7 +7,6 @@ function process_event($event, $userid, $handle, $cookieid, $params) {
case 'q_post':
if(qa_post_text('is_expert_question') == 'yes' || (in_array(qa_opt('expert_question_type'),array(1,2)) && !qa_get_logged_in_userid()) || qa_opt('expert_question_type') == 3) {
require_once QA_INCLUDE_DIR.'qa-app-post-update.php';
- qa_error_log($params);
qa_question_set_hidden($params, true, $userid, $handle, $cookieid, array(), array());
qa_db_query_sub(
View
11 qa-expert-layer.php
@@ -385,6 +385,17 @@ function expert_question_form() {
}
function get_expert_question_for_user($uid) {
+ qa_db_query_sub(
+ 'CREATE TABLE IF NOT EXISTS ^postmeta (
+ meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ post_id bigint(20) unsigned NOT NULL,
+ meta_key varchar(255) DEFAULT \'\',
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY post_id (post_id),
+ KEY meta_key (meta_key)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8'
+ );
$questions = qa_db_read_all_values(
qa_db_query_sub(
"SELECT ^posts.postid FROM ^postmeta, ^posts WHERE ^postmeta.meta_key='is_expert_question' AND ^postmeta.post_id=^posts.postid AND ^posts.userid=#",
View
11 qa-expert-overrides.php
@@ -8,6 +8,17 @@ function qa_get_permit_options() {
function qa_page_q_post_rules($post, $parentpost=null, $siblingposts=null, $childposts=null) {
$rules = qa_page_q_post_rules_base($post, $parentpost, $siblingposts, $childposts);
+ qa_db_query_sub(
+ 'CREATE TABLE IF NOT EXISTS ^postmeta (
+ meta_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ post_id bigint(20) unsigned NOT NULL,
+ meta_key varchar(255) DEFAULT \'\',
+ meta_value longtext,
+ PRIMARY KEY (meta_id),
+ KEY post_id (post_id),
+ KEY meta_key (meta_key)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8'
+ );
$expert = qa_db_read_one_value(
qa_db_query_sub(
"SELECT meta_value FROM ^postmeta WHERE meta_key='is_expert_question' AND post_id=#",

0 comments on commit 2d4fed8

Please sign in to comment.
Something went wrong with that request. Please try again.