Changeset 545
- Timestamp:
- Mar 15, 2010, 3:32:59 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/templates/source/global_recent_posts_list_block.html
r537 r545 23 23 <{$content.post_category}> // Displays a link to the category or categories a post belongs to. 24 24 <{$content.post_tags}> // Displays a link to the tag or tags a post belongs to. 25 //<{$content.post_views}> // Displays the number of posts viewer.26 //<{$content.new_mark}> // The mark is displayed. The mark is different according to lapsed days from the release date.25 <{$content.post_views}> // Displays the number of posts viewer. 26 <{$content.new_mark}> // The mark is displayed. The mark is different according to lapsed days from the release date. 27 27 <{/foreach}> // End of Loop 28 28 ************************* End of usage ************************ *}> … … 35 35 <{foreach from=$block.contents item=content}> 36 36 <li> 37 <{$content. title_link}><br />37 <{$content.new_mark}> <{$content.title_link}><br /> 38 38 <{$content.post_date_time}><br /> 39 39 <{$content.blog_link}><br /> -
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 { -
trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_posts_list_block_theme.php
r540 r545 22 22 $data_array = xpress_grobal_recent_posts($disp_count); 23 23 $item_no = 0; 24 $red_sec = $disp_red *60*60*24; 25 $green_sec = $disp_green *60*60*24; 24 26 foreach($data_array as $data){ 27 $elapse = time() - $data->post_unix_time; 28 $new_mark = ''; 29 if ($elapse < $red_sec ) { 30 $new_mark = '<em style="color: red; font-size: small;">New! </em>'; 31 32 } else if ($elapse < $green_sec) { 33 $new_mark = '<em style="color: green; font-size: small;">New! </em>'; 34 } 35 $data->new_mark = $new_mark; 36 25 37 $row_data = get_object_vars($data); 26 38
Note: See TracChangeset
for help on using the changeset viewer.