diff -r 000000000000 -r d970ebf37754 wp/wp-content/themes/IN-MOTION-package-u1/in-motion/functions.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wp/wp-content/themes/IN-MOTION-package-u1/in-motion/functions.php Wed Nov 06 03:21:17 2013 +0000 @@ -0,0 +1,288 @@ + 'Main Navigation Menu' + ) + ); + } + + // Declare sidebar widget zone + if (function_exists('register_sidebar')) { + register_sidebar(array( + 'name' => 'Sidebar-1 Widgets', + 'id' => 'sidebar-1-widgets', + 'description' => 'These are widgets for the sidebar.', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '
' + )); + } + + /* start footer widgets */ + function new_widgets_init() { + register_sidebar(array( + 'name' => 'Footer First Column Sidebar', + 'id' => 'first-footer-column-sidebar', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + )); + register_sidebar(array( + 'name' => 'Footer Second Column Sidebar', + 'id' => 'second-footer-column-sidebar', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + )); + register_sidebar(array( + 'name' => 'Footer Third Column Sidebar', + 'id' => 'third-footer-column-sidebar', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + )); + register_sidebar(array( + 'name' => 'Footer Fourth Column Sidebar', + 'id' => 'fourth-footer-column-sidebar', + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + )); + } + add_action( 'init', 'new_widgets_init' ); + /* end footer widgets */ + + + add_theme_support('post-thumbnails'); + + + + if(!function_exists('getPageTitle')) + { + function getPageTitle($pageId) + { + if(!is_numeric($pageId)) + { + return; + } + global $wpdb; + $sql_query = 'SELECT DISTINCT * FROM ' . $wpdb->posts . + ' WHERE ' . $wpdb->posts . '.ID=' . $pageId; + $posts = $wpdb->get_results($sql_query); + if(!empty($posts)) + { + foreach($posts as $post) + { + return nl2br($post->post_title); + } + } + } + } + + + function getPostViews($postID){ + $count_key = 'post_views_count'; + $count = get_post_meta($postID, $count_key, true); + if($count==''){ + delete_post_meta($postID, $count_key); + add_post_meta($postID, $count_key, '0'); + return "0 View"; + } + return $count; + } + function setPostViews($postID) { + $count_key = 'post_views_count'; + $count = get_post_meta($postID, $count_key, true); + if($count==''){ + $count = 0; + delete_post_meta($postID, $count_key); + add_post_meta($postID, $count_key, '0'); + }else{ + $count++; + update_post_meta($postID, $count_key, $count); + } + } + function SearchFilter($query) { + if ($query->is_search) { + $query->set('post_type', 'post'); + } + return $query; + } + + add_filter('pre_get_posts','SearchFilter'); + + include("functions/widget-posts.php"); + include("functions/widget-twitter.php"); + include("functions/widget-Flickr.php"); + include("functions/widget-video.php"); + include("functions/custom-post.php"); + include("functions/custom-portfolio.php"); + include("functions/custom-page.php"); + include("functions/shortcodes.php"); + include("functions/contact.php"); + + + function menu($page_number){ + echo ''; + } + + function topHeaderDisplay() + { + echo '
'; + echo '
'; + if ( function_exists( 'get_option_tree' ) ) { + $logo = get_option_tree( 'logo' ); + } + if ( $logo ) { + echo ''; + } + + echo '
'; + $socials2=''; + if ( function_exists( 'get_option_tree' ) ) { + if (get_option_tree( 'social_icons')) { + $socials2= get_option_tree( 'social_icons', $option_tree, false, true, -1 ); + $img_num = 1; + if(!empty($socials2)){ + echo '
'; + echo '
'; + } } } + echo '
'; + } + + + + + +/* start for comments */ +if ( ! function_exists( 'inmotion_comment' ) ) : +function inmotion_comment( $comment, $args, $depth ) { + $GLOBALS['comment'] = $comment; + switch ( $comment->comment_type ) : + case 'pingback' : + case 'trackback' : + ?> +
  • +

    ', '' ); ?>

    + +
  • id="li-comment-"> +
    +
    +
    + comment_parent ) + $avatar_size = 39; + + echo get_avatar( $comment, $avatar_size ); + + /* translators: 1: comment author, 2: date and time */ + printf( '%1$s %2$s', + sprintf( '%s', get_comment_author_link() ), + sprintf( '', + esc_url( get_comment_link( $comment->comment_ID ) ), + get_comment_time( 'c' ), + /* translators: 1: date, 2: time */ + sprintf( '%1$s at %2$s', get_comment_date(), get_comment_time() ) + ) + ); + ?> + + ', '' ); ?> +
    + + comment_approved == '0' ) : ?> + +
    + + +
    + +
    + +
    + __( 'Reply', 'pego_tr' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> +
    +
    + + \ No newline at end of file