2000-05-13 22:08:03 +00:00
|
|
|
<? // Preamble
|
|
|
|
$pageName = "Developers - Add News";
|
|
|
|
$focused = "home"; // Dock icon name to gets a border
|
|
|
|
$need = 'auth';
|
|
|
|
require("../parts/preamble.php"); // Load most of document
|
|
|
|
?>
|
|
|
|
<?
|
|
|
|
if ($newsItem) {
|
|
|
|
need('sql');
|
|
|
|
|
|
|
|
$user = ucfirst($userInfo[u_username]) ;
|
|
|
|
$newsItem = AddSlashes($newsItem);
|
|
|
|
|
|
|
|
$conn = mysql_connect (sqlHost, sqlUser, sqlPass);
|
|
|
|
if ($conn) {
|
|
|
|
$query = 'INSERT into news_main (n_date, n_user, n_news) VALUES (' .
|
|
|
|
" NOW(), '$user', '$newsItem')";
|
|
|
|
$result = mysql_db_query (sqlDB, $query, $conn);
|
|
|
|
if ($result) {
|
|
|
|
$numRows = mysql_affected_rows ($conn);
|
|
|
|
if ($numRows) {
|
|
|
|
echo '<P>Your news item has been processed successfully.';
|
|
|
|
} else {
|
2000-05-14 04:04:26 +00:00
|
|
|
echo '<P>There was an error in your input. If you don\'t know what it is, I\'m not going to tell you.';
|
2000-05-13 22:08:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
mysql_close ($conn);
|
|
|
|
} else {
|
|
|
|
echo 'You suck, butthead.';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tableBoxHeader(featureBgColor, tableHeadColor);
|
|
|
|
tableTitle("Add News", 1, tableHeadColor);
|
|
|
|
|
|
|
|
$date = strftime('%d %b %Y', time());
|
2000-05-15 00:34:20 +00:00
|
|
|
$user = $userInfo[u_username] ;
|
2000-05-13 22:08:03 +00:00
|
|
|
echo '<TR><TD><DL><DT><FONT SIZE=-1>Posted on ' . $date . ' by ' . $user . '</FONT></DT>' .
|
|
|
|
' <DD> ';
|
|
|
|
?>
|
|
|
|
<FORM action="addnews.php" method="post">
|
|
|
|
<TEXTAREA name="newsItem" rows="25" cols="64"></TEXTAREA><BR>
|
|
|
|
<INPUT align="center" type="submit" value="Post"></INPUT>
|
|
|
|
</FORM>
|
|
|
|
<? ' . </DD>' .
|
|
|
|
'</DL></TD></TR>';
|
|
|
|
tableBoxFooter();
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?
|
|
|
|
?>
|
|
|
|
<?
|
|
|
|
require (siteHome ."/parts/postamble.php"); // Finish this sucker up
|
|
|
|
?>
|