XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/blocks/global_recent_comments_block.php @ 688

Last change on this file since 688 was 543, checked in by toemon, 15 years ago

MultiBlog用に最近のコメント(全ブログ)を追加 Fixes#306

File size: 2.3 KB
Line 
1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_global_comments_show($options){
7        return _b_global_comments_show($options) ;
8}
9function b_'.$mydirname.'_global_comments_edit($options){
10        return _b_global_comments_edit($options) ;
11}
12' ) ;
13
14
15if( ! defined( 'XPRESS_GLOBAL_COMMENTS_BLOCK_INCLUDED' ) ) {
16        define( 'XPRESS_GLOBAL_COMMENTS_BLOCK_INCLUDED' , 1 ) ;
17        function _b_global_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                $date_format = empty( $options[4] ) ? '' : $options[4] ;
24                $time_format = empty( $options[5] ) ? '' : $options[5] ;
25                $com_select = empty( $options[6] ) ? '0' : $options[6] ;
26
27                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
28
29                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
30               
31                $form  = javascript_check();
32                $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
33                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
34                $form .= "<br />";
35                $form .= _MB_XP2_COUNT .": <input type='text' size='3' name='options[2]' value='" . $disp_count . "' /><br />\n";
36                $form .= _MB_XP2_LENGTH .": <input type='text' size='3' name='options[3]' value='" . $disp_length . "' /><br />\n";
37                $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
38                $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
39            $form .= "<br />\n";
40            $form .= comment_type_select('options[6]' , $com_select);
41
42
43                return $form;
44        }
45       
46        function _b_global_comments_show($options)
47        {
48                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
49                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
50                $block_function_name = basename( __FILE__ );
51               
52                require_once $mydirpath.'/include/xpress_block_render.php';
53                return xpress_block_render($mydirname,$block_function_name,$options);
54        }
55}
56?>
Note: See TracBrowser for help on using the repository browser.