XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 13, 2009, 6:38:28 PM (14 years ago)
Author:
toemon
Message:

ブロックオプション、カテゴリのマルチセレクトをカンマ区切りデータとして格納するようにした。 #243

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/recent_posts_list_block_theme.php

    r272 r435  
    1010        $time_format = empty( $options[6] ) ? '' : $options[6] ; 
    1111        $tag_select = $options[7] ; 
    12         $selected = array_slice($options,8); // get allowed cats 
     12        $cat_select = empty( $options[8] ) ? '0' : $options[8] ; 
     13         
     14        $selected = explode(',' , $cat_select); 
    1315 
    1416        $mydirpath = get_xpress_dir_path(); 
     
    1719        if (empty($time_format)) $time_format = get_settings('time_format'); 
    1820        if(empty($tag_select)) $tag_where = ''; else $tag_where = "tag='$tag_select'&"; 
     21        if (array_search(0,$selected)===0) $cat_select = 0; 
    1922 
    2023        $selected_author_id = xpress_selected_author_id('echo=0');       
     
    3033        if (!is_null($wpdb)){ 
    3134                $wp_query->in_the_loop = true;          //for use the_tags() in multi lopp  
    32                 if (array_search(0,$selected)===0) { 
     35                if ($cat_select) { 
     36                        $r = new WP_Query($author_where . $tag_where . "cat=$cat_select&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
     37                } else { 
    3338                        $r = new WP_Query($author_where . $tag_where ."showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
    34  
    35                 } else { 
    36                         $cat_id = implode(',',$selected); 
    37                         $r = new WP_Query($author_where . $tag_where . "cat=$cat_id&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
    3839                } 
    3940                while($r->have_posts()){                         
Note: See TracChangeset for help on using the changeset viewer.