Exemplo n.º 1
0
define('Q_THEME_DIR', QA_THEME_DIR . '/dude');
qa_register_plugin_module('event', 'inc/init.php', 'qw_init', 'QW Init');
qa_register_plugin_module('event', 'inc/cs-event-logger.php', 'qw_event_logger', 'QW Event Logger');
qa_register_plugin_module('event', 'inc/cs-user-events.php', 'qw_user_event_logger', 'QW User Event Logger');
// register plugin language
qa_register_plugin_phrases('language/dude-lang-*.php', 'dude');
qa_register_plugin_module('module', 'ra-option-admin.php', 'ra_option_admin', 'ra_theme_option');
qa_register_plugin_layer('ra-option-layer.php', 'RA Option Layer');
//load all addons
qw_load_addons();
//register addons language
if (qw_hook_exist('register_language')) {
    $lang_file_array = qw_apply_filter('register_language', array());
    if (isset($lang_file_array) && is_array($lang_file_array)) {
        foreach ($lang_file_array as $key => $file) {
            qa_register_phrases($file, $key);
        }
    }
}
function get_base_url()
{
    /* First we need to get the protocol the website is using */
    $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
    $root = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']);
    if (substr($root, -1) == '/') {
        $root = substr($root, 0, -1);
    }
    $base = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, rtrim(QA_BASE_DIR, '/'));
    /* Returns localhost OR mysite.com */
    $host = $_SERVER['HTTP_HOST'];
    $url = $protocol . rtrim($host, '/') . '/' . str_replace($root, '', $base);
Exemplo n.º 2
0
function qa_register_plugin_phrases($pattern, $name)
{
    global $qa_plugin_directory, $qa_plugin_urltoroot;
    if (empty($qa_plugin_directory) || empty($qa_plugin_urltoroot)) {
        qa_fatal_error('qa_register_plugin_phrases() can only be called from a plugin qa-plugin.php file');
    }
    qa_register_phrases($qa_plugin_directory . $pattern, $name);
}
Exemplo n.º 3
0
if ($debug) {
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
} else {
    error_reporting(0);
    @ini_set('display_errors', 0);
}
function get_base_url()
{
    return qa_opt('site_url');
}
define('Q_THEME_DIR', dirname(__FILE__));
define('Q_THEME_URL', qa_opt('site_url') . 'qa-theme/' . qa_get_site_theme());
include_once Q_THEME_DIR . '/functions.php';
include_once Q_THEME_DIR . '/inc/blocks.php';
qa_register_phrases(Q_THEME_DIR . '/language/cs-lang-*.php', 'cleanstrap');
if (isset($_REQUEST['cs_ajax'])) {
    if (isset($_REQUEST['cs_ajax'])) {
        $action = 'cs_ajax_' . $_REQUEST['action'];
        if (function_exists($action)) {
            $action();
        }
    }
} else {
    global $qa_request;
    $version = qa_opt('cs_version');
    if (empty($version)) {
        $version = 0;
    }
    if (version_compare($version, '2.4.3') < 0) {
        if (!(bool) qa_opt('cs_init')) {