|
|
|
<?php
#INNSearch
#Vince Busam (vinceb@ucla.edu)
#This allows users to search through a local INN server's archives
#We use it to search through old postings to our private newsgroups
#location of news active file
$active = "/var/lib/news/active";
#locate of news spool
$spooldir = "/var/spool/news/";
#number of levels deep subdirs of $spooldir are
$dirdepth = 4;
#minimum number of articles in group to show up on main search page
$minarticles = 1;
#groups with more articles than this will not be selected by default
$maxarticles = 1000;
print( "<HTML>");
print( "<head>");
print( "<title>");
print( "INNSearch");
print( "</title>");
print( "</head>");
if ($query) {
$searchgroups = "";
$sgroups = split( "&", getenv( "QUERY_STRING"));
for ($i=0; $i < count($sgroups); $i++) {
if (ereg( "=on", $sgroups[$i])) {
$tgroup = split( "=", $sgroups[$i]);
$tgroup[0] = ereg_replace( "\.", "/", $tgroup[0]);
$searchgroups = $searchgroups . " " . $spooldir . $tgroup[0]. "/*";
}
}
print ( "Search for \"$query\"<P>");
$fp = popen( "/bin/grep \"$query\" $searchgroups", "r");
while ($line = fgets($fp, 150)) {
$file = explode( ":", $line);
$group = explode( "/", $file[0]);
$newsgroup = "";
for ($i = $dirdepth; $i < (count($group)-1); $i++) {
if ($i > $dirdepth) { $newsgroup = $newsgroup . ".";}
$newsgroup = "$newsgroup$group[$i]";
}
if ($newsgroup) {
print( "<B>$newsgroup</B>");
print( " <A HREF=\"innsearch.phtml?article=$newsgroup.$group[$i]\">$grou
p[$i]</A>");
$la = split( ":", $line, 2);
$line = htmlspecialchars($la[1]);
print( " $line<BR>\n");
reset($file);
reset($group);
}
}
pclose($fp);
} else if ($article) {
$article = ereg_replace( "\.", "/", $article);
$fp = popen( "/bin/cat $spooldir$article", "r");
while ($line = fgets($fp, 150)) {
$line = htmlspecialchars($line);
print( "$line<BR>\n");
}
pclose($fp);
} else {
print ( "INNSearch<P>\n");
print ( "<FORM METHOD=\"get\" action=\"innsearch.phtml\">\n");
print ( "<INPUT name=\"query\" size=\"25\">\n");
print ( "<INPUT type=\"submit\" value = \"Search\"><BR>\n");
$fp = popen( "cat $active", "r");
while ($line = fgets($fp, 150)) {
$group = split( " ", $line);
if ($group[1] > $minarticles) {
print( "<input type=\"checkbox\" name=\"$group[0]\"");
if ($group[1] < $maxarticles) {
print( " checked ");
}
print( ">$group[0]<BR>\n");
}
}
pclose($fp);
print ( "</FORM>\n");
}
?>
|
|
| Functions to access a NNTP/NNRP newsserver. Complete set with examples is at ftp://ftp.nederland.net/pub/nnrplib Categories : Search, PHP, Complete Programs | | | free, search engine, indexing, system, information, web,
ftp, http, free, software, cgi, php, MySQL, database, php3,
FreeBSD, Linux, Unix, UdmSearch Categories : MySQL, Complete Programs, PHP, Databases, Search | | | Client classes for Dictionary servers UPDATED: 2000-06-06 Categories : Network, Search, Complete Programs, PHP Classes, PHP | | | DirtSearch Version 3.5 full function robust PHP and MySQL (and other
databases) Site or Web Wide Search Engine
Categories : PHP, MySQL, Complete Programs, Search, Databases | | | phpYellow Pages Standard Categories : PHP, Complete Programs, Databases, Directories, Search | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | PHP-MySQL shopping cart
Categories : PHP, Ecommerce, Complete Programs | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself. Categories : PHP, PHP Classes, Templates, Complete Programs | | | Tropicalm Genetree Family (MySQL based family tree) Categories : PHP, Interfaces, Databases, MySQL, Complete Programs | | | phpWebCam v1.0- Webcam management software - Automatically checks if you're online, and comes with a caption tool capable of handling multiple users. Categories : PHP, Complete Programs, HTML and PHP | | | a class for doing payments to a cybercash server
Categories : Ecommerce, Complete Programs, PHP Classes, PHP | | | Web Self Service Resource Scheduler Using php3 and MySQL Categories : PHP, Complete Programs, MySQL | | | A set of functions sitting on top of the abstraction layer that makes it a little easier to do SQL stuff. Documentation is within Categories : Databases, ODBC, Complete Programs, PHP | |
|
|
|