Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php wp_enqueue_script('jquery'); $table_top10_name = $wpdb->prefix . "dailytop10"; $app_theme = "TechNoise"; $app_version = '1.0'; function blogname(){ $blog = get_bloginfo('name'); $e = explode(' ', $blog, 2); $exp = " <span>" . $e[0] . "</span>"; if ($e[1]) $exp .= " " . $e[1]; return $exp; } function mod_install_top10 () { global $wpdb; global $table_top10_name; if($wpdb->get_var("SHOW TABLES LIKE '$table_top10_name'") != $table_top10_name) { $sql = "CREATE TABLE " . $table_top10_name . " ( id mediumint(9) NOT NULL AUTO_INCREMENT, visittime date DEFAULT '0000-00-00' NOT NULL, postnum int NOT NULL, postcount int DEFAULT '0' NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH . 'wp-admin/upgrade-functions.php'); dbDelta($sql); } } function get_wp_todays_date() { global $OFFSET; $format = "Y-m-d"; if ($offset) { $nowtime = gmdate($format, time() + 3600*$OFFSET); } else { $nowtime = date($format, time()); } return $nowtime; } add_action( 'after_setup_theme', 'theme_setup' ); if ( ! function_exists( 'theme_setup' ) ): function theme_setup() { add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); load_theme_textdomain( 'technoise', TEMPLATEPATH . '/languages' ); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if ( is_readable( $locale_file ) ) require_once( $locale_file ); register_nav_menus( array( 'pages' => __( 'Pages Navigation', 'technoise' ), 'categories' => __( 'Categories Navigation', 'technoise' ), ) ); } endif; function theme_widgets_init() { register_sidebar( array( 'name' => __( 'Primary Widget', 'technoise' ), 'id' => 'primary-widgets', 'description' => __( 'Sidebar Middle Right Widget (East)', 'technoise' ), 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgetTitle">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => __( 'Footer Widget', 'technoise' ), 'id' => 'footer-widgets', 'description' => __( 'Footer Widget', 'technoise' ), 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h4 class="widgetTitle">', 'after_title' => '</h4>', ) ); } add_action( 'widgets_init', 'theme_widgets_init' ); function the_short_title($limit=40,$echo=1,$title=''){ if (empty($title)){ $title = the_title('','',false); } if (strlen($title)<=$limit){ }else{ $title = substr_replace(the_title('','',false),'...',$limit); } if ($echo==1){ echo $title; }else{ return $title; } } add_action ('the_content', 'update_post_counter'); function update_post_counter($c){ global $post, $wpdb, $table_top10_name; if (is_single()): $counter = (int) get_post_meta($post->ID, 'post-counter', true); $counter = $counter + 1; update_post_meta($post->ID, 'post-counter', $counter); $entry_exists = $wpdb->get_var("SELECT COUNT(*) as total from $table_top10_name where visittime='" . get_wp_todays_date() . "' and postnum='" . $post->ID . "'"); if($entry_exists>0){ $entry_data = $wpdb->get_var("SELECT id from $table_top10_name where visittime='" . get_wp_todays_date() . "' and postnum='" . $post->ID . "'"); $wpdb->query("UPDATE $table_top10_name SET postcount = postcount+1, visittime = '" . get_wp_todays_date() . "' WHERE id = '" . $entry_data . "'"); }else{ $wpdb->query("INSERT INTO $table_top10_name (visittime, postnum, postcount) VALUES ('" . get_wp_todays_date() . "', '" . $post->ID . "', 1)"); } endif; return $c; } function get_today_hotstories ($limit=10, $title = 0){ global $wpdb, $table_top10_name; $todays_widget_temp = ''; $results = $wpdb->get_results("SELECT * from $table_top10_name inner join {$wpdb->posts} on {$wpdb->posts}.ID=$table_top10_name.postnum WHERE visittime = '" . get_wp_todays_date() . "' and postcount > 0 and post_status = 'publish' $and ORDER BY postcount DESC LIMIT $limit"); if ($results): foreach ($results as $list) { $postnum = $list->postnum; $postcount = $list->postcount; $id_post = $list->ID; $title_post = $list->post_title; $home_url_perma = get_permalink($id_post); $todays_widget_temp .= "<li><a href=\"$home_url_perma\">$title_post</a> <small class='grey'>($postcount views)</small></li>\n"; } else: $todays_widget_temp .= "<li>No posts viewed yet. $and</li>"; endif; echo $todays_widget_temp; } function the_description($args=''){ global $post; $content = $post->post_content; $defaults = array( 'more_link' => false, 'more_text' => 'Read More', 'limit' => 150, 'wrap_tag' => 'p' ); $r = wp_parse_args( $args, $defaults ); $content = preg_replace("/\[caption.*\[\/caption\]/", '', $content); $output = substr(strip_tags($content), 0, $r["limit"]-3) . "..."; $output = apply_filters('wptexturize', $output); $output = apply_filters('convert_chars', $output); if ($r['wrap_tag']) $output2 = '<' . $r['wrap_tag'] . '>'; $output2 .= $output; if ($r['more_link']) $output2 .= ' <a class="morelink" href="' . get_permalink($post->ID) . '#more' . $post->ID . '">' . $r['more_text'] . '</a>'; if ($r['wrap_tag']) $output2 .= '</' . $r['wrap_tag'] . '>'; echo $output2; } function theme_excerpt_length( $length ) { return 25; } add_filter( 'excerpt_length', 'theme_excerpt_length' ); function theme_continue_reading_link() { return ' <a href="'. get_permalink() . '">' . __( 'Read Articles <span class="meta-nav">→</span>', 'technoise' ) . '</a>'; } function theme_auto_excerpt_more( $more ) { return ' ...'; } add_filter( 'excerpt_more', 'theme_auto_excerpt_more' ); function theme_post_image ($args=''){ global $post; $THEME = get_bloginfo('template_directory') . '/'; $THEME_IMAGES = $THEME . 'images/'; $defaults = array( 'key' => 'featured_image', 'zoom_crop' => 0, 'width' => 150, 'height' => 150, 'no_image' => 'post', 'hide_empty' => 1 ); $no_image = array ( 'slider' => $THEME_IMAGES . 'demo/demo-slider.gif', 'slider_small' => $THEME_IMAGES . 'demo/slider-small.gif', 'post' => $THEME_IMAGES . 'demo/post.gif', 'reviews' => $THEME_IMAGES . 'demo/reviews.gif', ); $r = wp_parse_args( $args, $defaults ); $p = has_post_thumbnail($post->ID); $image = ''; if ($p){ $attachment_id = get_post_thumbnail_id( $post->ID ); $post_src = wp_get_attachment_image_src( $attachment_id, 'full' ); $image = $post_src[0]; }else{ $image = get_post_meta($post->ID, $r['key'], true); if (!strstr($image, 'http://') && $image) $image = home_url ('/') . $image; } if (!$image): $image = $THEME_IMAGES . 'no-image.jpg';; endif; $g = $THEME . "thumb.php?src=" . urlencode( $image ) . "&h=" . $r['height'] . "&w=" . $r['width'] . "&zc=" . $r['zoom_crop'] . "&q=100&a=t"; echo $g; } function the_post_single_category($class=""){ $category = get_the_category(); $category = $category[0]; $class = $class==""?"":' class="' . $class . '"'; echo '<a href="'. get_category_link($category->term_id) .'" ' . $class . '>' . $category->name . "</a>"; } function single_cat_link(){ $category = get_the_category(); $category = $category[0]; echo get_category_link($category->term_id); } function theme_post_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
- <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
- <a name="comment-<?php comment_ID() ?>"></a>
- <div id="div-comment-<?php comment_ID() ?>" class="comment-body">
- <div class="comment-author vcard">
- <?php if(get_comment_type() == "comment"){ ?>
- <?php the_commenter_avatar($args) ?>
- <?php } ?>
- <cite class="fn"><?php the_commenter_link() ?></cite> <span class="says">says:</span>
- </div>
- <div class="comment-meta commentmetadata">
- <a href="<?php echo get_comment_link(); ?>" title="<?php _e('Direct link to this comment', 'technoise'); ?>"><?php echo get_comment_date($GLOBALS['woodate']) ?> <?php _e('at', 'technoise'); ?> <?php echo get_comment_time(); ?></a><?php edit_comment_link('Edit', ' | ', ''); ?>
- </div>
- <?php comment_text() ?>
- <?php if ($comment->comment_approved == '0') { ?>
- <p class='unapproved'><?php _e('Your comment is awaiting moderation.', 'technoise'); ?></p>
- <?php } ?>
- <div class="reply">
- <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
- </div><!-- /.reply -->
- <?php } function theme_post_list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
- <li id="comment-<?php comment_ID(); ?>">
- <span class="author"><?php comment_author_link(); ?></span> -
- <span class="date"><?php echo get_comment_date($GLOBALS['woodate']) ?></span>
- <span class="pingcontent"><?php comment_text() ?></span>
- <?php } function the_commenter_link() { $commenter = get_comment_author_link(); if ( ereg( ']* class=[^>]+>', $commenter ) ) {$commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter ); } else { $commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );} echo $commenter ; } function the_commenter_avatar($args) { $email = get_comment_author_email(); $avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( "$email", $args['avatar_size']) ); echo $avatar; } if ( !function_exists('techvocal_theme_avatar') ) { function techvocal_theme_avatar( $avatar_defaults ) { $myavatar = get_bloginfo('template_directory') . '/images/no-user.png'; $avatar_defaults[$myavatar] = __('Tech Noise','technoise'); return $avatar_defaults; } add_filter( 'avatar_defaults', 'techvocal_theme_avatar' ); } function theme_get_pictures(){ $i = 1; while($i <= 200) : if(theme_get_image($i)) : echo '<li><a href="' . theme_get_image($i) . '" rel="lightbox[]" title="' . get_the_title(theme_get_image_id($i)) . '"><img class="thumb-archive" src="' . theme_get_image($i) . '" alt="' . get_the_title(theme_get_image_id($i)) . '" /></a></li>'; 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 <span class="entry-date">%2$s</span>', 'twentyten' ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 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 .= ' <li class="authoritem"> <div class="author_image"><a rel="bookmark" href="' . get_author_posts_url($author->post_author) . '">' . userphoto__get_userphoto($author->post_author, 100, '', '', '', '') . '</a></div> <a class="author_title" href="' . get_author_posts_url($author->post_author) . '" title="' . $userinfo->display_name . '">' . $userinfo->display_name . '</a> </li> '; } 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' => '<!-- Copy and Paster your Analytics Code -->', '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 '<div id="message" class="updated fade"><p>Theme Options Saved.</p></div>'; echo '<link rel="stylesheet" href="'.get_bloginfo('template_url').'/functions.css" />'; ?>
- <div class="wrap">
- <h2>Theme Options</h2>
- <div id="message"></div>
- <div class="metabox-holder">
- <form method="post" action="themes.php?page=theme-config" enctype="multipart/form-data">
- <?php wp_nonce_field('update-options'); ?>
- <div id="theme-options">
- <div id="left-column">
- <div class="postbox">
- <h3><?php _e("Overview", 'technoise'); ?></h3>
- <p><?php _e("<strong>Tech Noise</strong> is proudly designed by ", 'technoise'); ?><a rel="nofollow" target="_blank" href="http://www.templatescraze.com/" title="<?php _e("Templates Craze", 'technoise'); ?>"><?php _e("Templates Craze", 'technoise'); ?></a></p>
- <p style="text-decoration: none;"><a href="http://www.templatescraze.com/contactus.html" target="_blank"><?php _e("Get Support", 'technoise'); ?></a> | <a href="http://www.templatescraze.com/free-wp-themes/" target="_blank" title="<?php _e("Our Themes", 'technoise'); ?>"><?php _e("Our Themes", 'technoise'); ?></a> | <a href="http://www.templatescraze.com/web-design-articles/" target="_blank" title="<?php _e("Web Design Articles", 'technoise'); ?>"><?php _e("Web Design Articles", 'technoise'); ?></a></p>
- </div><!--end postbox-->
- <!--BEGIN OF HOMEPAGE & POSTBOXES-->
- <div class="postbox">
- <h3><?php _e("Layout", 'technoise'); ?></h3>
- <div class="postbox-content">
- <div class="option-row">
- <div class="option-name"><label for="slider_enable"><?php _e("Category 1 <small>(Next Slider)</small>:", 'technoise'); ?></label></div><!--end option-name-->
- <div class="option-value">
- <?php wp_dropdown_categories('name=themeoptions[layout][hc1]&class=background_pattern_select&hierarchical=1&selected=' . $themeoption['layout']['hc1'])?>
- </div><!--end option-value-->
- </div><!--end option-row-->
- <div class="option-row">
- <div class="option-name"><label for="reviews_enable"><?php _e("Category 2 <small>(Next Slider)</small>:", 'technoise'); ?></label></div><!--end option-name-->
- <div class="option-value">
- <?php wp_dropdown_categories('name=themeoptions[layout][hc2]&class=background_pattern_select&hierarchical=1&selected=' . $themeoption['layout']['hc2'])?>
- </div><!--end option-value-->
- </div><!--end option-row-->
- <div class="option-row">
- <div class="option-name"><label for="reviews_enable2"><?php _e("Category <small>(Next Gallery)</small>:", 'technoise'); ?></label></div><!--end option-name-->
- <div class="option-value">
- <?php wp_dropdown_categories('name=themeoptions[layout][hc3]&class=background_pattern_select&hierarchical=1&selected=' . $themeoption['layout']['hc3'])?>
- </div><!--end option-value-->
- </div><!--end option-row-->
- <div class="option-row">
- <div class="option-name"><label for="reviews_enable2"><?php _e("Categories <small>(Multiple Ajax)</small>:", 'technoise'); ?></label></div><!--end option-name-->
- <div class="option-value">
- <?php $cats = str_replace("<select ", '<select multiple="multiple"', wp_dropdown_categories('echo=0&name=themeoptions[layout][hc_multi][]&class=background_pattern_select_multi&hierarchical=1')); $fcats = $themeoption['layout']['hc_multi']; if (is_array ($fcats)): foreach ($fcats as $cid): $cats = str_replace('value="' . $cid . '"', 'value="' . $cid . '" selected="selected"', $cats); endforeach; echo $cats; else: echo $cats; endif; ?>
- </div><!--end option-value-->
- </div><!--end option-row-->
- <input type="submit" class="button" value="Save Changes" />
- </div>
- </div>
- <!--END OF HOMEPAGE & POSTBOXES-->
- <div class="postbox">
- <h3>Advertisement Settings</h3>
- <div class="postbox-content">
- <div class="option-row">
- <div class="option-name">
- <label>Publisher ID</label>
- </div><!--end option-name-->
- <div class="option-value">
- <input class="background_pattern_input" id="publisher_id" type="text" name="themeoptions[publisher_id]" value="<?php echo $themeoption['publisher_id'] ?>" />
- </div><!--end option-value-->
- </div>
- <input type="submit" class="button" value="Save Changes" />
- </div><!--end postbox-content-->
- </div>
- <!--end postbox-->
- </div><!--end left-column-->
- <div id="right-column">
- <div class="postbox">
- <h3>Social Media Settings</h3>
- <p>Paste your SocialMedia information in the box below.</p>
- <div class="postbox-content">
- <div class="option-row">
- <div class="option-name">
- <label>Twitter ID</label>
- </div><!--end option-name-->
- <div class="option-value">
- <input class="background_pattern_input" id="twitter" type="text" name="themeoptions[social][twitter]" value="<?php echo $themeoption['social']['twitter'] ?>" />
- </div><!--end option-value-->
- </div>
- <div class="option-row">
- <div class="option-name">
- <label>Facebook URL</label>
- </div><!--end option-name-->
- <div class="option-value">
- <input class="background_pattern_input" id="facebook" type="text" name="themeoptions[social][facebook]" value="<?php echo $themeoption['social']['facebook'] ?>" />
- </div><!--end option-value-->
- </div>
- <div class="option-row">
- <div class="option-name">
- <label>Feedburner ID</label>
- </div><!--end option-name-->
- <div class="option-value">
- <input class="background_pattern_input" id="feedburner" type="text" name="themeoptions[social][feedburner]" value="<?php echo $themeoption['social']['feedburner'] ?>" />
- </div><!--end option-value-->
- </div>
- <div class="option-row">
- <div class="option-name">
- <label>Linked In</label>
- </div><!--end option-name-->
- <div class="option-value">
- <input class="background_pattern_input" id="linkedin" type="text" name="themeoptions[social][linkedin]" value="<?php echo $themeoption['social']['linkedin'] ?>" />
- </div><!--end option-value-->
- </div>
- <input type="submit" class="button" value="Save Changes" />
- </div><!--end postbox-content-->
- </div><!--end postbox-->
- <div class="postbox">
- <h3>Google Analytics</h3>
- <p>Paste your Google Analytics code in the box below.</p>
- <div class="postbox-content">
- <div class="option-row">
- <textarea class="background_pattern_input" style="height:228px; width:99%" id="google_analytics" name="themeoptions[google_analytics]"><?php echo stripcslashes($themeoption['google_analytics']); ?></textarea>
- </div><!--end option-row-->
- <input type="submit" class="button" value="Save Changes" />
- </div><!--end postbox-content-->
- </div><!--end postbox-->
- </div><!--end right-column-->
- </div><!--theme-options-->
- <input type="hidden" name="action" value="update" />
- </form>
- </div><!--end metabox-holder-->
- </div><!--end wrap-->
- <?php } } add_action('init', array('BlogOptions', 'init')); function technoise_admin_options() { add_menu_page(__('TechNoise','technoise'), __('TechNoise','technoise'), 8, 'theme-config', array('BlogOptions', 'configration'), get_stylesheet_directory_uri() . '/images/theme-ico.gif', 3); add_submenu_page('theme-config', __('General Settings','technoise'), __('Settings','technoise'), 8, 'theme-config', array('BlogOptions', 'configration')); } add_action('admin_menu', 'technoise_admin_options'); $themeoption = BlogOptions::getOptions(); $TECHVOCAL_CAT1NS ['showposts'] = 6; $TECHVOCAL_CAT1NS ['cat'] = $themeoption['layout']['hc1']; $TECHVOCAL_CAT2NS ['showposts'] = 6; $TECHVOCAL_CAT2NS ['cat'] = $themeoption['layout']['hc2']; $TECHVOCAL_CAT3NS ['showposts'] = 6; $TECHVOCAL_CAT3NS ['cat'] = $themeoption['layout']['hc3']; $TECH_VOCAL_MULTI_CAT = $themeoption['layout']['hc_multi']; add_action ('wp_footer', 'add_footer_settings_ga'); function add_footer_settings_ga (){ global $themeoption; if ($themeoption['google_analytics']) echo $themeoption['google_analytics']; } function technoise_update_checks() { global $app_abbr, $app_version, $app_theme, $wp_version, $wpdb, $wp_local_package; $theme_name = trim(strtolower($app_theme)); $current = get_site_transient( $theme_name.'_update_theme' ); if ( ! is_object($current) ) { $current = new stdClass; $current->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 <a href="%3$s" target="_blank">download it now</a> or check <a class="thickbox thickbox-preview" href="%4$s" title="What\'s New in %1$s v%2$s" target="_blank">What\'s new!</a>.'), $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 "<div class='update-nag'>$msg</div>"; } add_action( 'admin_notices', 'technoise_update_nag', 4 ); if (is_admin()) add_action('init', 'technoise_update_checks'); function wp_footer_links_box (){ global $themeoption; ?>
- <div class="clear"></div>
- </div>
- </div>
- </div>
- <div class="footerblock">
- <div class="wrapper">
- <div id="searchpanel">
- <form id="searchp" action="<?php echo home_url ('/')?>" method="get">
- <input type="text" id="s" name="s" value="<?php _e('Search ...', 'technoise');?>" onclick="if (this.value=='<?php _e('Search ...', 'technoise');?>'){ this.value=''; }" onblur="if (this.value==''){ this.value='<?php _e('Search ...', 'technoise');?>'; }" class="input" /><input type="submit" value="Search" class="searchbtn" />
- </form>
- </div>
- <ul id="footerwidgets">
- <?php if ( ! dynamic_sidebar( 'footer-widgets' ) ) : ?>
- <li class="widget">
- <h4 class="widgetTitle"><?php _e('Archive', 'technoise')?></h4>
- <ul>
- <?php wp_get_archives('number=12&title_li=')?>
- </ul>
- </li>
- <li class="widget">
- <h4 class="widgetTitle"><?php _e('Pages', 'technoise')?></h4>
- <ul>
- <?php wp_list_pages('depth=1&title_li=')?>
- </ul>
- </li>
- <li class="widget">
- <h4 class="widgetTitle"><?php _e('Bookmarks', 'technoise')?></h4>
- <ul>
- <?php wp_list_bookmarks ('categorize=0&title_li=')?>
- </ul>
- </li>
- <?php endif; ?>
- </ul>
- <div class="clear"></div>
- </div>
- <div class="copyright-notice">
- <div class="wrapper">
- <ul class="subscribebox">
- <li class="rss"><a href="<?php bloginfo('rss2_url')?>"><?php _e( 'Subscribe', 'technoise' ); ?></a></li>
- <li class="twitter"><a rel="nofollow" href="http://www.twitter.com/<?php echo $themeoption['social']['twitter']?>" title="<?php _e( 'Follow us on Twitter', 'technoise' ); ?>"><?php _e( 'Follow us on Twitter', 'technoise' ); ?></a></li>
- <li class="facebook"><a rel="nofollow" href="<?php echo $themeoption['social']['facebook']?>" title="<?php _e( 'Follow us on Facebook', 'technoise' ); ?>"><?php _e( 'Follow us on Facebook', 'technoise' ); ?></a></li>
- <li class="linkedin"><a rel="nofollow" href="<?php echo $themeoption['social']['linkedin']?>" title="<?php _e( 'Follow us on Likedin', 'technoise' ); ?>"><?php _e( 'Follow us on Likedin', 'technoise' ); ?></a></li>
- </ul>
- <div id="copymessage">
- <p><?php echo sprintf( __( '© Copyright %s <a href="%s" title="%s">%s</a> — All rights reserved.', 'technoise' ), date( 'Y' ), home_url( '/' ), get_bloginfo('name'), get_bloginfo('name') )?> Designed by <a href="http://www.templatescraze.com/" title="Web Templates" target="_blank">Web Templates</a> and made free by <a href="http://www.techvocal.com/" title="Tech Blog" target="_blank">Tech Blog</a></p>
- <ul>
- <li class="first"><a href="<?php bloginfo('siteurl'); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><?php _e('Home', 'technoise'); ?></a></li>
- <?php wp_list_pages('title_li=&depth=1')?>
- </ul>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="<?php bloginfo('template_directory')?>/js/jquery.st-min.js"></script>
- <script type="text/javascript" src="<?php bloginfo('template_directory')?>/js/jquery.ss-min.js"></script>
- <script type="text/javascript" src="<?php bloginfo('template_directory')?>/js/menu.js"></script>
- <?php } add_action ('wp_footer', 'wp_footer_links_box'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement