tasks = array ('imageupload','formsave','zipupload','activate'); $this->PageOptions=$SMTheme->options; if (isset($_GET['page'])&&$_GET['page']!='') add_action('admin_head', array(&$this, 'loadHeadTemplate')); add_action( 'admin_enqueue_scripts', array(&$this, 'loadHead' )); add_action('admin_menu', array(&$this, 'loadMenu')); add_action('wp_ajax_processing_ajax', array(&$this, 'ajax_callback')); } function loadMenu(){ $info = wp_get_theme(); $name = $info['Name']?$info['Name']:'SMT Options'; add_menu_page('Theme', $name, 'manage_options', 'OptionsPage', array(&$this, 'ThemeOptionsPage'), '', 64); add_theme_page( $name, $name, 'manage_options', 'OptionsPage', array(&$this, 'ThemeOptionsPage')); $this->load_tabs_menu(1); } function loadHeadTemplate() { if ($_GET['page']=='OptionsPage')$_GET['page']='general'; if (is_array($this->PageOptions[$_GET['page']])) { ?>
> Please wait
SMThemes.com | |
    load_tabs_menu(); ?>
    load_tabs_content(); ?>
' />
Please wait Please wait Reset PageOptions[$_GET['page']]['name'] ?> options
PageOptions)&&count($this->PageOptions>0)) { foreach ($this->PageOptions as $href=>$menu) { if ($type) { add_submenu_page( 'OptionsPage', $menu['name'], $menu['name'], 'manage_options', $href, array(&$this,'ThemeOptionsPage')); } else { echo "
  • ".$menu[".$menu['name']."
  • "; } } remove_submenu_page( 'OptionsPage', 'OptionsPage' ); } } function load_tabs_content($type=0) { if (is_array($this->PageOptions)&&count($this->PageOptions>0)) { foreach ($this->PageOptions as $href=>$x) { echo '
  • '.$x['name'].'

    '; if ($href!='activate') echo '
    '; echo ""; foreach ($x['content'] as $param) { $param['option']=$href; $this->show_input( $param ); } if ($href!='activate') echo '
    '; echo '
  • '; } } } function show_input($param){ global $SMTheme; switch ($param['type']) { case 'p': ?>

    '>

    No Sidebars Right Sidebar Left Sidebar Left and Right Sidebars 2 Right Sidebars 2 Left Sidebars
    Theme was successfuly activated with key
    You can simply remove links from the footer after purchase and activate the theme.

    '> Activate theme

    $value ) { echo ""; } ?>

    '>

    '>

    ' value="" />

    '>

    '>

    ' alt='' id='img_' />
    ' value='' /> Upload

    '>

    ' value='1' />

    '>

    '> $value){ $value['value']=$param['value'][$key]; $value['name']=$param['name']."[".$value['name']."]"; $this->show_input($value); } ?>

    '>

    '>

    Image URL (32x32 px)PresetsUpload

    Value

    Save detail Add detail

    '>

    '> $detail) { ?>
    Caption Regex for check Type Required
    ' /> ' /> />
    Add inputAdvanced Settings

    '>

    '> $detail) { ?>
    Service Display
    ' /> ' /> /> Edit
    Add Button
    Title:
    Code:
    CancelSave
    PageOptions['general']['content']['logoimage']; ?>

    '>

    ' alt='' id='img_' />
    ' value='' /> Upload
    PageOptions['general']['content']['customtext']; ?>

    '>

    ' value="" />
    PageOptions['slider']['content']['category']['value'] =='' ) $this->PageOptions['slider']['content']['category']['value'] = array(); $params = $this->PageOptions['slider']['content']['category']['value']; $params = array_merge ( array( 'orderby' => 'date', 'numberposts' => 5, 'category' => 0 ), $params ); ?>

    Number of slides:

    ' />

    Category:

    Order by:

    PageOptions['slider']['content']['posts']['value']; ?>

    Posts:

    PageOptions['slider']['content']['pages']['value']; ?>

    Pages:

    PageOptions['slider']['content']['custom_slides']['value']; ?>
    $slide) { ?>
    <?php echo $slide['ttl']?>
    Image URL:' />Upload
    Link URL:' />
    Title:' />
    Content:
    DeleteSave
    Add slide
    Image URL:Upload
    Link URL:
    Title:
    Content:
    Add slide
    tasks))&&is_callable(array(get_class($this), $this->tasks[0]))) { call_user_func(array( get_class($this), $_POST['task'])); } die(); } function imageupload() { $exts = array('jpg','png','gif','jpeg','ico'); $file=$_FILES[$_POST['img']]; $ext=explode('.',$file['name']); $ext=$ext[count($ext)-1]; if (in_array($ext, $exts)) { $override['test_form']=false; $file=wp_handle_upload($file,$override); if (preg_match('/upb_new_slide_img/', $_POST['sender'])) { image_resize($file['file'], 56, 56, true, 'prev'); } echo $file['url']; } else echo 'Unallowed file extention'; } function formsave() { $option=$_POST['option']; if (isset($this->PageOptions[$option])) { $options=$_POST; unset($options['option']); unset($options['task']); $options=removeslashes($options); update_option($option,$options); } echo 'New configuration saved'; } function activate() { $data['domain']=$_SERVER['HTTP_HOST'].":".$_SERVER['SERVER_NAME']; $data['info']=get_theme_data(TEMPLATEPATH.'/style.css'); $data['info']=$data['info']['Name']; $data['theme']=get_template_directory_uri(); $data['act_key']=(string)$_POST['act_key']; $name = $info['Name']?$info['Name']:'SMT Options'; $url="http://smthemes.com/index.php?activation=4"; error_reporting(15); $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, "Accept: application/xml"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); curl_close($ch); print_r($response); if (preg_match('/okbox/', $response)) { $save=array('activator'=>'Your theme was successful activated at '.date('Y.m.d').' with activation key '.$data['act_key']); update_option('activate',$save); } } } function removeslashes($var) { if (is_array($var)) foreach ($var as $key=>$value) { $var[$key]=removeslashes($value); } else { return stripslashes($var); } return $var; } ?>