db = $wpdb; $this->db_pre = $table_prefix; $this->config = new Configurator(); $this->name = $this->config->item('themename'); if (isset($_GET['kreativestyle'])) { $set = $_GET['kreativestyle']; setcookie ("kreative_".strtolower($this->name), $set, time()+31536000); $this->style = $set; } $this->load_option(); } function load_option() { $options = array ( 'general' => get_option('kreativetheme_general'), 'nav' => get_option('kreativetheme_nav'), 'layout' => get_option('kreativetheme_layout'), 'ads' => get_option('kreativetheme_ads'), 'optimize' => get_option('kreativetheme_optimize'), 'plugs' => get_option('kreativetheme_plugs') ); $defaults = array(); foreach ($options as $opt => $val) { if ( $val === FALSE) { $options[$opt] = $defaults; } else { $options[$opt] = unserialize($val); } $this->config->set($opt, $options[$opt]); } } function siteNavigation($depth = 1) { $kt =& get_instance(); $output = ''; if (strtolower($kt->config->item('home_link', 'nav')) === 'true') { $output .= '
' . get_bloginfo('description') . '
'; } } } global $KreativeTheme; $KreativeTheme = new Kreative(); function &get_instance() { global $KreativeTheme; return $KreativeTheme; } function kreative_get_settings($group = 'defaults', $setting, $standard = FALSE) { $kt =& get_instance(); $item = $kt->config->item($setting, $group); if ( ! $item) $item = $standard; return $item; } function kreative_show_ads($format = '468x60', $select = '1') { $kt =& get_instance(); $default = array ( '300x120' => 'ads.gif' ); if ('true' == $kt->config->item("{$format}_enable_{$select}", 'ads')) { $code = $kt->config->item("{$format}_html_{$select}", 'ads'); if (trim($code) !== '') { echo $code; } else { $output = ''; $img = $kt->config->item("{$format}_img_{$select}", 'ads'); $url = $kt->config->item("{$format}_url_{$select}", 'ads'); if (trim($img) !== '') { $output = '