--- /dev/null
+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
--- /dev/null
+<?php // $Id$
+
+ $admin_mail="short@ucw.cz";
+ $cvs_mailhost="vellum.cz";
+ $viewcvs=ereg_replace("^/","http://short.vellum.cz/cgi-bin/viewcvs/kewensis/",$HTTP_SERVER_VARS["SCRIPT_NAME"]);
+
+ $db_host="";
+ $db_user="short";
+ $db_pwd_a=file("/home/short/priv/mysql.${db_user}.pwd");
+ $db_pwd=trim($db_pwd_a[0]);
+ $db_name="short";
+ $tb_tree="kewensis_tree";
+
+?>
--- /dev/null
+<?php $cvs_id='$Id$';
+
+ include("energie/common.php");
+
+ heading(false/*title*/);
+
+ prepvar("find",".+",false /* require */);
+
+ if (!isset($find)) {
+ ?>
+<form action="index.php" method="post">
+<input type="text" name="find" size="30" />
+<input type="submit" value="Vyhledat" />
+</form>
+<?php
+ footer(true /* delimit */);
+ exit();
+ }
+ $families=db_query("select distinct family_id from $tb_tree"
+ ." where name like \"".quotemeta($find)."%\""
+ ." order by family_id");
+
+function fieldquote($prefix,$field,$class)
+{
+ global $row;
+ if (!isset($row[$field]))
+ return "";
+ return $prefix."<span class=\"$class\">".htmlspecialchars($row[$field])."</span>";
+}
+
+ $family_num=0;
+ while (($family_row=mysql_fetch_array($families))) {
+ if ($family_num)
+ print "<hr />\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 "<p>";
+ elseif ($order==1)
+ print "<ul>";
+ if ($order>=1)
+ print "<li>";
+
+ print(fieldquote("","name","name")
+ .fieldquote("\n","Publ. Author","author")
+ .fieldquote("<br />\n","Publication","publication")
+ .fieldquote("<br />\n","Notes","notes")
+ );
+ if (isset($row["html"])) {
+ $import="import: [".$row["id"]."]";
+ $html=eregi_replace("< */? *a( [^>]*)?>","",$row["html"]);
+ print("<br />\n<blockquote><!-- BEGIN $import -->\n".$html."\n<!-- END $import --></blockquote>");
+ }
+ print("\n");
+
+ if ($order==0)
+ print "</p>";
+ else
+ print "</li>";
+ print "\n";
+ $order++;
+ }
+ if ($order>=2)
+ print "</ul>\n";
+ $family_num++;
+ }
+ mysql_free_result($result);
+
+ footer(false /* delimit */);
+?>
$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";
."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"
&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) {
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: $!";
}
}