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