Last change
on this file since 120 was
120,
checked in by toemon, 15 years ago
|
ブロックオプションの$selected = array_slice()部分が最後になるようにするため、ブロックオプションの$this_templateの位置を最後尾から2番目に変更
Ver 0.09 bump
|
File size:
1.2 KB
|
Rev | Line | |
---|
[110] | 1 | <?php
|
---|
| 2 | function authors_block($options)
|
---|
| 3 | {
|
---|
| 4 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 5 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_authors.html' : trim( $options[1] );
|
---|
| 6 | $optioncount = empty( $options[2] ) ? false : true ;
|
---|
| 7 | $exclude_admin = empty( $options[3] ) ? false : true ;
|
---|
| 8 | $show_fullname = empty( $options[4] ) ? false : true ;
|
---|
| 9 | $hide_empty = empty( $options[5] ) ? false : true ;
|
---|
[110] | 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.