*** 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 <TD colSpan="2"><? // News display
tableBoxHeader (featureBgColor, featureHeadColor); tableBoxHeader (featureBgColor, featureHeadColor);
tableTitle ('Latest News', 1, featureHeadColor); tableTitle ('Latest News', 1, featureHeadColor);
require "news_funcs.php"; need ("news");
$cached = latestNews ('1 month'); $cached = latestNews ('1 month');
tableBoxFooter (); tableBoxFooter ();
if ($cached) if ($cached)

View file

@ -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) function newsItem ($date, $user, $text)
{ {
if ($user == "Theoddone33") $user = "theoddone33"; if ($user == "Theoddone33") $user = "theoddone33";
echo '<TR>' . echo '<TR>' .
' <TD>' . ' <TD>' .
' <DL>' . ' <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>" . " <DD><P>$text</DD>" .
' </DL>' . ' </DL>' .
' </TD>' . ' </TD>' .
'</TR>'; '</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 () function monthForm ()
{ {
?><FORM name="bymonth" method="get" action="/old_news.php"><? ?><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) function fetchNewsEntry ($number)
{ {
need('date'); need('date');
@ -161,10 +156,37 @@
return array (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news)); 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) function monthlyNews ($month, $year)
{ {
need('date');
// Do sanity checking on dates // Do sanity checking on dates
if (((!is_int ($year)) || $year < 2000)) { if (((!is_int ($year)) || $year < 2000)) {
$year = date ('Y', time ()); $year = date ('Y', time ());
@ -186,8 +208,8 @@
$numRows = @mysql_num_rows ($result); $numRows = @mysql_num_rows ($result);
if ($numRows) { if ($numRows) {
for ($i = 0 ; $i < $numRows ; $i++) { for ($i = 0 ; $i < $numRows ; $i++) {
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result); $news[$i] = mysql_fetch_array ($result);
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news)); echo newsEntry ($news[$i]);
} }
} else { } else {
newsItem ('now', 'Web Server', '<P>No news for this month!'); newsItem ('now', 'Web Server', '<P>No news for this month!');
@ -197,14 +219,12 @@
} }
mysql_close ($conn); mysql_close ($conn);
} else { } 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%"); $search = AddSlashes ("%$string%");
$conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass); $conn = @mysql_pconnect (sqlHost, sqlUser, sqlPass);
if ($conn) { if ($conn) {
@ -215,13 +235,10 @@
if ($result) { if ($result) {
$numRows = @mysql_num_rows ($result); $numRows = @mysql_num_rows ($result);
if ($numRows) { if ($numRows) {
tableBoxHeader( 'black', tableHeadColor );
tableTitle( "Search Results", 1, tableHeadColor );
for ($i = 0 ; $i < $numRows ; $i++) { for ($i = 0 ; $i < $numRows ; $i++) {
list ($n_date, $n_user, $n_news) = mysql_fetch_row ($result); $news[$i] = mysql_fetch_array ($result);
newsItem (dateFromSQLDateTime ($n_date), $n_user, StripSlashes($n_news)); echo newsEntry ($news[$i]);
} }
tableBoxFooter();
} else { } else {
newsItem ('now', 'Web Server', "No news found matching '$string'"); 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>.'); 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 { } else {
echo '<P>Hmm... that\'s not right. An error occurred.'; echo '<P>Hmm... that\'s not right. An error occurred.';
} }
} } else {
else
echo '<P>MySQL error occurred, possibly an invalid query. Bitch at Deek.'; echo '<P>MySQL error occurred, possibly an invalid query. Bitch at Deek.';
}
mysql_close ($conn); mysql_close ($conn);
} else { } else {
echo '<P>&lt;MySQL&gt; You suck, butthead.'; echo '<P>&lt;MySQL&gt; You suck, butthead.';

View file

@ -1,10 +1,10 @@
<? // Preamble <? // Preamble
$pageName = "News Archives"; $pageName = "News Archives";
$focused = "none"; // Dock icon name to gets a border $focused = "none"; // Dock icon name to get a border
require("parts/preamble.php"); // Load most of document require "parts/preamble.php"; // Load most of document
?> ?>
<? <?
require("news_funcs.php"); need ("news");
?> ?>
<TABLE width="50%" cellSpacing="2" cellPadding="0" border="0"> <TABLE width="50%" cellSpacing="2" cellPadding="0" border="0">
<TR vAlign="top"> <TR vAlign="top">
@ -19,5 +19,5 @@
</TR> </TR>
</TABLE> </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'; $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 require "parts/preamble.php"; // Load most of document
?> ?>
<!--NOSEARCH-->
<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 align="center"><? <TD align="center"><?
require "news_funcs.php"; need ("news");
tableBoxHeader (featureBgColor, featureHeadColor); tableBoxHeader (featureBgColor, featureHeadColor);
tableTitle ($pageName, 1, featureHeadColor); tableTitle ($pageName, 1, featureHeadColor);
if ($month || $year) { if ($month || $year) {
@ -23,7 +22,6 @@
?></TD> ?></TD>
</TR> </TR>
</TABLE> </TABLE>
<!--NOSEARCH-->
<? <?
require "parts/postamble.php"; // Finish this sucker up require "parts/postamble.php"; // Finish this sucker up
?> ?>

View file

@ -41,7 +41,7 @@
function develMenu () function develMenu ()
{ {
menuSectionHeader ("Developers", 'white', menuHeadColor, menuBgColor); 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 ("/devtools.php", "Developer Tools");
menuItemLink ("/plans.php", "Developer Plans"); menuItemLink ("/plans.php", "Developer Plans");
menuItemLink ("/progress.php", "Progress"); menuItemLink ("/progress.php", "Progress");
@ -74,9 +74,10 @@
' <SELECT name="type_of_search">' . ' <SELECT name="type_of_search">' .
' <OPTION value="news">News</OPTION>' . ' <OPTION value="news">News</OPTION>' .
// ' <OPTION value="site">Site</OPTION>' . // ' <OPTION value="site">Site</OPTION>' .
' <OPTION value="bugs">Bug Tracking</OPTION>' . // ' <OPTION value="bugs">Bug Tracking</OPTION>' .
' <OPTION value="lists">Mailing Lists</OPTION>' . ' <OPTION value="devel">Developer Mail List</OPTION>' .
' <OPTION value="patches">Patches</OPTION>' . ' <OPTION value="devel">Users Mail List</OPTION>' .
// ' <OPTION value="patches">Patches</OPTION>' .
' </SELECT>' . ' </SELECT>' .
' <BR>' . ' <BR>' .
' <INPUT TYPE="CHECKBOX" NAME="exact" VALUE="1" CHECKED>&nbsp;Require Exact Match' . ' <INPUT TYPE="CHECKBOX" NAME="exact" VALUE="1" CHECKED>&nbsp;Require Exact Match' .

View file

@ -1,7 +1,7 @@
<? // Preamble <? // Preamble
$pageName = "Developer Plans"; $pageName = "Developer Plans";
$focused = "none"; // Dock icon name to gets a border $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--> <!--SEARCHME-->
<TABLE width="100%" cellSpacing="0" cellPadding="0" border="0"> <TABLE width="100%" cellSpacing="0" cellPadding="0" border="0">
@ -9,13 +9,13 @@
<TD colSpan="2"><? // News display <TD colSpan="2"><? // News display
tableBoxHeader ('black', tableHeadColor); tableBoxHeader ('black', tableHeadColor);
tableTitle ('Developer Plans', 1, tableHeadColor); tableTitle ('Developer Plans', 1, tableHeadColor);
require("news_funcs.php"); need ("news");
include("see_plans.php"); include "see_plans.php";
tableBoxFooter (); tableBoxFooter ();
?></TD> ?></TD>
</TR> </TR>
</TABLE> </TABLE>
<!--NOSEARCH--> <!--NOSEARCH-->
<? <?
require("parts/postamble.php"); // Finish this sucker up require "parts/postamble.php"; // Finish this sucker up
?> ?>

View file

@ -1,15 +1,22 @@
<?php <?
if ($type_of_search == "news") { switch ($type_of_search) {
case "news":
$string = AddSlashes ($words); $string = AddSlashes ($words);
include("old_news.php"); include "old_news.php";
} break;
elseif ($type_of_search == "lists") { case "devel":
$string = urlencode(StripSlashes($words)); $string = urlencode ($words);
header ("Location: http://www.geocrawler.com/search/?config=856&words=$string"); header ("Location: http://www.geocrawler.com/search/?config=856&words=$string");
elseif ($type_of_search == "site") { break;
case "user":
$string = urlencode ($words);
header ("Location: http://www.geocrawler.com/search/?config=898&words=$string");
break;
case "site":
$pageName = "Search Results"; $pageName = "Search Results";
$focused = "none"; // Dock icon name to gets a border $focused = "none"; // Dock icon name to get a border
require("parts/preamble.php"); // Load most of document include "parts/preamble.php"; // Load most of document
// Start actual search // Start actual search
$lib = dblist (); $lib = dblist ();
$dbm = dbmopen ("siteindex.db","r"); $dbm = dbmopen ("siteindex.db","r");
@ -34,13 +41,15 @@
} else { } else {
echo "<P>Sorry, no pages found containing '$words'"; echo "<P>Sorry, no pages found containing '$words'";
} }
require("parts/postamble.php"); // Finish this sucker up include "parts/postamble.php"; // Finish this sucker up
} else { break;
// Preamble default:
$pageName = "Search Results"; $pageName = "Search Results";
$focused = "none"; // Dock icon name to gets a border $focused = "none"; // Dock icon name to gets a border
require("parts/preamble.php"); // Load most of document include "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 ?><P>That type of search isn't supported yet. Please check back later.<?
include "parts/postamble.php"; // Finish this sucker up
break;
} }
?> ?>