[44] | 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] ;
|
---|
[120] | 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] ;
|
---|
[142] | 23 | $date_format = empty( $options[4] ) ? '' : $options[4] ;
|
---|
| 24 | $time_format = empty( $options[5] ) ? '' : $options[5] ;
|
---|
| 25 | $selected = array_slice($options,6); // get allowed cats
|
---|
| 26 |
|
---|
[44] | 27 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 28 |
|
---|
| 29 | require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
|
---|
| 30 |
|
---|
[142] | 31 | $form = "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
|
---|
| 32 | $form .= "<input type='hidden' name='options[1]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' /><br />\n";
|
---|
[121] | 33 | $form .= "<br />";
|
---|
[183] | 34 | $form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
|
---|
| 35 | $form .= _MB_XP2_LENGTH .": <input type='text' name='options[3]' value='" . $disp_length . "' /><br />\n";
|
---|
| 36 | $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
|
---|
| 37 | $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
|
---|
[142] | 38 | $form .= "<br />\n";
|
---|
[183] | 39 | $form .= _MB_XP2_COM_TYPE . "<br />\n";
|
---|
[44] | 40 | $isAll = (count($selected)==0||empty($selected[0]))?true:false;
|
---|
[142] | 41 | $form .= " <select name=\"options[]\" multiple=\"multiple\">";
|
---|
[44] | 42 | $form .= "<option value=\"0\" ";
|
---|
| 43 | if ($isAll) $form .= " selected=\"selected\"";
|
---|
[183] | 44 | $form .= ">"._MB_XP2_ALL ."</option>";
|
---|
[44] | 45 |
|
---|
| 46 | $form .= "<option value=\"1\" ";
|
---|
| 47 | if (in_array(1, $selected))
|
---|
| 48 | $form .= " selected=\"selected\"";
|
---|
[183] | 49 | $form .= ">"._MB_XP2_COMMENT ."</option>";
|
---|
[44] | 50 |
|
---|
| 51 | $form .= "<option value=\"2\" ";
|
---|
| 52 | if (in_array(2, $selected))
|
---|
| 53 | $form .= " selected=\"selected\"";
|
---|
[183] | 54 | $form .= ">"._MB_XP2_TRUCKBACK ."</option>";
|
---|
[44] | 55 |
|
---|
| 56 | $form .= "<option value=\"3\" ";
|
---|
| 57 | if (in_array(3, $selected))
|
---|
| 58 | $form .= " selected=\"selected\"";
|
---|
[183] | 59 | $form .= ">"._MB_XP2_PINGBACK ."</option>";
|
---|
[44] | 60 | $form .= "</select><br />";
|
---|
| 61 | // $form .="<br /><input type='text' size='60' name='options[5]' id='this_template' value='".htmlspecialchars($this_template,ENT_QUOTES)."' />";
|
---|
| 62 |
|
---|
| 63 |
|
---|
| 64 | return $form;
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | function _b_comments_show($options)
|
---|
| 68 | {
|
---|
| 69 | $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
|
---|
| 70 | $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
|
---|
| 71 | $block_function_name = basename( __FILE__ );
|
---|
| 72 |
|
---|
| 73 | require_once $mydirpath.'/include/xpress_block_render.php';
|
---|
| 74 | return xpress_block_render($mydirname,$block_function_name,$options);
|
---|
| 75 | }
|
---|
| 76 | }
|
---|
| 77 | ?> |
---|