<?php /** * Created by PhpStorm. * User: ununik * Date: 25.08.2015 * Time: 16:18 */ $saved = ""; $newComment = new CommentsEntry(); $notice = "<a href='index.php?page=entry&id={$entry['id']}' class='notice'>{$profil->getName()} právě okomentoval článek {$entry['title']}</a>"; if (isset($_POST['comment']) && $_POST['comment'] != "") { $commentSafe = safeText($_POST['comment']); $newComment->newComment($_GET['id'], $profil->getId(), $commentSafe, $author->getId(), $notice); $saved = "Váš komentář byl přidán."; } $allComments = $newComment->allComments($_GET['id']); $commentsInBox = (include "views/entry/comment-html.php"); return include_once "views/entry/commentsBox.php";
$relationships = "Čeká se na potvrzení od druhého sportovce."; } elseif ($relationship == "check") { $relationships = "Tento sportovec se chce s tebou seznámit. <form action='' method='post'><button name='friends' value='check'>Potvrdit žádost</button></form>"; } $relationships .= "<form action='index.php?page=message' method='post'><button name='id' value='{$profil->getId()}'>Odeslat zprávu</button></form>"; } $gender = ""; $web = $profil->getProfilWeb(); if ($profil->getGender() == "m") { $gender = "muž"; } elseif ($profil->getGender() == "f") { $gender = "žena"; } $clubs = $profil->getClubList(); $club = ""; foreach ($clubs as $club_one) { $club .= "{$club_one}<br>"; } $club .= ""; $aboutMe = nl2br($profil->getAboutMe()); $entr = new Entry(); $allEntries = $entr->showEntries($profil->getId()); $entries = ""; foreach ($allEntries as $oneEntry) { $date = date('j. n. Y', $oneEntry['timestamp']); $comments = new CommentsEntry(); $numComments = $comments->numOfComments($oneEntry['id']); $entries .= "<a href='index.php?page=entry&id={$oneEntry['id']}'>{$oneEntry['title']} ({$date})</a><br>\n <div>Počet komentářů: {$numComments}</div>"; } $title = 'Tiary'; return include_once "views/profil/profil-html.php";