case "feed": $comments = new Comment(); if (isset($_SESSION['user_is_logged'])) { echo $comments->printCommentBox($_GET['user']); } //tulostetaan kaikki kommentit $result = $comments->getComments($_GET['user']); while ($row = $result->fetch(PDO::FETCH_ASSOC)) { $date = strtotime($row['DateTime']); echo "<div class='comment'>" . "<a href='profile.php?user="******"'><span class='commenter'>" . $comments->getCommenter($row['CommenterId']) . ":</span></a>" . "<span class='comment_text'>" . $row['Comment'] . "</span>" . "<span class='comment_date'>" . date("d.m.Y", $date) . "<br>" . date("H:i:s", $date) . "</span>" . "</div>"; } //jos ollaan kirjauduttu sisään, näkyy kommentointiboxi break; case "profile": if (isset($_GET['edit']) && isset($_SESSION['user_is_logged'])) { echo $user->editForm(); } else { echo $user->printTable(); if ($_GET['user'] == $_SESSION['logged_user_email']) { echo "<a href='profile.php?user={$_SESSION["logged_user_email"]}&edit=1'>Muokkaa</a>"; } } $user = NULL; break; case "stats": include 'includes/profile-stats.php'; break; case "pictures": ?> <div class='profile_pictures'> <p>Täällä on ylieeppisesti kaikki kuvat...</p>