Esempio n. 1
0
            echo "<li>";
            $comment->show();
            $commenter = new User($conn);
            $commenter->loadFromDb($comment->getUserId());
            $commenter->show();
            echo "</li>";
        }
        echo "</ul>";
        echo "</div>";
    }
} elseif (isset($_GET["tweet"])) {
    $db = Database::getInstance();
    $conn = $db->getConnection();
    $tweetId = $_GET["tweet"];
    $tweet = new Tweet($conn);
    $tweet->loadFromDb($tweetId);
    $userId = $tweet->getUserId();
    $user = new User($conn);
    $user->loadFromDb($userId);
    echo "<div class='col-md-12 container tweet-block'>";
    $user->show();
    $tweet->show();
    $comments = $tweet->loadAllComments();
    require ROOT_NAME . "/includes/commentForm.php";
    echo "<ul class='comments'>";
    foreach ($comments as $comment) {
        echo "<li>";
        $comment->show();
        $commenter = new User($conn);
        $commenter->loadFromDb($comment->getUserId());
        $commenter->show();