当前位置: 首页>>代码示例>>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;未经允许,请勿转载。