Exemplo n.º 1
0
define('QW_CONTROL_ADDON_DIR', QW_CONTROL_DIR . '/addons');
define('QW_BASE_URL', get_base_url());
define('QW_CONTROL_URL', QW_BASE_URL . '/qa-plugin/ra-option-panel');
define('Q_THEME_URL', QW_BASE_URL . '/qa-theme/dude');
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);
    }
Exemplo n.º 2
0
less_css('bootstrap');
less_css('dude');
$context->ra_builder_css();
$css = qw_get_all_styles($context->template);
if (!empty($css)) {
    foreach ($css as $css_src) {
        if (isset($css_src['file']) && filter_var($css_src['file'], FILTER_VALIDATE_URL) !== FALSE) {
            echo '<link rel="stylesheet" type="text/css" href="' . $css_src['file'] . '"/>';
        }
    }
}
if (!empty($context->content['notices'])) {
    echo '<style><!--', '.qa-body-js-on .qa-notice {display:none;}', '//--></style>';
}
//register a hook
if (qw_hook_exist('head_script')) {
    echo qw_do_action('head_script', $context);
}
$scripts = qw_get_all_scripts($context->template);
echo '<script> ajax_url = "' . QW_CONTROL_URL . '/ajax.php"; theme_url = "' . Q_THEME_URL . '"; site_url = "' . QW_BASE_URL . '";</script>';
if (!empty($scripts)) {
    foreach ($scripts as $script_src) {
        if (filter_var($script_src['file'], FILTER_VALIDATE_URL) !== FALSE) {
            echo '<script type="text/javascript" src="' . $script_src['file'] . '"></script>';
        }
    }
}
?>
		<link rel="stylesheet" type="text/css" href="<?php 
echo DUDE_THEME_URL;
?>
Exemplo n.º 3
0
 function post_meta_who($post, $class)
 {
     if (qw_hook_exist(__FUNCTION__)) {
         $args = func_get_args();
         array_unshift($args, $this);
         return qw_event_hook(__FUNCTION__, $args, NULL);
     }
     if (isset($post['who'])) {
         $this->output('<span class="' . $class . '-who">');
         if (strlen(@$post['who']['prefix'])) {
             $this->output('<span class="' . $class . '-who-pad">' . $post['who']['prefix'] . '</span>');
         }
         if (isset($post['who']['data'])) {
             $handle = strip_tags($post['who']['data']);
             if ($post['who']['data'] == strip_tags($post['who']['data'])) {
                 $this->output('<span class="' . $class . '-who-data">' . $handle . '</span>');
             } else {
                 $name = ra_name($handle);
                 $this->output('<span class="' . $class . '-who-data"><a href="' . qa_path_html('user/' . $handle) . '">' . $name . '</a></span>');
             }
         }
         if (isset($post['who']['title'])) {
             $this->output('<span class="' . $class . '-who-title">' . $post['who']['title'] . '</span>');
         }
         // You can also use $post['level'] to get the author's privilege level (as a string)
         if (isset($post['who']['points'])) {
             $post['who']['points']['prefix'] = '(' . $post['who']['points']['prefix'];
             $post['who']['points']['suffix'] .= ')';
             $this->output_split($post['who']['points'], $class . '-who-points');
         }
         if (strlen(@$post['who']['suffix'])) {
             $this->output('<span class="' . $class . '-who-pad">' . $post['who']['suffix'] . '</span>');
         }
         $this->output('</span>');
     }
 }