XPressME Integration Kit

Trac

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

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

MultiBlog用に人気記事リスト(全ブログ)を追加 Fixes#310

File size: 2.1 KB
Line 
1<?php
2if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
3$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
4
5eval( '
6function b_'.$mydirname.'_global_popular_show($options){
7        return _b_global_popular_show($options) ;
8}
9function b_'.$mydirname.'_global_popular_edit($options){
10        return _b_global_popular_edit($options) ;
11}
12' ) ;
13
14if( ! defined( 'XPRESS_GLOBAL_POPULAR_BLOCK_INCLUDED' ) ) {
15        define( 'XPRESS_GLOBAL_POPULAR_BLOCK_INCLUDED' , 1 ) ;
16        function _b_global_popular_edit($options)
17        {
18                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
19                $this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_grobal_popular_posts_block.html' : trim( $options[1] );
20                $disp_count = empty( $options[2] ) ? '10' : $options[2] ;
21                $show_month_range = empty( $options[3] ) ? '0' : $options[3] ;
22                $date_format = empty( $options[4] ) ? '' : $options[4] ;
23                $time_format = empty( $options[5] ) ? '' : $options[5] ;
24
25                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
26               
27                require_once(XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/blocks/block_common.php');
28                $form  = javascript_check();
29                $form .= "MyDirectory <input type='text' name='options[0]' value='" . $mydirname . "' /><br />\n";
30                $form .= block_template_setting($mydirname,'options[1]',htmlspecialchars($this_template,ENT_QUOTES));
31                $form .= "<br />\n";
32                $form .= _MB_XP2_COUNT .": <input type='text' name='options[2]' value='" . $disp_count . "' /><br />\n";
33                $form .= _MB_XP2_MONTH_RANGE .": <input type='text' name='options[3]' value='" . $show_month_range . "' /><br />\n";
34                $form .= _MB_XP2_DATE_FORMAT .": <input type='text' name='options[4]' value='" . $date_format . "' /><br />\n";
35                $form .= _MB_XP2_TIME_FORMAT .": <input type='text' name='options[5]' value='" . $time_format . "' /><br />\n";
36                return $form;
37        }
38
39        function _b_global_popular_show($options)
40        {
41                $mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
42                $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;
43                $block_function_name = basename( __FILE__ );
44               
45                require_once $mydirpath.'/include/xpress_block_render.php';
46                return xpress_block_render($mydirname,$block_function_name,$options);
47        }
48}
49?>
Note: See TracBrowser for help on using the repository browser.