Ejemplo n.º 1
0
      </div>
    </div> 
    
    <div class='events'></div>
        
    <!-- Container of Posts -->
    <div class='posts-container'>
      <?php 
$data = new MysqlConnector();
$data->connectMysql();
#LOAD ALL POSTS
$result = $data->getPosts();
#PRINT EACH LOADED POST WITH ITS COMMENTS
while ($post = $result->fetch_assoc()) {
    //check if the logged user likes the current post
    $like = $data->isLiked($post['post_id']);
    //count how many like the post has
    $likes = $data->getNumOfLikes($post['post_id']);
    printPostCode($post['user_id'], $post['name'], $post['surname'], $post['description'], $post['post_id'], $post['sharing_date'], $like, $likes, $post['img_url']);
}
?>
    </div>
  </div>
  
  <div class='hidden postCodeSample'>
    <?php 
printPostCode("", "", "", "", "", "", false, "", "", "");
?>
  </div>

  <!-- A div for storing a codesample of a general comment -->