From: short <>
Date: Mon, 24 Dec 2001 13:28:01 +0000 (+0000)
Subject: Basic database web search implemented
X-Git-Url: http://git.jankratochvil.net/?p=kewensis.git;a=commitdiff_plain;h=cc9a120fa1095fe32c186606799e005456fccb54
Basic database web search implemented
---
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..cc84824
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,6 @@
+SourceCharset iso-8859-2
+DirectoryIndex index.php
+php_flag short_open_tag off
+php_flag magic_quotes_gpc off
+php_flag magic_quotes_runtime off
+AddType text/javascript .js
diff --git a/config.php b/config.php
new file mode 100644
index 0000000..3766162
--- /dev/null
+++ b/config.php
@@ -0,0 +1,14 @@
+
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..14f1ff3
--- /dev/null
+++ b/index.php
@@ -0,0 +1,74 @@
+
+
+".htmlspecialchars($row[$field])."";
+}
+
+ $family_num=0;
+ while (($family_row=mysql_fetch_array($families))) {
+ if ($family_num)
+ print "
\n";
+ $family_id=$family_row["family_id"];
+ $result=db_query("select id,name,Publication,Notes,html from $tb_tree"
+ ." where family_id=\"$family_id\""
+ ." order by family_id,family_order");
+ $order=0;
+ while (($row=mysql_fetch_array($result))) {
+ if ($order==0)
+ print "";
+ elseif ($order==1)
+ print "
";
+ if ($order>=1)
+ print "- ";
+
+ print(fieldquote("","name","name")
+ .fieldquote("\n","Publ. Author","author")
+ .fieldquote("
\n","Publication","publication")
+ .fieldquote("
\n","Notes","notes")
+ );
+ if (isset($row["html"])) {
+ $import="import: [".$row["id"]."]";
+ $html=eregi_replace("< */? *a( [^>]*)?>","",$row["html"]);
+ print("
\n\n".$html."\n
");
+ }
+ print("\n");
+
+ if ($order==0)
+ print "";
+ else
+ print " ";
+ print "\n";
+ $order++;
+ }
+ if ($order>=2)
+ print "
\n";
+ $family_num++;
+ }
+ mysql_free_result($result);
+
+ footer(false /* delimit */);
+?>
diff --git a/kewensis-collect.pl b/kewensis-collect.pl
index 8fd1d54..009be1e 100755
--- a/kewensis-collect.pl
+++ b/kewensis-collect.pl
@@ -193,8 +193,8 @@ my($tb_tree);
$db_driver="mysql";
$db_host="";
-#$db_user="short";
-#$DB_PWD=$ENV{"HOME"}."/priv/mysql.${db_user}.pwd";
+$db_user="short";
+$DB_PWD=$ENV{"HOME"}."/priv/mysql.${db_user}.pwd";
$db_name="short";
$tb_tree="kewensis_tree";
@@ -214,6 +214,7 @@ eval { &db_do("drop table $tb_tree") };
."family_id char(10) not null,"
."family_order int not null,"
."name varchar(100) not null,"
+ ."PublAuthor text null,"
."Publication text null,"
."Notes text null,"
."html text null"
@@ -223,7 +224,7 @@ eval { &db_do("drop table $tb_tree") };
&db_do("alter table $tb_tree add index (name)");
&db_do("alter table $tb_tree add unique (family_id,family_order)");
-my $insert_tb_tree=$db->prepare("insert into $tb_tree (id,family_id,family_order,name,Publication,Notes,html) values (?,?,?,?,?,?,?)")
+my $insert_tb_tree=$db->prepare("insert into $tb_tree (id,family_id,family_order,name,PublAuthor,Publication,Notes,html) values (?,?,?,?,?,?,?)")
or die "Prepare fail: $!";
foreach $owner (sort { $DB{$b}{"name"} cmp $DB{$a}{"name"}; } keys %OWNS) {
@@ -234,7 +235,7 @@ foreach $owner (sort { $DB{$b}{"name"} cmp $DB{$a}{"name"}; } keys %OWNS) {
my $id=$family[$family_order];
print "insert:$id,".$DB{$id}{"name"}."\n" if $D;
$insert_tb_tree->execute($id,$family_id,$family_order,
- $DB{$id}{"name"},$DB{$id}{"Publication"},$DB{$id}{"Notes"},$DB{$id}{"html"}
+ $DB{$id}{"name"},$DB{$id}{"Publ. Author"},$DB{$id}{"Publication"},$DB{$id}{"Notes"},$DB{$id}{"html"}
) or die "SQL insert failure: $!";
}
}