public function __construct($data) { $guid = $data['guid']; $reverse = isset($data['reverse']) ? $data['reverse'] : "false"; $inline = isset($data['inline']) ? $data['inline'] : "false"; $this->html = viewComments($guid, $reverse, $inline, false); }
function addComment($message, $idpincho) { session_start(); $p = new Pincho(); $pinfo = $p->getbyCode($idpincho); $idestablishment = $pinfo[0]["Establishment_idEstablishment"]; $pop = new Popular(); $popinfo = $pop->select($_SESSION["name"]); $idpopular = $popinfo[0]["idPopular"]; $c = new Comments(); $boolean = $c->add($message, $idpincho, $idestablishment, $idpopular); if ($boolean == false) { echo "Database error"; } else { viewComments($idpincho); } }
$video->load($id); include '../views/showDVD/singleVideo.php'; } if ($videoCount == 0) { include '../views/showDVD/noVideos.php'; } } function viewComments($dvd = 0) { $dbh = new Database(); $sth = $dbh->prepare("SELECT id FROM " . DB_PREFIX . "comments WHERE dvd = ? ORDER BY id DESC"); $sth->execute(array($dvd)); $commentCount = 0; while ($id = $sth->fetchColumn()) { $commentCount++; $comment = new Comment(); $comment->load($id); include '../views/showDVD/singleComment.php'; } } $dvd = (int) $URL[0]; $currentDVD = new DVD(); $currentDVD->load($dvd); include '../views/header.php'; include '../views/showDVD/header.php'; viewVideoList($dvd); include '../views/showDVD/suggestVideo.php'; include '../views/showDVD/addComment.php'; viewComments($dvd); include '../views/showDVD/footer.php'; include '../views/footer.php';