zb_system/functionc_system_event.php

Functions

VerifyLogin()

VerifyLogin(boolean  $throwException = true) : boolean

验证登录.

Parameters

boolean $throwException

Throws

\Exception

Returns

boolean

SetLoginCookie()

SetLoginCookie(\Member  $user, integer  $cookieTime) : boolean

设置登录Cookie,直接登录该用户.

Parameters

\Member $user
integer $cookieTime

Returns

boolean

Logout()

Logout() 

注销登录.

GetPost()

GetPost(mixed  $idorname,   $option = null) : \Post

获取文章.

Parameters

mixed $idorname

文章id 或 名称、别名

$option

Returns

\Post

GetList()

GetList(integer  $count = 10, null  $cate = null, null  $auth = null, null  $date = null, null  $tags = null, null  $search = null, null  $option = null) : array|mixed

获取文章列表.

Parameters

integer $count

数量

null $cate

分类ID

null $auth

用户ID

null $date

日期

null $tags

标签

null $search

搜索关键词

null $option

Returns

array|mixed

ViewIndex()

ViewIndex() : mixed

ViewIndex,首页,搜索页,feed页的主函数.

Throws

\Exception

Returns

mixed

ViewFeed()

ViewFeed() 

显示RSS2Feed.

ViewSearch()

ViewSearch() : mixed

展示搜索结果.

Throws

\Exception

Returns

mixed

ViewAuto()

ViewAuto(string  $inpurl) : null|string

根据Rewrite_url规则显示页面.

Parameters

string $inpurl

页面url

Throws

\Exception

Returns

null|string

ViewList()

ViewList(integer  $page, mixed  $cate, mixed  $auth, mixed  $date, mixed  $tags, boolean  $isrewrite = false) : string

显示列表页面.

Parameters

integer $page
mixed $cate
mixed $auth
mixed $date
mixed $tags

tags列表

boolean $isrewrite

是否启用urlrewrite

Throws

\Exception

Returns

string

ViewPost()

ViewPost(array|integer|string  $object, string  $theSecondParam, boolean  $enableRewrite = false) : string

显示文章.

Parameters

array|integer|string $object

文章ID/ ID/别名对象

string $theSecondParam

(如果有的话)文章别名

boolean $enableRewrite

是否启用urlrewrite

Throws

\Exception

Returns

string

ViewComments()

ViewComments(integer  $postid, integer  $page) : boolean

显示文章下评论列表.

Parameters

integer $postid

文章ID

integer $page

页数

Throws

\Exception

Returns

boolean

ViewComment()

ViewComment(integer  $id) : boolean

显示评论.

Parameters

integer $id

评论ID

Throws

\Exception

Returns

boolean

PostArticle()

PostArticle() : boolean

提交文章数据.

Throws

\Exception

Returns

boolean

DelArticle()

DelArticle() : boolean

删除文章.

Throws

\Exception

Returns

boolean

PostArticle_CheckTagAndConvertIDtoString()

PostArticle_CheckTagAndConvertIDtoString(string  $tagnamestring) : string

提交文章数据时检查tag数据,并将新tags转为标准格式返回.

Parameters

string $tagnamestring

提交的文章tag数据,可以:,,、等符号分隔

Returns

string —

返回如'{1}{2}{3}{4}'的字符串

DelArticle_Comments()

DelArticle_Comments(integer  $id) 

删除文章下所有评论.

Parameters

integer $id

文章ID

PostPage()

PostPage() : boolean

提交页面数据.

Throws

\Exception

Returns

boolean

DelPage()

DelPage() : boolean

删除页面.

Throws

\Exception

Returns

boolean

PostComment()

PostComment() : boolean

提交评论.

Throws

\Exception

Returns

boolean

DelComment()

DelComment() : boolean

删除评论.

Returns

boolean

DelComment_Children()

DelComment_Children(integer  $id) 

删除评论下的子评论.

Parameters

integer $id

父评论ID

GetSubComments()

GetSubComments(integer  $id, array<mixed,\Comment>  $array) 

只历遍并保留评论id进array,不进行删除.

Parameters

integer $id

父评论ID

array<mixed,\Comment> $array

将子评论ID存入新数组

CheckComment()

CheckComment() 

检查评论数据并保存、更新计数、更新“最新评论”模块.

BatchComment()

BatchComment() 

评论批量处理(删除、通过审核、加入审核).

PostCategory()

PostCategory() : boolean

提交分类数据.

Returns

boolean

DelCategory()

DelCategory() : boolean

删除分类.

Throws

\Exception

Returns

boolean

DelCategory_Articles()

DelCategory_Articles(integer  $id) 

删除分类下所有文章.

Parameters

integer $id

分类ID

PostTag()

PostTag() : boolean

提交标签数据.

Returns

boolean

DelTag()

DelTag() : boolean

删除标签.

Returns

boolean

PostMember()

PostMember() : boolean

提交用户数据.

Throws

\Exception

Returns

boolean

DelMember()

DelMember() : boolean

删除用户.

Returns

boolean

DelMember_AllData()

DelMember_AllData(integer  $id) 

删除用户下所有数据(包括文章、评论、附件).

Parameters

integer $id

用户ID

PostModule()

PostModule() : boolean

提交模块数据.

Returns

boolean

DelModule()

DelModule() : boolean

