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] ;
|
---|
20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] );
|
---|
21 | $day_select = ($options[2])?intval($options[2]):0;
|
---|
22 | $day_size = ($options[3])?intval($options[3]):0;
|
---|
23 | $disp_count = ($options[4])?intval($options[4]):10;
|
---|
24 | $excerpt = empty( $options[5] ) ? false : true ;
|
---|
25 | $excerpt_size = ($options[6])?intval($options[6]):100;
|
---|
26 | $date_format = empty( $options[7] ) ? '' : $options[7] ;
|
---|
27 | $time_format = empty( $options[8] ) ? '' : $options[8] ;
|
---|
28 | $tag_select = $options[9] ;
|
---|
29 | $selected = array_slice($options,10); // get allowed cats
|
---|
30 |
|
---|
31 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
32 |
|
---|
33 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
34 |
|
---|
35 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
36 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
37 | $form .= "<br />";
|
---|
38 | $form .= _MB_XP2_DAY_SELECT . ':' . _MB_XP2_DAY_BETWEEN . '<select name="options[2]">';
|
---|
39 | switch ($day_select){
|
---|
40 | case 1:
|
---|
41 | $form .= '<option value="0">' . _MB_XP2_NONE . '</option>';
|
---|
42 | $form .= '<option value="1" selected>'. _MB_XP2_TODAY . '</option>';
|
---|
43 | $form .= '<option value="2">' . _MB_XP2_LASTES . '</option>';
|
---|
44 | break;
|
---|
45 | case 2:
|
---|
46 | $form .= '<option value="0">' . _MB_XP2_NONE . '</option>';
|
---|
47 | $form .= '<option value="1">'. _MB_XP2_TODAY . '</option>';
|
---|
48 | $form .= '<option value="2" selected>' . _MB_XP2_LASTES . '</option>';
|
---|
49 | break;
|
---|
50 | default :
|
---|
51 | $form .= '<option value="0" selected>' . _MB_XP2_NONE . '</option>';
|
---|
52 | $form .= '<option value="1">'. _MB_XP2_TODAY . '</option>';
|
---|
53 | $form .= '<option value="2">' . _MB_XP2_LASTES . '</option>';
|
---|
54 | }
|
---|
55 | $form .= '</select>';
|
---|
56 |
|
---|
57 | $form .= ' ' . _MB_XP2_DAYS_AND . " <input type='text' size='2' name='options[3]' value='" . $day_size . "' />" . _MB_XP2_DAYS_AGO . "<br />\n";
|
---|
58 |
|
---|
59 | $form .= _MB_XP2_COUNT .": <input type='text' name='options[4]' value='" . $disp_count . "' /><br />\n";
|
---|
60 | $form .= yes_no_radio_option('options[5]', _MB_XP2_P_EXCERPT , $excerpt) . "<br />\n";
|
---|
61 | $form .= _MB_XP2_P_EXCERPT_SIZE .": <input type='text' name='options[6]' value='" . $excerpt_size . "' /><br />\n";
|
---|
62 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[7]' value='" . $date_format . "' /><br />\n";
|
---|
63 | $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[8]' value='" . $time_format . "' /><br />\n";
|
---|
64 |
|
---|
65 | include $mydirpath .'/wp-includes/version.php' ;
|
---|
66 | if (wp_version_compare($wp_version, '>=','2.3')){
|
---|
67 | $form .= "<br />\n";
|
---|
68 | $form .= _MB_XP2_TAGS_SELECT .": <input type='text' name='options[9]' value='" . $tag_select . "' /><br />\n";
|
---|
69 | } else {
|
---|
70 | $form .= "<input type='hidden' name='options[9]' value='' /><br />\n";
|
---|
71 | }
|
---|
72 |
|
---|
73 | $form .= _MB_XP2_CATS_SELECT ."<br />\n";
|
---|
74 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
75 | $form .= " <select name=\"options[]\" multiple=\"multiple\">\n";
|
---|
76 | $form .= "\t<option value=\"0\" ";
|
---|
77 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
78 | $form .= ">"._MB_XP2_ALL ."</option>\n";
|
---|
79 | ob_start();
|
---|
80 | dropdown_cats_options('ID','asc',$selected);
|
---|
81 | $list_str = ob_get_contents();
|
---|
82 | ob_end_clean();
|
---|
83 | $form .= $list_str. "</select><br />\n";
|
---|
84 |
|
---|
85 | // $form .="<br /><input type='text' size='60' name='options[11]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
86 |
|
---|
87 | return $form;
|
---|
88 | }
|
---|
89 |
|
---|
90 |
|
---|
91 | function _b_content_show($options)
|
---|
92 | {
|
---|
93 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
94 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
95 | $block_function_name = basename( __FILE__ );
|
---|
96 |
|
---|
97 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
98 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
99 | }
|
---|
100 | }
|
---|
101 | ?> |
---|