Esempio n. 1
0
 function sc_ra_ads($name)
 {
     if (qw_hook_exist(__FUNCTION__)) {
         $args = func_get_args();
         array_unshift($args, $this);
         return qw_event_hook(__FUNCTION__, $args, NULL);
     }
     $option = ra_opt('ra_qaads');
     if (is_array($option)) {
         if (in_array_r($name, $option)) {
             foreach ($option as $opt) {
                 if (ra_edit_mode() && $opt['name'] == $name) {
                     $this->output('<div style="height:100px;background:#333;text-align:center;font-size:20px;margin-bottom:20px;">', $opt['name'], '</div>');
                 } elseif ($opt['name'] == $name) {
                     $this->output(str_replace('\\', '', base64_decode($opt['code'])));
                 }
             }
         } else {
             $this->output('No ads code found with this name');
         }
     }
 }
Esempio n. 2
0
<?php

/* don't allow this page to be requested directly from browser */
if (!defined('QA_VERSION')) {
    header('Location: /');
    exit;
}
/* function for theme */
if (qa_opt('ra_installed') != true) {
    /* add some option when theme init first time */
    //create table for builder
    qa_db_query_sub('CREATE TABLE IF NOT EXISTS ^builder (' . 'name VARCHAR (64) UNIQUE NOT NULL,' . 'content LONGTEXT' . ') ENGINE=MyISAM DEFAULT CHARSET=utf8;');
    import_sql(DUDE_THEME_DIR . '/demo/builder_demo.sql');
    ra_opt('shortcodes', array('widget', 'ra_widget'));
    ra_opt('ra_installed', true);
    // update db, so that this code will not execute every time
}