本文整理汇总了PHP中post::reply方法的典型用法代码示例。如果您正苦于以下问题:PHP post::reply方法的具体用法?PHP post::reply怎么用?PHP post::reply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类post
的用法示例。
在下文中一共展示了post::reply方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: new_reply
private function new_reply($data)
{
if (isset($data['cat']) && isset($data['thread']) && isset($data['content']) && isset($data['page'])) {
// Set variables
$category_id = $data['cat'];
$thread_id = $data['thread'];
$page_num = $data['page'];
// Check category's access permissions
$category = category::get($category_id);
// Check category's access permissions
$thread = thread::get($thread_id);
if ($this->user['SiteRank'] >= $category['rankPost'] && $thread['locked'] != 1) {
if ($data['content'] != null) {
post::reply($data['cat'], $data['thread'], $data['content'], $this->user);
//Update thread last reply username
thread::update_last_reply($data['thread'], $this->user['Username']);
//Update thread replys count
thread::update_post_count($thread_id);
// Update user post count
self::user_post_count($this->user['Username']);
json::resp(array('success' => true, 'category' => (int) $category_id, 'thread' => (int) $thread_id, 'page' => (int) $page_num));
} else {
self::errorJSON('The post content cannot be blank!');
}
} else {
self::errorJSON('You cannot post to this thread! Check your permissions or if its locked.');
}
}
}