1 | <?php
|
---|
2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
4 |
|
---|
5 | eval( '
|
---|
6 | function b_'.$mydirname.'_archives_show($options){
|
---|
7 | return _b_archives_show($options) ;
|
---|
8 | }
|
---|
9 | function b_'.$mydirname.'_archives_edit($options){
|
---|
10 | return _b_archives_edit($options) ;
|
---|
11 | }
|
---|
12 | ' ) ;
|
---|
13 |
|
---|
14 |
|
---|
15 | if( ! defined( 'XPRESS_ARCHIVES_BLOCK_INCLUDED' ) ) {
|
---|
16 | define( 'XPRESS_ARCHIVES_BLOCK_INCLUDED' , 1 ) ;
|
---|
17 |
|
---|
18 | function _b_archives_edit($options)
|
---|
19 | {
|
---|
20 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
21 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_archives_block.html' : trim( $options[1] );
|
---|
22 | $type = empty( $options[2] ) ? 'monthly' : $options[2] ;
|
---|
23 | $limit = !is_numeric( $options[3] ) ? 0 : $options[3] ;
|
---|
24 | $show_post_count = empty( $options[4] ) ? false : true ;
|
---|
25 | $drop_down = empty( $options[5] ) ? false : true ;
|
---|
26 |
|
---|
27 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
28 |
|
---|
29 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
|
---|
30 | $form .= _MB_XP2_THISTEMPLATE . "<input type='text' size='50' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />";
|
---|
31 | $form .= "<br />";
|
---|
32 | $a_month = _MB_XP2_ARC_MONTH ;
|
---|
33 | $a_week = _MB_XP2_ARC_WEEK ;
|
---|
34 |
|
---|
35 | $form .= _MB_XP2_ARC_TYPE .": ";
|
---|
36 | $form .= "<select name='options[2]'>";
|
---|
37 | if ($type =='yearly')
|
---|
38 | $form .= "<option value='yearly' selected='selected'>". _MB_XP2_ARC_YEAR;
|
---|
39 | else
|
---|
40 | $form .= "<option value='yearly'>". _MB_XP2_ARC_YEAR;
|
---|
41 |
|
---|
42 | if ($type =='monthly')
|
---|
43 | $form .= "<option value='monthly' selected='selected'>". _MB_XP2_ARC_MONTH;
|
---|
44 | else
|
---|
45 | $form .= "<option value='monthly'>". _MB_XP2_ARC_MONTH;
|
---|
46 |
|
---|
47 | if ($type =='weekly')
|
---|
48 | $form .= "<option value='weekly' selected='selected'>". _MB_XP2_ARC_WEEK;
|
---|
49 | else
|
---|
50 | $form .= "<option value='weekly'>". _MB_XP2_ARC_WEEK;
|
---|
51 |
|
---|
52 | if ($type =='daily')
|
---|
53 | $form .= "<option value='daily' selected='selected'>". _MB_XP2_ARC_DAY;
|
---|
54 | else
|
---|
55 | $form .= "<option value='daily'>". _MB_XP2_ARC_DAY;
|
---|
56 |
|
---|
57 | if ($type =='postbypost')
|
---|
58 | $form .= "<option value='postbypost' selected='selected'>". _MB_XP2_ARC_POST;
|
---|
59 | else
|
---|
60 | $form .= "<option value='postbypost'>". _MB_XP2_ARC_POST;
|
---|
61 |
|
---|
62 | $form .= "</select><br/>";
|
---|
63 |
|
---|
64 | $form .= "<br />" . _MB_XP2_COUNT_ZERO_ALL . " <input type='text' size='3' name='options[3]' value='" . $limit . "' />";
|
---|
65 | $form .= "<br />" . yes_no_radio_option('options[4]', _MB_XP2_SHOW_NUM_OF_POST , $show_post_count);
|
---|
66 | $form .= "<br />" . yes_no_radio_option('options[5]', _MB_XP2_SHOW_DROP_DOWN , $drop_down);
|
---|
67 | // $form .="<br /><input type='text' size='60' name='options[5]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
68 |
|
---|
69 | return $form;
|
---|
70 | }
|
---|
71 |
|
---|
72 | function _b_archives_show($options)
|
---|
73 | {
|
---|
74 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
75 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
76 | $block_function_name = basename( __FILE__ );
|
---|
77 |
|
---|
78 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
79 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
80 | }
|
---|
81 |
|
---|
82 |
|
---|
83 | }
|
---|
84 |
|
---|
85 | ?> |
---|