include_once('commonfunctions.php'); if (isset($numComments) && $numComments == 0) print "No comments yet, be the first to review this $glbItem!"; else { if (!isset($faceId) && !isset($_GET['faceId'])) { print "No $glbItem selected"; return; } $pagAutonoma = !isset($isCommentsIncluded); if ($pagAutonoma) { //pagina chiamata esternamente, non inclusa session_start(); include 'config.inc.php'; includeHeader(); if (isset($_SESSION['userNick'])) $userNick = $_SESSION['userNick']; $faceId = $_GET['faceId']; $connected = mysql_connect($mysqlhost, $mysqluser, $mysqlpsw) or die ("MySql error1: ".mysql_error()); mysql_select_db($mysqldb) or die ("MySql error2: ".mysql_error()); } $sqlgetcomments = "SELECT `comId`, `nick`, `rating`, `comment`, `date` FROM `{$dbTablePrefix}_comments` WHERE (faceId = $faceId) ORDER BY `comId` DESC LIMIT 0, 10"; $res = mysql_query($sqlgetcomments) or die ("MySql Error3: ".mysql_error()); if (mysql_num_rows($res) == 0) { print "
No comments yet, be the first to review this $glbItem!
"; if ($pagAutonoma) { include 'rate.inc.php'; includeFooter(); } return; } print "| By $nick on $date | ![]() |
| $comment | |