@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rough data fetch for previous/next posts on a blog

Summary: Ref T9897. Not pretty, but pulls data.

Test Plan: {F1046464}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9897

Differential Revision: https://secure.phabricator.com/D14903

+35 -1
+35 -1
src/applications/phame/controller/post/PhamePostViewController.php
··· 120 120 $add_comment = phutil_tag_div('mlb mlt', $add_comment); 121 121 } 122 122 123 + list($prev, $next) = $this->loadAdjacentPosts($post); 124 + 123 125 $properties = id(new PHUIPropertyListView()) 124 126 ->setUser($viewer) 125 127 ->setObject($post); 126 128 129 + if ($next) { 130 + $properties->addProperty( 131 + pht('Later Posts'), 132 + $viewer->renderHandleList(mpull($next, 'getPHID'))); 133 + } 134 + 135 + if ($prev) { 136 + $properties->addProperty( 137 + pht('Earlier Posts'), 138 + $viewer->renderHandleList(mpull($prev, 'getPHID'))); 139 + } 140 + 127 141 $properties->invokeWillRenderEvent(); 128 142 129 143 $crumbs = $this->buildApplicationCrumbs(); 130 144 131 - $page = $this->newPage() 145 + $page = $this->newPage() 132 146 ->setTitle($post->getTitle()) 133 147 ->setPageObjectPHIDs(array($post->getPHID())) 134 148 ->setCrumbs($crumbs) ··· 234 248 ->setSubmitButtonName(pht('Add Comment')); 235 249 236 250 return phutil_tag_div('phui-document-view-pro-box', $box); 251 + } 252 + 253 + private function loadAdjacentPosts(PhamePost $post) { 254 + $viewer = $this->getViewer(); 255 + 256 + $query = id(new PhamePostQuery()) 257 + ->setViewer($viewer) 258 + ->withVisibility(PhameConstants::VISIBILITY_PUBLISHED) 259 + ->withBlogPHIDs(array($post->getBlog()->getPHID())) 260 + ->setLimit(2); 261 + 262 + $prev = id(clone $query) 263 + ->setAfterID($post->getID()) 264 + ->execute(); 265 + 266 + $next = id(clone $query) 267 + ->setBeforeID($post->getID()) 268 + ->execute(); 269 + 270 + return array($prev, $next); 237 271 } 238 272 239 273 }