comment_approved == '0') { ?>
$depth, 'max_depth' => $args['max_depth']))) ?>
'; endif; $i++; endwhile; } function theme_get_image_id($num = 0, $postID='') { global $post; if (!$postID) $postID = $post->ID; $children = get_children(array( 'post_parent' => $postID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' )); $count = 0; foreach ((array)$children as $key => $value) { $images[$count] = $value; $count++; } if(isset($images[$num])) return $images[$num]->ID; else return false; } function theme_get_image($num = 0, $postID='') { global $post; if (!$postID) $postID = $post->ID; $children = get_children(array( 'post_parent' => $postID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' )); $count = 0; foreach ((array)$children as $key => $value) { $images[$count] = $value; $count++; } if(isset($images[$num])) return wp_get_attachment_url($images[$num]->ID); else return false; } function theme_posted_on() { printf( __( 'Written by %1$s on
%2$s', 'twentyten' ), sprintf( '
%3$s', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), get_the_author() ), get_the_date() ); } function wp_list_popular_author ($args=''){ global $wpdb; $defaults = array('limit' => 9, 'order' => 'desc', 'echo' => true); $r = wp_parse_args( $args, $defaults ); $authors = $wpdb->get_results ("SELECT DISTINCT post_author, COUNT(ID) AS total FROM wp_posts WHERE post_type = 'post' AND (post_status = 'publish') GROUP BY post_author order by total " . $r['order'] . " LIMIT " . $r['limit']); foreach ($authors as $author){ $userinfo = get_userdata($author->post_author); $output .= '
' . $userinfo->display_name . ' '; } if ($r['echo']) echo $output; else return $output; } function technoise_post_type() { register_post_type( 'gallery', array('labels' => array( 'name' => __( 'Gallery', 'technoise' ), 'singular_name' => __( 'Gallery', 'technoise' ), 'add_new' => __( 'Add New', 'technoise' ), 'add_new_item' => __( 'Add New Gallery', 'technoise' ), 'edit' => __( 'Edit', 'technoise' ), 'edit_item' => __( 'Edit Gallery', 'technoise' ), 'new_item' => __( 'New Gallery', 'technoise' ), 'view' => __( 'View Gallery', 'technoise' ), 'view_item' => __( 'View Gallery', 'technoise' ), 'search_items' => __( 'Search Gallery', 'technoise' ), 'not_found' => __( 'No gallery found', 'technoise' ), 'not_found_in_trash' => __( 'No gallery found in trash', 'technoise' ), 'parent' => __( 'Parent Gallery', 'technoise' ), ), 'description' => __( 'This is where you can create new gallery on your site.', 'technoise' ), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => false, 'menu_position' => 5, 'menu_icon' => get_stylesheet_directory_uri() . '/images/theme-ico.gif', 'hierarchical' => false, 'rewrite' => array( 'slug' => 'pictures', 'with_front' => false ), 'query_var' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ), ) ); } add_action( 'init', 'technoise_post_type', 0 ); class BlogOptions { function init() { if(isset($_POST['themeoptions'])) { $optionsd = BlogOptions::getOptions(); $options = $_POST['themeoptions']; $error_s = "updated=true"; update_option('Blog_Setting_Options', $options); wp_redirect('admin.php?page=theme-config&' . $error_s); } else { $options = BlogOptions::getOptions(); } } function getOptions() { $options = get_option('Blog_Setting_Options'); if (!is_array($options)) { $options = array( 'google_analytics' => '', 'publisher_id' => '', 'layout' => array( 'hc1' => 3, 'hc2' => 7, 'hc3' => 49, 'hc_multi' => array(32,94,46,66,7,49), ), 'publisher_id' => '', 'social' => array( 'twitter' => 'templatescraze', 'facebook' => 'http://www.facebook.com/pages/TemplatesCraze/108340095879312', 'feedburner' => 'templatescraze', 'linkedin' => 'templatescraze' ), ); update_option('Blog_Setting_Options', $options); } return $options; } function configration() { $themeoption = BlogOptions::getOptions(); if ( $_GET['updated'] ) echo '
'; echo '
'; ?>
updates = array(); $current->version_checked = $app_version; } $locale = apply_filters( 'core_version_check_locale', get_locale() ); $current->last_checked = time(); set_site_transient( $theme_name.'_update_theme', $current ); if ( method_exists( $wpdb, 'db_version' ) ) $mysql_version = preg_replace('/[^0-9.].*/', '', $wpdb->db_version()); else $mysql_version = 'N/A'; if ( is_multisite( ) ) { $user_count = get_user_count( ); $num_blogs = get_blog_count( ); $wp_install = network_site_url( ); $multisite_enabled = 1; } else { $user_count = count_users( ); $multisite_enabled = 0; $num_blogs = 1; $wp_install = home_url( '/' ); } $local_package = isset( $wp_local_package )? $wp_local_package : ''; $url = "http://www.templatescraze.com/free-wp-themes/vcheck/?theme_name=$theme_name&theme_version=$app_version"; $options = array( 'timeout' => 30, 'user-agent' => $app_theme . '/' . $app_version . '; ' . home_url( '/' ), 'headers' => array( 'wp_install' => $wp_install, 'wp_blog' => home_url( '/' ) ) ); $response = wp_remote_get($url, $options); if ( is_wp_error( $response ) ) return false; if ( 200 != $response['response']['code'] ) return false; $body = json_decode( $response['body'], true ); $updates = new stdClass(); $updates->last_checked = time(); $updates->version_checked = $app_version; $updates->latest_version = $body["version"]; $updates->link_to_download = $body["downloadfrom"]; set_site_transient( $theme_name.'_update_theme', $updates); } function technoise_update_nag() { global $app_version, $app_theme; if ( !current_user_can('update_core') ) return false; $theme_name = trim(strtolower($app_theme)); $cur = get_site_transient( $theme_name.'_update_theme' ); if ( empty($cur) ) return false; if ( version_compare($cur->version_checked, $cur->latest_version, '>=' ) ) return false; if ( current_user_can('update_core') ) { $msg = sprintf( __('%1$s version %2$s is now available! Customers can
download it now or check
What\'s new!.'), $app_theme, $cur->latest_version, $cur->link_to_download, "http://www.templatescraze.com/free-wp-themes/version_info/?theme_name=$theme_name&theme_version=" . $cur->latest_version . "&preview_iframe=1&TB_iframe=true" ); } else { $msg = sprintf( __('%1$s version %2$s is now available! Please notify the site administrator.'), $app_theme, $cur->latest_version ); } echo "
$msg
"; } add_action( 'admin_notices', 'technoise_update_nag', 4 ); if (is_admin()) add_action('init', 'technoise_update_checks'); function wp_footer_links_box (){ global $themeoption; ?>
Theme Options Saved.
Theme Options