Last change
on this file since 110 was
110,
checked in by toemon, 16 years ago
|
アーカイブブロック、投稿者ブロックの実装。
テンプレートのusage修正
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php
|
---|
2 | function authors_block($options)
|
---|
3 | {
|
---|
4 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
5 | $optioncount = empty( $options[1] ) ? false : true ;
|
---|
6 | $exclude_admin = empty( $options[2] ) ? false : true ;
|
---|
7 | $show_fullname = empty( $options[3] ) ? false : true ;
|
---|
8 | $hide_empty = empty( $options[4] ) ? false : true ;
|
---|
9 | $this_template = empty( $options[5] ) ? 'db:'.$mydirname.'_block_authors.html' : trim( $options[5] );
|
---|
10 | $mydirpath = get_xpress_dir_path();
|
---|
11 |
|
---|
12 | ob_start();
|
---|
13 | // wp_list_authors($optioncount, $exclude_admin, $show_fullname,$hide_empty);
|
---|
14 | list_authors($optioncount, $exclude_admin, $show_fullname,$hide_empty);
|
---|
15 | $output=ob_get_contents() ;
|
---|
16 | ob_end_clean();
|
---|
17 | $output = preg_replace('/<li>/', '' ,$output); // "<li>" is deleted.
|
---|
18 | $output = preg_replace('/<\/li>/', '|' ,$output); // "</li>" replace "|".
|
---|
19 | $output = preg_replace('/\|$/', '' ,$output); // "|" at the end of line is deleted.
|
---|
20 |
|
---|
21 | $authors = explode('|',$output);
|
---|
22 | $item_no = 0;
|
---|
23 | foreach ($authors as $author){
|
---|
24 | $row_data = array(
|
---|
25 | 'author' => $author
|
---|
26 | );
|
---|
27 | $block['contents']['item'.$item_no] = $row_data;
|
---|
28 | $item_no++;
|
---|
29 | }
|
---|
30 | $block['data_count'] = $item_no;
|
---|
31 |
|
---|
32 | return $block ;
|
---|
33 | }
|
---|
34 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.