*** empty log message ***

This commit is contained in:
Jeff Teunissen 2000-07-08 04:06:04 +00:00
parent 30a9154f83
commit 36084176c2
8 changed files with 341 additions and 315 deletions

View file

@ -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)

View file

@ -1,236 +1,254 @@
<?
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>" .
" <DD><P>$text</DD>" .
' </DL>' .
' </TD>' .
'</TR>';
}
function monthForm ()
{
?><FORM name="bymonth" method="get" action="/old_news.php"><?
tableBoxHeader ('black', tableHeadColor);
tableTitle ("Search by Month", 1, tableHeadColor);
?><TD align="center"><?
tableHeader("100%", featureBgColor);
?>
<TR vAlign="center">
<TD align="center">
<STRONG>Month:</STRONG>
</TD>
<TD align="center">
<SELECT name="month">
<?
for ( $i = 1 ; $i < 13 ; $i++ ) {
printf("<OPTION>%02d</OPTION>", $i);
}
?>
</SELECT>
</TD>
<TD align="center">
<STRONG>Year:</STRONG>
</TD>
<TD align="center">
<SELECT name="year">
<OPTION SELECTED>2000</OPTION>
</SELECT>
</TD>
</TR>
<TR vAlign="center">
<TD align="center" colSpan="4">
<INPUT TYPE="submit" VALUE="Search">
</TD>
</TR>
<?
tableFooter ();
tableBoxFooter ();
?>
</FORM>
<?
}
function keywordForm ()
{
?><FORM name="bystring" method="get" action="/old_news.php"><?
tableBoxHeader ('black', tableHeadColor);
tableTitle ("Search by String", 1, tableHeadColor);
?><TD align="center"><?
tableHeader("100%", featureBgColor);
?>
<TR vAlign="center">
<TD align="center">
<STRONG>String:</STRONG>
</TD>
<TD align="center">
<INPUT name="string" type="text" size="25">
</TD>
</TR>
<TR vAlign="center">
<TD align="center" colSpan="2">
<INPUT TYPE="submit" VALUE="Search">
</TD>
</TR>
<?
tableFooter ();
tableBoxFooter ();
?>
</FORM>
<?
}
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');
$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 array (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news));
}
function monthlyNews ($month, $year)
{
need('date');
// Do sanity checking on dates
if (((!is_int($year)) || $year < 2000)) {
$year = date('Y',time());
}
if ($month < 1 || $month > 12) {
$month = date('m',time());
}
$date = "$year-$month";
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
" WHERE n_date BETWEEN '$date-00 00:00:00'" .
" AND '$date-31 23:59:59'" .
' 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 news for this month!');
}
} else {
newsItem ('now', 'Web Server', '<P>No news in database!');
}
mysql_close ($conn);
} else {
newsItem ('Now', 'Web Server', '<P>Error: Could not connect to SQL server to fetch news. Please notify the server administrator.');
}
}
function searchNews ( $string )
{
need ('date');
$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) {
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));
}
tableBoxFooter();
} else {
newsItem ('now', 'Web Server', "No news found matching '$string'");
}
} else {
newsItem ('now', 'Web Server', "No news found matching '$string'");
}
mysql_close ($conn);
} else {
newsItem ('now', 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
}
}
?>
<?
/*
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>" .
" <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"><?
tableBoxHeader ('black', tableHeadColor);
tableTitle ("Search by Month", 1, tableHeadColor);
?><TD align="center"><?
tableHeader("100%", featureBgColor);
?>
<TR vAlign="center">
<TD align="center">
<STRONG>Month:</STRONG>
</TD>
<TD align="center">
<SELECT name="month">
<?
for ( $i = 1 ; $i < 13 ; $i++ ) {
printf("<OPTION>%02d</OPTION>", $i);
}
?>
</SELECT>
</TD>
<TD align="center">
<STRONG>Year:</STRONG>
</TD>
<TD align="center">
<SELECT name="year">
<OPTION SELECTED>2000</OPTION>
</SELECT>
</TD>
</TR>
<TR vAlign="center">
<TD align="center" colSpan="4">
<INPUT TYPE="submit" VALUE="Search">
</TD>
</TR>
<?
tableFooter ();
tableBoxFooter ();
?>
</FORM>
<?
}
function keywordForm ()
{
?><FORM name="bystring" method="get" action="/old_news.php"><?
tableBoxHeader ('black', tableHeadColor);
tableTitle ("Search by String", 1, tableHeadColor);
?><TD align="center"><?
tableHeader("100%", featureBgColor);
?>
<TR vAlign="center">
<TD align="center">
<STRONG>String:</STRONG>
</TD>
<TD align="center">
<INPUT name="string" type="text" size="25">
</TD>
</TR>
<TR vAlign="center">
<TD align="center" colSpan="2">
<INPUT TYPE="submit" VALUE="Search">
</TD>
</TR>
<?
tableFooter ();
tableBoxFooter ();
?>
</FORM>
<?
}
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 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)
{
// Do sanity checking on dates
if (((!is_int ($year)) || $year < 2000)) {
$year = date ('Y', time ());
}
if ($month < 1 || $month > 12) {
$month = date ('m', time ());
}
$date = "$year-$month";
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = 'SELECT n_date, n_user, n_news FROM news_main' .
" WHERE n_date BETWEEN '$date-00 00:00:00'" .
" AND '$date-31 23:59:59'" .
' 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 news for this month!');
}
} else {
newsItem ('now', 'Web Server', '<P>No news in database!');
}
mysql_close ($conn);
} else {
newsItem ('now', 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
}
}
function searchNews ($string)
{
$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 ('now', 'Web Server', "No news found matching '$string'");
}
} else {
newsItem ('now', 'Web Server', "No news found matching '$string'");
}
mysql_close ($conn);
} else {
newsItem ('now', 'Web Server', '<STRONG>SQL error!</STRONG> Please contact the <A href="mailto:deek@quakeforge.net">Webmaster</A>.');
}
}
?>

View file

@ -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>&lt;MySQL&gt; You suck, butthead.';

View file

@ -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
?>

View file

@ -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
?>

View file

@ -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>&nbsp;Require Exact Match' .

View file

@ -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
?>
<!--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();
?></TD>
</TR>
</TABLE>
<!--NOSEARCH-->
<?
require("parts/postamble.php"); // Finish this sucker up
?>
<? // Preamble
$pageName = "Developer Plans";
$focused = "none"; // Dock icon name to gets a border
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);
need ("news");
include "see_plans.php";
tableBoxFooter ();
?></TD>
</TR>
</TABLE>
<!--NOSEARCH-->
<?
require "parts/postamble.php"; // Finish this sucker up
?>

View file

@ -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]++;
} else {
$files[$temp] = 0;
}
<?
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);
}
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
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
break;
}
?>