コード例 #1
0
ファイル: qa-theme.php プロジェクト: swuit/swuit-q2a
<?php

/*
	don't allow this page to be requested directly from browser 
*/
if (!defined('QA_VERSION')) {
    header('Location: /');
    exit;
}
/*
	Definitions
*/
define('MYTHEME_DIR', dirname(__FILE__));
define('MYTHEME_URL', qa_opt('site_url') . 'qa-theme/' . qa_get_site_theme() . '/');
// set layout cookies
$layout = qa_opt('it_layout_lists');
if ($layout) {
    setcookie('layoutdefault', $layout, time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN);
} else {
    setcookie('layoutdefault', 'masonry', time() + 86400 * 3650, '/', QA_COOKIE_DOMAIN);
}
require MYTHEME_DIR . '/functions.php';
require MYTHEME_DIR . '/qa-layer-base.php';
if (isset($_REQUEST['qat_ajax_req'])) {
    qa_register_layer('/qa-layer-ajax.php', 'QAT Ajax Theme Layer', MYTHEME_DIR, MYTHEME_URL);
    die;
}
/*
	Omit PHP closing tag to help avoid accidental output
*/
コード例 #2
0
ファイル: qa-theme.php プロジェクト: swuit/swuit-q2a
<?php

$theme_dir = dirname(__FILE__) . '/';
$theme_url = qa_opt('site_url') . 'qa-theme/' . qa_get_site_theme() . '/';
qa_register_layer('/qa-admin-options.php', 'Theme Options', $theme_dir, $theme_url);
class qa_html_theme extends qa_html_theme_base
{
    function head_metas()
    {
        qa_html_theme_base::head_metas();
        $this->output('<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">');
    }
    function head_css()
    {
        if (qa_opt('qat_compression') == 2) {
            //Gzip
            $this->output('<LINK REL="stylesheet" TYPE="text/css" HREF="' . $this->rooturl . 'qa-styles-gzip.php' . '"/>');
        } elseif (qa_opt('qat_compression') == 1) {
            //CSS Compression
            $this->output('<LINK REL="stylesheet" TYPE="text/css" HREF="' . $this->rooturl . 'qa-styles-commpressed.css' . '"/>');
        } else {
            // Normal CSS load
            $this->output('<LINK REL="stylesheet" TYPE="text/css" HREF="' . $this->rooturl . $this->css_name() . '"/>');
        }
        if (isset($this->content['css_src'])) {
            foreach ($this->content['css_src'] as $css_src) {
                $this->output('<LINK REL="stylesheet" TYPE="text/css" HREF="' . $css_src . '"/>');
            }
        }
        if (!empty($this->content['notices'])) {
            $this->output('<STYLE><!--', '.qa-body-js-on .qa-notice {display:none;}', '//--></STYLE>');
コード例 #3
0
ファイル: qa-base.php プロジェクト: netham91/question2answer
function qa_register_plugin_layer($include, $name)
{
    global $qa_plugin_directory, $qa_plugin_urltoroot;
    if (empty($qa_plugin_directory) || empty($qa_plugin_urltoroot)) {
        qa_fatal_error('qa_register_plugin_layer() can only be called from a plugin qa-plugin.php file');
    }
    qa_register_layer($include, $name, $qa_plugin_directory, $qa_plugin_urltoroot);
}
コード例 #4
0
ファイル: qa-theme.php プロジェクト: microbye/CleanStrap
         qa_opt('cs_init', true);
     }
     //create table for widgets
     qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^ra_widgets (' . 'id INT(10) NOT NULL AUTO_INCREMENT,' . 'name VARCHAR (64),' . 'position VARCHAR (64),' . 'widget_order INT(2) NOT NULL DEFAULT 0,' . 'param LONGTEXT,' . 'PRIMARY KEY (id),' . 'UNIQUE KEY id (id)' . ') ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;');
     $version = '2.4.3';
     qa_opt('cs_version', $version);
     // update version of theme
 }
 if (version_compare($version, '2.4.4') < 0) {
     qa_db_query_sub('RENAME TABLE ^ra_widgets TO  ^cs_widgets;');
     $version = '2.4.4';
     qa_opt('cs_version', $version);
 }
 if (qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
     qa_register_layer('/inc/options.php', 'Theme Options', Q_THEME_DIR, Q_THEME_URL);
     qa_register_layer('/inc/widgets.php', 'Theme Widgets', Q_THEME_DIR, Q_THEME_URL);
 }
 qa_register_module('widget', '/inc/widget_ask.php', 'cs_ask_widget', 'CS Ajax Ask', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_tags.php', 'cs_tags_widget', 'CS Tags', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_ticker.php', 'cs_ticker_widget', 'CS Ticker', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_top_users.php', 'cs_top_users_widget', 'CS Top Contributors', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_activity.php', 'cs_activity_widget', 'CS Site Activity', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_question_activity.php', 'cs_question_activity_widget', 'CS Question Activity', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_featured_questions.php', 'cs_featured_questions_widget', 'CS Featured Questions', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_site_status.php', 'cs_site_status_widget', 'CS Site Status', Q_THEME_DIR, Q_THEME_URL);
 //qa_register_module('widget', '/inc/widget_twitter.php', 'cs_twitter_widget', 'CS Twitter Widget', Q_THEME_DIR, Q_THEME_URL);
 //qa_register_module('widget', '/inc/widget_feed.php', 'cs_feed_widget', 'CS Feed Widget', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_new_users.php', 'cs_new_users_widget', 'CS New Users', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_related_questions.php', 'cs_related_questions', 'CS Related Questions', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_text.php', 'cs_widget_text', 'CS Text Widget', Q_THEME_DIR, Q_THEME_URL);
 qa_register_module('widget', '/inc/widget_posts.php', 'cs_widget_posts', 'CS Posts', Q_THEME_DIR, Q_THEME_URL);