删除模块.

Returns

boolean

PostUpload()

PostUpload() 

附件上传.

Throws

\Exception

DelUpload()

DelUpload() : boolean

删除附件.

Returns

boolean

EnablePlugin()

EnablePlugin(string  $name) : string

启用插件.

Parameters

string $name

插件ID

Throws

\Exception

Returns

string —

返回插件ID

DisablePlugin()

DisablePlugin(string  $name) : \App|boolean

禁用插件.

Parameters

string $name

插件ID

Returns

\App|boolean

SetTheme()

SetTheme(string  $theme, string  $style) : string

设置当前主题样式.

Parameters

string $theme

主题ID

string $style

样式名

Throws

\Exception

Returns

string —

返回主题ID

SetSidebar()

SetSidebar() 

设置侧栏.

SaveSetting()

SaveSetting() 

保存网站设置选项.

Throws

\Exception

FilterMeta()

FilterMeta(  $object) 

过滤扩展数据.

Parameters

$object

FilterComment()

FilterComment(  $comment) 

过滤评论数据.

Parameters

$comment

Throws

\Exception

FilterPost()

FilterPost(  $article) 

过滤文章数据.

Parameters

$article

FilterMember()

FilterMember(  $member) 

过滤用户数据.

Parameters

$member

Throws

\Exception

FilterModule()

FilterModule(  $module) 

过滤模块数据.

Parameters

$module

FilterCategory()

FilterCategory(  $category) 

过滤分类数据.

Parameters

$category

FilterTag()

FilterTag(  $tag) 

过滤tag数据.

Parameters

$tag

CountTopArticle()

CountTopArticle(integer  $type, null  $addplus = null, null  $delplus = null) 

统计置顶文章数组.

Parameters

integer $type
null $addplus
null $delplus

CountCommentNums()

CountCommentNums(integer  $allplus = null, integer  $chkplus = null) 

统计评论数.

Parameters

integer $allplus

控制是否要进行全表扫描 总评论

integer $chkplus

控制是否要进行全表扫描 未审核评论

CountNormalArticleNums()

CountNormalArticleNums(integer  $plus = null) 

统计公开文章数.

Parameters

integer $plus

控制是否要进行全表扫描

CountPost()

CountPost(\post  $article, integer  $plus = null) 

统计文章下评论数.

Parameters

\post $article
integer $plus

控制是否要进行全表扫描

CountPostArray()

CountPostArray(array  $array, integer  $plus = null) 

批量统计指定文章下评论数并保存.

Parameters

array $array

记录文章ID的数组

integer $plus

控制是否要进行全表扫描

CountCategory()

CountCategory(  $category, integer  $plus = null) 

统计分类下文章数.

Parameters

$category
integer $plus

控制是否要进行全表扫描

CountCategoryArray()

CountCategoryArray(array  $array, integer  $plus = null) 

批量统计指定分类下文章数并保存.

Parameters

array $array

记录分类ID的数组

integer $plus

控制是否要进行全表扫描

CountTag()

CountTag(  $tag, integer  $plus = null) 

统计tag下的文章数.

Parameters

$tag
integer $plus

控制是否要进行全表扫描

CountTagArrayString()

CountTagArrayString(string  $string, integer  $plus = null,   $articleid = null) : boolean

批量统计指定tag下文章数并保存.

Parameters

string $string

类似'{1}{2}{3}{4}{4}'的tagID串

integer $plus

控制是否要进行全表扫描

$articleid

Returns

boolean

CountMember()

CountMember(  $member, array  $plus = array(null, null, null, null)) 

统计用户下的文章数、页面数、评论数、附件数等.

Parameters

$member
array $plus

设置是否需要完全全表扫描

CountMemberArray()

CountMemberArray(array  $array, array  $plus = array(null, null, null, null)) 

批量统计指定用户数据并保存.

Parameters

array $array

记录用户ID的数组

array $plus

设置是否需要完全全表扫描

Include_ShowError404()

Include_ShowError404(  $errorCode,   $errorDescription,   $file,   $line) 

显示404页面(内置插件函数).

可通过主题中的404.php模板自定义显示效果

Parameters

$errorCode
$errorDescription
$file
$line

Throws

\Exception

Include_AddonAdminFont()

Include_AddonAdminFont() 

输出后台指定字体family(内置插件函数).

BuildModule_catalog()

BuildModule_catalog() : string

Throws

\Exception

Returns

string

BuildModule_calendar()

BuildModule_calendar(string  $date = '') : string

Parameters

string $date

Throws

\Exception

Returns

string

BuildModule_comments()

BuildModule_comments() : string

Throws

\Exception

Returns

string

BuildModule_previous()

BuildModule_previous() : string

Throws

\Exception

Returns

string

BuildModule_archives()

BuildModule_archives() : string

Throws

\Exception

Returns

string

BuildModule_navbar()

BuildModule_navbar() : string

Throws

\Exception

Returns

string

BuildModule_tags()

BuildModule_tags() : string

Throws

\Exception

Returns

string

BuildModule_authors()

BuildModule_authors(integer  $level = 4) : string

Parameters

integer $level

Throws

\Exception

Returns

string

BuildModule_statistics()

BuildModule_statistics(array  $array = array()) : string

Parameters

array $array

Throws

\Exception

Returns

string