當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Forum::forumExist方法代碼示例

本文整理匯總了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;
        }
開發者ID:MistriHD,項目名稱:Nameless,代碼行數:31,代碼來源:view_forum.php

示例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)));
開發者ID:NamelessMC,項目名稱:Nameless,代碼行數:31,代碼來源:new_topic.php


注:本文中的Forum::forumExist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。