XPressME Integration Kit

Trac


Ignore:
Timestamp:
Jun 8, 2009, 5:55:59 PM (15 years ago)
Author:
toemon
Message:

#137 WordPressME2.0.11への対応(ブロックの対応)

File:
1 edited

Legend:

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

    r157 r262  
    6464                        ob_end_clean();  
    6565                         
    66                         ob_start(); 
    67                                 the_tags(__('Tags:', 'kubrick') . ' ',' • ',''); 
    68                                 $tags = ob_get_contents(); 
    69                         ob_end_clean(); 
     66                        if (function_exists('the_tags')){ 
     67                                ob_start(); 
     68                                        the_tags(__('Tags:', 'xpress') . ' ',' • ',''); 
     69                                        $tags = ob_get_contents(); 
     70                                ob_end_clean();  
     71                        } else { 
     72                                $tags = ''; 
     73                        } 
    7074                         
    7175                        ob_start(); 
     
    7377                                $post_modified_date = ob_get_contents(); 
    7478                        ob_end_clean(); 
    75                          
     79 
    7680                        ob_start(); 
    7781                                the_modified_date($time_format); 
     
    141145        } 
    142146        return $block ; 
    143  
    144  
    145  
    146  
    147  
    148  
    149  
    150  
    151  
    152  
    153  
    154  
    155  
    156  
    157  
    158  
    159  
    160  
    161  
    162  
    163  
    164  
    165  
    166  
    167  
    168  
    169  
    170  
    171  
    172  
    173  
    174  
    175  
    176  
    177  
    178  
    179  
    180  
    181  
    182  
    183  
    184  
    185  
    186  
    187                  
    188         if (strstr($call_url,$this_url)){ 
    189                 $output ='<!-- xpress_recent_entries direct load -->' . "\n"; 
    190                 if (array_search(0,$selected)===0) { 
    191                         $r = new WP_Query("showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
    192                 } else { 
    193                         $cat_id = implode(',',$selected); 
    194                         $r = new WP_Query("cat=$cat_id&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish"); 
    195                 }        
    196                 if ($r->have_posts()) { 
    197                         $red_sec = $disp_red *60*60*24; 
    198                         $green_sec = $disp_green *60*60*24; 
    199                         $output .= '<!-- xpress_recent_block -->' . "\n" . '<ul>'; 
    200                         while ($r->have_posts()){ 
    201                                 $r->the_post(); 
    202                                 ob_start(); 
    203                                         if ( get_the_title() ) { 
    204                                                 the_title(); 
    205                                         } else { 
    206                                                 the_ID(); 
    207                                         } 
    208                                         $title = ob_get_contents(); 
    209                                 ob_end_clean(); 
    210                                 ob_start(); 
    211                                         the_time('U'); 
    212                                         $post_time = ob_get_contents(); 
    213                                 ob_end_clean(); 
    214                                 $elapse = time() - $post_time; 
    215                                 $new_mark = ''; 
    216                                 if ($elapse < $red_sec ) { 
    217                                         $new_mark = '<em style="color: red; font-size: small;">New!</em>'; 
    218  
    219                                 } else if ($elapse < $green_sec) { 
    220                                         $new_mark = '<em style="color: green; font-size: small;">New!</em>'; 
    221                                 } 
    222                                 ob_start(); 
    223                                         the_permalink(); 
    224                                         $permalink = ob_get_contents(); 
    225                                 ob_end_clean();  
    226                                 ob_start(); 
    227                                         the_author(); 
    228                                         $author = ob_get_contents(); 
    229                                 ob_end_clean(); 
    230                                 $output .=  '<li><a href="' . $permalink . '">' . $title . '</a> '; 
    231                                 if ($show_new) { 
    232                                         $output .= $new_mark ; 
    233                                 } 
    234                                 if ($show_author){ 
    235                                         $output .= ' ' . $author; 
    236                                 } 
    237                                 switch($show_date){ 
    238                                         case 1 : 
    239                                                 $format = get_settings('date_format'); 
    240                                                 $output .= '<p class="recentpost_time">(' . date($format,$post_time) . ')</p>'; 
    241                                                 break; 
    242                                         case 2 : 
    243                                                 $format = get_settings('date_format') . ' ' . get_settings('time_format'); 
    244                                                 $output .= '<p class="recentpost_time">(' . date($format,$post_time) . ')</p>'; 
    245                                                 break; 
    246                                         default :                                                        
    247                                 } 
    248                                 $output .= '</li>'. "\n";                                
    249                         } 
    250                         $output .= '</ul>'; 
    251                 } 
    252                 $block['content'] = $output; 
    253         } else { 
    254                 $para  = '?showposts=' . $disp_count; 
    255                 $para .= '&show_new=' . $show_new; 
    256                 $para .= '&disp_red=' . $disp_red; 
    257                 $para .= '&disp_green=' . $disp_green; 
    258                 $para .= '&show_author=' . $show_author; 
    259                 $para .= '&show_date=' .$show_date; 
    260                 $para .= '&cat_id=' . implode(',',$selected); 
    261  
    262                 $block['content'] = fetch_block($mydirname,$bid,'recent_entries_block',$para); 
    263         } 
    264         return $block ;  
    265  
    266147} 
    267  
    268148?> 
Note: See TracChangeset for help on using the changeset viewer.