本文整理汇总了PHP中Forum::forumExist方法的典型用法代码示例。如果您正苦于以下问题:PHP Forum::forumExist方法的具体用法?PHP Forum::forumExist怎么用?PHP Forum::forumExist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forum
的用法示例。
在下文中一共展示了Forum::forumExist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Forum
* License: MIT
*/
// Set the page name for the active link in navbar
$page = "forum";
$forum = new Forum();
$timeago = new Timeago();
$pagination = new Pagination();
require 'core/includes/paginate.php';
// Get number of topics on a page
if (!isset($_GET['fid']) || !is_numeric($_GET['fid'])) {
Redirect::to('/forum/error/?error=not_exist');
die;
}
$fid = (int) $_GET['fid'];
// Does the forum exist, and can the user view it?
$list = $forum->forumExist($fid, $user->data()->group_id);
if (!$list) {
Redirect::to('/forum/error/?error=not_exist');
die;
}
// Get page
if (isset($_GET['p'])) {
if (!is_numeric($_GET['p'])) {
Redirect::to("/forum");
die;
} else {
if ($_GET['p'] == 1) {
// Avoid bug in pagination class
Redirect::to('/forum/view_forum/?fid=' . $fid);
die;
}
示例2: Forum
// Set the page name for the active link in navbar
$page = "forum";
// User must be logged in to proceed
if (!$user->isLoggedIn()) {
Redirect::to('/forum');
die;
}
$forum = new Forum();
$mentionsParser = new MentionsParser();
if (!isset($_GET['fid']) || !is_numeric($_GET['fid'])) {
Redirect::to('/forum/error/?error=not_exist');
die;
}
$fid = (int) $_GET['fid'];
// Does the forum exist, and can the user view it?
$list = $forum->forumExist($fid, $user->data()->group_id);
if (!$list) {
Redirect::to('/forum/error/?error=not_exist');
die;
}
// Can the user post a topic in this forum?
$can_reply = $forum->canPostTopic($fid, $user->data()->group_id);
if (!$can_reply) {
Redirect::to('/forum/view_forum/?fid=' . $fid);
die;
}
// Deal with any inputted data
if (Input::exists()) {
if (Token::check(Input::get('token'))) {
$validate = new Validate();
$validation = $validate->check($_POST, array('title' => array('required' => true, 'min' => 2, 'max' => 64), 'content' => array('required' => true, 'min' => 2, 'max' => 20480)));