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


PHP Forum::addPost方法代碼示例

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


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

示例1: Forum

     $forum = new Forum($db, $user);
     $user->updateLastForumAccess();
     list($result, $totalCount) = $forum->getPosts((int) $params[3], (int) $_GET["limit"] ?: 10, (int) $_GET["index"] ?: 0);
     httpResponse($result, $totalCount);
     break;
 case validateRoute('POST', 'forums/\\d+/topics'):
     $forum = new Forum($db, $user);
     $user->updateLastForumAccess();
     $topicId = $forum->addTopic((int) $params[1], $postdata["subject"], $postdata["sub"] ?: '', $postdata["body"]);
     httpResponse(array("topicId" => $topicId));
     break;
 case validateRoute('POST', 'forums/\\d+/topics/\\d+/posts'):
     $mailbox = new Mailbox($db, $user);
     $forum = new Forum($db, $user, $mailbox);
     $user->updateLastForumAccess();
     $forum->addPost((int) $params[3], $postdata);
     httpResponse($result, $totalCount);
     break;
 case validateRoute('PATCH', 'forums/\\d+/topics/\\d+/posts/\\d+'):
     $forum = new Forum($db, $user);
     $forum->updatePost((int) $params[1], (int) $params[3], (int) $params[5], $postdata["postData"]);
     httpResponse($result, $totalCount);
     break;
 case validateRoute('DELETE', 'forums/\\d+/topics/\\d+/posts/\\d+'):
     $forum = new Forum($db, $user);
     $forum->deletePost((int) $params[1], (int) $params[3], (int) $params[5]);
     httpResponse();
     break;
 case validateRoute('GET', 'forums/users-online'):
     httpResponse($user->getForumOnline());
     break;
開發者ID:lordgabber,項目名稱:rartracker,代碼行數:31,代碼來源:api-v1.php

示例2:

     $forums->moveTopic();
     break;
 case 'deltopic':
     $forums->delTopic();
     break;
 case 'addtopic':
     $forums->addTopic();
     break;
 case 'newtopic':
     $forums->newTopic();
     break;
 case 'newpost':
     $forums->newPost();
     break;
 case 'addpost':
     $forums->addPost();
     break;
 case 'delpost':
     $forums->delPost();
     break;
 case 'addsubscription':
     $forums->setAbo('on');
     break;
 case 'unsubscription':
     $forums->setAbo('off');
     break;
 case 'forumlogin':
     $forums->forumsLogin();
     break;
 case 'change_type':
     $forums->changeType();
開發者ID:laiello,項目名稱:avecms,代碼行數:31,代碼來源:modul.php


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