예제 #1
0
파일: Feed.php 프로젝트: MenZil-Team/inews
 public function get()
 {
     $posts = Model::factory('Article')->where('status', '1')->order_by_desc('point')->limit(10)->find_many();
     $feed = new FeedFactory();
     $channel = new Channel();
     $channel->title(config('site.title'))->description(config('site.default_meta'))->url(Url::site())->appendTo($feed);
     foreach ($posts as $post) {
         $item = new Item();
         /** @var $post \Model\Article */
         $item->title($post->title)->description(Html::fromMarkdown($post->content))->url($post->permalink())->pubDate(strtotime($post->created_at))->appendTo($channel);
     }
     $this->data = substr($feed, 0, -1);
 }
예제 #2
0
파일: user.php 프로젝트: MenZil-Team/inews
?>
</li>
        <li>Comments: <?php 
echo $author->comments()->count();
?>
</li>
        <li>Diggs: <?php 
echo $author->diggs()->count();
?>
</li>
        <li>Created at: <small><?php 
echo $author->created_at;
?>
</small></li>
        <li>Bio: <?php 
echo \Helper\Html::fromMarkdown($author->bio);
?>
</li>
    </ul>

    <?php 
if ($user && $user->id == $author->id) {
    ?>
        <a class="btn" href="<?php 
    echo url('/account/edit');
    ?>
">Edit Profile</a>
    <?php 
}
?>