'
  • ', 'after_widget' => '

  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Footer_Widget1', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Footer_Widget2', 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', )); /** @ignore */ $themename = "SimpleNews Premium"; $shortname = "sn"; $options = array ( array( "name" => "Menu options", "type" => "title"), array( "type" => "open"), array( "name" => "Do you want to disable the top menu?", "desc" => "Check this box if you would like to DISABLE the Menu on the top.", "id" => $shortname."_pmenu_disableone", "type" => "checkbox", "std" => "false"), array( "name" => "Do you want to use selective top menu?", "desc" => "Check this box if you would like to ENABLE the selective Menu on the top.", "id" => $shortname."_topmenu_selector", "type" => "checkbox", "std" => "false"), array("name" => "Menu items list:", "desc" => "Set the ID's of the pages you want to use. (Separate commas, example: 1,2,3)", "id" => $shortname."_topmenu_list", "type" => "text", "std" => "1,2,3"), array( "type" => "close"), array( "name" => "Logo options", "type" => "title"), array( "type" => "open"), array("name" => "Logo Image", "desc" => "Set the image to use as the logo image. Size: 237*54 pixel. Write in the name of the image, default is: logo.png. (IMPORTANT: the image must be uploaded into the wp-content/themes/simplenews_premium/images directory!)", "id" => $shortname."_logo_image", "type" => "text", "std" => "logo.png"), array( "type" => "close"), array( "name" => "Footer options", "type" => "title"), array( "type" => "open"), array("name" => "Credit text", "desc" => "Set your credit text", "id" => $shortname."_footer_credit", "type" => "text", "std" => "2010. All Rights Reserved"), array( "type" => "close"), array( "name" => "Google Analytics options", "type" => "title"), array( "type" => "open"), array("name" => "Google Analytics Tracking Code", "desc" => "Enter your tracking code here for Google Analytics. (Complete Code, leave it blank to delete code from the site.)", "id" => $shortname."_simplenews_analytics_code", "type" => "textarea", "std" => ""), array( "type" => "close"), array( "name" => "Advertisement options", "type" => "title"), array( "type" => "open"), array( "name" => "Disable the banner Box in the sidebar?", "desc" => "Check this box if you would like to DISABLE the banner box in the sidebar.", "id" => $shortname."_sidebarbanner_disable", "type" => "checkbox", "std" => "false"), array("name" => "Banner place #1 image", "desc" => "Set the image for the first banner box. (IMPORTANT: the image must be uploaded into the wp-content/themes/simplenews_premium/images directory!)", "id" => $shortname."_banner_image1", "type" => "text", "std" => "125_banner.jpg"), array("name" => "Banner place #1 link", "desc" => "Set the link for the first banner box.", "id" => $shortname."_banner_link1", "type" => "text", "std" => ""), array("name" => "Banner place #2 image", "desc" => "Set the image for the second banner box. (IMPORTANT: the image must be uploaded into the wp-content/themes/simplenews_premium/images directory!)", "id" => $shortname."_banner_image2", "type" => "text", "std" => "125_banner.jpg"), array("name" => "Partners Banner place #2 link", "desc" => "Set the link for the second banner box.", "id" => $shortname."_banner_link2", "type" => "text", "std" => ""), array("name" => "Banner place #3 image", "desc" => "Set the image for the third banner box. (IMPORTANT: the image must be uploaded into the wp-content/themes/simplenews_premium/images directory!)", "id" => $shortname."_banner_image3", "type" => "text", "std" => "125_banner.jpg"), array("name" => "Banner place #3 link", "desc" => "Set the link for the third banner box.", "id" => $shortname."_banner_link3", "type" => "text", "std" => ""), array("name" => "Banner place #4 image", "desc" => "Set the image for the fourth banner box. (IMPORTANT: the image must be uploaded into the wp-content/themes/simplenews_premium/images directory!)", "id" => $shortname."_banner_image4", "type" => "text", "std" => "125_banner.jpg"), array("name" => "Banner place #4 link", "desc" => "Set the link for the fourth banner box.", "id" => $shortname."_banner_link4", "type" => "text", "std" => ""), array( "type" => "close") ); function mytheme_add_admin() { global $themename, $shortname, $options; if ( $_GET['page'] == basename(__FILE__) ) { if ( 'save' == $_REQUEST['action'] ) { foreach ($options as $value) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } foreach ($options as $value) { if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } header("Location: themes.php?page=functions.php&saved=true"); die; } else if( 'reset' == $_REQUEST['action'] ) { foreach ($options as $value) { delete_option( $value['id'] ); } header("Location: themes.php?page=functions.php&reset=true"); die; } } add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin'); } function create_section_for_text($value) { create_opening_tag($value); $text = ""; if (get_option($value['id']) === FALSE) { $text = $value['std']; } else { $text = get_option($value['id']); } echo ''."\n"; create_closing_tag(); } function mytheme_admin() { global $themename, $shortname, $options; if ( $_REQUEST['saved'] ) echo '

    '.$themename.' settings saved.

    '; if ( $_REQUEST['reset'] ) echo '

    '.$themename.' settings reset.

    '; ?>

    SimpleNews Theme Options


    array( "name" => "image", "type" => "text", "std" => "", "title" => "Image", "description" => "Using the \"Add an Image\" button, upload an image and paste the URL here. Images will be resized. This is the post main image and will automatically be sized.") ); function meta_boxes() { global $post, $meta_boxes; echo'
    adminicon

     
     
    " />
     
     
    />
     
     
    '; foreach($meta_boxes as $meta_box) { $meta_box_value = get_post_meta($post->ID, $pre.'_value', true); if($meta_box_value == "") $meta_box_value = $meta_box['std']; echo''; } echo'
    '; echo''; echo'

    '.$meta_box['title'].'

    '; echo'
    '; echo'
    '; echo'

    '; echo'
    '; } function create_meta_box() { global $theme_name; if ( function_exists('add_meta_box') ) { add_meta_box( 'new-meta-boxes', 'Photo for post', 'meta_boxes', 'post', 'normal', 'high' ); } } function save_postdata( $post_id ) { global $post, $meta_boxes; foreach($meta_boxes as $meta_box) { // Verify if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) { return $post_id; } if ( 'page' == $_POST['post_type'] ) { if ( !current_user_can( 'edit_page', $post_id )) return $post_id; } else { if ( !current_user_can( 'edit_post', $post_id )) return $post_id; } $data = $_POST[$meta_box['name'].'_value']; if(get_post_meta($post_id, $meta_box['name'].'_value') == "") add_post_meta($post_id, $meta_box['name'].'_value', $data, true); elseif($data != get_post_meta($post_id, $pre.'_value', true)) update_post_meta($post_id, $meta_box['name'].'_value', $data); elseif($data == "") delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true)); } } function short_title($before = '', $after = '', $echo = true, $length = false) { $title = get_the_title(); if ( $length && is_numeric($length) ) { $title = substr( $title, 0, $length ); } if ( strlen($title)> 0 ) { $title = apply_filters('short_title', $before . $title . $after, $before, $after); if ( $echo ) echo $title; else return $title; } } function new_excerpt_length($length) { return 50; } add_filter('excerpt_length', 'new_excerpt_length'); add_action('admin_menu', 'create_meta_box'); add_action('save_post', 'save_postdata'); add_action('admin_menu', 'mytheme_add_admin'); ?>