mirror of
https://git.code.sf.net/p/quake/website
synced 2025-02-18 18:01:41 +00:00
PHP library cleanups, news system cleanups, no more manual postamble including.
This commit is contained in:
parent
5754d54a63
commit
67a3d7bb36
30 changed files with 601 additions and 707 deletions
|
@ -3,7 +3,6 @@
|
|||
$currPage = "about"; // Name of the page, for menu/dock
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<!--SEARCHME-->
|
||||
<P>QuakeForge is a 3D graphics game engine based on id Software's legendary
|
||||
Quake and QuakeWorld game engine. Our purpose? To improve the state of the
|
||||
game by improving the engine and making it accessable to the largest number
|
||||
|
@ -25,7 +24,3 @@ implement any effective cheat prevention methods.
|
|||
<P>Other things we're doing include merging the two code trees, adding
|
||||
features, and improving the OpenGL renderer. And QuakeForge is still the most
|
||||
portable source tree based on the id Software code.
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -61,7 +61,3 @@ if you expect a reply.<br>
|
|||
</TR>
|
||||
</TABLE>
|
||||
</FORM>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<? // Preamble
|
||||
$pageName = "Copyright Information";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<!--SEARCHME-->
|
||||
<P>Web site Copyright © 1999-<? echo date("Y"); ?> the QuakeForge Project.
|
||||
<P>Web site Copyright © 1999-<?=date ("Y")?> the QuakeForge Project.
|
||||
|
||||
<P>QuakeForge is Copyright © 1999-<? echo date("Y"); ?> the QuakeForge project.<BR>
|
||||
<P>QuakeForge is Copyright © 1999-<?=date ("Y")?> the QuakeForge project.<BR>
|
||||
Portions Copyright © 1996-1997 id Software, Inc.
|
||||
|
||||
<P>The QuakeForge logo and in-game QuakeForge console background were designed by <A href="mailto:keiran69%40optusnet.com.au">"Twisted" (keiran69@optusnet.com.au)</A>.
|
||||
|
@ -17,8 +15,3 @@ Custom renderings available on request.
|
|||
<P>Quake® and QuakeWorld® are registered trademarks of id Software, Inc.
|
||||
|
||||
<P>Quake is Copyright © 1996-1997 id Software, Inc.
|
||||
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -87,7 +87,3 @@ and how to use it go to the <A href="http://www.gnu.org/manual/cvs/">GNU Web sit
|
|||
|
||||
<P>If you find anything that should be added to this document, send me an email
|
||||
at: <TT>absolute@squadron.org</TT>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<? // Preamble
|
||||
$pageName = "Developer Tools";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
$currPage = "devtools"; // Name of the page, for the menu
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<!--SEARCHME-->
|
||||
<P>The tools on this page are referenced here as a service to developers and
|
||||
prospective developers for QuakeForge.
|
||||
|
||||
|
@ -48,7 +46,3 @@ developers at a variety of locations.
|
|||
<DT>Windows 95, 98, NT, and Windows 2000:</DT>
|
||||
<DD>You can get an SSH client from Gordon Chaffee's <A href="http://bmrc.berkeley.edu/people/chaffee/winntutil.html">Windows NT Utilities</A> page.</DD>
|
||||
</DL>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<? // Preamble>
|
||||
$pageName = "Command Documentation for " . $program;
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
?>
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
<?
|
||||
have ('cmd');
|
||||
|
||||
function printRow ($name, $description)
|
||||
|
@ -56,7 +53,3 @@
|
|||
printCmdlist ($program);
|
||||
}
|
||||
?>
|
||||
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<? // Preamble
|
||||
$pageName = "CVAR Documentation for " . $program;
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
?>
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
<?
|
||||
have ('cvar');
|
||||
|
||||
function printRow ($flags, $name, $description)
|
||||
|
@ -50,7 +47,3 @@
|
|||
printCvarlist ($program);
|
||||
}
|
||||
?>
|
||||
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<? // Preamble
|
||||
$pageName = "Documentation";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
$currPage = "docs"; // Name of the page, for the menu
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
?>
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
<?
|
||||
need ("table");
|
||||
|
||||
function doc_list ($title, $list, $type)
|
||||
|
@ -108,8 +105,4 @@
|
|||
);
|
||||
|
||||
program_doc_list ("QuakeForge 0.3", $program_list, "");
|
||||
|
||||
?>
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<? // Preamble
|
||||
$pageName = "Downloads";
|
||||
$focused = "download"; // Dock icon name to get a border
|
||||
$currPage = "files"; // Name of the page, for the menu
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
|
||||
<?
|
||||
function fileDownloadLink ($baseUrl, $extensions)
|
||||
{
|
||||
$extension = explode (' ', $extensions);
|
||||
|
@ -24,6 +21,7 @@
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
function fileDownloadLinkGPG ($baseUrl, $extensions, $mode)
|
||||
{
|
||||
$extension = explode (' ', $extensions);
|
||||
|
@ -46,6 +44,7 @@
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
function fileUpdated ($file)
|
||||
{
|
||||
$ftime = filemtime ($file);
|
||||
|
@ -386,7 +385,3 @@ trees are more closely related than initial look would indicate.
|
|||
<A href="http://www.info-zip.org/pub/infozip/zlib/">http://www.info-zip.org/pub/infozip/zlib/</a>
|
||||
</LI>
|
||||
</UL>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
21
index.php
21
index.php
|
@ -2,16 +2,13 @@
|
|||
$pageName = "Welcome!";
|
||||
$currPage = "home"; // Name of the page, for the menu
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>Latest News</H2></DIV>
|
||||
<? // News display
|
||||
need ("news");
|
||||
$cached = latestNews (5);
|
||||
?>
|
||||
<DIV class="newsTitle"><A href="old_news.php">Older News...</A></DIV>
|
||||
</DIV>
|
||||
<!--<? include "partners.inc"; ?>-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
|
||||
need ("boxes news");
|
||||
newsBoxOpen ('Latest News');
|
||||
|
||||
printLatestNews (5);
|
||||
newsBoxTitle ('Older News...', '/old_news.php');
|
||||
|
||||
newsBoxClose ();
|
||||
?>
|
||||
<!--<? include "partners.inc"; ?>-->
|
||||
|
|
50
lib/boxes.php
Normal file
50
lib/boxes.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?
|
||||
/*
|
||||
boxes.php
|
||||
|
||||
DIV-based box functions
|
||||
|
||||
Copyright (C) 2000,2007 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
have ("boxes");
|
||||
|
||||
function newsBoxTitle ($title, $url = NULL) {
|
||||
echo '<DIV class="newsTitle">';
|
||||
if ($url) {
|
||||
echo '<A href="' . $url . "\">$title</A>";
|
||||
} else {
|
||||
echo "<H2>$title</H2>";
|
||||
}
|
||||
echo "</DIV>\n";
|
||||
}
|
||||
|
||||
function newsBoxOpen ($title = NULL) {
|
||||
echo "<DIV class=\"newsBox\">\n";
|
||||
|
||||
if ($title)
|
||||
newsBoxTitle ($title);
|
||||
}
|
||||
|
||||
function newsBoxClose () {
|
||||
echo '</DIV>';
|
||||
}
|
||||
?>
|
361
lib/news.php
361
lib/news.php
|
@ -1,251 +1,146 @@
|
|||
<?
|
||||
/*
|
||||
news.php
|
||||
|
||||
SQL-based news reading library
|
||||
/*
|
||||
news.php
|
||||
|
||||
Copyright (C) 2000,2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
Copyright (C) 2000 Daniel David Olson <theoddone33@users.sourceforge.net>
|
||||
SQL-based news reading
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
Copyright (C) 2000-2007 Jeff Teunissen <deek@quakeforge.net>
|
||||
Copyright (C) 2000 Daniel David Olson <theoddone33@users.sourceforge.net>
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
have ('news');
|
||||
|
||||
/* SQL definition for news table
|
||||
CREATE TABLE news_main (
|
||||
n_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
n_user TINYTEXT NOT NULL,
|
||||
n_date TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
n_news TEXT DEFAULT '' NOT NULL
|
||||
);
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
function newsItem ($date, $user, $text)
|
||||
{
|
||||
echo
|
||||
' <DL>' .
|
||||
' <DT><FONT SIZE="-1">' . "<EM>Posted on </EM>$date<EM> by </EM><STRONG>$user</STRONG></FONT></DT>" .
|
||||
" <DD><P>$text</P></DD>" .
|
||||
' </DL>' ;
|
||||
|
||||
have ('news');
|
||||
need ('sql');
|
||||
// SQL definition for news table
|
||||
$createQuery="CREATE TABLE news_main ("
|
||||
." n_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,"
|
||||
." n_user TINYTEXT NOT NULL,"
|
||||
." n_date TIMESTAMP NOT NULL DEFAULT NOW(),"
|
||||
." n_news TEXT NOT NULL"
|
||||
.")";
|
||||
|
||||
function formatNews ($date, $user, $text)
|
||||
{
|
||||
return "<DL>\n"
|
||||
.' <DT><FONT SIZE="-1">'
|
||||
. "<EM>Posted on </EM>$date<EM> by </EM><STRONG>$user</STRONG>"
|
||||
. "</FONT></DT>\n"
|
||||
." <DD>$text</DD>\n"
|
||||
."</DL>\n";
|
||||
}
|
||||
|
||||
|
||||
function formatNewsArray ($a)
|
||||
{
|
||||
need ("date");
|
||||
|
||||
return formatNews (dateFromSQLDateTime ($a['n_date']), $a['n_user'], StripSlashes($a['n_news']));
|
||||
}
|
||||
|
||||
|
||||
function printNews ($date, $user, $text)
|
||||
{
|
||||
echo formatNews ($date, $user, $text);
|
||||
}
|
||||
|
||||
|
||||
function printNewsArray ($a)
|
||||
{
|
||||
echo formatNewsArray ($a);
|
||||
}
|
||||
|
||||
|
||||
function latestNews ($max)
|
||||
{
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main'
|
||||
." ORDER BY n_date DESC LIMIT $max";
|
||||
|
||||
return sqlReadQuery ($query);
|
||||
}
|
||||
|
||||
|
||||
function printLatestNews ($max)
|
||||
{
|
||||
$filler = date ('d M Y');
|
||||
$entries = latestNews ($max);
|
||||
|
||||
if ($entries === true) { // success, but no data
|
||||
printNews ($filler, 'Web Server', 'Nobody has posted news yet, so I got nothing to say right now.');
|
||||
} elseif ($entries === false) { // bad query
|
||||
printNews ($filler, 'Web Server', 'Got an error while finding news. Bug a project administrator, eh?');
|
||||
} elseif ($entries === null) { // boom
|
||||
printNews ($filler, 'Web Server', 'Couldn\'t connect to the project news server...Sorry.');
|
||||
} else for ($i = 0; $i < count ($entries); $i++) {
|
||||
printNewsArray ($entries[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function monthlyNews ($month, $year)
|
||||
{
|
||||
if (($year < 1999) || ($year > date ('Y'))) { // Sanity checking
|
||||
$year = date ('Y');
|
||||
}
|
||||
|
||||
function newsEntry ($array)
|
||||
{
|
||||
need ("date");
|
||||
|
||||
return
|
||||
' <DL>' .
|
||||
' <DT><FONT size="-1"><EM>Posted on </EM>' . dateFromSQLDateTime ($array[n_date]) . '<EM> by </EM><STRONG>' . $array[n_user] . '</STRONG></FONT></DT>' .
|
||||
' <DD>' . StripSlashes ($array[n_news]) . '</DD>' .
|
||||
' </DL>';
|
||||
if (($month < 1) || ($month > 12)) {
|
||||
$month = date ('m');
|
||||
}
|
||||
|
||||
function monthForm ($month, $year)
|
||||
{
|
||||
need ('feature');
|
||||
$filler = date ('d M Y');
|
||||
$date1 = sprintf ("%04d-%02d", $year, $month);
|
||||
$date2 = sprintf ("%04d-%02d", $year, $month+1);
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main'
|
||||
." WHERE n_date BETWEEN '$date1-01 00:00:00'"
|
||||
." AND '$date2-01 00:00:00'"
|
||||
.' ORDER BY n_date DESC';
|
||||
|
||||
// suppress warnings
|
||||
@featureOpen ('Date Search');
|
||||
?>
|
||||
<FORM name="bymonth" method="get" action="<?=thisURL?>">
|
||||
<P align="center">
|
||||
<SELECT name="month">
|
||||
<?
|
||||
for ( $i = 1 ; $i < 13 ; $i++ ) {
|
||||
printf ("<OPTION%s>%02d</OPTION>", $i == $month ? " selected" : "", $i);
|
||||
}
|
||||
?>
|
||||
</SELECT><STRONG> / </STRONG><SELECT name="year">
|
||||
<?
|
||||
if ($year == "")
|
||||
$year = date ('Y');
|
||||
for ($i = 2000; $i <= date ('Y'); $i++ ) {
|
||||
if ($i == 2005 || $i == 2006)
|
||||
continue;
|
||||
|
||||
printf ("<OPTION%s>%04d</OPTION>", $i == $year ? " selected" : "", $i);
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
<BR>
|
||||
<BR>
|
||||
<INPUT type="submit" value="Search">
|
||||
</P>
|
||||
</FORM><?
|
||||
featureClose ();
|
||||
$entries = sqlReadQuery ($query);
|
||||
if ($entries === true) { // success, but no data
|
||||
printNews ($filler, 'Web Server', 'Nobody posted news in the month you asked for.');
|
||||
} elseif ($entries === false) { // bad query
|
||||
printNews ($filler, 'Web Server', 'Got an error while finding news. Bug a project administrator, eh?');
|
||||
} elseif ($entries === null) { // boom
|
||||
printNews ($filler, 'Web Server', 'Couldn\'t connect to the project news server...Sorry.');
|
||||
} else for ($i = 0; $i < count ($entries); $i++) {
|
||||
printNewsArray ($entries[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
function keywordForm ($string)
|
||||
{
|
||||
need ('feature');
|
||||
|
||||
// suppress warnings
|
||||
@featureOpen ('Keyword Search');
|
||||
?>
|
||||
<FORM name="bystring" method="get" action="<?=thisURL?>">
|
||||
<P align="center">
|
||||
<?
|
||||
printf ('<INPUT name="string" type="text" size="16" value="%s">', $string);
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<INPUT TYPE="submit" VALUE="Search">
|
||||
</P>
|
||||
</FORM><?
|
||||
featureClose ();
|
||||
function searchNews ($string)
|
||||
{
|
||||
$filler = date ('d M Y');
|
||||
$search = addSlashes ("%$string%");
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main'
|
||||
." WHERE n_news LIKE '$search'"
|
||||
.' ORDER BY n_date DESC';
|
||||
|
||||
$entries = sqlReadQuery ($query);
|
||||
if ($entries === true) { // success, but no data
|
||||
printNews ($filler, 'Web Server', "No news found matching '$string'");
|
||||
} elseif ($entries === false) { // bad query
|
||||
printNews ($filler, 'Web Server', 'Got an error while finding news. Bug a project administrator, eh?');
|
||||
} elseif ($entries === null) { // boom
|
||||
printNews ($filler, 'Web Server', 'Couldn\'t connect to the project news server...Sorry.');
|
||||
} else for ($i = 0; $i < count ($entries); $i++) {
|
||||
printNewsArray ($entries[$i]);
|
||||
}
|
||||
|
||||
function fetchNewsEntry ($number)
|
||||
{
|
||||
need('date');
|
||||
|
||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
" ORDER BY n_date DESC LIMIT $number";
|
||||
$result = @mysql_db_query (sqlDB, $query, $conn);
|
||||
if ($result) {
|
||||
$numRows = @mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
// return (list (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
function latestNews ($max)
|
||||
{
|
||||
if (sqlAvail) {
|
||||
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
' ORDER BY n_date DESC';
|
||||
$result = mysql_db_query (sqlDB, $query, $conn);
|
||||
if ($result) {
|
||||
$numRows = mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
for ($i = 0 ; $i < $numRows && $i < $max; $i++) {
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No current news!');
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No news in database!');
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
include 'newscache.php';
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No SQL server available!');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function monthlyNews ($month, $year)
|
||||
{
|
||||
if (($year < 1999) || ($year > date ('Y'))) { // Sanity checking
|
||||
$year = date ('Y');
|
||||
}
|
||||
|
||||
if (($month < 1) || ($month > 12)) {
|
||||
$month = date ('m');
|
||||
}
|
||||
|
||||
$date1 = sprintf ("%04d-%02d", $year, $month);
|
||||
$date2 = sprintf ("%04d-%02d", $year, $month+1);
|
||||
|
||||
if (sqlAvail) {
|
||||
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
" WHERE n_date BETWEEN '$date1-01 00:00:00'" .
|
||||
" AND '$date2-01 00:00:00'" .
|
||||
' ORDER BY n_date DESC';
|
||||
$result = @mysql_db_query (sqlDB, $query, $conn);
|
||||
if ($result) {
|
||||
$numRows = @mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No news for this month!');
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No news in database!');
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No SQL server available');
|
||||
}
|
||||
}
|
||||
|
||||
function searchNews ($string)
|
||||
{
|
||||
if (sqlAvail) {
|
||||
$search = AddSlashes ("%$string%");
|
||||
$conn = mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
" WHERE n_news LIKE '$search'" .
|
||||
' ORDER BY n_date DESC';
|
||||
$result = mysql_db_query (sqlDB, $query, $conn);
|
||||
if ($result) {
|
||||
$numRows = mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', "No news found matching '$string'");
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', "No news found matching '$string'");
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
|
||||
}
|
||||
} else {
|
||||
newsItem (date ('d M Y'), 'Web Server', '<P>No SQL server available');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
||||
?>
|
100
lib/sql.php
100
lib/sql.php
|
@ -1,29 +1,87 @@
|
|||
<?
|
||||
/*
|
||||
sql.php
|
||||
|
||||
SQL function library
|
||||
/*
|
||||
sql.php
|
||||
|
||||
Copyright (C) 2000,2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
SQL function library
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
Copyright (C) 2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
have ('sql');
|
||||
?>
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
have ('sql');
|
||||
|
||||
function sqlReadQuery ($query)
|
||||
{
|
||||
$ret = null;
|
||||
|
||||
global $sqlError;
|
||||
|
||||
$sqlError = null; // always set SQL error condition
|
||||
|
||||
if (sqlAvail && $conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass)) {
|
||||
if ($result = @mysql_db_query (sqlDB, $query, $conn)) {
|
||||
if ($numRows = @mysql_num_rows ($result)) {
|
||||
for ($i = 0; $i < $numRows; $i++) {
|
||||
$ret[$i] = @mysql_fetch_assoc ($result);
|
||||
}
|
||||
} else { // Successful query, no rows returned.
|
||||
$ret = true;
|
||||
}
|
||||
} else { // Query failed.
|
||||
$sqlError = mysql_error ();
|
||||
$ret = false;
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else { // Couldn't even connect.
|
||||
if (sqlAvail)
|
||||
$sqlError = mysql_error ();
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
function sqlWriteQuery ($query)
|
||||
{
|
||||
$ret = null;
|
||||
|
||||
global $sqlError;
|
||||
|
||||
$sqlError = null; // always set SQL error condition
|
||||
|
||||
if (sqlAvail
|
||||
&& defined (sqlRWUser)
|
||||
&& defined (sqlRWPass)
|
||||
&& $conn = @mysql_pconnect (sqlHost, sqlRWUser, sqlRWPass)) {
|
||||
if ($result = @mysql_db_query (sqlDB, $query, $conn)) {
|
||||
if ($numRows = @mysql_affected_rows ($result)) { // Success
|
||||
$ret = $numRows;
|
||||
}
|
||||
} else { // Query failed.
|
||||
$sqlError = @mysql_error ();
|
||||
$ret = false;
|
||||
}
|
||||
@mysql_close ($conn);
|
||||
} else { // Couldn't even connect.
|
||||
if (sqlAvail && defined (sqlRWUser) && defined (sqlRWPass))
|
||||
$sqlError = @mysql_error ();
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
?>
|
210
lib/table.php
210
lib/table.php
|
@ -1,124 +1,124 @@
|
|||
<?
|
||||
/*
|
||||
table.php
|
||||
|
||||
Table function library
|
||||
/*
|
||||
table.php
|
||||
|
||||
Copyright (C) 2000,2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
Table function library
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
Copyright (C) 2000,2001 Jeff Teunissen <deek@quakeforge.net>
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
have ('table');
|
||||
|
||||
/*
|
||||
tableBoxHeader
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
Begin a bordered table
|
||||
*/
|
||||
function tableBoxHeader ($bgColor, $borderColor)
|
||||
{
|
||||
echo '<TABLE width="100%" border="0" cellPadding="2" bgColor="' . $bgColor . '" class="featureBox">';
|
||||
}
|
||||
|
||||
/*
|
||||
tableBoxFooter
|
||||
have ('table');
|
||||
|
||||
Finish an opened bordered table
|
||||
*/
|
||||
function tableBoxFooter ()
|
||||
{
|
||||
echo '</TABLE>';
|
||||
}
|
||||
/*
|
||||
tableBoxHeader
|
||||
|
||||
/*
|
||||
tableHeader
|
||||
Begin a bordered table
|
||||
*/
|
||||
function tableBoxHeader ($bgColor, $borderColor)
|
||||
{
|
||||
echo '<TABLE width="100%" border="0" cellPadding="2" bgColor="' . $bgColor . '" class="featureBox">';
|
||||
}
|
||||
|
||||
Begin an unbordered table
|
||||
*/
|
||||
function tableHeader ($width, $bgColor)
|
||||
{
|
||||
echo '<TABLE cellSpacing="0" cellPadding="0" width="' . $width . '" border="0" bgColor="' . $bgColor . '">';
|
||||
}
|
||||
/*
|
||||
tableBoxFooter
|
||||
|
||||
/*
|
||||
tableFooter
|
||||
Finish an opened bordered table
|
||||
*/
|
||||
function tableBoxFooter ()
|
||||
{
|
||||
echo '</TABLE>';
|
||||
}
|
||||
|
||||
Close an unbordered table
|
||||
*/
|
||||
function tableFooter ()
|
||||
{
|
||||
echo '</TABLE>';
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableColumnStart ($align, $colSpan)
|
||||
{
|
||||
echo '<TD align="' . $align . '" colSpan="' . $colSpan . '">';
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableColumnEnd ()
|
||||
{
|
||||
echo '</TD>';
|
||||
}
|
||||
/*
|
||||
tableHeader
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableRowStart ($vAlign)
|
||||
{
|
||||
echo '<TR vAlign="' . $vAlign . '">';
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableRowEnd ()
|
||||
{
|
||||
echo '</TR>';
|
||||
}
|
||||
Begin an unbordered table
|
||||
*/
|
||||
function tableHeader ($width)
|
||||
{
|
||||
echo '<TABLE width="' . $width . '">';
|
||||
}
|
||||
|
||||
/*
|
||||
tableSpacer
|
||||
/*
|
||||
tableFooter
|
||||
|
||||
Display a scaled transparent spacer image inside a table heading
|
||||
*/
|
||||
function tableSpacer ($width, $height, $cols, $bgColor)
|
||||
{
|
||||
echo '<TH colSpan="' . $cols . '" width="' . $width . '" bgColor="' . $bgColor . '">' .
|
||||
' <IMG src="/img/blank.gif" height="' . $height . '" width="' . $width . '" border="0" alt="">' .
|
||||
'</TH>';
|
||||
}
|
||||
|
||||
/*
|
||||
tableTitle
|
||||
Close an unbordered table
|
||||
*/
|
||||
function tableFooter ()
|
||||
{
|
||||
echo '</TABLE>';
|
||||
}
|
||||
|
||||
Display a colored title in a BoxTable.
|
||||
*/
|
||||
function tableTitle ($name, $cols, $bgColor)
|
||||
{
|
||||
echo ' <TR bgColor="' . $bgColor . '" align="center">' .
|
||||
' <TH colspan="' . $cols . '">' .
|
||||
' <SPAN class="titleBar">' . $name . '</SPAN>' .
|
||||
' </TH>' .
|
||||
' </TR>';
|
||||
}
|
||||
/*
|
||||
*/
|
||||
function tableColumnStart ($align, $colSpan)
|
||||
{
|
||||
echo '<TD align="' . $align . '" colSpan="' . $colSpan . '">';
|
||||
}
|
||||
|
||||
?>
|
||||
/*
|
||||
*/
|
||||
function tableColumnEnd ()
|
||||
{
|
||||
echo '</TD>';
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableRowStart ($vAlign)
|
||||
{
|
||||
echo '<TR vAlign="' . $vAlign . '">';
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
function tableRowEnd ()
|
||||
{
|
||||
echo '</TR>';
|
||||
}
|
||||
|
||||
/*
|
||||
tableSpacer
|
||||
|
||||
Display a scaled transparent spacer image inside a table heading
|
||||
*/
|
||||
function tableSpacer ($width, $height, $cols, $bgColor)
|
||||
{
|
||||
echo '<TH colSpan="' . $cols . '" width="' . $width . '" bgColor="' . $bgColor . '">' .
|
||||
' <IMG src="/img/blank.gif" height="' . $height . '" width="' . $width . '" border="0" alt="">' .
|
||||
'</TH>';
|
||||
}
|
||||
|
||||
/*
|
||||
tableTitle
|
||||
|
||||
Display a colored title in a BoxTable.
|
||||
*/
|
||||
function tableTitle ($name, $cols, $bgColor)
|
||||
{
|
||||
echo ' <TR bgColor="' . $bgColor . '" align="center">' .
|
||||
' <TH colspan="' . $cols . '">' .
|
||||
' <SPAN class="titleBar">' . $name . '</SPAN>' .
|
||||
' </TH>' .
|
||||
' </TR>';
|
||||
}
|
||||
|
||||
?>
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
if (!$list) {
|
||||
echo "Bad Beavis! Go away.\n";
|
||||
require "parts/postamble.php";
|
||||
exit ();
|
||||
} else {
|
||||
$list = strToLower ($list);
|
||||
|
@ -88,7 +87,3 @@
|
|||
tableBoxFooter ();
|
||||
?>
|
||||
</FORM>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
19
lists.php
19
lists.php
|
@ -1,6 +1,5 @@
|
|||
<? // Preamble
|
||||
$pageName = "Mailing Lists";
|
||||
$focused = "mail"; // Dock icon name to get a border
|
||||
$currPage = "lists"; // Name of the page, for the menu
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
|
@ -9,18 +8,16 @@
|
|||
$subUrl = '/list_subscribe.php?list=';
|
||||
$archiveUrl = 'http://lists.quakeforge.net/list-archives/';
|
||||
|
||||
echo '[ ';
|
||||
echo '[ ';
|
||||
echo '<A href="' . $subUrl . $listName . '">subscribe</A>';
|
||||
echo ' | ';
|
||||
echo ' | ';
|
||||
echo '<A href="' . $archiveUrl . $listName . '/">archives</A>';
|
||||
echo ' ]';
|
||||
echo ' ]';
|
||||
}
|
||||
?>
|
||||
<!--SEARCHME-->
|
||||
|
||||
The QuakeForge Project has several email lists, which we use to keep in touch
|
||||
with each other and the community. This page is a list of them (or see the
|
||||
<A href="http://lists.quakeforge.net/lists/listinfo/">complete listing</A>).
|
||||
<P>The QuakeForge Project has several email lists, which we use to keep in
|
||||
touch with each other and the community. This page is a list of them (or see
|
||||
the <A href="http://lists.quakeforge.net/lists/listinfo/">complete listing</A>).
|
||||
|
||||
<H4>QuakeForge Announcements <? mailListLinks ('quakeforge-announce'); ?></H4>
|
||||
|
||||
|
@ -70,7 +67,3 @@ you like watching C-SPAN, this might be a good place for you to be.
|
|||
stuff, you want to be here. Many of the QuakeForge developers are here, and
|
||||
aside from our IRC channel, this is the closest thing to a tech support hotline
|
||||
that we have. There may also be discussion between players here.
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -9,6 +9,3 @@
|
|||
<P>This is the area for developers to post news, edit your user information,
|
||||
check on the server(s), and so on. Members with Admin-level access can modify
|
||||
news items here as well.</P>
|
||||
<?
|
||||
require siteHome . "/parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
84
news_add.php
84
news_add.php
|
@ -3,66 +3,44 @@
|
|||
$need = 'auth';
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
function showPreview ($date, $user, $def)
|
||||
{?>
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>Add News</H2></DIV>
|
||||
<DL>
|
||||
<DT><FONT size="-1"><EM>Posted on</EM> <?=$date?> <EM>by</EM> <STRONG><?=$user?></STRONG></FONT></DT>
|
||||
<DD>
|
||||
<FORM action="news_add.php" method="post">
|
||||
<TEXTAREA name="newsItem" rows="25" cols="64"><?=StripSlashes ($def)?></TEXTAREA><BR>
|
||||
<INPUT align="center" type="submit" name="mode" value="Post"></INPUT>
|
||||
<INPUT align="center" type="submit" name="mode" value="Preview"></INPUT>
|
||||
</FORM>
|
||||
</DD>
|
||||
</DL>
|
||||
</DIV>
|
||||
<?}
|
||||
|
||||
$newsItem = $_REQUEST['newsItem'];
|
||||
$newsText = $_REQUEST['newsText'];
|
||||
$mode = $_REQUEST['mode'];
|
||||
$user = $userInfo['u_displayname'];
|
||||
|
||||
if ($newsItem && $mode == "Post") {
|
||||
if ($newsText && $mode == "Post") {
|
||||
need ('sql');
|
||||
|
||||
$user = ucfirst ($REMOTE_USER);
|
||||
$newsItem = AddSlashes ($newsItem);
|
||||
$newsText = addSlashes ($newsText);
|
||||
$query = 'INSERT into news_main (n_date, n_user, n_news) VALUES ('
|
||||
."NOW(), '$user', '$newsText')";
|
||||
|
||||
$conn = mysql_connect (sqlHost, sqlRWUser, sqlRWPass);
|
||||
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 {
|
||||
echo '<P>There was an error in your input. If you don\'t know what it is, I\'m not going to tell you.';
|
||||
}
|
||||
}
|
||||
mysql_close ($conn);
|
||||
$rows = sqlWriteQuery ($query);
|
||||
if ($rows === null) {
|
||||
echo '<P>You suck, butthead.</P>';
|
||||
} elseif ($rows === false) {
|
||||
echo '<P>There was an error in your input. If you don\'t know what it is, I\'m not going to tell you.</P>';
|
||||
} else {
|
||||
echo '<P>You suck, butthead.';
|
||||
echo '<P>Your news item has been processed successfully.</P>';
|
||||
}
|
||||
} else {
|
||||
$date = strftime ('%d %b %Y', time ());
|
||||
$user = ucfirst ($REMOTE_USER);
|
||||
$date = date ('d M Y');
|
||||
|
||||
if ($newsItem) {?>
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>Posting News (Preview)</H2></DIV>
|
||||
<DL>
|
||||
<DT><FONT size="-1"><EM>(Will be) posted on</EM> <?=$date?> <EM>by</EM> <STRONG><?=$user?></STRONG></FONT></DT>
|
||||
<DD>
|
||||
<P><?=StripSlashes($newsItem)?></P>
|
||||
</DD>
|
||||
</DL>
|
||||
</DIV>
|
||||
<?}
|
||||
showPreview ($date, $user, $newsItem);
|
||||
need ('boxes news');
|
||||
|
||||
newsBoxOpen ();
|
||||
if ($newsText) {
|
||||
newsBoxTitle ("Latest News (Preview)");
|
||||
printNews ($date, $user, stripSlashes ($newsText));
|
||||
}
|
||||
newsBoxTitle ("Post News");
|
||||
$form = '<FORM action="' . thisURL . '" method="post">'
|
||||
. '<TEXTAREA name="newsText" rows="25" cols="64">'
|
||||
. stripSlashes ($newsText)
|
||||
. '</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 ();
|
||||
}
|
||||
|
||||
require siteHome . "/parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
?>
|
|
@ -30,7 +30,7 @@
|
|||
.' <TD><A href="news_del.php?newsID=' . $array[n_id] . '">' . $array[n_id] . '</A></TD>'
|
||||
.' <TD>' . dateFromSQLDateTime ($array[n_date]) . '</TD>'
|
||||
.' <TD>' . $array[n_user] . '</TD>'
|
||||
.' <TD>' . substr (convertFromHTML (StripSlashes ($array[n_news])), 0, 50) . '…</TD>'
|
||||
.' <TD>' . substr (convertFromHTML (stripSlashes ($array[n_news])), 0, 50) . '…</TD>'
|
||||
.'</TR>';
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
|||
</TR><?
|
||||
|
||||
for ($i = 0; $i < $numRows; $i++) {
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
$news[$i] = mysql_fetch_assoc ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
|
@ -81,6 +81,4 @@
|
|||
} else {
|
||||
echo '<P>Couldn\'t connect to the SQL server with the password you gave. <STRONG>("You suck, butthead.")</STRONG></P>';
|
||||
}
|
||||
|
||||
require siteHome . "/parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
?>
|
175
news_edit.php
175
news_edit.php
|
@ -4,7 +4,7 @@
|
|||
require "parts/preamble.php"; // Load most of document
|
||||
|
||||
if (!$userInfo['u_admin']) // no access from non-admin
|
||||
bailout ('<P>You don\'t have access to this page. Bug an admin to delete a news post.</P>');
|
||||
bailout ('<P>You don\'t have access to this page (yet?). Bug an admin to delete a news post.</P>');
|
||||
|
||||
need ('sql');
|
||||
|
||||
|
@ -18,130 +18,111 @@
|
|||
function convertFromHTML ($string)
|
||||
{
|
||||
$table = get_html_translation_table (HTML_ENTITIES);
|
||||
|
||||
return strtr ($string, $table);
|
||||
}
|
||||
|
||||
function newsEntrySummary ($array)
|
||||
function newsEntrySummary ($it)
|
||||
{
|
||||
need ("date");
|
||||
|
||||
return
|
||||
'<TR>'
|
||||
.' <TD><A href="news_edit.php?newsID=' . $array[n_id] . '">' . $array[n_id] . '</A></TD>'
|
||||
.' <TD>' . dateFromSQLDateTime ($array[n_date]) . '</TD>'
|
||||
.' <TD>' . $array[n_user] . '</TD>'
|
||||
.' <TD>' . substr (convertFromHTML (StripSlashes ($array[n_news])), 0, 50) . '…</TD>'
|
||||
.' <TD><A href="' . thisURL . '?newsID=' . $it['n_id'] . '">' . $it['n_id'] . '</A></TD>'
|
||||
.' <TD>' . dateFromSQLDateTime ($it['n_date']) . '</TD>'
|
||||
.' <TD>' . $it['n_user'] . '</TD>'
|
||||
.' <TD>' . substr (convertFromHTML (StripSlashes ($it['n_news'])), 0, 50) . '…</TD>'
|
||||
.'</TR>';
|
||||
}
|
||||
|
||||
function newsEntryEditor ($array)
|
||||
{
|
||||
need ("date");
|
||||
need ("boxes date news");
|
||||
|
||||
$id = $array[n_id];
|
||||
$usr = $array[n_user];
|
||||
$txt = convertFromHTML(stripSlashes($array[n_news]));
|
||||
$date = dateFromSQLDateTime($array[n_date]);
|
||||
$id = $array['n_id'];
|
||||
$usr = $array['n_user'];
|
||||
$txt = convertFromHTML (stripSlashes ($array['n_news']));
|
||||
$date = dateFromSQLDateTime ($array['n_date']);
|
||||
|
||||
newsBoxOpen ("Edit News Entry #$id");
|
||||
?>
|
||||
<FORM action="editnews.php?newsID=<?=$id?>" method="post">
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>Edit News Entry #<?=$id?></H2></DIV>
|
||||
<DL>
|
||||
<DT>
|
||||
<FONT size="-1">
|
||||
<EM>Posted on</EM>
|
||||
<?=$date?>
|
||||
<EM>by</EM>
|
||||
<STRONG>
|
||||
<INPUT type="text" name="newsUser" size="20" value="<?=$usr?>">
|
||||
</STRONG>
|
||||
<INPUT align="center" type="submit" value="Modify User / Text"></INPUT>
|
||||
</FONT>
|
||||
</DT>
|
||||
<DD>
|
||||
<TEXTAREA name="newsItem" rows="25" cols="64"><?=$txt?></TEXTAREA><BR>
|
||||
</DD>
|
||||
</DL>
|
||||
</DIV>
|
||||
</FORM>
|
||||
<FORM action="<?=thisURL?>?newsID=<?=$id?>" method="post">
|
||||
<DL>
|
||||
<DT><FONT size="-1"><EM>Posted on</EM> <?=$date?> <EM>by</EM>
|
||||
<STRONG>
|
||||
<INPUT type="text" name="newsUser" size="20" value="<?=$usr?>">
|
||||
</STRONG>
|
||||
<INPUT align="center" type="submit" value="Modify User / Text"></INPUT>
|
||||
</FONT></DT>
|
||||
<DD>
|
||||
<TEXTAREA name="newsText" rows="25" cols="64"><?=$txt?></TEXTAREA>
|
||||
</DD>
|
||||
</DL>
|
||||
</FORM>
|
||||
<?
|
||||
newsBoxClose ();
|
||||
}
|
||||
|
||||
need ('sql');
|
||||
need ('boxes sql table');
|
||||
|
||||
global $newsID;
|
||||
global $newsUser;
|
||||
global $newsItem;
|
||||
global $newsID = $_GET['newsID'];
|
||||
global $newsText = $_POST['newsText'];
|
||||
global $newsUser = $_POST['newsUser'];
|
||||
|
||||
$newsID = $_GET['newsID'];
|
||||
$newsItem = $_POST['newsItem'];
|
||||
$newsUser = $_POST['newsUser'];
|
||||
if ($newsID) {
|
||||
if ($newsUser && $newsText) {
|
||||
$newsText = addSlashes ($newsText);
|
||||
$query = 'UPDATE news_main SET'
|
||||
." n_user='$newsUser', n_news='$newsText'"
|
||||
." WHERE n_id='$newsID'";
|
||||
|
||||
if ($conn = mysql_pconnect (sqlHost, sqlRWUser, sqlRWPass)) {
|
||||
if ($newsID) {
|
||||
if ($newsUser && $newsItem) {
|
||||
$newsItem = AddSlashes ($newsItem);
|
||||
$query = "UPDATE news_main SET n_user='$newsUser', n_news='$newsItem' WHERE n_id='$newsID'";
|
||||
if ($result = mysql_db_query (sqlDB, $query, $conn)) {
|
||||
if ($numRows = mysql_affected_rows ($conn)) {
|
||||
echo '<P>Your modifications have been processed successfully.';
|
||||
} else {
|
||||
echo '<P>Your modifications were correctly formed, but had no effect on the database.';
|
||||
}
|
||||
} else {
|
||||
echo "<P>There was an error in your input. If you don't know what it is, I'm not going to tell you.";
|
||||
}
|
||||
$rows = sqlWriteQuery ($query);
|
||||
if ($rows === null) {
|
||||
echo "<P>Bad mojo, man. I couldn't talk to the SQL server. It said '$sqlError'.</P>";
|
||||
} elseif ($rows === false) {
|
||||
echo "<P>Something bad happened, and MySQL said '$sqlError'. Bug an admin.</P>";
|
||||
} elseif (!$rows) {
|
||||
echo '<P>Your edit was correctly formed, but had no effect on the database. Go fig, huh?</P>';
|
||||
} else {
|
||||
$query = "SELECT n_id, n_date, n_user, n_news FROM news_main "
|
||||
. "WHERE n_id=$newsID";
|
||||
$result = mysql_db_query (sqlDB, $query, $conn);
|
||||
if ($result) {
|
||||
$numRows = mysql_num_rows ($result);
|
||||
if ($numRows == 1) {
|
||||
$news = mysql_fetch_array ($result);
|
||||
newsEntryEditor ($news);
|
||||
} else {
|
||||
echo "<P>MOOOOO! Rows = $numRows";
|
||||
}
|
||||
} else {
|
||||
echo "<P>MOOOOO! No result.";
|
||||
}
|
||||
echo '<P>Your edit was processed successfully. Congratulations on your revision of history.<STRONG>:)</STRONG></P>';
|
||||
}
|
||||
} else {?>
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>Edit News</H2></DIV>
|
||||
<TABLE width="100%">
|
||||
<?
|
||||
$query = 'SELECT n_id, n_date, n_user, n_news FROM news_main' .
|
||||
' ORDER BY n_date DESC';
|
||||
if ($result = mysql_db_query (sqlDB, $query, $conn)) {
|
||||
if ($numRows = mysql_num_rows ($result)) {?>
|
||||
<TR>
|
||||
<TH align="left">ID</TH>
|
||||
<TH align="left">Date</TH>
|
||||
<TH align="left">User</TH>
|
||||
<TH align="left">Text</TH>
|
||||
</TR><?
|
||||
} else {
|
||||
$query = 'SELECT n_id, n_date, n_user, n_news FROM news_main'
|
||||
." WHERE n_id=$newsID";
|
||||
|
||||
for ($i = 0; $i < $numRows; $i++) {
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntrySummary ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
$entries = sqlReadQuery ($query);
|
||||
if ($entries === null) {
|
||||
echo "<P>Bad mojo, man. I couldn't talk to the SQL server. It said '$sqlError'.</P>";
|
||||
} elseif ($entries === false) {
|
||||
echo "<P>Something bad happened, and MySQL said '$sqlError'. Bug an admin.</P>";
|
||||
} elseif (count ($entries) == 1) {
|
||||
newsEntryEditor ($entries[0]);
|
||||
} else {
|
||||
echo "<P>This shouldn't even be possible, but there's more than one news entry with ID '$newsID'!</P>";
|
||||
}
|
||||
|
||||
tableFooter ();
|
||||
?>
|
||||
</DIV>
|
||||
<?
|
||||
}
|
||||
} else {
|
||||
echo '<P>You suck, butthead.';
|
||||
newsBoxOpen ("All News Postings");
|
||||
|
||||
$query = 'SELECT n_id, n_date, n_user, n_news FROM news_main'
|
||||
.' ORDER BY n_date DESC';
|
||||
|
||||
$entries = sqlReadQuery ($query);
|
||||
if ($entries && is_array ($entries) && count ($entries)) {
|
||||
tableHeader ("100%");
|
||||
?><TR>
|
||||
<TH align="left">ID</TH>
|
||||
<TH align="left">Date</TH>
|
||||
<TH align="left">User</TH>
|
||||
<TH align="left">Text</TH>
|
||||
</TR><?
|
||||
for ($i = 0; $i < count ($entries); $i++) {
|
||||
echo newsEntrySummary ($entries[$i]);
|
||||
}
|
||||
tableFooter ();
|
||||
} else {
|
||||
echo "<P>No news available.";
|
||||
}
|
||||
newsBoxClose ();
|
||||
}
|
||||
?>
|
||||
<?
|
||||
require siteHome . "/parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
27
old_news.php
27
old_news.php
|
@ -3,21 +3,18 @@
|
|||
$currPage = 'news';
|
||||
$modules = 'news_search'; // Modules to display
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<DIV class="newsBox">
|
||||
<DIV class="newsTitle"><H2>News Archives</H2></DIV>
|
||||
<?
|
||||
if ($month || $year) {
|
||||
monthlyNews ($month, $year);
|
||||
|
||||
need ('boxes news');
|
||||
|
||||
newsBoxOpen ("Search Results");
|
||||
if ($month || $year) {
|
||||
monthlyNews ($month, $year);
|
||||
} else {
|
||||
if ($string) {
|
||||
searchNews ($string);
|
||||
} else {
|
||||
if ($string) {
|
||||
searchNews ($string);
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', 'Go ahead, tough guy...use one of the forms to search the old news.');
|
||||
}
|
||||
printNews (date ('d M Y'), 'Web Server', 'Go ahead, tough guy...use one of the forms to search the old news.');
|
||||
}
|
||||
?>
|
||||
</DIV>
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
}
|
||||
newsBoxClose ();
|
||||
?>
|
||||
|
|
|
@ -43,7 +43,3 @@
|
|||
This is some text that only exists because Deek hasn't finished this page.
|
||||
This is some text that only exists because Deek hasn't finished this page.
|
||||
</P>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,9 +1,65 @@
|
|||
<?
|
||||
need ("news");
|
||||
// local vars
|
||||
$string = $_GET['string'];
|
||||
$month = $_GET['month'];
|
||||
$year = $_GET['year'];
|
||||
|
||||
function monthForm ($month, $year)
|
||||
{
|
||||
need ('feature');
|
||||
|
||||
// suppress warnings
|
||||
@featureOpen ('Date Search');
|
||||
?>
|
||||
<FORM name="bymonth" method="get" action="<?=thisURL?>">
|
||||
<P align="center">
|
||||
<SELECT name="month">
|
||||
<?
|
||||
for ( $i = 1 ; $i < 13 ; $i++ ) {
|
||||
printf ("<OPTION%s>%02d</OPTION>", $i == $month ? " selected" : "", $i);
|
||||
}
|
||||
?>
|
||||
</SELECT><STRONG> / </STRONG><SELECT name="year">
|
||||
<?
|
||||
if ($year == "")
|
||||
$year = date ('Y');
|
||||
for ($i = 2000; $i <= date ('Y'); $i++ ) {
|
||||
if ($i == 2005 || $i == 2006)
|
||||
continue;
|
||||
|
||||
printf ("<OPTION%s>%04d</OPTION>", $i == $year ? " selected" : "", $i);
|
||||
}
|
||||
?>
|
||||
</SELECT>
|
||||
<BR>
|
||||
<BR>
|
||||
<INPUT type="submit" value="Search">
|
||||
</P>
|
||||
</FORM><?
|
||||
featureClose ();
|
||||
}
|
||||
|
||||
|
||||
function keywordForm ($string)
|
||||
{
|
||||
need ('feature');
|
||||
|
||||
// suppress warnings
|
||||
@featureOpen ('Keyword Search');
|
||||
?>
|
||||
<FORM name="bystring" method="get" action="<?=thisURL?>">
|
||||
<P align="center">
|
||||
<?
|
||||
printf ('<INPUT name="string" type="text" size="16" value="%s">', $string);
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<INPUT TYPE="submit" VALUE="Search">
|
||||
</P>
|
||||
</FORM><?
|
||||
featureClose ();
|
||||
}
|
||||
|
||||
monthForm ($month, $year);
|
||||
keywordForm ($string);
|
||||
?>
|
||||
|
|
|
@ -42,4 +42,16 @@
|
|||
<DIV <?=$contentClass?> id="content"><!-- Content Start -->
|
||||
<?
|
||||
require siteHome . "/parts/topmain.php"; // insert page title
|
||||
|
||||
/*
|
||||
This is cool. We add the postamble to a function in the
|
||||
preamble and register it as a shutdown function, so the
|
||||
postamble doesn't have to be included from pages. :)
|
||||
*/
|
||||
function postamble ()
|
||||
{
|
||||
include siteHome . "/parts/postamble.php"; // heehee
|
||||
}
|
||||
|
||||
register_shutdown_function (postamble);
|
||||
?>
|
|
@ -1,8 +1,7 @@
|
|||
<? // Preamble
|
||||
$pageName = "Progress";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
$currPage = "progress"; // Name of the page, for the menu
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
||||
<TR vAlign=top>
|
||||
|
@ -43,7 +42,3 @@
|
|||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -30,6 +30,3 @@
|
|||
|
||||
?>
|
||||
</DIV>
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
44
search.php
44
search.php
|
@ -2,7 +2,7 @@
|
|||
switch ($type_of_search) {
|
||||
case "news":
|
||||
$string = AddSlashes ($words);
|
||||
include "news.php";
|
||||
include "old_news.php";
|
||||
break;
|
||||
case "-announce":
|
||||
$string = urlencode ($words);
|
||||
|
@ -24,44 +24,10 @@
|
|||
$string = urlencode ($words);
|
||||
header ("Location: http://www.geocrawler.com/search/?config=898&words=$string");
|
||||
break;
|
||||
case "site":
|
||||
$pageName = "Search Results";
|
||||
$focused = "none"; // Dock icon name to get a border
|
||||
include "parts/preamble.php"; // Load most of document
|
||||
|
||||
// Start actual search
|
||||
$lib = dblist ();
|
||||
$dbm = dbmopen ("siteindex.db","r");
|
||||
if (dbmexists ($dbm, $string)) {
|
||||
$parseMe = dbmfetch($dbm, $string);
|
||||
}
|
||||
dbmclose ($dbm);
|
||||
if ($parseMe) {
|
||||
echo $parseMe;
|
||||
$filenames = preg_split("/&&/", $parseMe);
|
||||
for ($i = 0;$i < sizeof($filenames);$i++) {
|
||||
$temp = $filenames[$i];
|
||||
if ($files[$temp]) {
|
||||
$files[$temp]++;
|
||||
} else {
|
||||
$files[$temp] = 0;
|
||||
}
|
||||
}
|
||||
while (list($key,$val) = each ($files)) {
|
||||
echo "<P><A HREF=\"$key\">$key</A> - $val hits";
|
||||
}
|
||||
} else {
|
||||
echo "<P>Sorry, no pages found containing '$words'";
|
||||
}
|
||||
include "parts/postamble.php"; // Finish this sucker up
|
||||
break;
|
||||
default:
|
||||
$pageName = "Search Results";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
include "parts/preamble.php"; // Load most of document
|
||||
|
||||
?><P>That type of search isn't supported yet. Please check back later.<?
|
||||
include "parts/postamble.php"; // Finish this sucker up
|
||||
$site = URLEncode ("quakeforge.net");
|
||||
$string = URLEncode ($words);
|
||||
header ("Location: http://www.google.com/custom?domains=$site&sitesearch=$site&q=$words");
|
||||
break;
|
||||
}
|
||||
?>
|
||||
?>
|
|
@ -1,9 +1,7 @@
|
|||
<? // Preamble
|
||||
$pageName = "Speed/Time Cheat Protection";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<!--SEARCHME-->
|
||||
<H4>How does it work?</H4>
|
||||
<P>The "time cheat" relies on the client lying to the server
|
||||
about how much time has passed since the last packet was sent. Knowing
|
||||
|
@ -30,22 +28,22 @@
|
|||
configure time cheat detection on your server.
|
||||
|
||||
<P><STRONG>sv_timekick</STRONG>: This cvar controls the number of times a
|
||||
player has to be caught "cheating" before they get kicked. sv_timekick
|
||||
shows up in serverinfo if it is changed from the default. If
|
||||
sv_timekick is less than 1, speed cheat detection is disabled. Default
|
||||
is 3.
|
||||
player has to be caught "cheating" before they get kicked. sv_timekick
|
||||
shows up in serverinfo if it is changed from the default. If
|
||||
sv_timekick is less than 1, speed cheat detection is disabled. Default
|
||||
is 3.
|
||||
|
||||
<P><STRONG>sv_timekick_fuzz</STRONG>: This cvar affects how strict the
|
||||
protection is. The higher the number, the more "fuzz" gets applied,
|
||||
and the less strict the detection code is. Raise this if your players
|
||||
are being kicked for packet loss and lag. The values of this cvar are
|
||||
in tenths of a percent. Default is 10, giving a fuzz factor of about
|
||||
1 percent.
|
||||
protection is. The higher the number, the more "fuzz" gets applied,
|
||||
and the less strict the detection code is. Raise this if your players
|
||||
are being kicked for packet loss and lag. The values of this cvar are
|
||||
in tenths of a percent. Default is 10, giving a fuzz factor of about
|
||||
1 percent.
|
||||
|
||||
<P><STRONG>sv_timekick_interval</STRONG>: This cvar controls how often, in
|
||||
seconds, the time tally is counted. Lowering this value increases the
|
||||
chance of false positives, but helps to minimize the amount of damage
|
||||
a time-cheating player can cause. Default is 30 seconds.
|
||||
seconds, the time tally is counted. Lowering this value increases the
|
||||
chance of false positives, but helps to minimize the amount of damage
|
||||
a time-cheating player can cause. Default is 30 seconds.
|
||||
|
||||
<H4>What can I do as a player?</H4>
|
||||
<P>Obviously, we suggest using one of QuakeForge's QuakeWorld-compatible
|
||||
|
@ -57,8 +55,3 @@
|
|||
You can also use any of the QuakeWorld-compatible clients released by the
|
||||
other engine projects, but of course we can't verify that any of them do
|
||||
not exhibit the problem or even if they work.
|
||||
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -4,6 +4,3 @@
|
|||
require "parts/preamble.php"; // Load up most of the document
|
||||
?>
|
||||
Page content goes here.
|
||||
<?
|
||||
require siteHome . "/parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
11
thanks.php
11
thanks.php
|
@ -1,12 +1,7 @@
|
|||
<? // Preamble
|
||||
$pageName = "Thanks!";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
<? // Preamble
|
||||
$pageName = "Thanks!";
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<P>Your comments have been submitted to the QuakeForge team.
|
||||
|
||||
<P>Click to be sent back to the <a href="contact.php">Contact Us</a> page.
|
||||
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue