include "config.php"; $issue_id = $_GET['issue_id']; if (isset($_GET['news_id'])) { $dbName = 'news'; $idName = 'news_id'; $id = $_GET['news_id']; } else if (isset($_GET['feature_id'])) { $dbName = 'features'; $idName = 'feature_id'; $id = $_GET['feature_id']; } else { $dbName = 'events'; $idName = 'event_id'; $id = $_GET['event_id']; } if (is_numeric($id) && $id > 0 && $id < 1000000) { } else { $id = 0; } $db[$dbName]->connect(); if ($_POST['formName'] == 'postComment') { if (!empty($_POST['newComment'])) { $query = "INSERT INTO `communique_comments` (`article_id`, `article_type`,`comment`, `date`) VALUES (".$_POST['article_id'].", '".$dbName."', '".$_POST['newComment']."', NOW())"; $result = mysql_query($query) or die (mysql_error()); } $query = "UPDATE `communique_".$dbName."` SET ratingSum=ratingSum+".$_POST['rating'].", numVotes=numVotes+1 WHERE ".$idName."=".$_POST['article_id']; $result = mysql_query($query) or die (mysql_error()); ?> } $db[$dbName]->buildSelectQuery('*', $idName.'='.$id); $db[$dbName]->query(); $row = $db[$dbName]->getRow(); ?>
| include "sidebar.php"; ?> |
=stripslashes($row['title'])?> $row['body'] = str_replace ('WEB_IMAGE_ROOT', WEB_IMAGE_ROOT, $row['body']); if ($row['html'] == 'yes') print stripslashes($row['body']); else print stripslashes(nl2br($row['body'])); ?> |
||
|
$result = mysql_query("SELECT * FROM `communique_comments` WHERE article_id=".$id." AND article_type='".$dbName."'");
?>
|
|||