XPressME Integration Kit

Trac

Changeset 126


Ignore:
Timestamp:
Mar 20, 2009, 9:50:54 PM (15 years ago)
Author:
toemon
Message:

投稿者ブロックの調整
list_authors()からwp_list_authors()に変更
この変更をもってデザイン面での修正 #70 も終了とする

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/templates/source/authors_block.html

    r121 r126  
    22        The template tag of the following list can be used.  
    33                <{$block.err_message}>                                  // When the block cannot be displayed, this outputs the reason. Please do not delete it. 
    4                 <{$block.data_count}>                                   // The number of archives is displayed.  
    5                 <{$block.contents}>                                             // Data array of archives.  
    6                 // Examples of <{$block.contents}> 
    7                 <{foreach from=$block.contents item=content}>   // Loop 
    8                 <{$content.author}>                                             // the author name is displayed as a link to their posts. Optionally this tag displays each author's post count. 
    9                 <{/foreach}>                                                    // End of Loop 
     4                <{$block.authors}>                                              // Displays Authors from wp_list_authors() function 
    105************************* End of usage ************************ *}> 
    116<{* Start Template *}> 
     
    149        <{$block.err_message}> 
    1510        <div class="xpress_authors_block"> 
    16                 <ul> 
    17                 <{foreach from=$block.contents item=content}> 
    18                         <li> 
    19                         <{$content.author}> 
    20                         </li> 
    21                 <{/foreach}> 
    22                 </ul> 
     11                <{$block.authors}> 
    2312        </div> 
    2413</div> 
  • trunk/wp-content/themes/xpress_default/blocks/authors_block_theme.php

    r120 r126  
    1010        $mydirpath = get_xpress_dir_path(); 
    1111         
     12        $param = array( 
     13                'optioncount' => $optioncount,  
     14                'exclude_admin' => $exclude_admin,  
     15                'format' => $format,  
     16                'show_fullname' => $show_fullname,  
     17                'hide_empty' => $hide_empty, 
     18                'feed' => '', 
     19                'feed_image' => '' 
     20        ); 
    1221        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() ; 
     22                wp_list_authors($param); 
     23                $list_authors = ob_get_contents() ; 
    1624        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; 
     25        $output = "<ul>\n" . $list_authors . "\n</ul>\n"; 
     26         
     27        $block['authors'] = $output; 
    3128         
    3229        return $block ; 
Note: See TracChangeset for help on using the changeset viewer.