本文整理匯總了PHP中post::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP post::get方法的具體用法?PHP post::get怎麽用?PHP post::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類post
的用法示例。
在下文中一共展示了post::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: posts
public function posts()
{
if (!$this->user->is_logged_in()) {
redirect("/user/main/userLogin", 'location');
} else {
$post = new post(-1);
$data['objects'] = $post->get();
$data['id_user'] = $this->user->get_id();
$this->show->set_user_backend();
$this->show->user_backend('show_post_objects', $data);
}
}
示例2: delete_post
private function delete_post($post_id)
{
if ($this->user['SiteRank'] >= 4) {
$post = post::get($post_id);
if ($post['postorderid'] == 0) {
if ($this->user['Username'] == $post['author'] || $this->user['Username'] >= 4) {
$result = post::delete($post_id);
//Update thread replys count
thread::update_post_count($post['thread']);
////Build event details to log
// $logEventID = '132';
// $logDetails = 'Forum post id:'.$post_id.' in thread id:'.$thread.' for category id:'.$category.' deleted!';
// $logEventAuthor = $this->user['Username'];
// //Write to admin log.
json::resp(array('success' => true, 'cat' => $post['cat'], 'thread' => $post['thread']));
}
} else {
self::errorJSON('Cannot delete first post of thread, the entire thread must be deleted!');
}
}
}