- Timestamp:
- Mar 15, 2010, 3:32:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php
r544 r545 479 479 $post_id = $GLOBALS['post']->ID; 480 480 } 481 if ( empty($blogid) ) { 482 $blogid = $blog_id; 483 } 481 484 482 485 $post_id = intval($post_id); 483 486 if($post_id==0) return null; 484 487 if(!isset($post_cache_views[$post_id])){ 485 if (is_null($blog _id)){488 if (is_null($blogid)){ 486 489 $blog_where = ''; 487 490 } else { 488 $blog_where = ' AND blog_id = '. $blog _id;491 $blog_where = ' AND blog_id = '. $blogid; 489 492 } 490 493 $sql = "SELECT post_views FROM " . get_wp_prefix() . "views" . " WHERE post_id=$post_id " . $blog_where; … … 937 940 $data->post_modified_date_time = $data->post_modified_date . ' ' . $data->post_modified_time; 938 941 939 $data->post_unix_time = xpress_get_post_unix_time($data->post_id, $data->brog_id); 942 ob_start(); 943 the_time('U'); 944 $data->post_unix_time = ob_get_contents(); 945 ob_end_clean(); 940 946 941 947 ob_start(); … … 955 961 $data->comments_link = ob_get_contents(); 956 962 ob_end_clean(); 963 964 $data->post_views = xpress_post_views_count('post_id=' . $data->post_id . '&blogid=' . $data->brog_id . '&format=' . __('Views :%d', 'xpress'). '&echo=0'); 965 957 966 $data_array[] = $data; 958 967 } // end whilwe … … 978 987 } 979 988 980 function xpress_get_post_unix_time($post_id=0,$b_id=1)981 {982 global $wpdb;983 $post_id= (int)$post_id;984 $b_id = (int)$b_id;985 986 $db_prefix = get_wp_prefix();987 988 if (empty($b_id)) $b_id =1;989 $blog_prefix = '';990 if ($b_id >1) $blog_prefix = $b_id . '_';991 $post_tb = $db_prefix . $blog_prefix .'posts';992 993 $sql = "SELECT UNIX_TIMESTAMP(post_date) AS post_timestamp FROM $post_tb WHERE ID = $post_id";994 $post_timestamp = $wpdb->get_var($sql);995 return $post_timestamp;996 }997 989 function xpress_get_blog_option($option_name,$b_id = 1) 998 990 {
Note: See TracChangeset
for help on using the changeset viewer.