1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814
|
diff -Nru zoph-0.3.3/INSTALL zoph.new/INSTALL
--- zoph-0.3.3/INSTALL 2002-12-13 23:05:49.000000000 +0000
+++ zoph.new/INSTALL 2003-07-17 22:04:44.000000000 +0100
@@ -6,7 +6,7 @@
The following need to be installed before Zoph will function. For
details on installing these, read the REQUIREMENTS document.
- - MySQL 3.23
+ - MySQL 3.23 or PostgreSQL
- Apache
- PHP 4
- Perl 5
@@ -21,8 +21,15 @@
2.1 Create a database and import the tables
+ Mysql:
+
$ mysqladmin -u root -p create zoph
- $ mysql -u root -p zoph < sql/zoph.sql
+ $ mysql -u root -p zoph < sql/mysql/zoph.sql
+
+ PostgresSQL:
+ $ createdb zoph
+ $ psql zoph < /usr/share/postgresql/contrib/pgcrypto.sql
+ $ psql zoph < sql/posgres/zoph.sql
2.2 Create users for zoph
@@ -30,11 +37,17 @@
zoph_admin is used when I work directly in mysql so I don't
have to use root.
+ MySQL:
+
$ mysql -u root -p
mysql> grant select, insert, update, delete on zoph.* to zoph_rw@localhost identified by 'PASSWORD';
mysql> grant all on zoph.* to zoph_admin identified by 'PASSWORD';
+ PostgreSQL:
+
+ users should have been granted rights by the import.
+
3. Configure the PHP templates
The values to be configured are in the php/config.inc.php file.
@@ -45,6 +58,10 @@
- DB_NAME : zoph (unless you used something else above)
- DB_USER : zoph_rw, using the above example
- DB_PASS : the password you set
+ - DB_TYPE : type of database, currently: 'mysql' or 'postgres'
+
+ - USE_MYSQL_PASSWORD : set this to use password() function of MySQL, otherwise
+ zoph will use an md5 hash for the password
- USE_IMAGE_SERVICE : see the section on the image service below.
the default is no (0).
diff -Nru zoph-0.3.3/php/album.inc.php zoph.new/php/album.inc.php
--- zoph-0.3.3/php/album.inc.php 2002-12-10 21:30:48.000000000 +0000
+++ zoph.new/php/album.inc.php 2003-07-17 19:45:13.000000000 +0100
@@ -202,18 +202,18 @@
"where ap.user_id = '" . escape_string($user->get("user_id")) .
"' and ap.album_id = pa.album_id" .
" and pa.album_id = al.album_id " .
- "group by al.album_id " .
+ "group by al.album_id,al.parent_album_id,al.album,al.album_description " .
"order by count desc, al.album " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
else {
$sql =
"select al.*, count(*) as count " .
"from albums as al, photo_albums as pa " .
"where pa.album_id = al.album_id " .
- "group by al.album_id " .
+ "group by al.album_id,al.parent_album_id,al.album,al.album_description " .
"order by count desc, al.album " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
return get_popular_results("album", $sql);
diff -Nru zoph-0.3.3/php/auth.inc.php zoph.new/php/auth.inc.php
--- zoph-0.3.3/php/auth.inc.php 2002-12-10 21:30:48.000000000 +0000
+++ zoph.new/php/auth.inc.php 2003-07-17 21:48:06.000000000 +0100
@@ -9,10 +9,8 @@
$_action = getvar("_action");
- mysql_pconnect(DB_HOST, DB_USER, DB_PASS)
- or die("Unable to connect to MySQL");
- mysql_select_db(DB_NAME)
- or die("Unable to select database");
+ zophdb_pconnect(DB_NAME, DB_HOST, DB_USER, DB_PASS)
+ or die("Unable to connect to the Database");
if (minimum_version('4.1.0')) {
$user = $_SESSION['user'];
@@ -25,14 +23,14 @@
$pword = getvar("pword");
$query =
- "select user_id from users where user_name = '" .
- escape_string($uname) . "' and " .
- "password = password('" . escape_string($pword) . "')";
+ "select user_id from users where user_name = '" .
+ escape_string($uname) . "' and ";
+ $query .= zophdb_password($pword);
- $result = mysql_query($query);
+ $result = zophdb_query($query);
- if(mysql_num_rows($result) == 1) {
- $row = mysql_fetch_array($result);
+ if(zophdb_num_rows($result) == 1) {
+ $row = zophdb_fetch_array($result);
$user = new user($row["user_id"]);
}
diff -Nru zoph-0.3.3/php/category.inc.php zoph.new/php/category.inc.php
--- zoph-0.3.3/php/category.inc.php 2002-12-10 21:30:48.000000000 +0000
+++ zoph.new/php/category.inc.php 2003-07-17 19:45:30.000000000 +0100
@@ -140,16 +140,16 @@
" and pc.category_id = cat.category_id " .
"group by cat.category_id " .
"order by count desc, cat.category " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
else {
$sql =
"select cat.*, count(*) as count " .
"from categories as cat, photo_categories as pc " .
"where pc.category_id = cat.category_id " .
- "group by cat.category_id " .
+ "group by cat.category_id,cat.parent_category_id,cat.category,cat.category_description " .
"order by count desc, cat.category " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
return get_popular_results("category", $sql);
diff -Nru zoph-0.3.3/php/config.inc.php zoph.new/php/config.inc.php
--- zoph-0.3.3/php/config.inc.php 2003-06-10 22:28:32.000000000 +0100
+++ zoph.new/php/config.inc.php 2003-07-17 19:30:35.000000000 +0100
@@ -1,6 +1,7 @@
<?php
define(VERSION, '0.3.3');
+ define(DB_TYPE, 'mysql');
define(DB_HOST, 'localhost');
define(DB_NAME, 'zoph');
define(DB_USER, 'zoph_rw');
@@ -21,9 +22,9 @@
define(SERVER_WEB_IMPORT, 0);
// commands to use to expand uploaded archives. set to 0 to disable.
- define(UNZIP_CMD, 1);
+// define(UNZIP_CMD, 1);
define(UNZIP_CMD, 'unzip');
- define(UNTAR_CMD, 1);
+// define(UNTAR_CMD, 1);
define(UNTAR_CMD, 'tar xvf');
// directory to use to temporarily extract uploaded archives
diff -Nru zoph-0.3.3/php/exif.inc.php zoph.new/php/exif.inc.php
--- zoph-0.3.3/php/exif.inc.php 2002-12-10 21:30:49.000000000 +0000
+++ zoph.new/php/exif.inc.php 2003-07-16 22:52:40.000000000 +0100
@@ -46,7 +46,7 @@
}
if (isset($exif["Flash"])) {
- $exifdata["flash_used"] = $exif["Flash"] ? "Yes" : "No";
+ $exifdata["flash_used"] = $exif["Flash"] ? "Y" : "N";
}
if ($exif["FocalLength"]) {
@@ -128,6 +128,7 @@
*/
if ($exif["CompressedBitsPerPixel"]) {
+ echo $exif["CompressedBitsPerPixel"]."\n";
list($a, $b) = explode('/', $exif["CompressedBitsPerPixel"]);
$val = round($a / $b);
switch ($val) {
diff -Nru zoph-0.3.3/php/import.php zoph.new/php/import.php
--- zoph-0.3.3/php/import.php 2002-12-13 21:40:25.000000000 +0000
+++ zoph.new/php/import.php 2003-07-16 23:13:42.000000000 +0100
@@ -221,8 +221,9 @@
if ($name && $path) {
$tmp_name = $HTTP_POST_FILES['_image_local']['tmp_name'];
+print "<hr>".$tmp_name."<hr>\n";
$file = IMAGE_DIR . $path . '/' . $name;
-
+print_r($HTTP_POST_FILES);
if (move_uploaded_file($tmp_name, $file)) {
echo translate("Received file") . ": $file<br>\n";
@@ -246,7 +247,7 @@
$cmd = 'cd ' . escapeshellarg($tmp_path) . ' && ' .
$expand . ' ' . escapeshellarg($file) . ' 2>&1';
- //echo "$cmd<br>\n";
+ echo "$cmd<br>\n";
echo "<p>\n<pre>\n";
system($cmd);
diff -Nru zoph-0.3.3/php/include.inc.php zoph.new/php/include.inc.php
--- zoph-0.3.3/php/include.inc.php 2002-12-10 21:30:49.000000000 +0000
+++ zoph.new/php/include.inc.php 2003-07-17 21:05:24.000000000 +0100
@@ -6,6 +6,15 @@
require_once("rtplang.class.php");
+ switch (DB_TYPE) {
+ case 'postgres':
+ require_once("zophdb.postgres.inc.php");
+ break;
+ case 'mysql':
+ require_once("zophdb.mysql.inc.php");
+ break;
+ }
+
require_once("zoph_table.inc.php");
require_once("zoph_tree_table.inc.php");
diff -Nru zoph-0.3.3/php/person.inc.php zoph.new/php/person.inc.php
--- zoph-0.3.3/php/person.inc.php 2002-12-10 21:30:49.000000000 +0000
+++ zoph.new/php/person.inc.php 2003-07-17 19:45:44.000000000 +0100
@@ -236,16 +236,16 @@
" and pp.person_id = ppl.person_id " .
"group by ppl.person_id " .
"order by count desc, ppl.last_name, ppl.first_name " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
else {
$sql =
- "select ppl.*, count(*) as count " .
+ "select ppl.person_id,ppl.first_name,ppl.last_name, count(*) as count " .
"from people as ppl, photo_people as pp " .
"where ppl.person_id = pp.person_id " .
- "group by ppl.person_id " .
+ "group by ppl.person_id,ppl.first_name,ppl.last_name " .
"order by count desc, ppl.last_name, ppl.first_name " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
return get_popular_results("person", $sql);
diff -Nru zoph-0.3.3/php/photo.inc.php zoph.new/php/photo.inc.php
--- zoph-0.3.3/php/photo.inc.php 2002-12-10 21:30:49.000000000 +0000
+++ zoph.new/php/photo.inc.php 2003-07-17 19:45:58.000000000 +0100
@@ -27,7 +27,7 @@
" and pa.album_id = ap.album_id" .
" and ap.user_id = '" . escape_string($user->get("user_id")) . "'" .
" and ap.access_level >= p.level " .
- "limit 0, 1";
+ "limit 1";
}
else {
$sql =
@@ -378,11 +378,11 @@
if (DEBUG) { echo "$query<br>\n"; }
- $result = mysql_query($query)
- or die_with_mysql_error("Rating grouping failed");
+ $result = zophdb_query($query)
+ or die_with_zophdb_error("Rating grouping failed");
$max_count = 0;
- while ($row = mysql_fetch_array($result)) {
+ while ($row = zophdb_fetch_array($result)) {
if ($row[0]) { $rating = $row[0]; }
else { $rating = "null"; }
diff -Nru zoph-0.3.3/php/photo_search.inc.php zoph.new/php/photo_search.inc.php
--- zoph-0.3.3/php/photo_search.inc.php 2002-12-10 21:30:50.000000000 +0000
+++ zoph.new/php/photo_search.inc.php 2003-07-17 19:50:17.000000000 +0100
@@ -30,9 +30,11 @@
$order = "ph." . $vars["_order"] . " $dir";
if ($order == "ph.date") { $order .= ", ph.time $dir"; }
$order .= ", ph.photo_id $dir";
+ $select .= ", ph.".$vars["_order"];
}
else {
$order = "ph.date $dir, ph.time $dir, ph.photo_id $dir";
+ $select .= ", ph.date, ph.time";
}
while (list($key, $val) = each($vars)) {
@@ -198,13 +200,31 @@
$num_photos = 1;
// don't bother with order
- $query =
- "select $select from $from_clause $where limit $offset, $rows";
+ // need to determine type of database due to syntax differences in limit clause
+ switch (DB_TYPE) {
+ case 'postgres':
+ $query =
+ "select $select from $from_clause $where limit $rows offset $offset";
+ break;
+ case 'mysql':
+ $query =
+ "select $select from $from_clause $where limit $offset, $rows";
+ break;
+ }
}
else {
- $query =
- "select $select from $from_clause $where order by $order " .
- "limit $offset, $rows";
+ switch (DB_TYPE) {
+ case 'postgres':
+ $query =
+ "select $select from $from_clause $where order by $order " .
+ "limit $rows offset $offset";
+ break;
+ case 'mysql':
+ $query =
+ "select $select from $from_clause $where order by $order " .
+ "limit $offset, $rows";
+ break;
+ }
}
//echo $query;
diff -Nru zoph-0.3.3/php/place.inc.php zoph.new/php/place.inc.php
--- zoph-0.3.3/php/place.inc.php 2002-12-10 21:30:50.000000000 +0000
+++ zoph.new/php/place.inc.php 2003-07-17 19:46:18.000000000 +0100
@@ -141,16 +141,16 @@
" and ph.location_id = plc.place_id " .
"group by plc.place_id " .
"order by count desc, plc.title, plc.city " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
else {
$sql =
- "select plc.*, count(*) as count " .
+ "select plc.place_id,plc.title,plc.city, count(*) as count " .
"from places as plc, photos as ph " .
"where plc.place_id = ph.location_id " .
- "group by plc.place_id " .
+ "group by plc.place_id,plc.title,plc.city " .
"order by count desc, plc.title, plc.city " .
- "limit 0, $TOP_N";
+ "limit $TOP_N";
}
return get_popular_results("place", $sql);
diff -Nru zoph-0.3.3/php/user.inc.php zoph.new/php/user.inc.php
--- zoph-0.3.3/php/user.inc.php 2002-12-10 21:30:50.000000000 +0000
+++ zoph.new/php/user.inc.php 2003-07-17 19:46:26.000000000 +0100
@@ -60,7 +60,7 @@
" and ph.photo_id = '" . escape_string($photo_id) . "'" .
" and ap.access_level >= ph.level " .
"order by ap.access_level desc, writable desc " .
- "limit 0, 1";
+ "limit 1";
$aps = get_records_from_query("album_permissions", $sql);
if ($aps && sizeof($aps) >= 1) {
diff -Nru zoph-0.3.3/php/zoph_table.inc.php zoph.new/php/zoph_table.inc.php
--- zoph-0.3.3/php/zoph_table.inc.php 2002-12-10 21:30:51.000000000 +0000
+++ zoph.new/php/zoph_table.inc.php 2003-07-17 21:50:10.000000000 +0100
@@ -92,11 +92,11 @@
if (DEBUG) { echo "$sql<br>\n"; }
- $result = mysql_query($sql)
- or die_with_mysql_error("Lookup failed:", $sql);
+ $result = zophdb_query($sql)
+ or die_with_zophdb_error("Lookup failed:", $sql);
- if (mysql_num_rows($result) == 1) {
- $row = mysql_fetch_assoc($result);
+ if (zophdb_num_rows($result) == 1) {
+ $row = zophdb_fetch_assoc($result);
$this->fields = array();
@@ -113,8 +113,8 @@
/*
* Inserts a record. The default behavior is to ignore the
* primary key field(s) with the assumption that these will
- * be generated by mysql (auto_increment). Passing a non null
- * parameter causes these fields to be manually inserted.
+ * be generated by the database (auto_increment). Passing a non
+ * null parameter causes these fields to be manually inserted.
*/
function insert($keep_key = null) {
@@ -126,6 +126,7 @@
while (list($name, $value) = each($this->fields)) {
if ($this->primary_keys && !$keep_key && $this->is_key($name)) {
+ $pk=$name;
continue;
}
@@ -137,7 +138,7 @@
$names .= $name;
if ($name == "password") {
- $values .= "password('" . escape_string($value) . "')";
+ $values .= zophdb_password($value);
}
else if ($value != "null") {
$values .= "'" . escape_string($value) . "'";
@@ -152,9 +153,13 @@
if (DEBUG) { echo "$sql<br>\n"; }
- mysql_query($sql) or die_with_mysql_error("Insert failed:", $sql);
+ zophdb_query($sql) or die_with_zophdb_error("Insert failed:", $sql);
- $id = mysql_insert_id();
+ if (!$keep_key) {
+ $id = zophdb_insert_id($pk,$this->table_name);
+ } else {
+ $id = 0;
+ }
if ($this->primary_keys && count($this->primary_keys) == 1) {
$this->fields[$this->primary_keys[0]] = $id;
@@ -187,14 +192,14 @@
if (DEBUG) { echo "$sql<br>\n"; }
- mysql_query($sql) or die_with_mysql_error("Delete failed:", $sql);
+ zophdb_query($sql) or die_with_zophdb_error("Delete failed:", $sql);
if ($extra_tables) {
foreach ($extra_tables as $table) {
$sql = "delete from $table where $constraints";
if (DEBUG) { echo "$sql<br>\n"; }
- mysql_query($sql) or
- die_with_mysql_error("Delete from $table failed:", $sql);
+ zophdb_query($sql) or
+ die_with_zophdb_error("Delete from $table failed:", $sql);
}
}
}
@@ -224,7 +229,8 @@
if ($values) { $values .= ", "; }
if ($name == "password") {
- $values .= "$name = password('" . escape_string($value) . "')";
+
+ $values .= "$name = ".zophdb_password($value);
}
else if ($value != "null") {
$values .= "$name = '" . escape_string($value) . "'";
@@ -240,7 +246,7 @@
if (DEBUG) { echo "$sql<br>\n"; }
- mysql_query($sql) or die_with_mysql_error("Update failed:", $sql);
+ zophdb_query($sql) or die_with_zophdb_error("Update failed:", $sql);
}
@@ -285,7 +291,7 @@
function get_edit_array() {
if (!$this->fields) { return; }
- $field_lengths = get_field_lengths($this->table_name);
+ $field_lengths = zophdb_get_field_lengths($this->table_name);
$keys = array_keys($field_lengths);
sort($keys);
@@ -325,10 +331,10 @@
function get_count_from_query($sql) {
if (DEBUG > 1) { echo "$sql<br>\n"; }
- $result = mysql_query($sql)
- or die_with_mysql_error("Unable to get count", $sql);
+ $result = zophdb_query($sql)
+ or die_with_zophdb_error("Unable to get count", $sql);
- return mysql_result($result, 0, 0);
+ return zophdb_result($result, 0, 0);
}
/*
@@ -387,11 +393,11 @@
if (DEBUG > 1) { echo "$sql<br>\n"; }
- $result = mysql_query($sql)
- or die_with_mysql_error("Unable to get records", $sql);
+ $result = zophdb_query($sql)
+ or die_with_zophdb_error("Unable to get records", $sql);
if ($min) {
- mysql_data_seek($result, $min);
+ zophdb_data_seek($result, $min);
}
if ($num) {
@@ -400,7 +406,7 @@
$objs = array();
if ($class != null) {
- while ((!$limit || $num-- > 0) && $row = mysql_fetch_assoc($result)) {
+ while ((!$limit || $num-- > 0) && $row = zophdb_fetch_assoc($result)) {
$obj = new $class;
$obj->set_fields($row);
$objs[] = $obj;
@@ -408,12 +414,12 @@
}
else {
// use to grab ids, for example
- while ((!$limit || $num-- > 0) && $row = mysql_fetch_row($result)) {
+ while ((!$limit || $num-- > 0) && $row = zophdb_fetch_row($result)) {
$objs[] = $row[0];
}
}
- mysql_free_result($result);
+ zophdb_free_result($result);
return $objs;
}
@@ -485,7 +491,7 @@
/*
* Escapes various characters in the given string using the
- * mysql_escape_string function.
+ * zophdb_escape_string function.
*/
function escape_string($str) {
@@ -494,7 +500,7 @@
$str = stripslashes($str);
}
- return mysql_escape_string($str);
+ return zophdb_escape_string($str);
}
@@ -505,17 +511,17 @@
function execute_query($sql, $silent = 0) {
if (DEBUG > 1) { echo "$sql<br>\n"; }
if ($silent) {
- mysql_query($sql);
+ zophdb_query($sql);
}
else {
- mysql_query($sql) or die_with_mysql_error("Something went wrong", $sql);
+ zophdb_query($sql) or die_with_zophdb_error("Something went wrong", $sql);
}
}
-function die_with_mysql_error($msg, $sql = "") {
+function die_with_zophdb_error($msg, $sql = "") {
$msg =
"<p><strong>$msg</strong><br>\n" .
- "<code>" . mysql_error() . "</code></p>\n";
+ "<code>" . zophdb_error() . "</code></p>\n";
if ($sql) {
$msg .= "<hr><p><code>$sql</code></p>\n";
@@ -541,16 +547,5 @@
);
}
-function get_field_lengths($table_name) {
-
- $db_fields = mysql_list_fields(DB_NAME, $table_name);
- $columns = mysql_num_fields($db_fields);
- for ($i = 0; $i < $columns; $i++) {
- $field_lengths[mysql_field_name($db_fields, $i)] =
- mysql_field_len($db_fields, $i);
- }
-
- return $field_lengths;
-}
?>
diff -Nru zoph-0.3.3/php/zophdb.mysql.inc.php zoph.new/php/zophdb.mysql.inc.php
--- zoph-0.3.3/php/zophdb.mysql.inc.php 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/php/zophdb.mysql.inc.php 2003-07-17 21:48:30.000000000 +0100
@@ -0,0 +1,80 @@
+<?php
+
+ /*
+ * abstracted database commands
+ * could be with mysql or postgres (or something else!)
+ */
+
+function zophdb_pconnect($dbname,$dbhost,$dbuser,$dbpass) {
+ if (!($ret = mysql_pconnect($dbhost,$dbuser,$dbpass))) {
+ return $ret;
+ }
+ return mysql_select_db($dbname);
+}
+
+function zophdb_query($query) {
+ // print "<hr>$query<hr>\n";
+ return mysql_query($query);
+}
+
+function zophdb_num_rows($result) {
+ return mysql_num_rows($result);
+}
+
+function zophdb_fetch_array($result) {
+ return mysql_fetch_array($result);
+}
+
+function zophdb_error() {
+ return mysql_error();
+}
+
+function zophdb_get_field_lengths($table_name) {
+
+ $db_fields = mysql_list_fields(DB_NAME, $table_name);
+ $columns = mysql_num_fields($db_fields);
+ for ($i = 0; $i < $columns; $i++) {
+ $field_lengths[mysql_field_name($db_fields, $i)] =
+ mysql_field_len($db_fields, $i);
+ }
+
+ return $field_lengths;
+}
+
+function zophdb_fetch_assoc($result) {
+ return mysql_fetch_assoc($result);
+}
+
+function zophdb_insert_id($pk,$table) {
+ return mysql_insert_id();
+}
+
+function zophdb_result($result,$i,$j) {
+ return mysql_result($result,$i,$j);
+}
+
+function zophdb_data_seek($result, $min) {
+ return mysql_result_offset($result, $min);
+}
+
+function zophdb_fetch_row($result) {
+ return mysql_fetch_row($result);
+}
+
+function zophdb_free_result($result) {
+ return mysql_free_result($result);
+}
+
+function zophdb_escape_string($str) {
+ return mysql_escape_string($str);
+}
+
+function zophdb_password($str) {
+ if (MYSQL_USE_PASSWORD) {
+ return "password('".escape_string($str)."')";
+ } else {
+ return "md5('".escape_string($str)."')";
+ }
+}
+
+?>
diff -Nru zoph-0.3.3/php/zophdb.postgres.inc.php zoph.new/php/zophdb.postgres.inc.php
--- zoph-0.3.3/php/zophdb.postgres.inc.php 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/php/zophdb.postgres.inc.php 2003-07-17 21:48:10.000000000 +0100
@@ -0,0 +1,93 @@
+<?php
+
+ /*
+ * abstracted database commands
+ * could be with mysql or postgres (or something else!)
+ */
+
+function zophdb_pconnect($dbname,$dbhost,$dbuser,$dbpass) {
+ return pg_pconnect("dbname=$dbname host=$dbhost user=$dbuser password=$dbpass");
+}
+
+function zophdb_query($query) {
+ print "<hr>$query<hr>\n";
+ return pg_query($query);
+}
+
+function zophdb_num_rows($result) {
+ return pg_num_rows($result);
+}
+
+function zophdb_fetch_array($result) {
+ return pg_fetch_array($result);
+}
+
+function zophdb_error() {
+ return pg_last_error();
+}
+
+function zophdb_list_fields($dbname, $tablename) {
+
+}
+
+function zophdb_get_field_lengths($tablename) {
+
+ $res=pg_query("select * from $tablename limit 1");
+ $numfields = pg_num_fields($res);
+ for ($i = 0; $i < $numfields; $i++) {
+ $field_lengths[$i] = pg_fieldsize($res,$i);
+ }
+ return $field_lengths;
+}
+
+/*
+function zophdb_get_field_lengths($table_name) {
+
+ $db_fields = zophdb_list_fields(DB_NAME, $table_name);
+ $columns = zophdb_num_fields($db_fields);
+ for ($i = 0; $i < $columns; $i++) {
+ $field_lengths[zophdb_field_name($db_fields, $i)] =
+ zophdb_field_len($db_fields, $i);
+ }
+
+ return $field_lengths;
+}
+*/
+
+
+function zophdb_fetch_assoc($result) {
+ return pg_fetch_assoc($result);
+}
+
+function zophdb_insert_id($pk,$table) {
+ $seq_name = $table."_".$pk."_seq";
+ $result = pg_query("SELECT currval('$seq_name')");
+ $row = pg_fetch_row($result);
+ return $row[0];
+}
+
+function zophdb_result($result,$i,$j) {
+ return pg_fetch_result($result,$i,$j);
+}
+
+function zophdb_data_seek($result, $min) {
+ return pg_result_offset($result, $min);
+}
+
+function zophdb_fetch_row($result) {
+ return pg_fetch_array($result);
+}
+
+function zophdb_free_result($result) {
+ return pg_free_result($result);
+}
+
+function zophdb_escape_string($str) {
+ return pg_escape_string($str);
+}
+
+function zophdb_password($str) {
+ return "digest('".escape_string($str)."','md5')";
+}
+
+?>
diff -Nru zoph-0.3.3/sql/mysql/zoph.mysql.sql zoph.new/sql/mysql/zoph.mysql.sql
--- zoph-0.3.3/sql/mysql/zoph.mysql.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph.mysql.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,243 @@
+-- MySQL dump 8.21
+--
+-- Host: localhost Database: zoph
+---------------------------------------------------------
+-- Server version 3.23.49-log
+
+--
+-- Table structure for table 'album_permissions'
+--
+
+CREATE TABLE album_permissions (
+ user_id int(11) NOT NULL default '0',
+ album_id int(11) NOT NULL default '0',
+ access_level tinyint(4) NOT NULL default '0',
+ writable char(1) NOT NULL default '0',
+ PRIMARY KEY (user_id,album_id),
+ KEY ap_access_level (access_level)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'albums'
+--
+
+CREATE TABLE albums (
+ album_id int(11) NOT NULL auto_increment,
+ parent_album_id int(11) NOT NULL default '0',
+ album varchar(32) NOT NULL default '',
+ album_description varchar(255) default NULL,
+ PRIMARY KEY (album_id),
+ KEY album_parent_id (parent_album_id)
+) TYPE=MyISAM;
+
+INSERT INTO albums VALUES (1,0,'Album Root',NULL);
+
+--
+-- Table structure for table 'categories'
+--
+
+CREATE TABLE categories (
+ category_id int(11) NOT NULL auto_increment,
+ parent_category_id int(11) NOT NULL default '0',
+ category varchar(32) NOT NULL default '',
+ category_description varchar(255) default NULL,
+ PRIMARY KEY (category_id),
+ KEY cat_parent_id (parent_category_id)
+) TYPE=MyISAM;
+
+INSERT INTO categories VALUES (1,0,'Category Root',NULL);
+
+--
+-- Table structure for table 'color_schemes'
+--
+
+CREATE TABLE color_schemes (
+ color_scheme_id int(11) NOT NULL auto_increment,
+ name varchar(64) NOT NULL default '',
+ page_bg_color varchar(6) default NULL,
+ text_color varchar(6) default NULL,
+ link_color varchar(6) default NULL,
+ vlink_color varchar(6) default NULL,
+ table_bg_color varchar(6) default NULL,
+ table_border_color varchar(6) default NULL,
+ breadcrumb_bg_color varchar(6) default NULL,
+ title_bg_color varchar(6) default NULL,
+ tab_bg_color varchar(6) default NULL,
+ tab_font_color varchar(6) default NULL,
+ selected_tab_bg_color varchar(6) default NULL,
+ selected_tab_font_color varchar(6) default NULL,
+ title_font_color varchar(6) default NULL,
+ PRIMARY KEY (color_scheme_id)
+) TYPE=MyISAM;
+
+INSERT INTO color_schemes VALUES (1,'default','ffffff','000000','111111','444444','ffffff','000000','ffffff','f0f0f0','000000','ffffff','c0c0c0','000000','000000');
+INSERT INTO color_schemes VALUES (2,'blugram','909090','000000','111111','333333','eef0f0','000000','cce0e0','dde0cc','ccd0bb','000000','bbd0d0','000000','000000');
+INSERT INTO color_schemes VALUES (3,'dow','444444','000000','000055','000033','cccccc','000000','aaaaaa','2222aa','2222aa','ffffff','cccccc','000000','ffffff');
+INSERT INTO color_schemes VALUES (4,'hoenig','FFEFD6','5C1F00','330000','330000','FFFBF5','000000','FFF7EB','FFE7C2','FFE7C2','5C1F00','FFD799','000000','993300');
+INSERT INTO color_schemes VALUES (5,'forest','336633','000000','000000','000000','99CC99','000000','669966','663300','663300','E0E0E0','996633','FFFFFF','99CC99');
+INSERT INTO color_schemes VALUES (6,'black','000000','FFFFFF','FFFFFF','FFFFFF','000000','FFFFFF','000000','666666','666666','FFFFFF','999999','FFFFFF','FFFFFF');
+INSERT INTO color_schemes VALUES (7,'beach','646D7E','000000','000000','000000','F9EEE2','000000','9AADC7','C6DEFF','617C58','D0D0D0','8BB381','000000','646D7E');
+
+--
+-- Table structure for table 'people'
+--
+
+CREATE TABLE people (
+ person_id int(11) NOT NULL auto_increment,
+ first_name varchar(32) default NULL,
+ last_name varchar(32) default NULL,
+ middle_name varchar(32) default NULL,
+ called varchar(16) default NULL,
+ gender char(1) default NULL,
+ dob date default NULL,
+ dod date default NULL,
+ home_id int(11) default NULL,
+ work_id int(11) default NULL,
+ father_id int(11) default NULL,
+ mother_id int(11) default NULL,
+ spouse_id int(11) default NULL,
+ notes varchar(255) default NULL,
+ PRIMARY KEY (person_id),
+ KEY person_last_name (last_name(10)),
+ KEY person_first_name (first_name(10))
+) TYPE=MyISAM;
+
+INSERT INTO people VALUES (1,'Unknown','Person',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+--
+-- Table structure for table 'photo_albums'
+--
+
+CREATE TABLE photo_albums (
+ photo_id int(11) NOT NULL default '0',
+ album_id int(11) NOT NULL default '0',
+ PRIMARY KEY (photo_id,album_id)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'photo_categories'
+--
+
+CREATE TABLE photo_categories (
+ photo_id int(11) NOT NULL default '0',
+ category_id int(11) NOT NULL default '0',
+ PRIMARY KEY (photo_id,category_id)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'photo_people'
+--
+
+CREATE TABLE photo_people (
+ photo_id int(11) NOT NULL default '0',
+ person_id int(11) NOT NULL default '0',
+ position int(11) default NULL,
+ PRIMARY KEY (photo_id,person_id)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'photos'
+--
+
+CREATE TABLE photos (
+ photo_id int(11) NOT NULL auto_increment,
+ name varchar(128) default NULL,
+ path varchar(255) default NULL,
+ width int(11) default NULL,
+ height int(11) default NULL,
+ size int(11) default NULL,
+ title varchar(64) default NULL,
+ photographer_id int(11) default NULL,
+ location_id int(11) default NULL,
+ view varchar(64) default NULL,
+ rating tinyint(4) default NULL,
+ description blob,
+ date varchar(10) default NULL,
+ time varchar(8) default NULL,
+ camera_make varchar(32) default NULL,
+ camera_model varchar(32) default NULL,
+ flash_used char(1) default NULL,
+ focal_length varchar(64) default NULL,
+ exposure varchar(64) default NULL,
+ compression varchar(64) default NULL,
+ aperture varchar(16) default NULL,
+ level tinyint(4) NOT NULL default '1',
+ iso_equiv varchar(8) default NULL,
+ metering_mode varchar(16) default NULL,
+ focus_dist varchar(16) default NULL,
+ ccd_width varchar(16) default NULL,
+ comment varchar(128) default NULL,
+ timestamp timestamp(14) NOT NULL,
+ PRIMARY KEY (photo_id),
+ KEY photo_photog_id (photographer_id),
+ KEY photo_loc_id (location_id),
+ KEY photo_rating (rating),
+ KEY photo_level (level)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'places'
+--
+
+CREATE TABLE places (
+ place_id int(11) NOT NULL auto_increment,
+ contact_type int(11) NOT NULL default '0',
+ title varchar(64) NOT NULL default '',
+ address varchar(64) default NULL,
+ address2 varchar(64) default NULL,
+ city varchar(32) default NULL,
+ state varchar(32) default NULL,
+ zip varchar(10) default NULL,
+ country varchar(32) default NULL,
+ notes varchar(255) default NULL,
+ PRIMARY KEY (place_id),
+ KEY place_city (city(10)),
+ KEY place_title (title(10))
+) TYPE=MyISAM;
+
+--
+-- Table structure for table 'prefs'
+--
+
+CREATE TABLE prefs (
+ user_id int(11) NOT NULL default '0',
+ show_breadcrumbs char(1) NOT NULL default '1',
+ num_breadcrumbs smallint(5) unsigned NOT NULL default '8',
+ num_rows tinyint(3) unsigned NOT NULL default '3',
+ num_cols tinyint(3) unsigned NOT NULL default '4',
+ max_pager_size tinyint(3) unsigned NOT NULL default '10',
+ random_photo_min_rating tinyint(3) unsigned NOT NULL default '0',
+ reports_top_n smallint(5) unsigned NOT NULL default '5',
+ color_scheme_id int(11) NOT NULL default '1',
+ slideshow_time smallint(6) NOT NULL default '5',
+ language char(2) default NULL,
+ recent_photo_days smallint(6) NOT NULL default '7',
+ auto_edit char(1) NOT NULL default '0',
+ camera_info char(1) NOT NULL default '1',
+ desc_thumbnails char(1) NOT NULL default '0',
+ PRIMARY KEY (user_id)
+) TYPE=MyISAM;
+
+INSERT INTO prefs VALUES (1,'1',8,3,4,10,0,5,1,5,NULL,7,'0','1','0');
+
+--
+-- Table structure for table 'users'
+--
+
+CREATE TABLE users (
+ user_id int(11) NOT NULL auto_increment,
+ person_id int(11) NOT NULL default '0',
+ user_class char(1) NOT NULL default '1',
+ user_name varchar(16) NOT NULL default '',
+ password varchar(32) default NULL,
+ browse_people char(1) NOT NULL default '0',
+ browse_places char(1) NOT NULL default '0',
+ detailed_people char(1) NOT NULL default '0',
+ detailed_places char(1) NOT NULL default '0',
+ import char(1) NOT NULL default '0',
+ lightbox_id int(11) default NULL,
+ PRIMARY KEY (user_id)
+) TYPE=MyISAM;
+
+INSERT INTO users VALUES (1,1,'0','admin',password('admin'),'1','1','1','1','1',NULL);
+
diff -Nru zoph-0.3.3/sql/mysql/zoph_update-0.2.1.sql zoph.new/sql/mysql/zoph_update-0.2.1.sql
--- zoph-0.3.3/sql/mysql/zoph_update-0.2.1.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph_update-0.2.1.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,27 @@
+#
+# focal length was not long enough for some cameras
+#
+alter table photos modify focal_length varchar(64);
+
+#
+# let these descriptions be larger too
+#
+alter table albums modify album_description varchar(255);
+alter table categories modify category_description varchar(255);
+
+#
+# a couple new photo fields
+#
+alter table photos add focus_dist varchar(16);
+alter table photos add ccd_width varchar(16);
+alter table photos add comment varchar(128);
+
+#
+# forgot to make this not null
+#
+alter table users modify detailed_people char(1) not null default '0';
+
+#
+# change state from char(2) to varchar(32) so it can be more versatile
+#
+alter table places modify state varchar(32);
diff -Nru zoph-0.3.3/sql/mysql/zoph_update-0.3.1.sql zoph.new/sql/mysql/zoph_update-0.3.1.sql
--- zoph-0.3.3/sql/mysql/zoph_update-0.3.1.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph_update-0.3.1.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,33 @@
+#
+# Zoph 0.3 -> 0.3.1 update
+# 30 Sep 2002
+#
+
+#
+# create a pref for an always edit mode
+#
+alter table prefs add auto_edit char(1) not null default '0';
+
+#
+# create a pref for whether to display camera info
+#
+alter table prefs add camera_info char(1) not null default '1';
+
+#
+# create a field to define a lightbox for a user
+#
+alter table users add lightbox_id int;
+
+#
+# These tables were accidentally included in zoph.sql 0.3
+#
+drop table contact_types;
+drop table email_addresses;
+drop table links;
+drop table people_email_addresses;
+drop table people_phone_numbers;
+drop table people_places;
+drop table phone_numbers;
+drop table photo_links;
+drop table places_phone_numbers;
+drop table related_photos;
diff -Nru zoph-0.3.3/sql/mysql/zoph_update-0.3.2.sql zoph.new/sql/mysql/zoph_update-0.3.2.sql
--- zoph-0.3.3/sql/mysql/zoph_update-0.3.2.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph_update-0.3.2.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,13 @@
+#
+# Zoph 0.3.1 -> 0.3.2 update
+# 17 Oct 2002
+#
+
+#
+# four new color schemes if you want them
+#
+INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('hoenig','FFEFD6','5C1F00','330000','330000','FFFBF5','000000','FFF7EB','FFE7C2','FFE7C2','5C1F00','FFD799','000000','993300');
+INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('forest','336633','000000','000000','000000','99CC99','000000','669966','663300','663300','E0E0E0','996633','FFFFFF','99CC99');
+INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('black','000000','FFFFFF','FFFFFF','FFFFFF','000000','FFFFFF','000000','666666','666666','FFFFFF','999999','FFFFFF','FFFFFF');
+INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('beach','646D7E','000000','000000','000000','F9EEE2','000000','9AADC7','C6DEFF','617C58','D0D0D0','8BB381','000000','646D7E');
+
diff -Nru zoph-0.3.3/sql/mysql/zoph_update-0.3.3.sql zoph.new/sql/mysql/zoph_update-0.3.3.sql
--- zoph-0.3.3/sql/mysql/zoph_update-0.3.3.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph_update-0.3.3.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,9 @@
+#
+# Zoph 0.3.2 -> 0.3.3 update
+# 18 Nov 2002
+#
+
+#
+# create a pref for displaying descriptions under thumbnails
+#
+alter table prefs add desc_thumbnails char(1) not null default '0';
diff -Nru zoph-0.3.3/sql/mysql/zoph_update-0.3.sql zoph.new/sql/mysql/zoph_update-0.3.sql
--- zoph-0.3.3/sql/mysql/zoph_update-0.3.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/mysql/zoph_update-0.3.sql 2003-07-17 20:01:15.000000000 +0100
@@ -0,0 +1,30 @@
+#
+# Zoph 0.2.1 -> 0.3 update
+# 20 Sep 2002
+#
+
+#
+# increase size of name and path photo fields
+#
+alter table photos modify name varchar(128);
+alter table photos modify path varchar(255);
+
+#
+# create timestamp field
+#
+alter table photos add timestamp timestamp(14);
+
+#
+# create a language pref field
+#
+alter table prefs add language char(2);
+
+#
+# create a field for the number of days used by the view recent links
+#
+alter table prefs add recent_photo_days smallint not null default 7;
+
+#
+# create a import permission field
+#
+alter table users add import char(1) not null default '0';
diff -Nru zoph-0.3.3/sql/postgres/zoph.postgres.sql zoph.new/sql/postgres/zoph.postgres.sql
--- zoph-0.3.3/sql/postgres/zoph.postgres.sql 1970-01-01 01:00:00.000000000 +0100
+++ zoph.new/sql/postgres/zoph.postgres.sql 2003-07-17 22:00:53.000000000 +0100
@@ -0,0 +1,284 @@
+--
+-- Table structure for table 'album_permissions'
+--
+
+CREATE TABLE album_permissions (
+ user_id int NOT NULL default '0',
+ album_id int NOT NULL default '0',
+ access_level smallint NOT NULL default '0',
+ writable char(1) NOT NULL default '0',
+ PRIMARY KEY (user_id,album_id)
+);
+
+CREATE INDEX ap_access_level ON album_permissions (access_level);
+
+--
+-- Table structure for table 'albums'
+--
+
+CREATE TABLE albums (
+ album_id SERIAL,
+ parent_album_id int NOT NULL default '0',
+ album varchar(32) NOT NULL default '',
+ album_description varchar(255) default NULL,
+ PRIMARY KEY (album_id)
+);
+
+CREATE INDEX album_parent_id ON albums(parent_album_id);
+
+INSERT INTO albums VALUES (1,0,'Album Root',NULL);
+
+--
+-- Table structure for table 'categories'
+--
+
+CREATE TABLE categories (
+ category_id SERIAL,
+ parent_category_id int NOT NULL default '0',
+ category varchar(32) NOT NULL default '',
+ category_description varchar(255) default NULL,
+ PRIMARY KEY (category_id)
+);
+
+CREATE INDEX cat_parent_id on categories(parent_category_id);
+
+INSERT INTO categories VALUES (1,0,'Category Root',NULL);
+
+--
+-- Table structure for table 'color_schemes'
+--
+
+CREATE TABLE color_schemes (
+ color_scheme_id SERIAL,
+ name varchar(64) NOT NULL default '',
+ page_bg_color varchar(6) default NULL,
+ text_color varchar(6) default NULL,
+ link_color varchar(6) default NULL,
+ vlink_color varchar(6) default NULL,
+ table_bg_color varchar(6) default NULL,
+ table_border_color varchar(6) default NULL,
+ breadcrumb_bg_color varchar(6) default NULL,
+ title_bg_color varchar(6) default NULL,
+ tab_bg_color varchar(6) default NULL,
+ tab_font_color varchar(6) default NULL,
+ selected_tab_bg_color varchar(6) default NULL,
+ selected_tab_font_color varchar(6) default NULL,
+ title_font_color varchar(6) default NULL,
+ PRIMARY KEY (color_scheme_id)
+);
+
+INSERT INTO color_schemes VALUES (1,'default','ffffff','000000','111111','444444','ffffff','000000','ffffff','f0f0f0','000000','ffffff','c0c0c0','000000','000000');
+INSERT INTO color_schemes VALUES (2,'blugram','909090','000000','111111','333333','eef0f0','000000','cce0e0','dde0cc','ccd0bb','000000','bbd0d0','000000','000000');
+INSERT INTO color_schemes VALUES (3,'dow','444444','000000','000055','000033','cccccc','000000','aaaaaa','2222aa','2222aa','ffffff','cccccc','000000','ffffff');
+INSERT INTO color_schemes VALUES (4,'hoenig','FFEFD6','5C1F00','330000','330000','FFFBF5','000000','FFF7EB','FFE7C2','FFE7C2','5C1F00','FFD799','000000','993300');
+INSERT INTO color_schemes VALUES (5,'forest','336633','000000','000000','000000','99CC99','000000','669966','663300','663300','E0E0E0','996633','FFFFFF','99CC99');
+INSERT INTO color_schemes VALUES (6,'black','000000','FFFFFF','FFFFFF','FFFFFF','000000','FFFFFF','000000','666666','666666','FFFFFF','999999','FFFFFF','FFFFFF');
+INSERT INTO color_schemes VALUES (7,'beach','646D7E','000000','000000','000000','F9EEE2','000000','9AADC7','C6DEFF','617C58','D0D0D0','8BB381','000000','646D7E');
+
+--
+-- Table structure for table 'people'
+--
+
+CREATE TABLE people (
+ person_id SERIAL,
+ first_name varchar(32) default NULL,
+ last_name varchar(32) default NULL,
+ middle_name varchar(32) default NULL,
+ called varchar(16) default NULL,
+ gender char(1) default NULL,
+ dob date default NULL,
+ dod date default NULL,
+ home_id int default NULL,
+ work_id int default NULL,
+ father_id int default NULL,
+ mother_id int default NULL,
+ spouse_id int default NULL,
+ notes varchar(255) default NULL,
+ PRIMARY KEY (person_id)
+);
+
+CREATE INDEX person_last_name ON people(last_name);
+CREATE INDEX person_first_name ON people(first_name);
+
+INSERT INTO people VALUES (1,'Unknown','Person',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+
+--
+-- Table structure for table 'photo_albums'
+--
+
+CREATE TABLE photo_albums (
+ photo_id int NOT NULL default '0',
+ album_id int NOT NULL default '0',
+ PRIMARY KEY (photo_id,album_id)
+);
+
+--
+-- Table structure for table 'photo_categories'
+--
+
+CREATE TABLE photo_categories (
+ photo_id int NOT NULL default '0',
+ category_id int NOT NULL default '0',
+ PRIMARY KEY (photo_id,category_id)
+);
+
+--
+-- Table structure for table 'photo_people'
+--
+
+CREATE TABLE photo_people (
+ photo_id int NOT NULL default '0',
+ person_id int NOT NULL default '0',
+ position int default NULL,
+ PRIMARY KEY (photo_id,person_id)
+);
+
+--
+-- Table structure for table 'photos'
+--
+
+CREATE TABLE photos (
+ photo_id SERIAL,
+ name varchar(128) default NULL,
+ path varchar(255) default NULL,
+ width int default NULL,
+ height int default NULL,
+ size int default NULL,
+ title varchar(64) default NULL,
+ photographer_id int default NULL,
+ location_id int default NULL,
+ view varchar(64) default NULL,
+ rating smallint default NULL,
+ description text,
+ date varchar(10) default NULL,
+ time varchar(8) default NULL,
+ camera_make varchar(32) default NULL,
+ camera_model varchar(32) default NULL,
+ flash_used char(1) default NULL,
+ focal_length varchar(64) default NULL,
+ exposure varchar(64) default NULL,
+ compression varchar(64) default NULL,
+ aperture varchar(16) default NULL,
+ level smallint NOT NULL default '1',
+ iso_equiv varchar(8) default NULL,
+ metering_mode varchar(16) default NULL,
+ focus_dist varchar(16) default NULL,
+ ccd_width varchar(16) default NULL,
+ comment varchar(128) default NULL,
+ timestamp timestamp NOT NULL default now(),
+ PRIMARY KEY (photo_id)
+);
+
+CREATE INDEX photo_photog_id ON photos (photographer_id);
+CREATE INDEX photo_loc_id ON photos (location_id);
+CREATE INDEX photo_rating ON photos (rating);
+CREATE INDEX photo_level ON photos (level);
+
+--
+-- Table structure for table 'places'
+--
+
+CREATE TABLE places (
+ place_id SERIAL,
+ contact_type int NOT NULL default '0',
+ title varchar(64) NOT NULL default '',
+ address varchar(64) default NULL,
+ address2 varchar(64) default NULL,
+ city varchar(32) default NULL,
+ state varchar(32) default NULL,
+ zip varchar(10) default NULL,
+ country varchar(32) default NULL,
+ notes varchar(255) default NULL,
+ PRIMARY KEY (place_id)
+);
+
+CREATE INDEX place_city ON places (city);
+CREATE INDEX place_title ON places (title);
+
+--
+-- Table structure for table 'prefs'
+--
+
+CREATE TABLE prefs (
+ user_id int NOT NULL default '0',
+ show_breadcrumbs char(1) NOT NULL default '1',
+ num_breadcrumbs smallint NOT NULL default '8',
+ num_rows smallint NOT NULL default '3',
+ num_cols smallint NOT NULL default '4',
+ max_pager_size smallint NOT NULL default '10',
+ random_photo_min_rating smallint NOT NULL default '0',
+ reports_top_n smallint NOT NULL default '5',
+ color_scheme_id int NOT NULL default '1',
+ slideshow_time smallint NOT NULL default '5',
+ language char(2) default NULL,
+ recent_photo_days smallint NOT NULL default '7',
+ auto_edit char(1) NOT NULL default '0',
+ camera_info char(1) NOT NULL default '1',
+ desc_thumbnails char(1) NOT NULL default '0',
+ PRIMARY KEY (user_id)
+);
+
+INSERT INTO prefs VALUES (1,'1',8,3,4,10,0,5,1,5,NULL,7,'0','1','0');
+
+--
+-- Table structure for table 'users'
+--
+
+CREATE TABLE users (
+ user_id SERIAL,
+ person_id int NOT NULL default '0',
+ user_class char(1) NOT NULL default '1',
+ user_name varchar(16) NOT NULL default '',
+ password bytea default NULL,
+ browse_people char(1) NOT NULL default '0',
+ browse_places char(1) NOT NULL default '0',
+ detailed_people char(1) NOT NULL default '0',
+ detailed_places char(1) NOT NULL default '0',
+ import char(1) NOT NULL default '0',
+ lightbox_id int default NULL,
+ PRIMARY KEY (user_id)
+);
+
+INSERT INTO users VALUES (1,1,'0','admin',digest('admin','md5'),'1','1','1','1','1',NULL);
+
+grant select, insert, update, delete on album_permissions,
+ albums,
+ albums_album_id_seq,
+ categories,
+ categories_category_id_seq,
+ color_schemes,
+ color_schemes_color_scheme_id_seq,
+ people,
+ people_person_id_seq,
+ photo_albums,
+ photo_categories,
+ photo_people,
+ photos,
+ photos_photo_id_seq,
+ places,
+ places_place_id_seq,
+ prefs,
+ users,
+ users_user_id_seq
+ to zoph_rw;
+
+grant all on album_permissions,
+ albums,
+ albums_album_id_seq,
+ categories,
+ categories_category_id_seq,
+ color_schemes,
+ color_schemes_color_scheme_id_seq,
+ people,
+ people_person_id_seq,
+ photo_albums,
+ photo_categories,
+ photo_people,
+ photos,
+ photos_photo_id_seq,
+ places,
+ places_place_id_seq,
+ prefs,
+ users,
+ users_user_id_seq
+ to zoph_admin;
diff -Nru zoph-0.3.3/sql/zoph.sql zoph.new/sql/zoph.sql
--- zoph-0.3.3/sql/zoph.sql 2002-12-13 23:28:50.000000000 +0000
+++ zoph.new/sql/zoph.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,243 +0,0 @@
--- MySQL dump 8.21
---
--- Host: localhost Database: zoph
----------------------------------------------------------
--- Server version 3.23.49-log
-
---
--- Table structure for table 'album_permissions'
---
-
-CREATE TABLE album_permissions (
- user_id int(11) NOT NULL default '0',
- album_id int(11) NOT NULL default '0',
- access_level tinyint(4) NOT NULL default '0',
- writable char(1) NOT NULL default '0',
- PRIMARY KEY (user_id,album_id),
- KEY ap_access_level (access_level)
-) TYPE=MyISAM;
-
---
--- Table structure for table 'albums'
---
-
-CREATE TABLE albums (
- album_id int(11) NOT NULL auto_increment,
- parent_album_id int(11) NOT NULL default '0',
- album varchar(32) NOT NULL default '',
- album_description varchar(255) default NULL,
- PRIMARY KEY (album_id),
- KEY album_parent_id (parent_album_id)
-) TYPE=MyISAM;
-
-INSERT INTO albums VALUES (1,0,'Album Root',NULL);
-
---
--- Table structure for table 'categories'
---
-
-CREATE TABLE categories (
- category_id int(11) NOT NULL auto_increment,
- parent_category_id int(11) NOT NULL default '0',
- category varchar(32) NOT NULL default '',
- category_description varchar(255) default NULL,
- PRIMARY KEY (category_id),
- KEY cat_parent_id (parent_category_id)
-) TYPE=MyISAM;
-
-INSERT INTO categories VALUES (1,0,'Category Root',NULL);
-
---
--- Table structure for table 'color_schemes'
---
-
-CREATE TABLE color_schemes (
- color_scheme_id int(11) NOT NULL auto_increment,
- name varchar(64) NOT NULL default '',
- page_bg_color varchar(6) default NULL,
- text_color varchar(6) default NULL,
- link_color varchar(6) default NULL,
- vlink_color varchar(6) default NULL,
- table_bg_color varchar(6) default NULL,
- table_border_color varchar(6) default NULL,
- breadcrumb_bg_color varchar(6) default NULL,
- title_bg_color varchar(6) default NULL,
- tab_bg_color varchar(6) default NULL,
- tab_font_color varchar(6) default NULL,
- selected_tab_bg_color varchar(6) default NULL,
- selected_tab_font_color varchar(6) default NULL,
- title_font_color varchar(6) default NULL,
- PRIMARY KEY (color_scheme_id)
-) TYPE=MyISAM;
-
-INSERT INTO color_schemes VALUES (1,'default','ffffff','000000','111111','444444','ffffff','000000','ffffff','f0f0f0','000000','ffffff','c0c0c0','000000','000000');
-INSERT INTO color_schemes VALUES (2,'blugram','909090','000000','111111','333333','eef0f0','000000','cce0e0','dde0cc','ccd0bb','000000','bbd0d0','000000','000000');
-INSERT INTO color_schemes VALUES (3,'dow','444444','000000','000055','000033','cccccc','000000','aaaaaa','2222aa','2222aa','ffffff','cccccc','000000','ffffff');
-INSERT INTO color_schemes VALUES (4,'hoenig','FFEFD6','5C1F00','330000','330000','FFFBF5','000000','FFF7EB','FFE7C2','FFE7C2','5C1F00','FFD799','000000','993300');
-INSERT INTO color_schemes VALUES (5,'forest','336633','000000','000000','000000','99CC99','000000','669966','663300','663300','E0E0E0','996633','FFFFFF','99CC99');
-INSERT INTO color_schemes VALUES (6,'black','000000','FFFFFF','FFFFFF','FFFFFF','000000','FFFFFF','000000','666666','666666','FFFFFF','999999','FFFFFF','FFFFFF');
-INSERT INTO color_schemes VALUES (7,'beach','646D7E','000000','000000','000000','F9EEE2','000000','9AADC7','C6DEFF','617C58','D0D0D0','8BB381','000000','646D7E');
-
---
--- Table structure for table 'people'
---
-
-CREATE TABLE people (
- person_id int(11) NOT NULL auto_increment,
- first_name varchar(32) default NULL,
- last_name varchar(32) default NULL,
- middle_name varchar(32) default NULL,
- called varchar(16) default NULL,
- gender char(1) default NULL,
- dob date default NULL,
- dod date default NULL,
- home_id int(11) default NULL,
- work_id int(11) default NULL,
- father_id int(11) default NULL,
- mother_id int(11) default NULL,
- spouse_id int(11) default NULL,
- notes varchar(255) default NULL,
- PRIMARY KEY (person_id),
- KEY person_last_name (last_name(10)),
- KEY person_first_name (first_name(10))
-) TYPE=MyISAM;
-
-INSERT INTO people VALUES (1,'Unknown','Person',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-
---
--- Table structure for table 'photo_albums'
---
-
-CREATE TABLE photo_albums (
- photo_id int(11) NOT NULL default '0',
- album_id int(11) NOT NULL default '0',
- PRIMARY KEY (photo_id,album_id)
-) TYPE=MyISAM;
-
---
--- Table structure for table 'photo_categories'
---
-
-CREATE TABLE photo_categories (
- photo_id int(11) NOT NULL default '0',
- category_id int(11) NOT NULL default '0',
- PRIMARY KEY (photo_id,category_id)
-) TYPE=MyISAM;
-
---
--- Table structure for table 'photo_people'
---
-
-CREATE TABLE photo_people (
- photo_id int(11) NOT NULL default '0',
- person_id int(11) NOT NULL default '0',
- position int(11) default NULL,
- PRIMARY KEY (photo_id,person_id)
-) TYPE=MyISAM;
-
---
--- Table structure for table 'photos'
---
-
-CREATE TABLE photos (
- photo_id int(11) NOT NULL auto_increment,
- name varchar(128) default NULL,
- path varchar(255) default NULL,
- width int(11) default NULL,
- height int(11) default NULL,
- size int(11) default NULL,
- title varchar(64) default NULL,
- photographer_id int(11) default NULL,
- location_id int(11) default NULL,
- view varchar(64) default NULL,
- rating tinyint(4) default NULL,
- description blob,
- date varchar(10) default NULL,
- time varchar(8) default NULL,
- camera_make varchar(32) default NULL,
- camera_model varchar(32) default NULL,
- flash_used char(1) default NULL,
- focal_length varchar(64) default NULL,
- exposure varchar(64) default NULL,
- compression varchar(64) default NULL,
- aperture varchar(16) default NULL,
- level tinyint(4) NOT NULL default '1',
- iso_equiv varchar(8) default NULL,
- metering_mode varchar(16) default NULL,
- focus_dist varchar(16) default NULL,
- ccd_width varchar(16) default NULL,
- comment varchar(128) default NULL,
- timestamp timestamp(14) NOT NULL,
- PRIMARY KEY (photo_id),
- KEY photo_photog_id (photographer_id),
- KEY photo_loc_id (location_id),
- KEY photo_rating (rating),
- KEY photo_level (level)
-) TYPE=MyISAM;
-
---
--- Table structure for table 'places'
---
-
-CREATE TABLE places (
- place_id int(11) NOT NULL auto_increment,
- contact_type int(11) NOT NULL default '0',
- title varchar(64) NOT NULL default '',
- address varchar(64) default NULL,
- address2 varchar(64) default NULL,
- city varchar(32) default NULL,
- state varchar(32) default NULL,
- zip varchar(10) default NULL,
- country varchar(32) default NULL,
- notes varchar(255) default NULL,
- PRIMARY KEY (place_id),
- KEY place_city (city(10)),
- KEY place_title (title(10))
-) TYPE=MyISAM;
-
---
--- Table structure for table 'prefs'
---
-
-CREATE TABLE prefs (
- user_id int(11) NOT NULL default '0',
- show_breadcrumbs char(1) NOT NULL default '1',
- num_breadcrumbs smallint(5) unsigned NOT NULL default '8',
- num_rows tinyint(3) unsigned NOT NULL default '3',
- num_cols tinyint(3) unsigned NOT NULL default '4',
- max_pager_size tinyint(3) unsigned NOT NULL default '10',
- random_photo_min_rating tinyint(3) unsigned NOT NULL default '0',
- reports_top_n smallint(5) unsigned NOT NULL default '5',
- color_scheme_id int(11) NOT NULL default '1',
- slideshow_time smallint(6) NOT NULL default '5',
- language char(2) default NULL,
- recent_photo_days smallint(6) NOT NULL default '7',
- auto_edit char(1) NOT NULL default '0',
- camera_info char(1) NOT NULL default '1',
- desc_thumbnails char(1) NOT NULL default '0',
- PRIMARY KEY (user_id)
-) TYPE=MyISAM;
-
-INSERT INTO prefs VALUES (1,'1',8,3,4,10,0,5,1,5,NULL,7,'0','1','0');
-
---
--- Table structure for table 'users'
---
-
-CREATE TABLE users (
- user_id int(11) NOT NULL auto_increment,
- person_id int(11) NOT NULL default '0',
- user_class char(1) NOT NULL default '1',
- user_name varchar(16) NOT NULL default '',
- password varchar(32) default NULL,
- browse_people char(1) NOT NULL default '0',
- browse_places char(1) NOT NULL default '0',
- detailed_people char(1) NOT NULL default '0',
- detailed_places char(1) NOT NULL default '0',
- import char(1) NOT NULL default '0',
- lightbox_id int(11) default NULL,
- PRIMARY KEY (user_id)
-) TYPE=MyISAM;
-
-INSERT INTO users VALUES (1,1,'0','admin',password('admin'),'1','1','1','1','1',NULL);
-
diff -Nru zoph-0.3.3/sql/zoph_update-0.2.1.sql zoph.new/sql/zoph_update-0.2.1.sql
--- zoph-0.3.3/sql/zoph_update-0.2.1.sql 2002-06-22 01:43:45.000000000 +0100
+++ zoph.new/sql/zoph_update-0.2.1.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,27 +0,0 @@
-#
-# focal length was not long enough for some cameras
-#
-alter table photos modify focal_length varchar(64);
-
-#
-# let these descriptions be larger too
-#
-alter table albums modify album_description varchar(255);
-alter table categories modify category_description varchar(255);
-
-#
-# a couple new photo fields
-#
-alter table photos add focus_dist varchar(16);
-alter table photos add ccd_width varchar(16);
-alter table photos add comment varchar(128);
-
-#
-# forgot to make this not null
-#
-alter table users modify detailed_people char(1) not null default '0';
-
-#
-# change state from char(2) to varchar(32) so it can be more versatile
-#
-alter table places modify state varchar(32);
diff -Nru zoph-0.3.3/sql/zoph_update-0.3.1.sql zoph.new/sql/zoph_update-0.3.1.sql
--- zoph-0.3.3/sql/zoph_update-0.3.1.sql 2002-09-30 17:15:41.000000000 +0100
+++ zoph.new/sql/zoph_update-0.3.1.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-#
-# Zoph 0.3 -> 0.3.1 update
-# 30 Sep 2002
-#
-
-#
-# create a pref for an always edit mode
-#
-alter table prefs add auto_edit char(1) not null default '0';
-
-#
-# create a pref for whether to display camera info
-#
-alter table prefs add camera_info char(1) not null default '1';
-
-#
-# create a field to define a lightbox for a user
-#
-alter table users add lightbox_id int;
-
-#
-# These tables were accidentally included in zoph.sql 0.3
-#
-drop table contact_types;
-drop table email_addresses;
-drop table links;
-drop table people_email_addresses;
-drop table people_phone_numbers;
-drop table people_places;
-drop table phone_numbers;
-drop table photo_links;
-drop table places_phone_numbers;
-drop table related_photos;
diff -Nru zoph-0.3.3/sql/zoph_update-0.3.2.sql zoph.new/sql/zoph_update-0.3.2.sql
--- zoph-0.3.3/sql/zoph_update-0.3.2.sql 2002-10-17 18:46:09.000000000 +0100
+++ zoph.new/sql/zoph_update-0.3.2.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-#
-# Zoph 0.3.1 -> 0.3.2 update
-# 17 Oct 2002
-#
-
-#
-# four new color schemes if you want them
-#
-INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('hoenig','FFEFD6','5C1F00','330000','330000','FFFBF5','000000','FFF7EB','FFE7C2','FFE7C2','5C1F00','FFD799','000000','993300');
-INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('forest','336633','000000','000000','000000','99CC99','000000','669966','663300','663300','E0E0E0','996633','FFFFFF','99CC99');
-INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('black','000000','FFFFFF','FFFFFF','FFFFFF','000000','FFFFFF','000000','666666','666666','FFFFFF','999999','FFFFFF','FFFFFF');
-INSERT INTO color_schemes (name, page_bg_color, text_color, link_color, vlink_color, table_bg_color, table_border_color, breadcrumb_bg_color, title_bg_color, tab_bg_color, tab_font_color, selected_tab_bg_color, selected_tab_font_color, title_font_color) VALUES ('beach','646D7E','000000','000000','000000','F9EEE2','000000','9AADC7','C6DEFF','617C58','D0D0D0','8BB381','000000','646D7E');
-
diff -Nru zoph-0.3.3/sql/zoph_update-0.3.3.sql zoph.new/sql/zoph_update-0.3.3.sql
--- zoph-0.3.3/sql/zoph_update-0.3.3.sql 2002-11-11 17:49:21.000000000 +0000
+++ zoph.new/sql/zoph_update-0.3.3.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,9 +0,0 @@
-#
-# Zoph 0.3.2 -> 0.3.3 update
-# 18 Nov 2002
-#
-
-#
-# create a pref for displaying descriptions under thumbnails
-#
-alter table prefs add desc_thumbnails char(1) not null default '0';
diff -Nru zoph-0.3.3/sql/zoph_update-0.3.sql zoph.new/sql/zoph_update-0.3.sql
--- zoph-0.3.3/sql/zoph_update-0.3.sql 2002-09-25 01:03:58.000000000 +0100
+++ zoph.new/sql/zoph_update-0.3.sql 1970-01-01 01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-#
-# Zoph 0.2.1 -> 0.3 update
-# 20 Sep 2002
-#
-
-#
-# increase size of name and path photo fields
-#
-alter table photos modify name varchar(128);
-alter table photos modify path varchar(255);
-
-#
-# create timestamp field
-#
-alter table photos add timestamp timestamp(14);
-
-#
-# create a language pref field
-#
-alter table prefs add language char(2);
-
-#
-# create a field for the number of days used by the view recent links
-#
-alter table prefs add recent_photo_days smallint not null default 7;
-
-#
-# create a import permission field
-#
-alter table users add import char(1) not null default '0';
|