Changeset 451 for branches/XPressMU/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php
- Timestamp:
- Nov 20, 2009, 2:52:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/XPressMU/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php
r425 r451 1 1 <?php 2 //if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; 3 2 // Block Version: 1.0 4 3 function recent_posts_content_block($options) 5 4 { 6 5 $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 7 6 $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] ); 8 $day_select = ($options[2])?intval($options[2]):0; 9 $day_size = ($options[3])?intval($options[3]):0; 10 $disp_count = ($options[4])?intval($options[4]):10; 11 $excerpt = empty( $options[5] ) ? false : true ; 12 $excerpt_size = ($options[6])?intval($options[6]):100; 13 $date_format = empty( $options[7] ) ? '' : $options[7] ; 14 $time_format = empty( $options[8] ) ? '' : $options[8] ; 15 $tag_select = $options[9] ; 16 $selected = array_slice($options,10); // get allowed cats 17 7 $disp_count = ($options[2])?intval($options[2]):10; 8 $excerpt = empty( $options[3] ) ? false : true ; 9 $excerpt_size = ($options[4])?intval($options[4]):100; 10 $date_format = empty( $options[5] ) ? '' : $options[5] ; 11 $time_format = empty( $options[6] ) ? '' : $options[6] ; 12 $tag_select = $options[7] ; 13 $cat_select = empty( $options[8] ) ? '0' : $options[8] ; 14 $day_select = ($options[9])?intval($options[9]):0; 15 $day_size = ($options[10])?intval($options[10]):0; 16 17 $selected = explode(',' , $cat_select); 18 18 19 $mydirpath = get_xpress_dir_path(); 19 20 … … 21 22 if (empty($time_format)) $time_format = get_settings('time_format'); 22 23 if(empty($tag_select)) $tag_where = ''; else $tag_where = "tag='$tag_select'&"; 23 24 if (array_search(0,$selected)===0) $cat_select = 0; 25 24 26 $selected_author_id = xpress_selected_author_id('echo=0'); 25 27 if (!empty($selected_author_id)){ … … 37 39 if (!is_null($wpdb)){ 38 40 $wp_query->in_the_loop = true; //for use the_tags() in multi lopp 39 if (array_search(0,$selected)===0) { 41 if ($cat_select) { 42 $r = new WP_Query($author_where . $tag_where ."cat=$cat_select&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 43 } else { 40 44 $r = new WP_Query($author_where . $tag_where ."showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 41 } else {42 $cat_id = implode(',',$selected);43 $r = new WP_Query($author_where . $tag_where ."cat=$cat_id&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish");44 45 } 45 46 while($r->have_posts()){ … … 52 53 if ($day_select == 2){ 53 54 $post_date = mktime (0, 0, 0, get_the_time("m"), get_the_time("d"), get_the_time("Y")); 54 if (empty($la stes_date)) $lastes_date = $post_date;55 $base_date = $la stes_date - $between_days;55 if (empty($latest_date)) $latest_date = $post_date; 56 $base_date = $latest_date - $between_days; 56 57 if ($post_date < $base_date) continue; 57 58 }
Note: See TracChangeset
for help on using the changeset viewer.