\Log_Model

文章、页面管理

Summary

Methods
Properties
Constants
__construct()
addlog()
updateLog()
getLogNum()
getOneLogForAdmin()
getOneLogForHome()
getLogsForAdmin()
getLogsForHome()
getAllPageList()
deleteLog()
hideSwitch()
checkSwitch()
postDate()
updateViewCount()
isRepeatPost()
neighborLog()
getRandLog()
getHotLog()
checkAlias()
authPassword()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$db
N/A

Properties

$db

$db : 

Type

Methods

__construct()

__construct() 

addlog()

addlog(array  $logData) : integer

添加文章、页面

Parameters

array $logData

Returns

integer

updateLog()

updateLog(array  $logData, integer  $blogId) 

更新文章内容

Parameters

array $logData
integer $blogId

getLogNum()

getLogNum(string  $hide = 'n', string  $condition = '', string  $type = 'blog', integer  $spot) : integer

获取指定条件的文章条数

Parameters

string $hide
string $condition
string $type
integer $spot

0:前台 1:后台

Returns

integer

getOneLogForAdmin()

getOneLogForAdmin(  $blogId) 

后台获取单篇文章

Parameters

$blogId

getOneLogForHome()

getOneLogForHome(  $blogId) 

前台获取单篇文章

Parameters

$blogId

getLogsForAdmin()

getLogsForAdmin(string  $condition = '', string  $hide_state = '', integer  $page = 1, string  $type = 'blog') : array

后台获取文章列表

Parameters

string $condition
string $hide_state
integer $page
string $type

Returns

array

getLogsForHome()

getLogsForHome(string  $condition = '', integer  $page = 1, integer  $perPageNum) : array

前台获取文章列表

Parameters

string $condition
integer $page
integer $perPageNum

Returns

array

getAllPageList()

getAllPageList() 

获取全部页面列表

deleteLog()

deleteLog(integer  $blogId) 

删除文章

Parameters

integer $blogId

hideSwitch()

hideSwitch(integer  $blogId, string  $state) 

隐藏/显示文章

Parameters

integer $blogId
string $state

checkSwitch()

checkSwitch(integer  $blogId, string  $state) 

审核/驳回作者文章

Parameters

integer $blogId
string $state

postDate()

postDate(integer  $timezone = 8, string  $postDate = null, string  $oldDate = null) : \date

获取文章发布时间

Parameters

integer $timezone
string $postDate
string $oldDate

Returns

\date

updateViewCount()

updateViewCount(integer  $blogId) 

增加阅读次数

Parameters

integer $blogId

isRepeatPost()

isRepeatPost(  $title,   $time) 

判断是否重复发文

Parameters

$title
$time

neighborLog()

neighborLog(integer  $date) : array

获取相邻文章

Parameters

integer $date

unix时间戳

Returns

array

getRandLog()

getRandLog(  $num) 

随机获取指定数量文章

Parameters

$num

getHotLog()

getHotLog(  $num) 

获取热门文章

Parameters

$num

checkAlias()

checkAlias(string  $alias, array  $logalias_cache, integer  $logid) 

处理文章别名,防止别名重复

Parameters

string $alias
array $logalias_cache
integer $logid

authPassword()

authPassword(  $postPwd,   $cookiePwd,   $logPwd,   $logid) 

加密文章访问验证

Parameters

$postPwd
$cookiePwd
$logPwd
$logid