Ejemplo n.º 1
0
 static function getPostAll()
 {
     $posts = Post::all();
     foreach ($posts as $post) {
         self::setFormattedDate($post);
     }
     return $posts;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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');
 }
Ejemplo n.º 4
0
Archivo: post.php Proyecto: 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());
 }
Ejemplo n.º 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!";
 }
Ejemplo n.º 6
0
 public function unregisterGlobally()
 {
     if (Post::$context === $this) {
         Post::$context = NULL;
     }
 }
Ejemplo n.º 7
0
 <?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