mirror of
https://git.code.sf.net/p/quake/website
synced 2024-11-27 14:32:31 +00:00
*** empty log message ***
This commit is contained in:
parent
30a9154f83
commit
36084176c2
8 changed files with 341 additions and 315 deletions
|
@ -9,7 +9,7 @@
|
|||
<TD colSpan="2"><? // News display
|
||||
tableBoxHeader (featureBgColor, featureHeadColor);
|
||||
tableTitle ('Latest News', 1, featureHeadColor);
|
||||
require "news_funcs.php";
|
||||
need ("news");
|
||||
$cached = latestNews ('1 month');
|
||||
tableBoxFooter ();
|
||||
if ($cached)
|
||||
|
|
|
@ -1,17 +1,61 @@
|
|||
<?
|
||||
/*
|
||||
news.php
|
||||
|
||||
SQL-based news reading library
|
||||
|
||||
Copyright (C) 2000 Contributors of the QuakeForge Project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
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 ('news');
|
||||
|
||||
function newsItem ($date, $user, $text)
|
||||
{
|
||||
if ($user == "Theoddone33") $user = "theoddone33";
|
||||
echo '<TR>' .
|
||||
' <TD>' .
|
||||
' <DL>' .
|
||||
" <DT><FONT SIZE=\"-1\">Posted on $date by $user</FONT></DT>" .
|
||||
' <DT><FONT SIZE="-1">' . "Posted on $date by $user</FONT></DT>" .
|
||||
" <DD><P>$text</DD>" .
|
||||
' </DL>' .
|
||||
' </TD>' .
|
||||
'</TR>';
|
||||
}
|
||||
|
||||
function newsEntry ($array)
|
||||
{
|
||||
need ("date");
|
||||
|
||||
if ($array[n_user] == "Theoddone33") $user = "theoddone33";
|
||||
return '<TR>' .
|
||||
' <TD>' .
|
||||
' <DL>' .
|
||||
' <DT><FONT SIZE="-1"> Posted on ' . dateFromSQLDateTime ($array[n_date]) . ' by ' . $array[n_user] . '</FONT></DT>' .
|
||||
' <DD><P>' . StripSlashes ($array[n_news]) . '</DD>' .
|
||||
' </DL>' .
|
||||
' </TD>' .
|
||||
'</TR>';
|
||||
}
|
||||
|
||||
function monthForm ()
|
||||
{
|
||||
?><FORM name="bymonth" method="get" action="/old_news.php"><?
|
||||
|
@ -84,55 +128,6 @@
|
|||
<?
|
||||
}
|
||||
|
||||
function listMonths ()
|
||||
{
|
||||
$startyear = 2000;
|
||||
$today = getdate ();
|
||||
|
||||
while ($startyear <= $today['year']) {
|
||||
for ($month = $today['mon']+1 ; $month > 1 ; $month--) {
|
||||
echo '<P><A href="old_news.php?month=' .
|
||||
date ("m", mktime (0,0,0,$month,0,0,0)) .
|
||||
'&year=' . date ("Y", mktime (0,0,0,0,0,$today['year']+1,0)) . '">' .
|
||||
date ("F, Y", mktime (0,0,0,$month,0,$today['year'],0)) .
|
||||
'</A>';
|
||||
}
|
||||
$today['year']--;
|
||||
}
|
||||
}
|
||||
|
||||
function latestNews ($length)
|
||||
{
|
||||
need('date');
|
||||
|
||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
" WHERE n_date > DATE_SUB(NOW(), INTERVAL $length)" .
|
||||
' 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++) {
|
||||
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
||||
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
||||
}
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', '<P>No current news!');
|
||||
}
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', '<P>No news in database!');
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
include ('cache.php');
|
||||
return (1);
|
||||
// newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
function fetchNewsEntry ($number)
|
||||
{
|
||||
need('date');
|
||||
|
@ -161,17 +156,44 @@
|
|||
return array (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
||||
}
|
||||
|
||||
function latestNews ($length)
|
||||
{
|
||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
|
||||
" WHERE n_date > DATE_SUB(NOW(), INTERVAL $length)" .
|
||||
' 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 ('now', 'Web Server', '<P>No current news!');
|
||||
}
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', '<P>No news in database!');
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
include 'cache.php';
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function monthlyNews ($month, $year)
|
||||
{
|
||||
need('date');
|
||||
|
||||
// Do sanity checking on dates
|
||||
if (((!is_int($year)) || $year < 2000)) {
|
||||
$year = date('Y',time());
|
||||
if (((!is_int ($year)) || $year < 2000)) {
|
||||
$year = date ('Y', time ());
|
||||
}
|
||||
|
||||
if ($month < 1 || $month > 12) {
|
||||
$month = date('m',time());
|
||||
$month = date ('m', time ());
|
||||
}
|
||||
$date = "$year-$month";
|
||||
|
||||
|
@ -186,8 +208,8 @@
|
|||
$numRows = @mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
||||
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', '<P>No news for this month!');
|
||||
|
@ -197,14 +219,12 @@
|
|||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
|
||||
newsItem ('now', 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
|
||||
}
|
||||
}
|
||||
|
||||
function searchNews ( $string )
|
||||
function searchNews ($string)
|
||||
{
|
||||
need ('date');
|
||||
|
||||
$search = AddSlashes ("%$string%");
|
||||
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
|
||||
if ($conn) {
|
||||
|
@ -215,13 +235,10 @@
|
|||
if ($result) {
|
||||
$numRows = @mysql_num_rows ($result);
|
||||
if ($numRows) {
|
||||
tableBoxHeader( 'black', tableHeadColor );
|
||||
tableTitle( "Search Results", 1, tableHeadColor );
|
||||
for ($i = 0 ; $i < $numRows ; $i++) {
|
||||
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result);
|
||||
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
|
||||
$news[$i] = mysql_fetch_array ($result);
|
||||
echo newsEntry ($news[$i]);
|
||||
}
|
||||
tableBoxFooter();
|
||||
} else {
|
||||
newsItem ('now', 'Web Server', "No news found matching '$string'");
|
||||
}
|
||||
|
@ -233,4 +250,5 @@
|
|||
newsItem ('now', 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -24,9 +24,9 @@
|
|||
} else {
|
||||
echo '<P>Hmm... that\'s not right. An error occurred.';
|
||||
}
|
||||
}
|
||||
else
|
||||
} else {
|
||||
echo '<P>MySQL error occurred, possibly an invalid query. Bitch at Deek.';
|
||||
}
|
||||
mysql_close ($conn);
|
||||
} else {
|
||||
echo '<P><MySQL> You suck, butthead.';
|
||||
|
|
8
news.php
8
news.php
|
@ -1,10 +1,10 @@
|
|||
<? // Preamble
|
||||
$pageName = "News Archives";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
$focused = "none"; // Dock icon name to get a border
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<?
|
||||
require("news_funcs.php");
|
||||
need ("news");
|
||||
?>
|
||||
<TABLE width="50%" cellSpacing="2" cellPadding="0" border="0">
|
||||
<TR vAlign="top">
|
||||
|
@ -19,5 +19,5 @@
|
|||
</TR>
|
||||
</TABLE>
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<?
|
||||
$pageName = 'News Archives';
|
||||
$focused = "home"; // Dock icon name to get a border
|
||||
$focused = "none"; // Dock icon name to get a border
|
||||
require "parts/preamble.php"; // Load most of document
|
||||
?>
|
||||
<!--NOSEARCH-->
|
||||
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
||||
<TR vAlign="top">
|
||||
<TD align="center"><?
|
||||
require "news_funcs.php";
|
||||
need ("news");
|
||||
tableBoxHeader (featureBgColor, featureHeadColor);
|
||||
tableTitle ($pageName, 1, featureHeadColor);
|
||||
if ($month || $year) {
|
||||
|
@ -23,7 +22,6 @@
|
|||
?></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
function develMenu ()
|
||||
{
|
||||
menuSectionHeader ("Developers", 'white', menuHeadColor, menuBgColor);
|
||||
menuItemLink ("http://sourceforge.net/cvs/?group_id=882", "CVS Access");
|
||||
menuItemLink ("http://cvs.quakeforge.net/cgi-bin/cvsweb.cgi/?cvsroot=quake", "Browse CVS");
|
||||
menuItemLink ("/devtools.php", "Developer Tools");
|
||||
menuItemLink ("/plans.php", "Developer Plans");
|
||||
menuItemLink ("/progress.php", "Progress");
|
||||
|
@ -74,9 +74,10 @@
|
|||
' <SELECT name="type_of_search">' .
|
||||
' <OPTION value="news">News</OPTION>' .
|
||||
// ' <OPTION value="site">Site</OPTION>' .
|
||||
' <OPTION value="bugs">Bug Tracking</OPTION>' .
|
||||
' <OPTION value="lists">Mailing Lists</OPTION>' .
|
||||
' <OPTION value="patches">Patches</OPTION>' .
|
||||
// ' <OPTION value="bugs">Bug Tracking</OPTION>' .
|
||||
' <OPTION value="devel">Developer Mail List</OPTION>' .
|
||||
' <OPTION value="devel">Users Mail List</OPTION>' .
|
||||
// ' <OPTION value="patches">Patches</OPTION>' .
|
||||
' </SELECT>' .
|
||||
' <BR>' .
|
||||
' <INPUT TYPE="CHECKBOX" NAME="exact" VALUE="1" CHECKED> Require Exact Match' .
|
||||
|
|
14
plans.php
14
plans.php
|
@ -1,21 +1,21 @@
|
|||
<? // Preamble
|
||||
$pageName = "Developer Plans";
|
||||
$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-->
|
||||
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
|
||||
<TR vAlign="top">
|
||||
<TD colSpan="2"><? // News display
|
||||
tableBoxHeader( 'black', tableHeadColor );
|
||||
tableTitle( 'Developer Plans', 1, tableHeadColor );
|
||||
require("news_funcs.php");
|
||||
include("see_plans.php");
|
||||
tableBoxFooter();
|
||||
tableBoxHeader ('black', tableHeadColor);
|
||||
tableTitle ('Developer Plans', 1, tableHeadColor);
|
||||
need ("news");
|
||||
include "see_plans.php";
|
||||
tableBoxFooter ();
|
||||
?></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<!--NOSEARCH-->
|
||||
<?
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
require "parts/postamble.php"; // Finish this sucker up
|
||||
?>
|
||||
|
|
91
search.php
91
search.php
|
@ -1,46 +1,55 @@
|
|||
<?php
|
||||
if ($type_of_search == "news") {
|
||||
$string = AddSlashes($words);
|
||||
include("old_news.php");
|
||||
}
|
||||
elseif ($type_of_search == "lists") {
|
||||
$string = urlencode(StripSlashes($words));
|
||||
header ("Location: http://www.geocrawler.com/search/?config=856&words=$string");
|
||||
elseif ($type_of_search == "site") {
|
||||
$pageName = "Search Results";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("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]++;
|
||||
<?
|
||||
switch ($type_of_search) {
|
||||
case "news":
|
||||
$string = AddSlashes ($words);
|
||||
include "old_news.php";
|
||||
break;
|
||||
case "devel":
|
||||
$string = urlencode ($words);
|
||||
header ("Location: http://www.geocrawler.com/search/?config=856&words=$string");
|
||||
break;
|
||||
case "user":
|
||||
$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;
|
||||
$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'";
|
||||
}
|
||||
while (list($key,$val) = each ($files)) {
|
||||
echo "<P><A HREF=\"$key\">$key</A> - $val hits";
|
||||
}
|
||||
} else {
|
||||
echo "<P>Sorry, no pages found containing '$words'";
|
||||
}
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
} else {
|
||||
// Preamble
|
||||
$pageName = "Search Results";
|
||||
$focused = "none"; // Dock icon name to gets a border
|
||||
require("parts/preamble.php"); // Load most of document
|
||||
echo '<P>That type of search isn\'t supported yet. Please check back later.';
|
||||
require("parts/postamble.php"); // Finish this sucker up
|
||||
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
|
||||
break;
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue