XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/global_recent_posts_list_block_theme.php @ 537

Last change on this file since 537 was 537, checked in by toemon, 14 years ago

MultiBlog用に最近の投稿(全ブログ)を追加 r536とあわせ Fixes #302

File size: 1.4 KB
Line 
1<?php
2// Block Version: 1.0
3function global_recent_posts_list_block($options)
4{
5        if (is_admin()) return;
6        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
7        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_list_block.html' : trim( $options[1] );
8        $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
9        $disp_red = empty( $options[3] ) ? '1' : $options[3] ;
10        $disp_green = empty( $options[4] ) ? '7' : $options[4] ;
11        $date_format = empty( $options[5] ) ? '' : $options[5] ;
12        $time_format = empty( $options[6] ) ? '' : $options[6] ;
13        $mydirpath = get_xpress_dir_path();
14       
15        if (xpress_is_multiblog() && function_exists('get_blog_list')){
16                if (empty($date_format)) $date_format = get_settings('date_format');
17                if (empty($time_format)) $time_format = get_settings('time_format');
18                if(empty($tag_select)) $tag_where = ''; else $tag_where = "tag='$tag_select'&";
19               
20                global $wpdb,$wp_query;
21                $block = array();
22               
23                $data_array = xpress_grobal_recent_posts($disp_count);
24                $item_no = 0;
25                foreach($data_array as $data){
26                        $row_data = get_object_vars($data);
27                               
28                        $block['contents']['item'.$item_no] = $row_data;
29                        $item_no++;
30                }
31                $block['data_count'] = $item_no;  //xml unserialise error
32        } else {
33                $block['err_message'] = __('This blog is not set to the multi blog.', 'xpress');
34        }
35               
36        return $block ;
37}
38?>
Note: See TracBrowser for help on using the repository browser.