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_content_block_theme.php

    r429 r435  
    66        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 
    77        $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  
     8        $disp_count =  ($options[2])?intval($options[2]):10; 
     9        $excerpt = empty( $options[3] ) ? false : true ; 
     10        $excerpt_size =  ($options[4])?intval($options[4]):100; 
     11        $date_format = empty( $options[5] ) ? '' : $options[5] ; 
     12        $time_format = empty( $options[6] ) ? '' : $options[6] ; 
     13        $tag_select = $options[7] ; 
     14        $cat_select = empty( $options[8] ) ? '0' : $options[8] ; 
     15        $day_select = ($options[9])?intval($options[9]):0; 
     16        $day_size = ($options[10])?intval($options[10]):0; 
     17 
     18        $selected = explode(',' , $cat_select); 
     19         
    1820        $mydirpath = get_xpress_dir_path(); 
    1921         
     
    2123        if (empty($time_format)) $time_format = get_settings('time_format'); 
    2224        if(empty($tag_select)) $tag_where = ''; else $tag_where = "tag='$tag_select'&"; 
    23          
     25        if (array_search(0,$selected)===0) $cat_select = 0; 
     26 
    2427        $selected_author_id = xpress_selected_author_id('echo=0');       
    2528        if (!empty($selected_author_id)){ 
     
    3740        if (!is_null($wpdb)){ 
    3841                $wp_query->in_the_loop = true;          //for use the_tags() in multi lopp  
    39                 if (array_search(0,$selected)===0) { 
     42                if ($cat_select) { 
     43                        $r = new WP_Query($author_where . $tag_where ."cat=$cat_select&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
     44                } else { 
    4045                        $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"); 
    4446                } 
    4547                while($r->have_posts()){                         
Note: See TracChangeset for help on using the changeset viewer.