当前位置: 首页>>代码示例>>PHP>>正文


PHP DiscussionModel::FetchPageInfo方法代码示例

本文整理汇总了PHP中DiscussionModel::FetchPageInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP DiscussionModel::FetchPageInfo方法的具体用法?PHP DiscussionModel::FetchPageInfo怎么用?PHP DiscussionModel::FetchPageInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DiscussionModel的用法示例。


在下文中一共展示了DiscussionModel::FetchPageInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: RefetchPageInfo

 /**
  * Re-fetch a discussion's content based on its foreign url.
  * @param type $DiscussionID
  */
 public function RefetchPageInfo($DiscussionID)
 {
     // Make sure we are posting back.
     if (!$this->Request->IsPostBack()) {
         throw PermissionException('Javascript');
     }
     // Grab the discussion.
     $Discussion = $this->DiscussionModel->GetID($DiscussionID);
     if (!$Discussion) {
         throw NotFoundException('Discussion');
     }
     // Make sure the user has permission to edit this discussion.
     $this->Permission('Vanilla.Discussions.Edit', TRUE, 'Category', $Discussion->PermissionCategoryID);
     $ForeignUrl = GetValueR('Attributes.ForeignUrl', $Discussion);
     if (!$ForeignUrl) {
         throw new Gdn_UserException(T("This discussion isn't associated with a url."));
     }
     $Stub = $this->DiscussionModel->FetchPageInfo($ForeignUrl, TRUE);
     // Save the stub.
     $this->DiscussionModel->SetField($DiscussionID, (array) $Stub);
     // Send some of the stuff back.
     if (isset($Stub['Name'])) {
         $this->JsonTarget('.PageTitle h1', Gdn_Format::Text($Stub['Name']));
     }
     if (isset($Stub['Body'])) {
         $this->JsonTarget("#Discussion_{$DiscussionID} .Message", Gdn_Format::To($Stub['Body'], $Stub['Format']));
     }
     $this->InformMessage('The page was successfully fetched.');
     $this->Render('Blank', 'Utility', 'Dashboard');
 }
开发者ID:srikarrohit,项目名称:Vanillaforums-SSO,代码行数:34,代码来源:class.discussioncontroller.php


注:本文中的DiscussionModel::FetchPageInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。