'Sidebar 1', 'description' => 'Secondary sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Sidebar 2', 'description' => 'Secondary sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Main Menu Ads Area', 'description' => 'Any Widgets(width 900px)', 'before_widget' => '', 'after_widget' => '', 'before_title' => '' )); register_sidebar(array( 'name' => 'Home Featured', 'description' => 'Home Featured area. width:650px', 'before_widget' => '', 'after_widget' => '', 'before_title' => '' )); register_sidebar(array( 'name' => 'Home Page: Left', 'description' => 'Home page left side area. Under the featured widget.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Home Page: Right', 'description' => 'Home page right side area. Under the featured widget.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Footer: Left', 'description' => 'Blog footer widget area.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Footer: Center', 'description' => 'Blog footer widget area. Middle position.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => 'Footer: Right', 'description' => 'Blog footer widget area.', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

' )); // //register_nav_menus function alihan_register_my_menus() { register_nav_menus( array( 'main-menu' => __( 'Main Menu' ), 'top-menu' => __( 'Top Menu' ) ) ); } add_action( 'init', 'alihan_register_my_menus' ); // theme support // post-thumbnails $pts = get_option('alihan_post_thumbnails_size'); if ( eregi("x",$pts) ) { $pts = explode("x",$pts); $ptsW = $pts[0]; $ptsH = $pts[1]; } else { $ptsW = 100; $ptsH = 100; } //echo "$ptsW, $ptsH"; add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( $ptsW, $ptsH, true ); // other add_custom_background(); add_theme_support( 'menus' ); add_theme_support('automatic-feed-links'); add_editor_style(); //custom image header define('NO_HEADER_TEXT', true ); define('HEADER_IMAGE', '%s/images/default_header.png'); // %s is the template dir uri define('HEADER_IMAGE_WIDTH', 960); // use width and height appropriate for your theme define('HEADER_IMAGE_HEIGHT', 200); if ( ! defined( 'HEADER_TEXTCOLOR' ) ) define( 'HEADER_TEXTCOLOR', '' ); // gets included in the admin header function alihan_admin_header_style() { ?> '; } else { echo ''; } // load custom CSS alihan_custom_css(); } add_action("wp_head", "alihan_wp_head"); // comments function alihan_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
id="comment-">

    comment_approved == '0') : ?>
Your comment is awaiting moderation.
at    #   $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>

Pingback

