Example #1
0
 static function getPostAll()
 {
     $posts = Post::all();
     foreach ($posts as $post) {
         self::setFormattedDate($post);
     }
     return $posts;
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $this->left = View::template('v_left.php');
     $this->post = MPost::app();
     $this->image = MImage::app();
     $this->tag = MTag::app();
     $this->comment = MComment::app();
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     $this->post = MPost::app();
     //$this->left = View::template('post/v_left.php');
     $this->image = Image::app();
     $this->tag = Tag::app();
     $this->check_access('edit_posts');
 }
Example #4
0
File: post.php Project: svlt/back
 /**
  * POST /post.json
  * Create a new post
  * 
  * @todo Allow posting to a buddy's page
  * @param \Base $fw
  */
 public function post(\Base $fw)
 {
     $userId = self::_requireAuth();
     if ($fw->get('POST.user_id') != $userId) {
         \App::error(403);
     }
     $post = \Model\Post::create(['user_id' => $userId, 'page_id' => $fw->get('POST.user_id'), 'content' => $fw->get('POST.content')]);
     $detail = \App::model('post/detail')->load($post->id);
     $this->_json($detail->cast());
 }
Example #5
0
 public function uninstall()
 {
     die('serious?');
     // clears all tables !!!
     \Model\Post::setdown();
     \Model\Tag::setdown();
     \Model\Comment::setdown();
     \Model\User::setdown();
     $cfg = new Config();
     $cfg->clear('ACTIVE_DB');
     $cfg->save();
     \Base::instance()->clear('SESSION');
     echo "goodbye!";
 }
Example #6
0
 public function unregisterGlobally()
 {
     if (Post::$context === $this) {
         Post::$context = NULL;
     }
 }
 <?php 
use Cls\Front\DB;
use Core\Img;
use Cls\Comm;
use Model\Post;
$data = Post::getByCate(['url' => '/', 'size' => 10]);
$page = $data['page'];
$datas = $data['datas'];
$j = count($datas);
$i = 0;
?>
 

  <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
  <!--列表标题-->
    <div class="am-list-news-hd am-cf">
          <h2><?php 
echo $title1;
?>
</h2>
    </div>

		  <div class="am-list-news-bd">
		  <ul class="am-list">
		 
		      <?php 
foreach ($datas as $v) {
    $i++;
    ?>
		      <li class="am-g">
		          <a href="/post/<?php