[100] | 1 | <?php
|
---|
| 2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
| 3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
| 4 |
|
---|
| 5 | eval( '
|
---|
| 6 | function b_'.$mydirname.'_posts_show($options){
|
---|
| 7 | return _b_posts_show($options) ;
|
---|
| 8 | }
|
---|
| 9 | function b_'.$mydirname.'_posts_edit($options){
|
---|
| 10 | return _b_posts_edit($options) ;
|
---|
| 11 | }
|
---|
| 12 | ' ) ;
|
---|
| 13 |
|
---|
| 14 | if( ! defined( 'XPRESS_POSTS_BLOCK_INCLUDED' ) ) {
|
---|
| 15 | define( 'XPRESS_POSTS_BLOCK_INCLUDED' , 1 ) ;
|
---|
| 16 | function _b_posts_edit($options)
|
---|
| 17 | {
|
---|
| 18 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
[120] | 19 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_list_block.html' : trim( $options[1] );
|
---|
| 20 | $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
|
---|
| 21 | $disp_red = empty( $options[3] ) ? '1' : $options[3] ;
|
---|
| 22 | $disp_green = empty( $options[4] ) ? '7' : $options[4] ;
|
---|
[142] | 23 | $date_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
| 24 | $time_format = empty( $options[6] ) ? '' : $options[6] ;
|
---|
| 25 | $tag_select = $options[7] ;
|
---|
[435] | 26 | $cat_select = empty( $options[8] ) ? '0' : $options[8] ;
|
---|
[142] | 27 |
|
---|
[100] | 28 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 29 |
|
---|
| 30 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 31 |
|
---|
[495] | 32 | $form = javascript_check();
|
---|
| 33 | $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
[484] | 34 | $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
|
---|
[142] | 35 | $form .= "<br />\n";
|
---|
[463] | 36 | $form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
| 37 | $form .= _MB_XP2_REDNEW_DAYS .": <input type='text' size='3' name='options[3]' value='" . $disp_red . "' /><br />\n";
|
---|
| 38 | $form .= _MB_XP2_GREENNEW_DAYS .": <input type='text' size='3' name='options[4]' value='" . $disp_green . "' /><br />\n";
|
---|
[183] | 39 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[5]' value='" . $date_format . "' /><br />\n";
|
---|
| 40 | $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[6]' value='" . $time_format . "' /><br />\n";
|
---|
[100] | 41 |
|
---|
[365] | 42 | include $mydirpath .'/wp-includes/version.php' ;
|
---|
| 43 | if (wp_version_compare($wp_version, '>=','2.3')){
|
---|
| 44 | $form .= "<br />\n";
|
---|
| 45 | $form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[7]' value='" . $tag_select . "' /><br />\n";
|
---|
| 46 | } else {
|
---|
| 47 | $form .= "<input type='hidden' name='options[7]' value='' /><br />\n";
|
---|
| 48 | }
|
---|
| 49 |
|
---|
[435] | 50 | $form .= categorie_select('options[8]' , $cat_select);
|
---|
[100] | 51 |
|
---|
| 52 | return $form;
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | function _b_posts_show($options)
|
---|
| 56 | {
|
---|
| 57 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 58 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 59 | $block_function_name = basename( __FILE__ );
|
---|
| 60 |
|
---|
| 61 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 62 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 63 | }
|
---|
| 64 | }
|
---|
| 65 | ?> |
---|