$feed
"; //$rss = unserialize(file_get_contents($feed)); $option_value = get_option( 'Ali Han Twitter Cache' ); if ( trim($option_value) == "" ) { // cache? add_option( 'Ali Han Twitter Cache', '', '', 'yes' ); } // cache is exist //CacheTime preg_match('#CacheTime(.*?)--#si',$option_value,$CacheTime); $CacheTime = $CacheTime[1]; $now = date('Y-m-d H:i:s'); $timeDiff = timeDiff($CacheTime, $now ); //check updates if ($timeDiff>1) { $rss = wp_remote_get( $feed, $args = array() ); $rss = $rss ["body"]; $rss .= ""; update_option( 'Ali Han Twitter Cache', $rss); echo ""; } // clean up and output the twitter feed $feed = str_replace("&", "&", $option_value); $feed = str_replace("<", "<", $feed); $feed = str_replace(">", ">", $feed); $feed = str_replace(""", "\"", $feed); $clean = explode("", $feed); $amount = count($clean) - 1; if ($amount) { // are there any tweets? for ($i=1; $i<= $amount; $i++) { if ($limit == '') $limit=10; if ($limit < $i) continue; preg_match('#", $clean[$i]); $clean_content_1 = explode("", $entry_close[0]); $clean_content = explode("", $clean_content_1[1]); $clean_name_2 = explode("", $entry_close[0]); $clean_name_1 = explode("(", $clean_name_2[1]); $clean_name = explode(")", $clean_name_1[1]); $clean_user = explode(" (", $clean_name_2[1]); $clean_lower_user = strtolower($clean_user[0]); $clean_uri_1 = explode("", $entry_close[0]); $clean_uri = explode("", $clean_uri_1[1]); $clean_time_1 = explode("", $entry_close[0]); $clean_time = explode("", $clean_time_1[1]); $unix_time = strtotime($clean_time[0]); $pretty_time = relativeTime($unix_time); echo ''; } } else { // if there aren't any tweets echo ''; } echo "Tweets updated ". round( $timeDiff )." minutes ago.."; } /* Relative Time Function For use in the "Parse Twitter Feeds" code below */ define("SECOND", 1); define("MINUTE", 60 * SECOND); define("HOUR", 60 * MINUTE); define("DAY", 24 * HOUR); define("MONTH", 30 * DAY); function relativeTime($time) { $delta = strtotime('+2 hours') - $time; if ($delta < 2 * MINUTE) { return "1 min ago"; } if ($delta < 45 * MINUTE) { return floor($delta / MINUTE) . " min ago"; } if ($delta < 90 * MINUTE) { return "1 hour ago"; } if ($delta < 24 * HOUR) { return floor($delta / HOUR) . " hours ago"; } if ($delta < 48 * HOUR) { return "yesterday"; } if ($delta < 30 * DAY) { return floor($delta / DAY) . " days ago"; } if ($delta < 12 * MONTH) { $months = floor($delta / DAY / 30); return $months <= 1 ? "1 month ago" : $months . " months ago"; } else { $years = floor($delta / DAY / 365); return $years <= 1 ? "1 year ago" : $years . " years ago"; } } // /** * Retrieve or display pagination code. * * The defaults for overwriting are: * 'page' - Default is null (int). The current page. This function will * automatically determine the value. * 'pages' - Default is null (int). The total number of pages. This function will * automatically determine the value. * 'range' - Default is 3 (int). The number of page links to show before and after * the current page. * 'gap' - Default is 3 (int). The minimum number of pages before a gap is * replaced with ellipses (...). * 'anchor' - Default is 1 (int). The number of links to always show at begining * and end of pagination * 'before' - Default is '
' (string). The html or text * to add before the pagination links. * 'after' - Default is '
' (string). The html or text to add after the * pagination links. * 'title' - Default is '__('Pages:')' (string). The text to display before the * pagination links. * 'next_page' - Default is '__('»')' (string). The text to use for the * next page link. * 'previous_page' - Default is '__('«')' (string). The text to use for the * previous page link. * 'echo' - Default is 1 (int). To return the code instead of echo'ing, set this * to 0 (zero). * * @author Eric Martin * @copyright Copyright (c) 2009, Eric Martin * @version 1.0 ------------------------------------------------------------------------------- Copyright (c) 2009 Eric Martin http://www.ericmmartin.com/ Link: http://www.ericmmartin.com/pagination-function-for-wordpress License : http://www.gnu.org/licenses/gpl-2.0.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (license.txt); if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- * @param array|string $args Optional. Override default arguments. * @return string HTML content, if not displaying. */ function alihan_emm_paginate($args = null) { $defaults = array( 'page' => null, 'pages' => null, 'range' => 3, 'gap' => 3, 'anchor' => 1, 'before' => '
', 'after' => '
', 'title' => __(''), 'nextpage' => __('»'), 'previouspage' => __('«'), 'echo' => 1 ); $r = wp_parse_args($args, $defaults); extract($r, EXTR_SKIP); if (!$page && !$pages) { global $wp_query; $page = get_query_var('paged'); $page = !empty($page) ? intval($page) : 1; $posts_per_page = intval(get_query_var('posts_per_page')); $pages = intval(ceil($wp_query->found_posts / $posts_per_page)); } $output = ""; if ($pages > 1) { $output .= "$before$title"; $ellipsis = "..."; if ($page > 1 && !empty($previouspage)) { $output .= "$previouspage"; } $min_links = $range * 2 + 1; $block_min = min($page - $range, $pages - $min_links); $block_high = max($page + $range, $min_links); $left_gap = (($block_min - $anchor - $gap) > 0) ? true : false; $right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false; if ($left_gap && !$right_gap) { $output .= sprintf('%s%s%s', alihan_emm_paginate_loop(1, $anchor), $ellipsis, alihan_emm_paginate_loop($block_min, $pages, $page) ); } else if ($left_gap && $right_gap) { $output .= sprintf('%s%s%s%s%s', alihan_emm_paginate_loop(1, $anchor), $ellipsis, alihan_emm_paginate_loop($block_min, $block_high, $page), $ellipsis, alihan_emm_paginate_loop(($pages - $anchor + 1), $pages) ); } else if ($right_gap && !$left_gap) { $output .= sprintf('%s%s%s', alihan_emm_paginate_loop(1, $block_high, $page), $ellipsis, alihan_emm_paginate_loop(($pages - $anchor + 1), $pages) ); } else { $output .= alihan_emm_paginate_loop(1, $pages, $page); } if ($page < $pages && !empty($nextpage)) { $output .= "$nextpage"; } $output .= $after; } if ($echo) { echo $output; } return $output; } /** * Helper function for pagination which builds the page links. * * @access private * * @author Eric Martin * @copyright Copyright (c) 2009, Eric Martin ------------------------------------------------------------------------------- Copyright (c) 2009 Eric Martin http://www.ericmmartin.com/ Link: http://www.ericmmartin.com/pagination-function-for-wordpress License : http://www.gnu.org/licenses/gpl-2.0.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (license.txt); if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- * @version 1.0 * * @param int $start The first link page. * @param int $max The last link page. * @return int $page Optional, default is 0. The current page. */ function alihan_emm_paginate_loop($start, $max, $page = 0) { $output = ""; for ($i = $start; $i <= $max; $i++) { $output .= ($page === intval($i)) ? "$i" : "$i"; } return $output; } /////////////////////////////////////// function the_title_check () { $post_title = trim( the_title('','',false) ); if( $post_title == '') {?>

 
Green Nature Theme by Ali Han"; } ?>