XPressME Integration Kit

Trac


Ignore:
Timestamp:
Oct 7, 2011, 8:59:37 AM (13 years ago)
Author:
toemon
Message:

マルチサイト用、最近の投稿(全ブログ)ブロックのオプションに「対象ブログの除外」、「ブログ毎に抽出」を追加、ブロックオプションのデフォルトテンプレートの誤りを修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Ver2.4/xpressme_integration_kit/wp-content/plugins/xpressme/include/custom_functions.php

    r688 r792  
    891891} 
    892892 
    893 function xpress_grobal_recent_posts($num = 10,$post_list='') 
     893function xpress_grobal_recent_posts($num = 10,$exclusion_blog = 0, $shown_for_each_blog = false) 
    894894{ 
    895895        global $wpdb, $wp_rewrite , $switched , $blog_id; 
    896896        if (empty($date_format)) $date_format = get_settings('date_format'); 
    897897        if (empty($time_format)) $time_format = get_settings('time_format'); 
     898        $exclusion = explode(',' , $exclusion_blog); 
     899 
    898900 
    899901        $first_blogid = $blog_id; 
     
    904906                $blogs = get_blog_list(0,'all'); 
    905907                foreach ($blogs AS $blog) { 
     908                        if (!in_array(0, $exclusion) && in_array($blog['blog_id'], $exclusion)) continue; 
    906909                        switch_to_blog($blog['blog_id']); 
    907910                        $wp_rewrite->init();  // http://core.trac.wordpress.org/ticket/12040 is solved, it is unnecessary. 
     
    922925                                                ob_end_clean(); 
    923926                                                 
    924                                                 $data->brog_id = $blog['blog_id']; 
     927                                                $data->blog_id = $blog['blog_id']; 
    925928                                                $data->blog_name = get_bloginfo('name'); 
    926929                                                $data->blog_url = get_bloginfo('url'); 
     
    995998                                                 
    996999                                                $data->post_views = xpress_post_views_count('post_id=' . $data->post_id . '&blogid=' . $data->brog_id . '&format=' . __('Views :%d', 'xpress'). '&echo=0'); 
     1000                                                if (function_exists('the_qf_get_thumb_one')){ 
     1001                                                        $data->post_thumbnail = the_qf_get_thumb_one("num=0&width=120&tag=1","",$data->the_full_content); 
     1002                                                } else { 
     1003                                                        $data->post_thumbnail = get_the_post_thumbnail(null,'thumbnail'); 
     1004                                                } 
     1005                                                $data->author_avatar =get_avatar(get_the_author_meta('ID'),$size = '32'); 
    9971006 
    9981007                                                $data_array[] = $data; 
     
    10061015 
    10071016                restore_current_blog(); 
     1017        } 
     1018        if (!$shown_for_each_blog){ 
    10081019                usort($data_array, "the_time_cmp"); 
    1009         } 
    1010          
    1011         if (!empty($num)){ 
    1012                 $data_array = array_slice($data_array,0,$num); 
     1020                if (!empty($num)){ 
     1021                        $data_array = array_slice($data_array,0,$num); 
     1022                } 
    10131023        } 
    10141024        return $data_array; 
Note: See TracChangeset for help on using the changeset viewer.