1 | <?php
|
---|
2 | if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
|
---|
3 | $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
|
---|
4 |
|
---|
5 | eval( '
|
---|
6 | function b_'.$mydirname.'_comments_show($options){
|
---|
7 | return _b_comments_show($options) ;
|
---|
8 | }
|
---|
9 | function b_'.$mydirname.'_comments_edit($options){
|
---|
10 | return _b_comments_edit($options) ;
|
---|
11 | }
|
---|
12 | ' ) ;
|
---|
13 |
|
---|
14 |
|
---|
15 | if( ! defined( 'XPRESS_COMMENTS_BLOCK_INCLUDED' ) ) {
|
---|
16 | define( 'XPRESS_COMMENTS_BLOCK_INCLUDED' , 1 ) ;
|
---|
17 | function _b_comments_edit($options)
|
---|
18 | {
|
---|
19 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
20 | $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_comments_block.html' : trim( $options[1] );
|
---|
21 | $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
|
---|
22 | $disp_length = empty( $options[3] ) ? '30' : $options[3] ;
|
---|
23 | $selected = array_slice($options,4); // get allowed cats
|
---|
24 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
25 |
|
---|
26 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
27 |
|
---|
28 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />";
|
---|
29 | $form .= _MB_XPRESS_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />";
|
---|
30 | $form .= _MB_XPRESS_LENGTH .": <input type='text' name='options[3]' value='" . $disp_length . "' />";
|
---|
31 | $form .= "<br /><br />" . _MB_XPRESS_COM_TYPE ;
|
---|
32 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
33 | $form .= "<br /> <select name=\"options[]\" multiple=\"multiple\">";
|
---|
34 | $form .= "<option value=\"0\" ";
|
---|
35 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
36 | $form .= ">"._MB_XPRESS_ALL ."</option>";
|
---|
37 |
|
---|
38 | $form .= "<option value=\"1\" ";
|
---|
39 | if (in_array(1, $selected))
|
---|
40 | $form .= " selected=\"selected\"";
|
---|
41 | $form .= ">"._MB_XPRESS_COMMENT ."</option>";
|
---|
42 |
|
---|
43 | $form .= "<option value=\"2\" ";
|
---|
44 | if (in_array(2, $selected))
|
---|
45 | $form .= " selected=\"selected\"";
|
---|
46 | $form .= ">"._MB_XPRESS_TRUCKBACK ."</option>";
|
---|
47 |
|
---|
48 | $form .= "<option value=\"3\" ";
|
---|
49 | if (in_array(3, $selected))
|
---|
50 | $form .= " selected=\"selected\"";
|
---|
51 | $form .= ">"._MB_XPRESS_PINGBACK ."</option>";
|
---|
52 | $form .= "</select><br />";
|
---|
53 | // $form .="<br /><input type='text' size='60' name='options[5]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
54 |
|
---|
55 |
|
---|
56 | return $form;
|
---|
57 | }
|
---|
58 |
|
---|
59 | function _b_comments_show($options)
|
---|
60 | {
|
---|
61 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
62 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
63 | $block_function_name = basename( __FILE__ );
|
---|
64 |
|
---|
65 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
66 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
67 | }
|
---|
68 | }
|
---|
69 | ?> |
---|