ZBlogPHP::RegPostType PHP Method

RegPostType() public method

注册PostType int $typeid 系统定义在0-99,插件自定义100-255 string $urlrule 默认是取Page类型的Url Rule string $template 默认模板名page
public RegPostType ( $typeid, $name, $urlrule = '', $template = 'page' )
    public function RegPostType($typeid, $name, $urlrule = '', $template = 'page')
    {
        if ($urlrule == '') {
            $urlrule = $this->option['ZC_PAGE_REGEX'];
        }
        $typeid = (int) $typeid;
        $name = strtolower(trim($name));
        if ($typeid > 99) {
            if (isset($this->posttype[$typeid])) {
                $this->ShowError(87, __FILE__, __LINE__);
            }
        }
        $this->posttype[$typeid] = array($name, $urlrule, $template);
    }
ZBlogPHP