"; echo "

Are you sure you want to delete message #$delete?

"; echo "
\n"; echo "\n"; echo "  "; echo "\n"; echo "
"; echo ""; PAGEFOOTER(); die(""); } if (isset($add)) { if (!isset($subject) || !strcmp($subject,"") ) { # USERERROR("No subject!",1); $subject = "Testbed News"; } if (!isset($author) || !strcmp($author,"") ) { # USERERROR("No author!",1); $author = "testbed-ops"; } if (isset($bodyfile) && strcmp($bodyfile,"") && strcmp($bodyfile,"none")) { $bodyfile = addslashes($bodyfile); $handle = @fopen($bodyfile,"r"); if ($handle) { $body = fread($handle, filesize($bodyfile)); fclose($handle); } else { USERERROR("Couldn't open uploaded file!",1); } } if (!isset($body) || !strcmp($body,"")) { USERERROR("No message body!",1); } $subject = addslashes($subject); $author = addslashes($author); $body = addslashes($body); if (isset($msgid)) { $msgid = addslashes($msgid); if (!isset($date) || !strcmp($date,"") ) { USERERROR("No date!",1); } $date = addslashes($date); DBQueryFatal("UPDATE webnews SET ". "subject='$subject', ". "author='$author', ". "date='$date', ". "body='$body' ". "WHERE msgid='$msgid'"); echo "

Updated message with subject '$subject'.


"; } else { DBQueryFatal("INSERT INTO webnews (subject, date, author, body) ". "VALUES ('$subject', NOW(), '$author', '$body')"); echo "

Posted message with subject '$subject'.


"; } echo "

Back to news

"; PAGEFOOTER(); die(""); } if (isset($edit)) { $edit = addslashes($edit); $query_result = DBQueryFatal("SELECT subject, author, body, msgid, date ". "FROM webnews ". "WHERE msgid='$edit'" ); if (!mysql_num_rows($query_result)) { USERERROR("No message with msgid '$edit'!",1); } $row = mysql_fetch_array($query_result); $subject = htmlspecialchars($row[subject], ENT_QUOTES); $date = htmlspecialchars($row[date], ENT_QUOTES); $author = htmlspecialchars($row[author], ENT_QUOTES); $body = htmlspecialchars($row[body], ENT_QUOTES); $msgid = htmlspecialchars($row[msgid], ENT_QUOTES); } if (isset($edit) || isset($addnew)) { if (isset($addnew)) { $author = $uid; echo "

Add new message:

\n"; } else { echo "

Edit message:

\n"; } echo "
\n"; if (isset($msgid)) { echo ""; } # if (isset($date)) { # echo ""; # } echo "Subject:
". "". "

\n"; if (isset($date)) { echo "Date:
". "". "

\n"; } echo "Posted by:
". "". "

\n". "Body (HTML):
". "

"; echo "or Upload Body File:
"; echo ""; echo ""; echo "

\n"; if (isset($addnew)) { echo "\n"; } else { echo "\n"; } echo "  \n"; echo "
"; PAGEFOOTER(); die(""); } else { echo "
\n"; echo "\n"; echo "
"; } } else { PAGEHEADER("News"); } ?>

News

(Changelog/Technical Details)

Hide Archived Messages\n"; } else { echo "Show Archived Messages\n"; } } $query_result= DBQueryFatal("SELECT subject, author, body, msgid, ". "DATE_FORMAT(date,'%W, %M %e, %Y, %l:%i%p') as prettydate, ". "(TO_DAYS(NOW()) - TO_DAYS(date)) as age, ". "archived, ". "DATE_FORMAT(archived_date,'%W, %M %e, %Y, %l:%i%p') as ". " archived_date ". "FROM webnews ". "$show_archive_clause ". "ORDER BY date DESC" ); if (!mysql_num_rows($query_result)) { echo "

No messages.

"; } else { if ($isadmin) { echo "
"; echo ""; } while ($row = mysql_fetch_array($query_result)) { $subject = $row[subject]; $date = $row[prettydate]; $author = $row[author]; $body = $row[body]; $msgid = $row[msgid]; $age = $row[age]; $archived = $row[archived]; $archived_date = $row[archived_date]; echo "\n"; echo ""; echo "\n". ""; if ($isadmin) { echo "\n"; } echo "\n"; echo "\n"; echo "
$subject"; if ($age < 7) { echo " "; } echo "
"; echo "$date; posted by $author."; if ($archived) { echo " Archived on $archived_date.\n"; } if ($isadmin) { echo " (Message #$msgid)"; } echo "
"; echo "". ""; if ($archived) echo ""; else echo ""; echo "
". "
". $body. "
". "

"; } if ($isadmin) { echo "\n"; } } PAGEFOOTER(); ?>