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


PHP Forum::add方法代碼示例

本文整理匯總了PHP中Forum::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP Forum::add方法的具體用法?PHP Forum::add怎麽用?PHP Forum::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Forum的用法示例。


在下文中一共展示了Forum::add方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add

 function add()
 {
     $model = new Forum();
     $model->add();
     if ($_POST['parent'] != 0) {
         $this->redirect('/forum/' . $_POST['parent'] . '/');
     } else {
         $this->redirect('/forum/');
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:10,代碼來源:ForumController.php

示例2: __construct

 function __construct()
 {
     if ($_GET['act'] == 'del') {
         Forum::del();
         $this->redirect('/' . implode('/', Funcs::$uri) . '/');
     }
     if (Funcs::$uri[2] == '') {
         $tree = Tree::getTreeByUrl('wide', array('help', 'forum'));
         Funcs::setMeta($tree);
         $tree['list'] = Forum::getForum();
         View::render('forum/forum', $tree);
     } elseif (Funcs::$uri[3] == '') {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getItems();
                 Funcs::setMeta($tree);
                 View::render('forum/items', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/');
             }
         } else {
             $tree = Forum::getItems();
             Funcs::setMeta($tree);
             View::render('forum/items', $tree);
         }
     } else {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getList();
                 Funcs::setMeta($tree);
                 View::render('forum/list', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/' . Funcs::$uri[3] . '/');
             }
         } else {
             $tree = Forum::getList();
             Funcs::setMeta($tree);
             View::render('forum/list', $tree);
         }
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:43,代碼來源:ForumController.php

示例3: Forum

<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$id = $_GET["id"] + 0;
$forum = new Forum();
if ($page->isPostBack()) {
    $forum->add($id, $page->users->currentUserId(), "", $_POST["addReply"]);
    header("Location:" . WWW_TOP . "/forumpost/" . $id . "#last");
    die;
}
$results = $forum->getPosts($id);
if (count($results) == 0) {
    header("Location:" . WWW_TOP . "/forum");
    die;
}
$page->meta_title = "Forum Post";
$page->meta_keywords = "view,forum,post,thread";
$page->meta_description = "View forum post";
$page->smarty->assign('results', $results);
$page->smarty->assign('privateprofiles', $page->settings->getSetting('privateprofiles') == 1 ? true : false);
$page->content = $page->smarty->fetch('forumpost.tpl');
$page->render();
開發者ID:RickDB,項目名稱:newznab-tmux,代碼行數:24,代碼來源:forumpost.php

示例4: Forum

<?php

if (!$page->users->isLoggedIn()) {
    $page->show403();
}
$forum = new Forum(['Settings' => $page->settings]);
if ($page->isPostBack()) {
    $forum->add(0, $page->users->currentUserId(), $_POST["addSubject"], $_POST["addMessage"]);
    header("Location:" . WWW_TOP . "/forum");
    exit;
}
$offset = isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset']) ? $_REQUEST["offset"] : 0;
$results = array();
$results = $forum->getBrowseRange($offset, ITEMS_PER_PAGE);
$page->smarty->assign('pagertotalitems', $forum->getBrowseCount());
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', WWW_TOP . "/forum?offset=");
$page->smarty->assign('pagerquerysuffix', "#results");
$pager = $page->smarty->fetch("pager.tpl");
$page->smarty->assign('pager', $pager);
$page->smarty->assign('results', $results);
$page->meta_title = "Forum";
$page->meta_keywords = "forum,chat,posts";
$page->meta_description = "Forum";
$page->content = $page->smarty->fetch('forum.tpl');
$page->render();
開發者ID:Jay204,項目名稱:nZEDb,代碼行數:27,代碼來源:forum.php

示例5: admin_add_forum

 public function admin_add_forum()
 {
     if (!Visitor::current()->group->can("add_forum")) {
         show_403(__("Access Denied"), __("You do not have sufficient privileges to add forums.", "discuss"));
     }
     Forum::add($_POST['name'], $_POST['description']);
     Flash::notice(__("Forum added.", "discuss"), "/admin/?action=manage_forums");
 }
開發者ID:vito,項目名稱:chyrp-site,代碼行數:8,代碼來源:discuss.php


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