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/popular_posts_block_theme.php

    r418 r435  
    99        $time_format = empty( $options[5] ) ? '' : $options[5] ; 
    1010        $tag_select = $options[6] ; 
    11         $selected = array_slice($options, 7); // get allowed cats 
     11        $cat_select = empty( $options[7] ) ? '0' : $options[7] ; 
     12         
     13        $selected = explode(',' , $cat_select); 
    1214 
    1315        $mydirpath = get_xpress_dir_path(); 
     
    1517        if (empty($date_format)) $date_format = get_settings('date_format'); 
    1618        if (empty($time_format)) $time_format = get_settings('time_format'); 
    17         if (array_search(0,$selected)===0) { 
    18                 $cat_select = false; 
    19         }else { 
    20                 $cat_select = true;                      
    21         } 
    22         $cat_id = implode(',',$selected); 
     19        if (array_search(0,$selected)===0) $cat_select = 0; 
     20         
     21        $cat_select; 
    2322        $block = array(); 
    2423        $item_no = 0;    
     
    5857 
    5958                if ($cat_select) { 
    60                         $where .= " AND ($term_taxonomy.term_id IN ($cat_id))"; 
     59                        $where .= " AND ($term_taxonomy.term_id IN ($cat_select))"; 
    6160                } 
    6261                 
     
    7574                 
    7675                if ($cat_select) { 
    77                         $where .= " AND ($post2cat_tb.category_id IN ($cat_id))"; 
     76                        $where .= " AND ($post2cat_tb.category_id IN ($cat_select))"; 
    7877                } 
    7978        } 
Note: See TracChangeset for help on using the changeset viewer.