> ## Documentation Index
> Fetch the complete documentation index at: https://discuz.p.cafe/llms.txt
> Use this file to discover all available pages before exploring further.

# 特殊主题

## **概述**

特殊主题模块用于创建一个特殊主题。特殊主题类型脚本格式如下：

```php theme={null}
<?php
​
class threadplugin_identifier {
​
    var $name = 'XX主题';            //主题类型名称
    var $iconfile = 'icon.gif';        //发布主题链接中的前缀图标
    var $buttontext = '发布xx主题';    //发帖时按钮文字
​
    function newthread($fid) {
        return ...;
    }
​
    function newthread_submit($fid) {
​
    }
​
    function newthread_submit_end($fid, $tid) {
​
    }
​
    function editpost($fid, $tid) {
        return ...;
    }
​
    function editpost_submit($fid, $tid) {
​
    }
​
    function editpost_submit_end($fid, $tid) {
​
    }
​
    function newreply_submit_end($fid, $tid) {
​
    }
​
    function viewthread($tid) {
        return ...;
    }
}
​
?>
```

### **命名规则**

**identifier：** 插件的唯一标识符，在插件设置中设置。

## **函数说明**

| **函数名**                              | **含义**                                  |
| :----------------------------------- | :-------------------------------------- |
| newthread(\$fid)                     | 发主题时页面新增的表单项目，通过 return 返回即可输出到发帖页面中    |
| newthread\_submit(\$fid)             | 主题发布后的数据判断                              |
| newthread\_submit\_end(\$fid, \$tid) | 主题发布后的数据处理                              |
| editpost(\$fid, \$tid)               | 编辑主题时页面新增的表单项目，通过 return 返回即可输出到编辑主题页面中 |
| editpost\_submit(\$fid, \$tid)       | 主题编辑后的数据判断                              |
| editpost\_submit\_end(\$fid, \$tid)  | 主题编辑后的数据处理                              |
| newreply\_submit\_end(\$fid, \$tid)  | 回帖后的数据处理                                |
| viewthread(\$tid)                    | 查看主题时页面新增的内容，通过 return 返回即可输出到主题首贴页面中   |
