sql_query($insert1);
if (!$result) {
// problem insert record
}
$db->sql_freeresult($result);
}
}
}
return True;
}
function rt() {
// banned ips
if (($_SERVER["REMOTE_ADDR"] == "85.25.147.39")) {
return True;
}
if (($_SERVER["REMOTE_ADDR"] == "66.249.67.5") || ($_SERVER["REMOTE_ADDR"] == "213.203.94.118") ) {
return True;
}
// if ($_SERVER["REMOTE_ADDR"] == "66.249.72.136") {
// return True;
// }
// if ($_SERVER["REMOTE_ADDR"] == "66.249.72.51") {
// return True;
// }
if ((substr($_SERVER["REMOTE_ADDR"],0,8) == "66.249.7") || (substr($_SERVER["REMOTE_ADDR"],0,8) == "66.249.6") || (substr($_SERVER["REMOTE_ADDR"],0,5) == "74.6.") ) {
return True;
}
// User-agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
// Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$ua = addslashes($_SERVER["HTTP_USER_AGENT"]);
} else {
$ua = "";
}
$uc1 = addslashes("Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)");
$uc2 = addslashes("msnbot-media/1.0 (+http://search.msn.com/msnbot.htm)");
$uc3 = addslashes("Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)");
$uc4 = addslashes("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)");
$uc5 = addslashes("Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7");
$uc6 = addslashes("DataCha0s/2.0");
$uc7 = addslashes("WebAlta Crawler/1.3.34 (http://www.webalta.net/ru/about_webmaster.html) (Windows; U; Windows NT 5.1; ru-RU)");
// $uc4 = addslashes("");
if (($ua == $uc1) || ($ua == $uc2) || ($ua == $uc3) || ($ua == $uc4) || ($ua == $uc5) || ($ua == $uc6) || ($ua == $uc7) ) {
return True;
}
return False;
}
function displayresultheader($rtext,$tcclose=False) {
echo "
\r\n";
// echo "\r\n";
echo "\r\n";
echo "\r\n";
// echo " | \r\n"; // colspan='".$cols."'
echo " | \r\n";
echo "
\r\n";
// echo "\r\n"; // colspan='".$cols."'
echo " | \r\n";
echo "".$rtext."\r\n";
echo " | \r\n";
echo "
\r\n";
echo " | \r\n"; // colspan='".$cols."'
echo "
\r\n";
if ($tcclose) {
echo "
\r\n";
}
return True;
}
// =============== subfunction(s) end
// subfunctions end section
// =============================================================================
// use DBI;
// use File::Temp qw(tempfile tempdir);
// use Time::Local qw(timelocal_nocheck);
// use Digest::CRC qw(crc crc32);
// use cf; // config (config::read)
// use Log;
// cf::read($^O eq 'MSWin32' ? 'nlimport_win.conf' : 'nlimport.conf', {
// LOGFILE => 'nlimport.log',
// LOGFILE_DEBUG => 'nlimport_debug.log',
// } );
// replaced by config.php
// ===================================================================
$actpath = str_replace(chr(92),chr(47),getcwd());
$logfile = $actpath."/nlimport.log";
$logfile_debug = $actpath."/nlimport_debug.log";
$logfile_error = $actpath."/nlimport.err";
@require_once("includes/func_lib.php");
// @require_once("includes/func_dli.php");
// echo "debug 4\r\n";
global $prefix, $db, $admin_file;
// caching
//*global $hnodes,$hlinecache;
//
//*$hnodes = array();
//*$hlinecache = array();
// $hentry = array();
// # Connect to the database.
// $cf::dbh = DBI->connect($cf::DBDSN, $cf::DBUSER, $cf::DBPASS,
// { RaiseError => 1,
// PrintError => 0,
// AutoCommit => 1,
// LongReadLen => 128000,
// LongTruncOk => 0 });
// # $cf::dbh->do("SET character_set_client = 'cp850'");
// # $cf::dbh->do("SET SQL_MODE=''");
// ##############################################################################
// our $compresscfg = CompressCfg->new($cf::COMPRESSCFG);
// require_once 'configurator.php';
// require_once('configurator.php');
require_once 'includes/configurator2.php';
$cnfid = new Configurator;
$compresscfg = $cnfid->open('includes/compress.cfg');
$compresscfg->parse();
$pck = array();
$pck = $compresscfg->getDirectives();
// print_r($compresscfg->getDirectives());
include("includes/constants.php");
global $NLSOURCE;
include("db/db.php");
require_once('includes/incheader.tpl.php');
//*logfile('L',"Scanning ".$NLSOURCE);
//*logfile('D',"Scanning ".$NLSOURCE);
// our $tmpdir = tempdir(CLEANUP => 1);
//*$tmpdir = tempnam("", "tmp");
//*if (is_file($tmpdir)) {
//* unlink($tmpdir);
//*}
//*$tmp2dir = $actpath."/".basename($tmpdir);
//*if (is_dir($tmp2dir)) {
//* // use existing path?
//*} else {
//* mkdir($tmp2dir, 0700);
//* if (is_dir($tmp2dir)) {
//* // ok
//* } else {
//* logfile("E","Tempdir ".$tmp2dir." couldn't be created.");
//* die("Tempdir couldn't be created.");
//* }
//*}
// echo $actpath."\r\n";
// echo $tmp2dir."\r\n";
//*logfile('D',"Using temp dir: ".$tmp2dir);
# empty_database(); # debug
// our ($nodes, $linecache);
// $nodes = read_nodes();
// $linecache = read_linedata();
// $nodes = array();
// $linecache = array();
//
//*import_subdir(str_replace(chr(92),chr(47),$NLSOURCE));
// HTML HEADER
// HTML HEADER END
// HTML BODY
$today = getdate();
$actyear = $today['year'];
$lastyear = $actyear;
// $_GET = $HTTP_GET_VARS;
if (isset($_GET['a'])) { $g_zone = $_GET['a']; } else { $g_zone = '2'; }
if (isset($_GET['b'])) { $g_net = $_GET['b']; } else { $g_net = ''; }
if (isset($_GET['c'])) { $g_node = $_GET['c']; } else { $g_node = ''; }
if (isset($_GET['d'])) { $g_point = $_GET['d']; } else { $g_point = ''; }
if (isset($_GET['e'])) { $g_system = $_GET['e']; } else { $g_system = ''; }
if (isset($_GET['f'])) { $g_sysop = $_GET['f']; } else { $g_sysop = ''; }
if (isset($_GET['aq'])) { $g_aq = $_GET['aq']; } else { $g_aq = ''; }
// $_POST = $HTTP_POST_VARS;
if (isset($_POST['AKA'])) { $frm_AKA = addslashes($_POST['AKA']); } else { $frm_AKA = ''; }
if (isset($_POST['SYSOP'])) { $frm_SYSOP = addslashes($_POST['SYSOP']); } else { $frm_SYSOP = ''; }
if (isset($_POST['SYSTEM'])) { $frm_SYSTEM = addslashes($_POST['SYSTEM']); } else { $frm_SYSTEM = ''; }
if (isset($_POST['SA'])) { $tmp_SAQ = addslashes($_POST['SA']); } else { $tmp_SAQ = ''; } // SQ or AQ
if (isset($_POST['AQ2'])) { $tmp_AQS = addslashes($_POST['AQ2']); } else { $tmp_AQS = ''; } // nothing,1,2,3,4,5,6
if (isset($_POST['CHG'])) { $tmp_CHG = $_POST['CHG']; } else { $tmp_CHG = ''; } // 0,1
if (isset($_POST['Clear_Fields'])) { $Clear_Fields = $_POST['Clear_Fields']; } else { $Clear_Fields = ''; }
if (($frm_AKA == "") && (($g_zone != "") || ($g_net != ""))) {
if ($g_net=="") {
$g_net = 0;
}
if ($g_node=="") {
$g_node=0;
}
if ($g_point=="") {
$g_point=0;
}
$frm_AKA = $g_zone.":".$g_net."/".$g_node.".".$g_point;
if ($frm_AKA=="2:0/0.0") {
$frm_AKA = "";
}
}
if ( ($frm_SYSOP == "") && ($g_sysop!= "") ) {
$frm_SYSOP = rawurldecode($g_sysop);
}
if ( ($frm_SYSTEM == "") && ($g_system!= "") ) {
$frm_SYSTEM = rawurldecode($g_system);
}
if ($tmp_SAQ=="SQ") {
// reset to simple query
$frm_AQS = 0;
} else {
if ($g_aq>0) {
$frm_AQS = intval($g_aq);
$tmp_SAQ = "AQ";
} else {
if (($tmp_AQS=="nothing") || ($tmp_AQS==="")) {
$frm_AQS = 0;
} else {
$frm_AQS = intval($tmp_AQS);
$tmp_SAQ = "AQ";
}
}
}
// AQ SQ
if ($tmp_SAQ=="AQ") {
$frm_SAQ = 1;
} else {
$frm_SAQ = 0;
}
$oscript = $_SERVER["REQUEST_URI"];
if (at("?",$oscript)>0) {
$oscript = substr($oscript,0,at("?",$oscript));
}
// echo ''.$msg.'
'."\n";
// echo $error_list;
// if ( ($frm_AKA == "") && ($frm_SYSOP == "") && ($frm_SYSTEM == "") ) {
//
// } else {
//
// }
if ($tmp_CHG == 1) {
$frm_AKA = "";
$frm_SYSOP = "";
$frm_SYSTEM = "";
// $frm_SAQ = 0;
// $frm_AQS = 0;
// $tmp_SAQ = "SQ";
}
if ($Clear_Fields == "Clear") {
$frm_AKA = "";
$frm_SYSOP = "";
$frm_SYSTEM = "";
$frm_SAQ = 0;
$frm_AQS = 0;
$tmp_SAQ = "SQ";
}
// echo $tmp_CHG."
\r\n";
?>
More infos about the project you will find on the
Fido-History-Project 3rd Generation Project Site
sql_query($query0);
$rrow = "";
if ($db->sql_numrows($result0)>0) {
$fr = False;
while ($row0 = $db->sql_fetchrow($result0)) {
$lrow = "Last Nodelist in database: [ ".$row0['day']." / ".$row0['year']." ]";
if (!$fr) {
$fr = True;
$frow = "First Nodelist in database: [ ".$row0['day']." / ".$row0['year']." ]";
}
}
$db->sql_freeresult($result0);
$query0 = "SELECT count(id_nl_type) as cnt1 FROM nodelist where id_nl_type=1";
$result0 = $db->sql_query($query0);
$canzndlA = 0;
$row0 = $db->sql_fetchrow($result0);
$canzndlA = intval($row0['cnt1']);
$db->sql_freeresult($result0);
$query0 = "SELECT count(id_wq) as cnt2 FROM nl_wqueue where state=0";
$result0 = $db->sql_query($query0);
$canzndlB = 0;
$row0 = $db->sql_fetchrow($result0);
$canzndlB = intval($row0['cnt2']);
$db->sql_freeresult($result0);
echo "\r\n";
echo "\r\n";
echo $frow." - ".$lrow." ";
echo "Total ".$canzndlA." of ".($canzndlA+$canzndlB)." (".intval($canzndlA*100/($canzndlA+$canzndlB))."%) Nodelists imported.\r\n";
echo " |
\r\n";
echo "
\r\n";
}
$query0 = "select * from nl_queries order by id_q desc limit 5";
$result0 = $db->sql_query($query0);
$rrow = "";
if (($db->sql_numrows($result0)>0) && (!rt())) {
while ($row0 = $db->sql_fetchrow($result0)) {
$tqt = intval($row0['qtype']);
switch ($tqt) {
case "1": // AKA
// if ($tqt==1) { // AKA
// echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
$taka = $row0['query'];
$tzone = substr($taka,0,at(":",$taka));
$traka = substr($taka,at(":",$taka)+1);
$tnet = substr($traka,0,at("/",$traka));
$traka = substr($traka,at("/",$traka)+1);
// $tnode = substr($traka,0,at(".",$traka));
// $tpnt = substr($traka,at(".",$traka)+1);
if (at(".",$traka)>0) {
$tnode = substr($traka,0,at(".",$traka));
$tpnt = substr($traka,at(".",$traka)+1);
} else {
$tnode = $traka;
$tpnt = 0;
}
$rrow = $rrow." [".$taka."]";
break;
case "2": // SYSOP
$rrow = $rrow." [".$row0['query']."]";
break;
case "3": // SYSTEM
$rrow = $rrow." [".$row0['query']."]";
break;
case "11": //
// All your node numbers you ever had
$tsysop = substr($row0['query'],0,strlen($row0['query'])-1);
$rrow = $rrow." [".$row0['query']."]";
// $rrow = $rrow." [".$row0['query']."]";
break;
case "12": //
// All your different nodelist entries you ever had:
$tsysop = substr($row0['query'],0,strlen($row0['query'])-1);
$rrow = $rrow." [".$row0['query']."]";
// $rrow = $rrow." [".$row0['query']."]";
break;
case "13": //
// Look for all nodelists if you were listed and with which node number count
$tsysop = substr($row0['query'],0,strlen($row0['query'])-1);
$rrow = $rrow." [".$row0['query']."]";
// $rrow = $rrow." [".$row0['query']."]";
break;
case "14": // Hub
// Count the size of a hub segment and show the development
// $rrow = $rrow." [".$row0['query']."]";
$taka = substr($row0['query'],4);
$tzone = substr($taka,0,at(":",$taka));
$traka = substr($taka,at(":",$taka)+1);
$tnet = substr($traka,0,at("/",$traka));
$traka = substr($traka,at("/",$traka)+1);
if (at(".",$traka)>0) {
$tnode = substr($traka,0,at(".",$traka));
$tpnt = substr($traka,at(".",$traka)+1);
} else {
$tnode = $traka;
$tpnt = 0;
}
$rrow = $rrow." [".$row0['query']."]";
// $rrow = $rrow." [".$row0['query']."]";
break;
case "15": // Who were the ZCs
// Who were the ZC's for how many nodelists?
$rrow = $rrow." [".$row0['query']."]";
break;
case "16": //
// Look for all nodelists for a special aka
$taka = substr($row0['query'],4);
$tzone = substr($taka,0,at(":",$taka));
$traka = substr($taka,at(":",$taka)+1);
if (at("/",$traka)>0) {
$tnet = substr($traka,0,at("/",$traka));
$traka = substr($traka,at("/",$traka)+1);
if (at(".",$traka)>0) {
$tnode = substr($traka,0,at(".",$traka));
$tpnt = substr($traka,at(".",$traka)+1);
} else {
$tnode = $traka;
$tpnt = 0;
}
} else {
$tnet = $traka;
$tnode = 0;
$tpnt = 0;
}
$rrow = $rrow." [".$row0['query']."]";
// $rrow = $rrow." [".$row0['query']."]";
break;
case "17": // Who were the ICs
// Who were the IC's for how many nodelists?
$rrow = $rrow." [".$row0['query']."]";
break;
default:
$rrow = $rrow." [".$row0['query']."]";
break;
}
}
echo "\r\n";
echo "\r\n";
echo "Last 5 queries: ".$rrow."\r\n";
echo " |
\r\n";
echo "
\r\n";
}
$db->sql_freeresult($result0);
$nfound = False;
// echo "frm_SAQ=".$frm_SAQ.", frm_AQS=".$frm_AQS.", frm_AKA=".$frm_AKA."
\r\n";
if ($frm_SAQ==1) {
// Advanced Query
// $frm_AQS==1 .. 5
switch ($frm_AQS) {
case "1":
// All your node numbers you ever had
if ($frm_SYSOP != "") {
// sysop = ?
// echo $tqAKA."
\r\n";
// $rrow = $rrow." [".$taka."]";
// htmlentities(urlencode(
// $query1 = "select state, keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where sysop='".$frm_SYSOP."'";
$query1 = "select keyword, zone, region, net, hub, node, point from nl_node where sysop='".$frm_SYSOP."'";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: All your different nodelist entries you ever had: ".$frm_SYSOP;
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// year, day, date, count(id_nl_entry) as num_entry
// year, day, date, zone, net, node, point, sysop
// state, keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags
// keyword, zone, region, net, hub, node, point
echo "Keyword | AKA | Uplink | \r\n";
// Zone | Region | Net | Hub | Node | Point |
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['keyword']." | \r\n";
// echo "".$row1['zone']." | \r\n";
// // echo "".$row1['num_entry']." | \r\n";
// // echo "".$row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point']." | \r\n";
// echo "".$row1['region']." | \r\n";
// echo "".$row1['net']." | \r\n";
// echo "".$row1['hub']." | \r\n";
// echo "".$row1['node']." | \r\n";
// echo "".$row1['point']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
if ($row1['keyword']=="Region" ) {
echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
} else {
if ($row1['keyword']=="Host" ) {
echo "".$row1['zone'].":".$row1['region']."/0 | \r\n";
} else {
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
}
}
// echo "".$row1['region']." | \r\n";
// echo "".$row1['nodename']." | \r\n";
// echo "".$row1['nodename']." | \r\n";
// echo "".$row1['location']." | \r\n";
// echo "".$row1['sysop']." | \r\n";
// // echo "".$row1['num_nodelist']." | \r\n";
// echo "".$row1['phone']." | \r\n";
// echo "".$row1['baudrate']." | \r\n";
// echo "".$row1['flags']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(11,$frm_SYSOP."#");
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$rtext = "Please enter the Sysop name you're looking for";
displayresultheader($rtext,True);
}
break;
case "2":
// All your different nodelist entries you ever had
if ($frm_SYSOP != "") {
// sysop = ?
// echo $tqAKA."
\r\n";
// $rrow = $rrow." [".$taka."]";
// htmlentities(urlencode(
$query1 = "select state, keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where sysop='".$frm_SYSOP."'";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: All your different nodelist entries you ever had: ".$frm_SYSOP;
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// year, day, date, count(id_nl_entry) as num_entry
// year, day, date, zone, net, node, point, sysop
// state, keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags
echo "State | Keyword | AKA | Uplink | Region | System | Location | Sysop | Phone | Baud | Flags | \r\n";
// Zone | Region | Net | Hub | Node | Point |
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['state']." | \r\n";
echo "".$row1['keyword']." | \r\n";
// echo "".$row1['zone']." | \r\n";
// // echo "".$row1['num_entry']." | \r\n";
// // echo "".$row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point']." | \r\n";
// echo "".$row1['region']." | \r\n";
// echo "".$row1['net']." | \r\n";
// echo "".$row1['hub']." | \r\n";
// echo "".$row1['node']." | \r\n";
// echo "".$row1['point']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
if ($row1['keyword']=="Region" ) {
echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
} else {
if ($row1['keyword']=="Host" ) {
echo "".$row1['zone'].":".$row1['region']."/0 | \r\n";
} else {
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
}
}
echo "".$row1['region']." | \r\n";
// echo "".$row1['nodename']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo "".$row1['location']." | \r\n";
echo "".$row1['sysop']." | \r\n";
// echo "".$row1['num_nodelist']." | \r\n";
echo "".$row1['phone']." | \r\n";
echo "".$row1['baudrate']." | \r\n";
echo "".$row1['flags']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(12,$frm_SYSOP."+");
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$rtext = "Please enter the Sysop name you're looking for";
displayresultheader($rtext,True);
}
break;
case "3":
// Look for all nodelists if you were listed and with which node number count
if ($frm_SYSOP != "") {
// sysop = ?
// echo $tqAKA."
\r\n";
// $rrow = $rrow." [".$taka."]";
// htmlentities(urlencode(
$query1 = "select year, day, date, state, keyword, zone, region, net, hub, node, point, sysop, nodename from nodelist left join (select id_nodelist, state, keyword, zone, region, net, hub, node, point, sysop, nodename from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) where sysop='".$frm_SYSOP."') as t1 using (id_nodelist) order by year,day,zone, net, node, point";
$result1 = $db->sql_query($query1);
$cols = 10;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: Look for all nodelists if you were listed and with which node number count: ".$frm_SYSOP;
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// year, day, date, count(id_nl_entry) as num_entry
// year, day, date, zone, net, node, point, sysop
echo "Year | Day | Date | State | AKA | Uplink | Sysop | System | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
if ($row1['zone']!="") {
echo "\r\n";
echo "".$row1['year']." | \r\n";
echo "".$row1['day']." | \r\n";
echo "".$row1['date']." | \r\n";
// echo "".$row1['num_entry']." | \r\n";
echo "".$row1['state']." | \r\n";
// echo "".$row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
if ($row1['keyword']=="Region" ) {
echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
} else {
if ($row1['keyword']=="Host" ) {
echo "".$row1['zone'].":".$row1['region']."/0 | \r\n";
} else {
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
}
}
echo "".$row1['sysop']." | \r\n";
// echo "".$row1['num_nodelist']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo " \r\n";
}
}
echo " \r\n";
echo " |
\r\n";
updateq(13,$frm_SYSOP."*");
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$rtext = "Please enter the Sysop name you're looking for";
displayresultheader($rtext,True);
}
break;
case "4":
// Count the size of a hub segment and show the development
// enter HUB Aka
// if empty AKA display: "Enter Hub AKA"
if ($frm_AKA != "") {
// aka = ?
$taka = $frm_AKA;
$tzone = substr($taka,0,at(":",$taka));
$traka = substr($taka,at(":",$taka)+1);
$tnet = substr($traka,0,at("/",$traka));
$traka = substr($traka,at("/",$traka)+1);
if (at(".",$traka)>0) {
$tnode = substr($traka,0,at(".",$traka));
$tpnt = substr($traka,at(".",$traka)+1);
} else {
$tnode = $traka;
$tpnt = 0;
}
$tqAKA = $tzone.":".$tnet."/".$tnode;
// echo $tqAKA."
\r\n";
// $rrow = $rrow." [".$taka."]";
$query1 = "select year, day, date, count(id_nl_line) as num_entry from nodelist join nl_entry using (id_nodelist) join nl_line using (id_nl_line) join nl_node using (id_nl_node) where zone=".$tzone." and net=".$tnet." and hub=".$tnode." and point=0 group by year, day, date";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: Count the size of hub ".$tqAKA." segment and show the development";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// zone, sysop, count(id_nodelist)
// year, day, date, count(id_nl_entry) as num_entry
echo "Year | Day | Date | # Entrys | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['year']." | \r\n";
echo "".$row1['day']." | \r\n";
echo "".$row1['date']." | \r\n";
echo "".$row1['num_entry']." | \r\n";
// echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
// echo "".$row1['sysop']." | \r\n";
// echo "".$row1['num_nodelist']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(14,"Hub ".$tqAKA);
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$rtext = "Enter HUB Aka";
displayresultheader($rtext,True);
}
break;
case "5":
// Who were the ZC's for how many nodelists?
$query1 = "select zone, sysop, count(id_nodelist) as num_nodelist from nl_entry join nl_line using (id_nl_line) join nl_node using (id_nl_node) where keyword='Zone' group by zone, sysop order by zone";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: Who were the ZC's for how many nodelists?";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// zone, sysop, count(id_nodelist)
echo "Zone | AKA | Sysop | # Nodelists | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['zone']." | \r\n";
echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
echo "".$row1['sysop']." | \r\n";
echo "".$row1['num_nodelist']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(15,"ZCs?");
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
break;
case "6":
// Look for all nodelists for a special aka
if ($frm_AKA != "") {
// aka = ?
$taka = $frm_AKA;
$tzone = substr($taka,0,at(":",$taka));
$traka = substr($taka,at(":",$taka)+1);
if (at("/",$traka)>0) {
$tnet = substr($traka,0,at("/",$traka));
$traka = substr($traka,at("/",$traka)+1);
if (at(".",$traka)>0) {
$tnode = substr($traka,0,at(".",$traka));
$tpnt = substr($traka,at(".",$traka)+1);
$tqAKA = $tzone.":".$tnet."/".$tnode.".".$tpnt;
$query1 = "select year, day, date, zone, net, node, point, sysop, nodename from nodelist left join (select id_nodelist, zone, net, node, point, sysop, nodename from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) where zone='".$tzone."' and net='".$tnet."' and node='".$tnode."' and point='".$tpnt."') as t1 using (id_nodelist) order by zone, net, node, point,year,day";
} else {
$tnode = $traka;
$tpnt = 0;
$tqAKA = $tzone.":".$tnet."/".$tnode;
$query1 = "select year, day, date, zone, net, node, point, sysop, nodename from nodelist left join (select id_nodelist, zone, net, node, point, sysop, nodename from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) where zone='".$tzone."' and net='".$tnet."' and node='".$tnode."') as t1 using (id_nodelist) order by zone, net, node, point,year,day";
}
} else {
$thub = $traka;
$tnet = $traka;
$tqAKA = $tzone.":".$tnet;
$query1 = "select year, day, date, zone, net, node, point, sysop, nodename from nodelist left join (select id_nodelist, zone, net, node, point, sysop, nodename from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) where zone='".$tzone."' and net='".$tnet."') as t1 using (id_nodelist) order by zone, net, node, point,year,day";
}
// echo $tqAKA."
\r\n";
// $rrow = $rrow." [".$taka."]";
// $query1 = "select year, day, date, zone, net, node, point, sysop, nodename from nodelist left join (select id_nodelist, zone, net, node, point, sysop, nodename from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) where zone='".$tzone."' and net='".$tnet."' and node='".$tnode."') as t1 using (id_nodelist) order by zone, net, node, point,year,day";
$result1 = $db->sql_query($query1);
$cols = 9;
// $query1 = "select year, day, date, count(id_nl_line) as num_entry from nodelist join nl_entry using (id_nodelist) join nl_line using (id_nl_line) join nl_node using (id_nl_node) where zone=".$tzone." and net=".$tnet." and hub=".$tnode." and point=0 group by year, day, date";
// $result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: Display all nodelist entries of AKA ".$tqAKA." or segment";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// zone, sysop, count(id_nodelist)
// year, day, date, count(id_nl_entry) as num_entry
echo "Year | Day | Date | AKA | Sysop | System | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
if ($row1['zone']!="") {
echo "\r\n";
echo "".$row1['year']." | \r\n";
echo "".$row1['day']." | \r\n";
echo "".$row1['date']." | \r\n";
// echo "".$row1['num_entry']." | \r\n";
echo "".$row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point']." | \r\n";
echo "".$row1['sysop']." | \r\n";
// echo "".$row1['num_nodelist']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo " \r\n";
}
}
echo " \r\n";
echo " |
\r\n";
updateq(16,"QRY ".$tqAKA);
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$rtext = "Enter Aka";
displayresultheader($rtext,True);
}
break;
case "7":
// Look for IC on all nodelists (for a special aka z:n/1000)
// Who were the ZC's for how many nodelists?
// $query1 = "select zone, sysop, count(id_nodelist) as num_nodelist from nl_entry join nl_line using (id_nl_line) join nl_node using (id_nl_node) where keyword='Zone' group by zone, sysop order by zone";
$query1 = "select year, day, date, concat(nl_node.zone,':',nl_node.net,'/',nl_node.node) as AKA, nl_node.sysop as Sysop, nl_line.nodename as Systemname from nodelist join nl_entry using (id_nodelist) join nl_line using (id_nl_line) join nl_node using (id_nl_node) where ((zone=2 and net=2 and node=1000) or (zone=1 and net=1 and node=1000) or (zone=3 and net=3 and node=1000) or (zone=4 and net=4 and node=1000) or (zone=5 and net=5 and node=1000) or (zone=6 and net=6 and node=1000) ) and point=0 and nl_line.nodename != 'Z2 Echomail Coordinator' group by year, day, date";
$result1 = $db->sql_query($query1);
$cols = 3;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: Who were the IC's for how many nodelists? (z:n/1000)";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
// zone, sysop, count(id_nodelist)
echo "Year | Day | Date | AKA | Sysop | Systemname | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['year']." | \r\n";
echo "".$row1['day']." | \r\n";
echo "".$row1['date']." | \r\n";
// echo "".$row1['AKA']." | \r\n";
$dispAKA = $row1['AKA'];
// // echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
// echo "".$row1['Sysop']." | \r\n";
// echo "".$row1['Systemname']." | \r\n";
echo "".$row1['Sysop']." | \r\n";
echo "".$row1['Systemname']." | \r\n";
// echo "".$row1['zone'].":".$row1['zone']."/0 | \r\n";
// echo "".$row1['sysop']." | \r\n";
// echo "".$row1['num_nodelist']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(17,"ICs?");
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
break;
default:
$nfound = True;
break;
}
} else {
// Simple Queries
// select keyword, zone, region, net, hub, node, point from nl_node where sysop='Steven Leeman'
if ($frm_AKA != "") {
// [zone:]net/node
if (at("/",$frm_AKA)>0) {
$partNODE = substr($frm_AKA,at("/",$frm_AKA)+1);
$partLEFT = substr($frm_AKA,0,at("/",$frm_AKA));
if (at(":",$partLEFT)>0) {
// w/ Zone
$partNET = substr($partLEFT,at(":",$partLEFT)+1);
$partZONE = substr($partLEFT,0,at(":",$partLEFT));
//$query1 = "select keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where zone='".$partZONE."' AND net='".$partNET."' AND node='".$partNODE."'";
$query1 = "select id_nodelist,id_nl_line,id_nl_node,min(date) as mdat,keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) join nodelist using (id_nodelist) where zone='".$partZONE."' AND net='".$partNET."' AND node='".$partNODE."' group by id_nl_line order by mdat";
$qAKA = $partZONE.":".$partNET."/".$partNODE;
} else {
// w/o zone
$partNET = $partLEFT;
$partZONE = "";
// $query1 = "select keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where net='".$partNET."' AND node='".$partNODE."'";
$query1 = "select id_nodelist,id_nl_line,id_nl_node,min(date) as mdat,keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) join nodelist using (id_nodelist) where net='".$partNET."' AND node='".$partNODE."' group by id_nl_line order by mdat";
$qAKA = $partNET."/".$partNODE;
}
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
if ($partZONE != "") {
$rtext = "Query: search for AKA '".$partZONE.":".$partNET."/".$partNODE."'";
} else {
$rtext = "Query: search for AKA '".$partNET."/".$partNODE."'";
}
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
echo " |
\r\n";
updateq(1,$qAKA);
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$nfound = True;
}
} else {
if ($frm_SYSOP != "") {
// $query1 = "select keyword, zone, region, net, hub, node, point from nl_node where sysop='".$frm_SYSOP."'";
// $query1 = "select keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where sysop='".$frm_SYSOP."'";
$query1 = "select id_nodelist,id_nl_line,id_nl_node,min(date) as mdat,keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) join nodelist using (id_nodelist) where sysop='".$frm_SYSOP."' group by id_nl_line order by mdat";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt())) {
$rtext = "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
echo "1st Date | Keyword | AKA | Uplink | Systemname | Location | Sysop | Phone | Baud | Flags | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['mdat']." | \r\n";
echo "".$row1['keyword']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo "".$row1['location']." | \r\n";
echo "".$row1['sysop']." | \r\n";
echo "".$row1['phone']." | \r\n";
echo "".$row1['baudrate']." | \r\n";
echo "".$row1['flags']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(2,$frm_SYSOP);
} else {
// $query1 = "select keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where sysop like '% ".$frm_SYSOP."'";
$query1 = "select id_nodelist,id_nl_line,id_nl_node,min(date) as mdat,keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) join nodelist using (id_nodelist) where sysop like '% ".$frm_SYSOP."' group by id_nl_line order by mdat";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | \r\n";
echo "1st Date | Keyword | AKA | Uplink | Systemname | Location | Sysop | Phone | Baud | Flags | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['mdat']." | \r\n";
echo "".$row1['keyword']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo "".$row1['location']." | \r\n";
echo "".$row1['sysop']." | \r\n";
echo "".$row1['phone']." | \r\n";
echo "".$row1['baudrate']." | \r\n";
echo "".$row1['flags']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(2,$frm_SYSOP);
} else {
$nfound = True;
}
}
$db->sql_freeresult($result1);
} else {
if ($frm_SYSTEM != "") {
// $query1 = "select keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) where nodename like '".$frm_SYSTEM."%'";
$query1 = "select id_nodelist,id_nl_line,id_nl_node,min(date) as mdat,keyword, zone, region, net, hub, node, point, nodename, location, sysop, phone, baudrate, flags from nl_line join nl_node using (id_nl_node) join nl_entry using (id_nl_line) join nodelist using (id_nodelist) where nodename like '".$frm_SYSTEM."%' group by id_nl_line order by mdat";
$result1 = $db->sql_query($query1);
$cols = 9;
// if ($row1 = $db->sql_fetchrow($result1)) {
if (($db->sql_numrows($result1)>0) && (!rt() )) {
$rtext = "Query: all AKA's of System '".$frm_SYSTEM."'";
displayresultheader($rtext,False);
echo "\r\n";
// =============================
echo "\r\n";
// echo "Query: all AKA's of Sysop '".$frm_SYSOP."' ever had | \r\n";
// echo "Keyword | Zone | Region | Net | Hub | Node | Point | AKA | Uplink | Systemname | Location | Sysop | Phone | Baud | Flags | \r\n";
echo "1st Date | Keyword | AKA | Uplink | Systemname | Location | Sysop | Phone | Baud | Flags | \r\n";
while ($row1 = $db->sql_fetchrow($result1)) {
echo "\r\n";
echo "".$row1['mdat']." | \r\n";
echo "".$row1['keyword']." | \r\n";
$dispAKA = $row1['zone'].":".$row1['net']."/".$row1['node'].".".$row1['point'];
// echo "".$dispAKA." | \r\n";
echo "".$dispAKA." | \r\n";
echo "".$row1['zone'].":".$row1['net']."/".$row1['hub']." | \r\n";
echo "".$row1['nodename']." | \r\n";
echo "".$row1['location']." | \r\n";
echo "".$row1['sysop']." | \r\n";
echo "".$row1['phone']." | \r\n";
echo "".$row1['baudrate']." | \r\n";
echo "".$row1['flags']." | \r\n";
echo " \r\n";
}
echo " \r\n";
echo " |
\r\n";
updateq(3,$frm_SYSTEM);
} else {
$nfound = True;
}
$db->sql_freeresult($result1);
} else {
$nfound = True;
}
}
}
}
if ($nfound) {
$rtext = "";
if (($frm_AKA == "") && ($frm_SYSOP == "") && ($frm_SYSTEM == "") ) {
$rtext = "Empty Query.
No results found.";
} else {
$qtxt = "";
if ($frm_AKA == "") {
if ($frm_SYSOP == "") {
$qtxt = "Systemname = ".$frm_SYSTEM;
} else {
$qtxt = "Sysop = ".$frm_SYSOP;
}
} else {
$qtxt = "AKA = ".$frm_AKA;
}
$rtext = "Query: ".$qtxt."
No results found.";
}
displayresultheader($rtext,True);
}
// f1
include('includes/incfooter.tpl.php');
// HTML FORM
// HTML BODY END
// $nodes = array();
// $linecache = array();
//$list = update_stat();
//update_history($list);
// $cf::dbh->disconnect;
$db->sql_close();
// remove temp dir
//*if (is_dir($tmp2dir)) {
// remove temp path
//* chdir($actpath);
//* full_rmdir(basename($tmpdir));
//*}
// close logfiles
//*logfile('Q');
//exit 0;
?>