mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-27 14:32:31 +00:00
Dammit.
This commit is contained in:
parent
3de7bfd43d
commit
decf2308ff
3 changed files with 55 additions and 7 deletions
|
@ -66,8 +66,8 @@
|
||||||
need ('boxes sql table');
|
need ('boxes sql table');
|
||||||
|
|
||||||
global $newsID;
|
global $newsID;
|
||||||
global $newsText = $_POST['newsText'];
|
global $newsText
|
||||||
global $newsUser = $_POST['newsUser'];
|
global $newsUser
|
||||||
|
|
||||||
$newsID = $_GET['newsID'];
|
$newsID = $_GET['newsID'];
|
||||||
$newsText = $_POST['newsText'];
|
$newsText = $_POST['newsText'];
|
||||||
|
|
53
plan_add.php
Normal file
53
plan_add.php
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<? // Preamble
|
||||||
|
$pageName = "Post a new Plan Entry";
|
||||||
|
$need = 'auth';
|
||||||
|
require "parts/preamble.php"; // Load most of document
|
||||||
|
|
||||||
|
need ("boxes news");
|
||||||
|
|
||||||
|
// set up local vars
|
||||||
|
$mode = $_REQUEST['mode'];
|
||||||
|
$planSubj = $_REQUEST['planSubj'];
|
||||||
|
$planText = $_REQUEST['planText'];
|
||||||
|
$user = $userInfo['u_displayname'];
|
||||||
|
|
||||||
|
if ($planText && $planSubj && $mode == "Post") {
|
||||||
|
need ('sql');
|
||||||
|
|
||||||
|
$planText = addSlashes ($planText);
|
||||||
|
|
||||||
|
if ($conn = mysql_connect (sqlHost, sqlRWUser, sqlRWPass)) {
|
||||||
|
$query = 'INSERT INTO plans (p_date, p_user, p_subject, p_plan) VALUES ('
|
||||||
|
."NOW(), '$user', '$planSubj', '$planText')";
|
||||||
|
|
||||||
|
if ($result = mysql_db_query (sqlDB, $query, $conn)
|
||||||
|
&& $numRows = mysql_affected_rows ($conn)) {
|
||||||
|
echo '<P>Your plan entry has been posted successfully.</P>';
|
||||||
|
} else {
|
||||||
|
echo '<P>Somebody screwed up, MySQL said "' . mysql_error () . '". Bug a project admin or somethin\' eh?</P>';
|
||||||
|
}
|
||||||
|
mysql_close ($conn);
|
||||||
|
} else {
|
||||||
|
echo '<P>Somebody screwed up, MySQL said "' . mysql_error () . '". Bug a project admin or somethin\' eh?</P>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$date = date ('d M Y');
|
||||||
|
|
||||||
|
newsBoxOpen ();
|
||||||
|
if ($planText) {
|
||||||
|
newsBoxTitle ("Latest Plan for $user (Preview)");
|
||||||
|
printNews ($date, $user, stripSlashes ($planText));
|
||||||
|
}
|
||||||
|
newsBoxTitle ("Post Plan Entry");
|
||||||
|
$form = '<FORM action="' . thisURL . '" method="post">'
|
||||||
|
. 'Subject: <INPUT type="text" name="planSubj" size="59" value="'. stripSlashes ($planSubj) .'"><BR>'
|
||||||
|
. '<TEXTAREA name="planText" rows="25" cols="64">'
|
||||||
|
. stripSlashes ($planText)
|
||||||
|
. '</TEXTAREA><BR>'
|
||||||
|
. '<INPUT align="center" type="submit" name="mode" value="Post"></INPUT>'
|
||||||
|
. '<INPUT align="center" type="submit" name="mode" value="Preview"></INPUT>'
|
||||||
|
.'</FORM>';
|
||||||
|
printNews ($date, $user, $form);
|
||||||
|
newsBoxClose ();
|
||||||
|
}
|
||||||
|
?>
|
|
@ -4,7 +4,6 @@
|
||||||
$currPage = "plans"; // Name of the page, for the menu
|
$currPage = "plans"; // Name of the page, for the menu
|
||||||
require "parts/preamble.php"; // Load most of document
|
require "parts/preamble.php"; // Load most of document
|
||||||
?>
|
?>
|
||||||
<!--SEARCHME-->
|
|
||||||
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
||||||
<TR vAlign="top">
|
<TR vAlign="top">
|
||||||
<TD colSpan="2"><? // News display
|
<TD colSpan="2"><? // News display
|
||||||
|
@ -16,7 +15,3 @@
|
||||||
?></TD>
|
?></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
<!--NOSEARCH-->
|
|
||||||
<?
|
|
||||||
require "parts/postamble.php"; // Finish this sucker up
|
|
||||||
?>
|
|
||||||
|
|
Loading…
Reference in a new issue