示例#1
0
 public function build()
 {
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayPosts();
     Blorg::displayAd($this->app, 'bottom');
     $this->displayFooter();
     $this->layout->endCapture();
 }
 public function build()
 {
     parent::build();
     ob_start();
     Blorg::displayAd($this->app, 'top');
     echo $this->layout->data->content;
     Blorg::displayAd($this->app, 'bottom');
     $this->layout->data->content = ob_get_clean();
 }
示例#3
0
 public function build()
 {
     if (isset($this->layout->navbar)) {
         $this->buildNavBar();
     }
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayArchive();
     Blorg::displayAd($this->app, 'bottom');
     $this->layout->endCapture();
     $this->layout->data->title = Blorg::_('Archive');
 }
示例#4
0
 protected function displayComments()
 {
     if ($this->post->comment_status != SiteCommentStatus::CLOSED) {
         Blorg::displayAd($this->app, 'post_comments');
         $div_tag = new SwatHtmlTag('div');
         $div_tag->id = 'comments';
         $div_tag->class = 'entry-comments';
         $div_tag->open();
         $comments = $this->post->getVisibleComments();
         $view = SiteViewFactory::get($this->app, 'post-comment');
         $count = count($comments);
         if ($count > 0) {
             echo '<h3 class="comments-title">', Blorg::_('Comments'), '</h3>';
         }
         // display message for locked comments
         if ($this->post->comment_status == SiteCommentStatus::LOCKED) {
             $div_tag = new SwatHtmlTag('div');
             $div_tag->class = 'comments-locked-message';
             $div_tag->setContent(Blorg::_('Comments are locked. No additional comments may be ' . 'posted.'));
             $div_tag->display();
         }
         foreach ($comments as $i => $comment) {
             if ($i == $count - 1) {
                 $div_tag = new SwatHtmlTag('div');
                 $div_tag->id = 'last_comment';
                 $div_tag->open();
                 $view->display($comment);
                 $div_tag->close();
             } else {
                 $view->display($comment);
             }
         }
         $div_tag->close();
     }
 }
示例#5
0
 protected function displayBodytext(BlorgPost $post)
 {
     switch ($this->getMode('bodytext')) {
         case SiteView::MODE_ALL:
             $div_tag = new SwatHtmlTag('div');
             $div_tag->class = 'entry-content';
             $div_tag->setContent($post->bodytext, 'text/xml');
             $div_tag->display();
             if ($this->getMode('extended_bodytext') == SiteView::MODE_ALL && ($post->extended_bodytext != '' || $this->app->config->blorg->ad_post_comments == '')) {
                 Blorg::displayAd($this->app, 'post_content');
             }
             break;
         case SiteView::MODE_SUMMARY:
             $bodytext = null;
             $link = $this->getLink('bodytext');
             // don't summarize microblogs
             if ($post->title == '') {
                 $stripped_bodytext = strip_tags($post->bodytext);
                 $stripped_bodytext = html_entity_decode($stripped_bodytext, ENT_COMPAT, 'UTF-8');
                 if (strlen($stripped_bodytext) <= $this->microblog_length) {
                     $bodytext = $post->bodytext;
                 }
             }
             if ($bodytext === null) {
                 $flag = false;
                 $bodytext = SwatString::ellipsizeRight(SwatString::condense($post->bodytext), $this->bodytext_summary_length, ' …', $flag);
                 if ($flag && $link !== false) {
                     $anchor_tag = new SwatHtmlTag('a');
                     if (is_string($link)) {
                         $anchor_tag->href = $link;
                     } else {
                         $anchor_tag->href = $this->getRelativeUri($post);
                     }
                     $anchor_tag->setContent(Blorg::_('read more »'));
                     $bodytext .= ' ' . $anchor_tag;
                 }
             }
             $div_tag = new SwatHtmlTag('div');
             $div_tag->class = 'entry-content';
             $div_tag->setContent($bodytext, 'text/xml');
             $div_tag->display();
             break;
     }
 }
示例#6
0
 public function build()
 {
     if (isset($this->layout->navbar)) {
         $this->buildNavBar();
     }
     $this->buildTitle();
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayAuthor();
     if ($this->app->config->blorg->show_author_posts) {
         $this->displayPosts();
         $this->displayFooter();
     }
     Blorg::displayAd($this->app, 'bottom');
     $this->layout->endCapture();
 }
示例#7
0
 public function build()
 {
     if (isset($this->layout->navbar)) {
         $this->buildNavBar();
     }
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayMonths();
     Blorg::displayAd($this->app, 'bottom');
     $this->displayFooter();
     $this->layout->endCapture();
     $this->layout->data->title = $this->year;
 }
 public function build()
 {
     if (isset($this->layout->navbar)) {
         $this->buildNavBar();
     }
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayPosts();
     Blorg::displayAd($this->app, 'bottom');
     $this->layout->endCapture();
     $date = new SwatDate();
     $date->setDate($this->year, $this->month, 1);
     $date->setTZ($this->app->default_time_zone);
     $this->layout->data->title = $date->formatLikeIntl(SwatDate::DF_MY);
 }
示例#9
0
 public function build()
 {
     if (isset($this->layout->navbar)) {
         $this->buildNavBar();
     }
     $this->buildAtomLinks();
     $this->layout->startCapture('content');
     Blorg::displayAd($this->app, 'top');
     $this->displayPosts();
     $this->displayFooter();
     Blorg::displayAd($this->app, 'bottom');
     $this->layout->endCapture();
     $this->layout->data->title = sprintf(Blorg::_('Posts Tagged: <em>%s</em>'), $this->tag->title);
 }