<?php
class block_sample_test extends discuz_block {
function __construct() {}
// 数据来源名称
function name() {
return 'test';
}
// 模块设置项
// title: 显示的名称
// type: 为类型,text, password, number, textarea, radio, select, mselect, mradio, mcheckbox, calendar
function getsetting() {
return array(
'content' => array(
'title' => 'blank_content',
'type' => 'mtextarea'
)
);
}
// 模块字段
// name: 字段名称
// formtype: 类型,text, textarea, date, title, summary, pic
// datatype 数据格式,string, int, date, title, summary, pic
function fields() {
return array(
'field' => array('name' => '示例字段', 'formtype' => 'text', 'datatype' => 'string')
);
}
// 模块参数
// 第一个值: 类所在的模块分类,通常为类名,_real 结尾时表示为实时模块,不缓存
// 第二个值: 模块分类显示的名称
function blockclass() {
return array('sample_test_real', 'test');
}
// 模块数据的返回脚本
// html 为返回的 HTML 内容,data 为返回的数组
function getdata($style, $parameter) {
return array('html' => $parameter['content'].time(), 'data' => null);
}
}
?>