XPressME Integration Kit

Trac

Changeset 125


Ignore:
Timestamp:
Mar 20, 2009, 12:47:52 PM (15 years ago)
Author:
toemon
Message:

サイドバーの追加 と アーカイブブロックの修正 #74 bump Ver0.11

Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/blocks/archives_block.php

    r121 r125  
    2020                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 
    2121                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_block_category.html' : trim( $options[1] ); 
    22                 $type = empty( $options[2] ) ? false : true ; 
    23                 $limit = empty( $options[3] ) ? '10' : $options[3] ; 
     22                $type = empty( $options[2] ) ? 'monthly' : $options[2] ; 
     23                $limit  = !is_numeric( $options[3] ) ? 0 : $options[3] ; 
    2424                $show_post_count = empty( $options[4] ) ? false : true ;                 
    2525                $drop_down = empty( $options[5] ) ? false : true ; 
     
    3333                $a_week = _MB_XPRESS_ARC_WEEK ;          
    3434 
    35                 $form .= "<br />" . yes_no_radio_option('options[2]', _MB_XPRESS_ARC_TYPE , $type,$a_month,$a_week); 
    36                 $form .= "<br />" . _MB_XPRESS_COUNT . "  <input type='text' name='options[3]' value='" . $limit . "' />"; 
     35                $form .= _MB_XPRESS_ARC_TYPE .": "; 
     36                $form .=  "<select name='options[2]'>"; 
     37                if ($type =='yearly') 
     38                        $form .=  "<option value='yearly' selected='selected'>". _MB_XPRESS_ARC_YEAR; 
     39                else 
     40                        $form .=  "<option value='yearly'>". _MB_XPRESS_ARC_YEAR; 
     41                 
     42                if ($type =='monthly') 
     43                        $form .=  "<option value='monthly' selected='selected'>". _MB_XPRESS_ARC_MONTH; 
     44                else 
     45                        $form .=  "<option value='monthly'>". _MB_XPRESS_ARC_MONTH; 
     46                 
     47                if ($type =='weekly') 
     48                        $form .=  "<option value='weekly' selected='selected'>". _MB_XPRESS_ARC_WEEK; 
     49                else 
     50                        $form .=  "<option value='weekly'>". _MB_XPRESS_ARC_WEEK; 
     51                 
     52                if ($type =='daily') 
     53                        $form .=  "<option value='daily' selected='selected'>". _MB_XPRESS_ARC_DAY; 
     54                else 
     55                        $form .=  "<option value='daily'>". _MB_XPRESS_ARC_DAY; 
     56 
     57                if ($type =='postbypost') 
     58                        $form .=  "<option value='postbypost' selected='selected'>". _MB_XPRESS_ARC_POST; 
     59                else 
     60                        $form .=  "<option value='postbypost'>". _MB_XPRESS_ARC_POST; 
     61 
     62                $form .=  "</select><br/>"; 
     63                 
     64                $form .= "<br />" . _MB_XPRESS_COUNT_ZERO_ALL . "  <input type='text' name='options[3]' value='" . $limit . "' />"; 
    3765                $form .= "<br />" . yes_no_radio_option('options[4]', _MB_XPRESS_SHOW_NUM_OF_POST , $show_post_count); 
    3866                $form .= "<br />" . yes_no_radio_option('options[5]', _MB_XPRESS_SHOW_DROP_DOWN , $drop_down); 
  • trunk/language/ja_utf8/blocks.php

    r122 r125  
    44// general       
    55        define("_MB_XPRESS_COUNT",'表示数'); 
     6        define("_MB_XPRESS_COUNT_ZERO_ALL",'表示数(0の場合全てを表示)'); 
    67        define("_MB_XPRESS_LENGTH","長さ"); 
    78        define("_MB_XPRESS_ALL","すべて"); 
     
    4647         
    4748// archives 
    48         define("_MB_XPRESS_ARC_MONTH","月間アーカイブ"); 
    49         define("_MB_XPRESS_ARC_WEEK","週間アーカイブ"); 
    5049        define("_MB_XPRESS_ARC_TYPE","アーカイブタイプ"); 
     50        define("_MB_XPRESS_ARC_YEAR","年別アーカイブ"); 
     51        define("_MB_XPRESS_ARC_MONTH","月別アーカイブ"); 
     52        define("_MB_XPRESS_ARC_WEEK","週別アーカイブ"); 
     53        define("_MB_XPRESS_ARC_DAY","日別アーカイブ"); 
     54        define("_MB_XPRESS_ARC_POST","個別記事アーカイブ"); 
    5155 
    5256// authors       
  • trunk/templates/source/archives_block.html

    r121 r125  
    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.config.is_archive_doropdown}>  // When this returns the true value. The user has selected the archive to be displayed by the drop down list in the setting of the block.   
    6                 <{$block.archive_dropdown}>                             // Displays a dropdown list of links to date-based archives. 
    7                 <{$block.contents}>                                             // Data array of archives.  
    8                 // Examples of <{$block.contents}> 
    9                 <{foreach from=$block.contents item=content}>   // Loop 
    10                 <{$content.archive}>                                    // Displays a list of links to date-based archives. 
    11                 <{/foreach}>                                                    // End of Loop 
     4                <{$block.archive}>                                              // Displays Archives from wp_get_archives() function 
    125************************* End of usage ************************ *}> 
    136<{* Start Template *}> 
     
    169        <{$block.err_message}> 
    1710        <div class="xpress_archive_block"> 
    18                 <{if $block.config.is_archive_doropdown}> 
    19                         <{$block.archive_dropdown}> 
    20                 <{else}> 
    21                         <ul> 
    22                                 <{foreach from=$block.contents item=content}> 
    23                                         <li> 
    24                                         <{$content.archive}> 
    25                                         </li> 
    26                                 <{/foreach}> 
    27                         </ul> 
    28                 <{/if}> 
     11                <{$block.archive}> 
    2912        </div> 
    3013</div> 
  • trunk/wp-content/themes/xpress_default/blocks/archives_block_theme.php

    r120 r125  
    44        $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ; 
    55        $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_archives_block.html' : trim( $options[1] ); 
    6         $type = empty( $options[2] ) ? false : true ; 
    7         $limit = empty( $options[3] ) ? '10' : $options[3] ; 
     6        $type = empty( $options[2] ) ? 'monthly' : $options[2] ; 
     7        $limit  = !is_numeric( $options[3] ) ? 0 : $options[3] ; 
    88        $show_post_count = empty( $options[4] ) ? false : true ;                 
    99        $drop_down = empty( $options[5] ) ? false : true ;       
    1010         
    11         if ($type) { 
    12                 $type_name = 'monthly'; 
     11        switch($type){ 
     12                case 'yearly': 
     13                        $select_str = __('Select Yearly', 'xpress'); 
     14                        break; 
     15                case 'monthly': 
     16                        $select_str = __('Select Monthly', 'xpress'); 
     17                        break; 
     18                case 'weekly': 
     19                        $select_str = __('Select Weekly', 'xpress'); 
     20                        break; 
     21                case 'daily': 
     22                        $select_str = __('Select Daily', 'xpress'); 
     23                        break; 
     24                case 'postbypost': 
     25                        $select_str = __('Select Post', 'xpress'); 
     26                        break; 
     27                default: 
     28                        $select_str = __('Select Monthly', 'xpress'); 
     29        } 
     30         
     31        if ($drop_down) $format = 'option'; else $format = 'html'; 
     32        if ($limit == 0 ) $limit_str = ''; else $limit_str = $limit; 
     33         
     34        $param = array( 
     35                'type' => $type,  
     36                'limit' => $limit_str,  
     37                'format' => $format,  
     38                'before' => '',  
     39                'after' => '', 
     40                'show_post_count' => $show_post_count 
     41        ); 
     42         
     43        ob_start(); 
     44                wp_get_archives($param); 
     45                $get_archives_output = ob_get_contents(); 
     46        ob_end_clean(); 
     47         
     48 
     49        if($drop_down){ 
     50                 
     51 
     52                $output = '<form id="archiveform" action="">'; 
     53                $output .= '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">'; 
     54                $output .= "<option value=''>" . $select_str . "</option>\n"; 
     55                $output .=  $get_archives_output; 
     56                $output .= '</select>'; 
     57                $output .= '</form>'; 
     58                 
     59                $output  = '<select name="archive-dropdown"' . "onChange='document.location.href=this.options[this.selectedIndex].value;'>\n"; 
     60                $output .= '<option value="">'.attribute_escape($select_str) . "</option>\n"; 
     61                $output .=      $get_archives_output; 
     62                $output .=      "</select>\n"; 
     63                 
    1364        } else { 
    14                 $type_name = 'weekly'; 
    15         }                        
    16  
    17         $drop_down_list = '<form id="archiveform" action="">'; 
    18         $drop_down_list .= '<select name="archive_chrono" onchange="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">'; 
    19         $drop_down_list .= "<option value=''>"; 
    20         if ($type) { 
    21                 $drop_down_list .= __('Select Monthly', 'xpress'); 
    22         } else { 
    23                 $drop_down_list .= __('Select Weekly', 'xpress'); 
     65                $output  = "<ul>\n"; 
     66                $output .=  $get_archives_output; 
     67                $output  .= "</ul>\n"; 
    2468        } 
    25         $drop_down_list .=  '</option>'; 
    26         ob_start(); 
    27                 get_archives($type_name,$limit,'option','','',$show_post_count); 
    28                 $drop_down_list .= ob_get_contents(); 
    29         ob_end_clean(); 
    30         $drop_down_list .= '</select>'; 
    31         $drop_down_list .= '</form>';                            
    32  
    33         ob_start(); 
    34                 get_archives($type_name,$limit,'custom','','|',$show_post_count); 
    35                 $output = ob_get_contents(); 
    36         ob_end_clean(); 
    37         $output = preg_replace('/\|$/', '' ,$output); // "|" at the end of line is deleted.  
    38         $archives = explode('|',$output); 
    39         $item_no = 0; 
    40         foreach ($archives as $archive){ 
    41                 $row_data = array( 
    42                         'archive'               => $archive 
    43                 ); 
    44                 $block['contents']['item'.$item_no] = $row_data; 
    45                 $item_no++; 
    46         } 
    47         $block['data_count'] = $item_no; 
    48         $block['config']['is_archive_doropdown'] = $drop_down; 
    49         $block['archive_dropdown'] = $drop_down_list; 
     69        $block['archive'] = $output; 
    5070        return $block ;  
    5171} 
  • trunk/wp-content/themes/xpress_default/ja.po

    r122 r125  
    1818"Report-Msgid-Bugs-To: wp-polyglots@lists.automattic.com\n" 
    1919"POT-Creation-Date: 2008-08-15 21:16+0900\n" 
    20 "PO-Revision-Date: 2009-03-19 16:41+0900\n" 
     20"PO-Revision-Date: 2009-03-20 12:18+0900\n" 
    2121"Last-Translator: toemon <toychee@toemon.com>\n" 
    2222"Language-Team: toemon <info@toemon.com>\n" 
     
    654654msgstr "この投稿を編集 " 
    655655 
    656 #: xpress_default/blocks/archives_block_theme.php:21 
     656#: xpress_default/blocks/archives_block_theme.php:13 
     657msgid "Select Yearly" 
     658msgstr "年を選択" 
     659 
     660#: xpress_default/blocks/archives_block_theme.php:16 
     661#: xpress_default/blocks/archives_block_theme.php:28 
    657662msgid "Select Monthly" 
    658663msgstr "月を選択" 
    659664 
    660 #: xpress_default/blocks/archives_block_theme.php:23 
     665#: xpress_default/blocks/archives_block_theme.php:19 
    661666msgid "Select Weekly" 
    662667msgstr "週を選択" 
     668 
     669#: xpress_default/blocks/archives_block_theme.php:22 
     670msgid "Select Daily" 
     671msgstr "日を選択" 
     672 
     673#: xpress_default/blocks/archives_block_theme.php:25 
     674msgid "Select Post" 
     675msgstr "記事を選択" 
    663676 
    664677#: xpress_default/blocks/calender_block_theme.php:71 
  • trunk/xoops_version.php

    r124 r125  
    3131$modversion['name'] = ucfirst($mydirname) . ' ' . constant('_MI_XPRESS_NAME') ; 
    3232$modversion['description'] = constant( '_MI_XPRESS_DESC'); 
    33 $modversion['version'] = "0.10"; 
     33$modversion['version'] = "0.11"; 
    3434$modversion['credits'] = "Wordpress DEV (http://wordpress.org/) XPressME DEV Toemon) (http://www.toemon.com) ;"; 
    3535$modversion['author'] = "toemon (http://www.toemon.com)"; 
     
    4040 
    4141// status 
    42 $modversion['codename'] = "r124"; 
     42$modversion['codename'] = "r125"; 
    4343 
    4444// onInstall, onUpdate, onUninstall 
     
    165165        'show_func'     => "b_". $mydirname . "_archives_show" , 
    166166        'edit_func'     => "b_". $mydirname . "_archives_edit" , 
    167         'options'               => $mydirname. '||1|10|1|0' , 
    168         'can_clone'             => false , 
     167        'options'               => $mydirname. '||monthly|0|1|0' , 
     168        'can_clone'             => true , 
    169169        'func_num'              => $b_no,        
    170170); 
Note: See TracChangeset for help on using the changeset viewer.