<?php
/*
Plugin Name: CM Answers
Plugin URI: https://www.cminds.com/cm-answer-store-page-content/
Description: Allow users to post questions and answers (Q&A) in a stackoverflow style forum which is easy to use and install. Easy social integration & Customization
Author: CreativeMindsSolutions
Version: 3.4.2

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

add_action( 'init', function () {
    load_plugin_textdomain(
        'cm-answers',
        false,
        dirname( plugin_basename( __FILE__ ) ) . '/lang'
    );
} );

if (version_compare('5.3', phpversion(), '>')) {
	die(sprintf(__('We are sorry, but you need to have at least PHP 5.3 to run this plugin (currently installed version: %s) - please upgrade or contact your system administrator.'), phpversion()));
}

//Define constants
define('CMA_PREFIX', 'CMA_');
define('CMA_PATH', WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__)));
define('CMA_URL', plugins_url('', __FILE__));
define('CMA_RESOURCE_URL', CMA_URL.'/views/resources/');
define('CMA_PLUGIN_FILE', __FILE__);
/* AJAX check  */
define('CMA_AJAX', !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' || !empty($_REQUEST['ajax']));

//Init the plugin
require_once CMA_PATH . '/lib/CMA.php';
include_once CMA_PATH . '/lib/models/AnswerThread.php';
include_once CMA_PATH . '/lib/controllers/BaseController.php';
require_once CMA_PATH . '/lib/controllers/AnswerController.php';
require_once CMA_PATH . '/lib/models/Labels.php';
require_once CMA_PATH . '/lib/models/Settings.php';
require_once CMA_PATH . '/lib/models/Answer.php';
require_once CMA_PATH . '/lib/models/Category.php';
require_once CMA_PATH . '/lib/helpers/BuddyPress.php';
require_once CMA_PATH . '/lib/helpers/storage.php';
require_once CMA_PATH . '/package/cminds-free.php';
require_once CMA_PATH . '/wizard/wizard.php';
register_activation_hook(__FILE__, array('CMA', 'install'));
//register_deactivation_hook( __FILE__, array('CMA', 'deactivate'));
//register_uninstall_hook(__FILE__, array('CMA', 'uninstall'));
add_filter('doing_it_wrong_trigger_error',function($trigger,$function){if($function==='_load_textdomain_just_in_time'){return false;}return $trigger;},10,2);
CMA::init();