コード例 #1
0
ファイル: page.php プロジェクト: Esisto/IoEsisto
 private static function PCSameAuthor($data)
 {
     if (isset(self::$currentObject) && !is_null(self::$currentObject) && self::$currentObject !== false) {
         require_once 'user/UserManager.php';
         $user = UserManager::loadUser(self::$currentObject->getAuthor(), false);
         if (true) {
             //TODO se l'autore vuole
             echo "<p>Dello stesso autore</p>";
             require_once 'search/SearchManager.php';
             $posts = SearchManager::searchBy("Post", array("author" => $user->getID(), "no_id" => self::$currentObject->getID(), "loadComments" => false), array("order" => -1, "by" => "ps_creationDate"));
             self::$post_options[PostPage::SHORT] = true;
             self::$post_options[PostPage::NO_COMMENTS] = true;
             self::$post_options[PostPage::NO_MODIF_DATE] = true;
             require_once 'post/PostPage.php';
             foreach ($posts as $p) {
                 PostPage::showPost($p, self::$post_options);
             }
             self::$post_options[PostPage::SHORT] = false;
             self::$post_options[PostPage::NO_COMMENTS] = false;
             self::$post_options[PostPage::NO_MODIF_DATE] = false;
         }
     }
 }