[54] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_content_show($options){
|
---|
| 7 | return _b_content_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_content_edit($options){
|
---|
| 10 | return _b_content_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_CONTENT_BLOCK_INCLUDED' ) ) {
|
---|
| 15 | define( 'XPRESS_CONTENT_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 16 |
|
---|
| 17 | function _b_content_edit($options)
|
---|
| 18 | {
|
---|
| 19 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] );
|
---|
[451] | 21 | $disp_count = ($options[2])?intval($options[2]):10;
|
---|
| 22 | $excerpt = empty( $options[3] ) ? false : true ;
|
---|
| 23 | $excerpt_size = ($options[4])?intval($options[4]):100;
|
---|
| 24 | $date_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
| 25 | $time_format = empty( $options[6] ) ? '' : $options[6] ;
|
---|
| 26 | $tag_select = $options[7] ;
|
---|
| 27 | $cat_select = empty( $options[8] ) ? '0' : $options[8] ;
|
---|
| 28 | $day_select = ($options[9])?intval($options[9]):0;
|
---|
| 29 | $day_size = ($options[10])?intval($options[10]):0;
|
---|
[54] | 30 |
|
---|
| 31 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 32 |
|
---|
| 33 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 34 |
|
---|
[100] | 35 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
[488] | 36 | $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
|
---|
| 37 | $form .= "<br />";
|
---|
| 38 | $form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
[451] | 39 | $form .= yes_no_radio_option('options[3]', _MB_XP2_P_EXCERPT , $excerpt) . "<br />\n";
|
---|
| 40 | $form .= _MB_XP2_P_EXCERPT_SIZE .": <input type='text' name='options[4]' value='" . $excerpt_size . "' /><br />\n";
|
---|
| 41 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n";
|
---|
| 42 | $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
|
---|
| 43 |
|
---|
| 44 | include $mydirpath .'/wp-includes/version.php' ;
|
---|
| 45 | if (wp_version_compare($wp_version, '>=','2.3')){
|
---|
| 46 | $form .= "<br />\n";
|
---|
| 47 | $form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
|
---|
| 48 | } else {
|
---|
| 49 | $form .= "<input type='hidden' name='options[7]' value='' /><br />\n";
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | $form .= categorie_select('options[8]' , $cat_select);
|
---|
| 53 |
|
---|
| 54 | $form .= "<br />";
|
---|
| 55 | $form .= _MB_XP2_DAY_SELECT . ':' . _MB_XP2_DAY_BETWEEN . '<select name="options[9]">';
|
---|
[425] | 56 | switch ($day_select){
|
---|
| 57 | case 1:
|
---|
| 58 | $form .= '<option value="0">' . _MB_XP2_NONE . '</option>';
|
---|
| 59 | $form .= '<option value="1" selected>'. _MB_XP2_TODAY . '</option>';
|
---|
[451] | 60 | $form .= '<option value="2">' . _MB_XP2_LATEST . '</option>';
|
---|
[425] | 61 | break;
|
---|
| 62 | case 2:
|
---|
| 63 | $form .= '<option value="0">' . _MB_XP2_NONE . '</option>';
|
---|
| 64 | $form .= '<option value="1">'. _MB_XP2_TODAY . '</option>';
|
---|
[451] | 65 | $form .= '<option value="2" selected>' . _MB_XP2_LATEST . '</option>';
|
---|
[425] | 66 | break;
|
---|
| 67 | default :
|
---|
| 68 | $form .= '<option value="0" selected>' . _MB_XP2_NONE . '</option>';
|
---|
| 69 | $form .= '<option value="1">'. _MB_XP2_TODAY . '</option>';
|
---|
[451] | 70 | $form .= '<option value="2">' . _MB_XP2_LATEST . '</option>';
|
---|
[425] | 71 | }
|
---|
| 72 | $form .= '</select>';
|
---|
[100] | 73 |
|
---|
[451] | 74 | $form .= ' ' . _MB_XP2_DAYS_AND . " <input type='text' size='2' name='options[10]' value='" . $day_size . "' />" . _MB_XP2_DAYS_AGO . "<br />\n";
|
---|
[425] | 75 |
|
---|
[54] | 76 | return $form;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | function _b_content_show($options)
|
---|
| 81 | {
|
---|
| 82 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 83 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 84 | $block_function_name = basename( __FILE__ );
|
---|
| 85 |
|
---|
| 86 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 87 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 88 | }
|
---|
| 89 | }
|
---|
| 90 | ?> |
---|