$ip = getenv("REMOTE_ADDR"); include("common_db.include"); ?>
Bulletin Board |
include("functions.include");
if(isset($submit))
{
if(($comment_author) && ($comment))
{
if(!$comment_email)($comment_email = "$comment_author@email_withheld");
$comment_timestamp = time();
$comment = ereg_replace("\n", " ", $comment); /* $comment = addslashes($comment); */ $mysql_access = mysql_connect($localhost, $user, $pw); mysql_select_db($db, $mysql_access); // $dup_query = "SELECT * FROM sf_comments WHERE comment='$comment'"; // $dup_result = mysql_query ($query, $mysql_access); // $dup_row = mysql_fetch_array ($dup_result); // $duplicate = $dup_row['comment']; // if (!$duplicate = "") // { $query = "INSERT INTO sf_comments VALUES (0, '$id', '$comment', '$comment_author', '$comment_email', '$comment_timestamp', '$ip')"; $result = mysql_query ($query, $mysql_access); $query = "UPDATE sf_news SET comments=comments+1 WHERE ID='$id'"; $result = mysql_db_query($db,$query); mysql_close (); // } // else // { // echo "refresh"; // } } else { echo "You left required fields blank."; } } $mysql_access = mysql_connect($localhost, $user, $pw); $query = "SELECT * FROM sf_news WHERE id='$id'"; $result = mysql_db_query ($db, $query); $row = mysql_fetch_array ($result); $tag = $row['ID']; $title = stripslashes($row['title']); $body = stripslashes($row['body']); $source = stripslashes($row['source']); $url = stripslashes($row['url']); $timestamp = $row['timestamp']; $author = $row['admin_id']; $comments = $row['comments']; $shell = ereg_replace("_", " ", $row['shell_id']); $query2 = "SELECT * FROM admin WHERE admin_id='$author'"; $result2 = mysql_db_query ($db, $query2); $row2 = mysql_fetch_array ($result2); $author = "".$row2['admin_name'].""; render_news_story($title, $body, $source, $url, $author, $timestamp, $tag, $comments, $shell); echo " "; $query = "SELECT * FROM sf_comments WHERE news_id='$id' ORDER BY id DESC"; $result = mysql_db_query ($db, $query); if(mysql_num_rows ($result)){ while ($row = mysql_fetch_array ($result)){ $authortest = $row['comment_author']; $authortest = $row['comment_author'] . "@email_withheld"; $timestamp = gmdate("D M dS Y H:i:s", $row['comment_timestamp']); $timestamp = ereg_replace(" 0", " ", $timestamp); $comment = stripslashes($row['comment']); $ip = $row['ip']; echo "
|
|