File: ctable.php

package info (click to toggle)
owl-dms 0.90-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 17,292 kB
  • ctags: 10,919
  • sloc: php: 48,457; sql: 3,603; sh: 363; perl: 204; makefile: 73
file content (1204 lines) | stat: -rw-r--r-- 58,112 bytes parent folder | download
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
<html>
<head>
<title>OWL Database - Load Script</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000066" vlink="#666666" alink="#000066">
<?php
// THIS SCRIPT will allow you to create the Owl mysql tables in the database of your choice.

// you can call this script with:
//
// http://yourwebserver.com/intranet/admin/tools/ctable.php?action=clean
//
// This will Drop the existing database defined bellow in database_instance
// and recreate a default Owl Database.
//
// 

$database_instance = "intranet";
$table_prefix = "";

//$dblink = mysql_connect("server.hosting.your.database","username","password") or die ("could not connect");
$dblink = mysql_connect("localhost","root","") or die ("could not connect");

if ($action == "clean")
{
   print("<h2>Droping The Database....</h2>");
   $select = "DROP DATABASE $database_instance";
   $result = mysql_db_query($database_instance,$select,$dblink); 

   print("<h2>Creating The Database....</h2>");
   mysql_create_db($database_instance);
}

if ($action == "delete")
{
print("<h3>Droping table active_sessions....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."active_sessions;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE active_sessions");
print("<h3>Droping table advanced_acl....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."advanced_acl;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE advanced_acl");
print("<h3>Droping table comments....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."comments;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE comments");
print("<h3>Droping table docfields....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."docfields;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE docfields");
print("<h3>Droping table docfieldslabel....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."docfieldslabel;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE docfieldslabel");
print("<h3>Droping table docfieldvalues....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."docfieldvalues;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE docfieldvalues");
print("<h3>Droping table doctype....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."doctype;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE doctype");
print("<h3>Droping table favorites....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."favorites;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE favorites");
print("<h3>Droping table filedata....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."filedata;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE filedata");
print("<h3>Droping table files....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."files;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE files");
print("<h3>Droping table folders....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."folders;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE folders");
print("<h3>Droping table groups....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."groups;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE groups");
print("<h3>Droping table html....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."html;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE html");
print("<h3>Droping table membergroup....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."membergroup;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE membergroup");
print("<h3>Droping table mimes....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."mimes;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE mimes");
print("<h3>Droping table metakeywords....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."metakeywords;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE metakeywords");
print("<h3>Droping table monitored_file....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."monitored_file;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE monitored_file");
print("<h3>Droping table monitored_folder....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."monitored_folder;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE monitored_folder");
print("<h3>Droping table news....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."news;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE news");
print("<h3>Droping table owl_log....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."owl_log;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE owl_log");
print("<h3>Droping table prefs....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."prefs;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE prefs");
print("<h3>Droping table searchidx....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."searchidx;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE searchidx");
print("<h3>Droping table trackoldpasswd....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."trackoldpasswd;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE trackoldpasswd");
print("<h3>Droping table users....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."users;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE users");
print("<h3>Droping table wordidx....</h3>");
   $select ="DROP TABLE IF EXISTS " . $table_prefix ."wordidx;";
   $result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not DROP TABLE wordidx");
}





// -- MySQL dump 8.22
// --
// -- Host: localhost    Database: intranet
// ---------------------------------------------------------
// -- Server version	3.23.56-log

print("<h2>Start....</h2>");

// --
// -- Table structure for table 'active_sessions'
// --

print("<h3>Creating table active_sessions....</h3>");
$select = "CREATE TABLE " . $table_prefix ."active_sessions (
  sessid char(32) NOT NULL default '',
  usid char(25) default NULL,
  lastused int(10) unsigned default NULL,
  ip char(16) default NULL,
  currentdb int(4) default NULL,
  PRIMARY KEY  (sessid)
);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE active_sessions");



print("<h3>Creating table advanced_acl....</h3>");
$select = "CREATE TABLE " . $table_prefix ."CREATE TABLE advanced_acl (
  group_id int(4) default NULL,
  user_id int(4) default NULL,
  file_id int(4) default NULL,
  folder_id int(4) default NULL,
  owlread int(4) default '0',
  owlwrite int(4) default '0',
  owlviewlog int(4) default '0',
  owldelete int(4) default '0',
  owlcopy int(4) default '0',
  owlmove int(4) default '0',
  owlproperties int(4) default '0',
  owlupdate int(4) default '0',
  owlcomment int(4) default '0',
  owlcheckin int(4) default '0',
  owlemail int(4) default '0',
  owlrelsearch int(4) default '0',
  owlsetacl int(4) default '0',
  owlmonitor int(4) default '0'
);";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE advanced_acl");


$select = "INSERT INTO " . $table_prefix ."advanced_acl VALUES (NULL,0,NULL,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE advanced_acl");

// --
// -- Table structure for table 'comment'
// --

print("<h3>Creating table comments....</h3>");
$select = "CREATE TABLE " . $table_prefix ."comments (
  id int(4) NOT NULL auto_increment,
  fid int(4) NOT NULL default '0',
  userid int(4) default NULL,
  comment_date datetime NOT NULL default '0000-00-00 00:00:00',
  comments text NOT NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE comment");

//--
//-- Table structure for table 'docfields'
//--

print("<h3>Creating table docfields....</h3>");
$select = "CREATE TABLE " . $table_prefix ."docfields (
  id int(4) NOT NULL auto_increment,
  doc_type_id int(4) NOT NULL default '0',
  field_name char(80) NOT NULL default '',
  field_position int(4) NOT NULL default '0',
  field_type char(80) NOT NULL default '',
  field_values char(80) NOT NULL default '',
  field_size bigint(20) NOT NULL default '0',
  searchable int(4) NOT NULL default '0',
  show_desc int(4) NOT NULL default '0',
  required int(4) NOT NULL default '0',
  show_in_list int(4) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE docfields");

//--
//-- Table structure for table 'docfieldslabel'
//--

print("<h3>Creating table docfieldslabel....</h3>");
$select = "CREATE TABLE " . $table_prefix ."docfieldslabel (
  doc_field_id int(4) NOT NULL default '0',
  field_label char(80) NOT NULL default '',
  locale char(80) NOT NULL default ''
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE docfieldslabel");

//--
//-- Table structure for table 'docfieldvalues'
//--

print("<h3>Creating table docfieldvalues....</h3>");
$select = "CREATE TABLE " . $table_prefix ."docfieldvalues (
  id int(4) NOT NULL auto_increment,
  file_id int(4) NOT NULL default '0',
  field_name char(80) NOT NULL default '',
  field_value char(80) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE docfieldvalues");

//--
//-- Table structure for table 'doctype'
//--

print("<h3>Creating table doctype....</h3>");
$select = "CREATE TABLE " . $table_prefix ."doctype (
  doc_type_id int(4) NOT NULL auto_increment,
  doc_type_name char(255) NOT NULL default '',
  PRIMARY KEY  (doc_type_id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE doctype");

//--
//-- Inserting data for table 'doctype'
//--

$select = "INSERT INTO " . $table_prefix ."doctype VALUES (1,'Default');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE doctype");

// --
// -- Table structure for table 'favorites'
// --

print("<h3>Creating table favorites....</h3>");
$select = "CREATE TABLE " . $table_prefix ."favorites (
  userid int(4) NOT NULL default '0',
  folder_id int(4) NOT NULL default '1'
);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE favorites");


// --
// -- Table structure for table 'filedata'
// --

print("<h3>Creating table filedata....</h3>");
$select = "CREATE TABLE " . $table_prefix ."filedata (
  id int(4) NOT NULL default '0',
  compressed int(4) NOT NULL default '0',
  data longblob,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE filedata");

// --
// -- Table structure for table 'files'
// --

print("<h3>Creating table files....</h3>");
$select = "CREATE TABLE " . $table_prefix ."files (
  id int(4) NOT NULL auto_increment,
  name varchar(80) NOT NULL default '',
  filename varchar(255) NOT NULL default '',
  f_size bigint(20) NOT NULL default '0',
  creatorid int(4) NOT NULL default '0',
  parent int(4) NOT NULL default '0',
  created datetime NOT NULL default '0000-00-00 00:00:00',
  description text NOT NULL,
  metadata text NOT NULL,
  security int(4) NOT NULL default '0',
  groupid int(4) NOT NULL default '0',
  smodified datetime NOT NULL default '0000-00-00 00:00:00',
  checked_out int(4) NOT NULL default '0',
  major_revision int(4) NOT NULL default '0',
  minor_revision int(4) NOT NULL default '1',
  url int(4) NOT NULL default '0',
  password varchar(50) NOT NULL default '',
  doctype int(4) default NULL,
  updatorid int(4) default NULL,
  linkedto int(4) default NULL,
  approved int(4) default NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY fileid_index (id),
  KEY parentid_index (parent)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE files");

// --
// -- Data for table 'files'
// --

$select = "INSERT INTO " . $table_prefix ."files VALUES (1,'Test File','test.txt',36,1,1,'2000-12-27 05:17:00','','',0,0,'2000-12-27 05:17:00',0,0,1,0,'',1,0,0,1);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE files");

// --
// -- Table structure for table 'folders'
// --

print("<h3>Creating table folders....</h3>");
$select = "CREATE TABLE " . $table_prefix ."folders (
  id int(4) NOT NULL auto_increment,
  name varchar(255) NOT NULL default '',
  parent int(4) NOT NULL default '0',
  description text NOT NULL,
  security varchar(5) NOT NULL default '',
  groupid int(4) NOT NULL default '0',
  creatorid int(4) NOT NULL default '0',
  password varchar(50) NOT NULL default '',
  smodified datetime default NULL,
  PRIMARY KEY  (id),
  UNIQUE KEY folderid_index (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE  folders"); 

// --
// -- Data for table 'folders'
// --

$select = "INSERT INTO " . $table_prefix ."folders VALUES (1,'Documents',0,'','51',0,1,'','2001-11-25 08:11:50');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE folders");

// --
// -- Table structure for table 'groups'
// --

print("<h3>Creating table groups....</h3>");
$select = "CREATE TABLE " . $table_prefix ."groups (
  id int(4) NOT NULL auto_increment,
  name char(30) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE groups");

// --
// -- Data for table 'groups'
// --

$select = "INSERT INTO " . $table_prefix ."groups VALUES (0, 'Administrators');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE groups");
$select = "UPDATE " . $table_prefix ."groups SET id = 0 WHERE name = 'Administrators';";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not UPDATE TABLE groups");
$select = "INSERT INTO " . $table_prefix ."groups VALUES (1, 'Anonymous');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT groups");
$select = "INSERT INTO " . $table_prefix ."groups VALUES (2, 'File Admin');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT groups");

// --
// -- Table structure for table 'html'
// --

print("<h3>Creating table html....</h3>");
$select = "CREATE TABLE " . $table_prefix ."html (
  id int(4) NOT NULL auto_increment,
  table_expand_width char(15) default NULL,
  table_collapse_width char(15) default NULL,
  body_background char(255) default NULL,
  owl_logo char(255) default NULL,
  body_textcolor char(15) default NULL,
  body_link char(15) default NULL,
  body_vlink char(15) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
                                                                                                                                                                                             

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE html");

// --
// -- Data for table 'html'
// --
$select = "INSERT INTO " . $table_prefix ."html VALUES (1,'90%','50%','','owl.gif','#000000','#000000','#000000');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE html");

// --
// -- Table structure for table 'membergroup'
// --

print("<h3>Creating table membergroup....</h3>");
$select = "CREATE TABLE " . $table_prefix ."membergroup (
  userid int(4) NOT NULL default '0',
  groupid int(4) default NULL,
  groupadmin int(4) default NULL
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE membergroup");

//--
//-- Table structure for table 'metakeywords'
//--

print("<h3>Creating table metakeywords....</h3>");

$select = "CREATE TABLE " . $table_prefix ."metakeywords (
  keyword_id int(4) NOT NULL auto_increment,
  keyword_text char(255) NOT NULL default '',
  PRIMARY KEY  (keyword_id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE metakeywords");


// --
// -- Table structure for table 'mimes'
// --

print("<h3>Creating table mimes....</h3>");
$select = "CREATE TABLE " . $table_prefix ."mimes (
  filetype char(10) NOT NULL default '',
  mimetype char(50) NOT NULL default '',
  PRIMARY KEY  (filetype)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE mimes");

// --
// -- Data for table 'mimes'
// --

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ai', 'application/postscript');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('aif', 'audio/x-aiff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('aifc', 'audio/x-aiff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('aiff', 'audio/x-aiff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('asc', 'text/plain');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('au', 'audio/basic');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('avi', 'video/x-msvideo');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('bcpio', 'application/x-bcpio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('bin', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('bmp', 'image/bmp');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('cdf', 'application/x-netcdf');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('class', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('cpio', 'application/x-cpio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('cpt', 'application/mac-compactpro');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('csh', 'application/x-csh');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('css', 'text/css');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('dcr', 'application/x-director');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('dir', 'application/x-director');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('dms', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('doc', 'application/msword');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('dvi', 'application/x-dvi');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('dxr', 'application/x-director');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('eps', 'application/postscript');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('etx', 'text/x-setext');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('exe', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ez', 'application/andrew-inset');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('gif', 'image/gif');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('gtar', 'application/x-gtar');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('hdf', 'application/x-hdf');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('hqx', 'application/mac-binhex40');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('htm', 'text/html');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('html', 'text/html');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ice', 'x-conference/x-cooltalk');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ief', 'image/ief');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('iges', 'model/iges');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('igs', 'model/iges');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('jpe', 'image/jpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('jpeg', 'image/jpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('jpg', 'image/jpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('js', 'application/x-javascript');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('kar', 'audio/midi');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('latex', 'application/x-latex');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('lha', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('lzh', 'application/octet-stream');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('man', 'application/x-troff-man');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('me', 'application/x-troff-me');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mesh', 'model/mesh');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mid', 'audio/midi');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('midi', 'audio/midi');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mif', 'application/vnd.mif');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mov', 'video/quicktime');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('movie', 'video/x-sgi-movie');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mp2', 'audio/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mp3', 'audio/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mpe', 'video/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mpeg', 'video/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mpg', 'video/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('mpga', 'audio/mpeg');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ms', 'application/x-troff-ms');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('msh', 'model/mesh');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('nc', 'application/x-netcdf');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('oda', 'application/oda');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pbm', 'image/x-portable-bitmap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pdb', 'chemical/x-pdb');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pdf', 'application/pdf');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pgm', 'image/x-portable-graymap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pgn', 'application/x-chess-pgn');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('png', 'image/png');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('pnm', 'image/x-portable-anymap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ppm', 'image/x-portable-pixmap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ppt', 'application/vnd.ms-powerpoint');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ps', 'application/postscript');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('qt', 'video/quicktime');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ra', 'audio/x-realaudio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ram', 'audio/x-pn-realaudio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ras', 'image/x-cmu-raster');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('rgb', 'image/x-rgb');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('rm', 'audio/x-pn-realaudio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('roff', 'application/x-troff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('rpm', 'audio/x-pn-realaudio-plugin');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('rtf', 'text/rtf');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('rtx', 'text/richtext');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sgm', 'text/sgml');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sgml', 'text/sgml');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sh', 'application/x-sh');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('shar', 'application/x-shar');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('silo', 'model/mesh');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sit', 'application/x-stuffit');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('skd', 'application/x-koan');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('skm', 'application/x-koan');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('skp', 'application/x-koan');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('skt', 'application/x-koan');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('smi', 'application/smil');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('smil', 'application/smil');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('snd', 'audio/basic');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('spl', 'application/x-futuresplash');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('src', 'application/x-wais-source');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sv4cpio', 'application/x-sv4cpio');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sv4crc', 'application/x-sv4crc');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('swf', 'application/x-shockwave-flash');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('t', 'application/x-troff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tar', 'application/x-tar');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tcl', 'application/x-tcl');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tex', 'application/x-tex');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('texi', 'application/x-texinfo');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('texinfo', 'application/x-texinfo');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tif', 'image/tiff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tiff', 'image/tiff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tr', 'application/x-troff');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tsv', 'text/tab-separated-values');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('txt', 'text/plain');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('ustar', 'application/x-ustar');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('vcd', 'application/x-cdlink');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('vrml', 'model/vrml');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('wav', 'audio/x-wav');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('wrl', 'model/vrml');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xbm', 'image/x-xbitmap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xls', 'application/vnd.ms-excel');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xml', 'text/xml');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xpm', 'image/x-xpixmap');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xwd', 'image/x-xwindowdump');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('xyz', 'chemical/x-pdb');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('zip', 'application/zip');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('gz', 'application/x-gzip');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('tgz', 'application/x-gzip');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxw','application/vnd.sun.xml.writer');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('stw','application/vnd.sun.xml.writer.template');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxg','application/vnd.sun.xml.writer.global');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxc','application/vnd.sun.xml.calc');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('stc','application/vnd.sun.xml.calc.template');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxi','application/vnd.sun.xml.impress');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sti','application/vnd.sun.xml.impress.template');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxd','application/vnd.sun.xml.draw');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('std','application/vnd.sun.xml.draw.template');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");

$select = "INSERT INTO " . $table_prefix ."mimes VALUES ('sxm','application/vnd.sun.xml.math');";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE mimes");


// --
// -- Table structure for table 'monitored_file'
// --

print("<h3>Creating table monitored_file....</h3>");
$select = "CREATE TABLE " . $table_prefix ."monitored_file (
  id int(4) NOT NULL auto_increment,
  userid int(4) NOT NULL default '0',
  fid int(4) NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE monitored_file");

// --
// -- Table structure for table 'monitored_folder'
// --

print("<h3>Creating table monitored_folder....</h3>");
$select = "CREATE TABLE " . $table_prefix ."monitored_folder (
  id int(4) NOT NULL auto_increment,
  userid int(4) NOT NULL default '0',
  fid int(4) NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE monitored_folder");

// --
// -- Table structure for table 'news'
// --

print("<h3>Creating table news....</h3>");
$select = "CREATE TABLE " . $table_prefix ."news (
  id int(4) NOT NULL auto_increment,
  gid int(4) NOT NULL default '0',
  news_title varchar(255) NOT NULL default '',
  news_date datetime NOT NULL default '0000-00-00 00:00:00',
  news text NOT NULL,
  news_end_date datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE news");

// --
// -- Table structure for table 'owl_log'
// --

print("<h3>Creating table owl_log....</h3>");
$select = "CREATE TABLE " . $table_prefix ."owl_log (
  id int(4) NOT NULL auto_increment,
  userid int(4) default NULL,
  filename varchar(255) default NULL,
  parent int(4) default NULL,
  action varchar(40) default NULL,
  details text,
  ip varchar(16) default NULL,
  agent varchar(100) default NULL,
  logdate datetime NOT NULL default '0000-00-00 00:00:00',
  type varchar(20) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE owl_log");

//--
//-- Table structure for table 'peerreview'
//--

print("<h3>Creating table peerreview....</h3>");
$select = "CREATE TABLE " . $table_prefix ."peerreview (
  reviewer_id int(4) NOT NULL default '0',
  file_id int(4) NOT NULL default '0',
  status int(4) NOT NULL default '0'
) TYPE=MyISAM;";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE peerreview");


// --
// -- Table structure for table 'prefs'
// --

print("<h3>Creating table prefs....</h3>");
$select = "CREATE TABLE " . $table_prefix ."prefs (
  id int(4) NOT NULL auto_increment,
  email_from varchar(80) default NULL,
  email_fromname varchar(80) default NULL,
  email_replyto varchar(80) default NULL,
  email_server varchar(30) default NULL,
  email_subject varchar(60) default NULL,
  lookathd varchar(15) default NULL,
  lookathddel int(4) default NULL,
  def_file_security int(4) default NULL,
  def_file_group_owner int(4) default NULL,
  def_file_owner int(4) default NULL,
  def_file_title varchar(40) default NULL,
  def_file_meta varchar(40) default NULL,
  def_fold_security int(4) default NULL,
  def_fold_group_owner int(4) default NULL,
  def_fold_owner int(4) default NULL,
  max_filesize int(4) default NULL,
  tmpdir varchar(255) default NULL,
  timeout int(4) default NULL,
  expand int(4) default NULL,
  version_control int(4) default NULL,
  restrict_view int(4) default NULL,
  hide_backup int(4) default NULL,
  dbdump_path varchar(80) default NULL,
  gzip_path varchar(80) default NULL,
  tar_path varchar(80) default NULL,
  unzip_path varchar(80) default NULL,
  pod2html_path varchar(80) default NULL,
  pdftotext_path varchar(80) default NULL,
  wordtotext_path varchar(80) default NULL,
  file_perm int(4) default NULL,
  folder_perm int(4) default NULL,
  logging int(4) default NULL,
  log_file int(4) default NULL,
  log_login int(4) default NULL,
  log_rec_per_page int(4) default NULL,
  rec_per_page int(4) default NULL,
  self_reg int(4) default NULL,
  self_reg_quota int(4) default NULL,
  self_reg_notify int(4) default NULL,
  self_reg_attachfile int(4) default NULL,
  self_reg_disabled int(4) default NULL,
  self_reg_noprefacces int(4) default NULL,
  self_reg_maxsessions int(4) default NULL,
  self_reg_group int(4) default NULL,
  anon_ro int(4) default NULL,
  anon_user int(4) default NULL,
  file_admin_group int(4) default NULL,
  forgot_pass int(4) default NULL,
  collect_trash int(4) default NULL,
  trash_can_location varchar(80) default NULL,
  allow_popup int(4) default NULL,
  allow_custpopup int(5) default NULL,
  status_bar_location int(4) default NULL,
  remember_me int(4) default NULL,
  cookie_timeout int(4) default NULL,
  use_smtp int(4) default NULL,
  use_smtp_auth int(4) default NULL,
  smtp_passwd varchar(40) default NULL,
  search_bar int(4) default NULL,
  bulk_buttons int(4) default NULL,
  action_buttons int(4) default NULL,
  folder_tools int(4) default NULL,
  pref_bar int(4) default NULL,
  smtp_auth_login varchar(50) default NULL,
  expand_disp_status int(4) default NULL,
  expand_disp_doc_num int(4) default NULL,
  expand_disp_doc_type int(4) default NULL,
  expand_disp_title int(4) default NULL,
  expand_disp_version int(4) default NULL,
  expand_disp_file int(4) default NULL,
  expand_disp_size int(4) default NULL,
  expand_disp_posted int(4) default NULL,
  expand_disp_modified int(4) default NULL,
  expand_disp_action int(4) default NULL,
  expand_disp_held int(4) default NULL,
  collapse_disp_status int(4) default NULL,
  collapse_disp_doc_num int(4) default NULL,
  collapse_disp_doc_type int(4) default NULL,
  collapse_disp_title int(4) default NULL,
  collapse_disp_version int(4) default NULL,
  collapse_disp_file int(4) default NULL,
  collapse_disp_size int(4) default NULL,
  collapse_disp_posted int(4) default NULL,
  collapse_disp_modified int(4) default NULL,
  collapse_disp_action int(4) default NULL,
  collapse_disp_held int(4) default NULL,
  expand_search_disp_score int(4) default NULL,
  expand_search_disp_folder_path int(4) default NULL,
  expand_search_disp_doc_type int(4) default NULL,
  expand_search_disp_file int(4) default NULL,
  expand_search_disp_size int(4) default NULL,
  expand_search_disp_posted int(4) default NULL,
  expand_search_disp_modified int(4) default NULL,
  expand_search_disp_action int(4) default NULL,
  collapse_search_disp_score int(4) default NULL,
  colps_search_disp_fld_path int(4) default NULL,
  collapse_search_disp_doc_type int(4) default NULL,
  collapse_search_disp_file int(4) default NULL,
  collapse_search_disp_size int(4) default NULL,
  collapse_search_disp_posted int(4) default NULL,
  collapse_search_disp_modified int(4) default NULL,
  collapse_search_disp_action int(4) default NULL,
  hide_folder_doc_count int(4) default NULL,
  old_action_icons int(4) default NULL,
  search_result_folders int(4) default NULL,
  restore_file_prefix varchar(50) default NULL,
  major_revision int(4) default NULL,
  minor_revision int(4) default NULL,
  doc_id_prefix varchar(10) default NULL,
  doc_id_num_digits int(4) default NULL,
  view_doc_in_new_window int(4) default NULL,
  admin_login_to_browse_page int(4) default NULL,
  save_keywords_to_db int(4) default NULL,
  self_reg_homedir int(4) default NULL,
  self_reg_firstdir int(4) default NULL,
  virus_path varchar(80) default NULL,
  peer_review int(4) default NULL,
  peer_opt int(4) default NULL,
  folder_size int(4) default NULL,
  download_folder_zip int(4) default NULL,
  display_password_override int(4) default NULL,
  thumb_disp_status int(4) default NULL,
  thumb_disp_doc_num int(4) default NULL,
  thumb_disp_image_info int(4) default NULL,
  thumb_disp_version int(4) default NULL,
  thumb_disp_size int(4) default NULL,
  thumb_disp_posted int(4) default NULL,
  thumb_disp_modified int(4) default NULL,
  thumb_disp_action int(4) default NULL,
  thumb_disp_held int(4) default NULL,
  thumbnails_tool_path varchar(255) default NULL,
  thumbnails_video_tool_path varchar(255) default NULL,
  thumbnails_video_tool_opt varchar(255) default NULL,
  thumbnails int(4) default NULL,
  thumbnails_small_width int(4) default NULL,
  thumbnails_med_width int(4) default NULL,
  thumbnails_large_width int(4) default NULL,
  thumbnail_view_columns int(4) default NULL,
  rtftotext_path varchar(250) default NULL,
  min_pass_length int(4) default NULL,
  min_username_length int(4) default NULL,
  min_pass_numeric int(4) default NULL,
  min_pass_special int(4) default NULL,
  enable_lock_account int(4) default NULL,
  lock_account_bad_password int(4) default NULL,
  track_user_passwords int(4) default NULL,
  change_password_every int(4) default NULL,
  folderdescreq int(4) default NULL,
  show_user_info int(4) default NULL,
  filedescreq int(4) default NULL,
  collapse_search_disp_doc_num int(4) default NULL,
  expand_search_disp_doc_num int(4) default NULL,
  colps_search_disp_doc_fields int(4) default NULL,
  expand_search_disp_doc_fields int(4) default NULL,
  collapse_disp_doc_fields int(4) default NULL,
  expand_disp_doc_fields int(4) default NULL,
  self_create_homedir int(4) default NULL,
  self_captcha int(4) default NULL,
  info_panel_wide int(4) default NULL,
  track_favorites int(4) default NULL,
  expand_disp_updated int(4) default NULL,
  collapse_disp_updated int(4) default NULL,
  expand_search_disp_updated int(4) default NULL,
  collapse_search_disp_updated int(4) default NULL,
  thumb_disp_updated int(4) default NULL,
  info_panel_wide int(4) default NULL,
  track_favorites  int(4) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE prefs");


// --
// -- Data for table 'prefs'
// --

$select = "INSERT INTO ". $table_prefix ."prefs VALUES (1,'owl@yourdomain.com','OWL','owl@yourdomain.com','localhost','[OWL] : AUTOMATED MAIL','false',1,0,0,1,'<font color=red>No Info</font>','not in',0,0,1,51200000,'/tmp',600,1,1,0,1,'/usr/bin/mysqldump','/usr/bin/gzip','/bin/tar','/usr/bin/unzip','','/usr/bin/pdftotext','/usr/local/bin/antiword',0,0,0,1,1,25,0,0,0,0,0,0,0,0,1,0,2,2,0,0,'',1,1,1,0,30,0,0,'',2,1,1,1,1,'',1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,0,1,'',1,0,'ABC-',5,0,0,0,1,1,'',0,1,1,1,0,1,0,1,1,1,1,1,1,1,'/usr/bin/convert','/usr/local/bin/mplayer',' -vo png -ss 0:05 -frames 2 -nosound -really-quiet',1,25,50,100,4,'/usr/local/bin/unrtf',8,8,0,0,0,4,10,90,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0);";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT TABLE prefs");

// --
// -- Table structure for table 'searchidx'
// --

print("<h3>Creating table searchidx....</h3>");
$select = "CREATE TABLE " . $table_prefix ."searchidx (
  wordid int(4) default NULL,
  owlfileid int(4) default NULL,
  KEY search_fileid (owlfileid)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE searchidx");

// --
// -- Table structure for table 'trackoldpasswd'
// --

print("<h3>Creating table trackoldpasswd....</h3>");
$select = "CREATE TABLE " . $table_prefix ."trackoldpasswd (
  id int(4) NOT NULL auto_increment,
  userid int(4) NOT NULL default '0',
  password varchar(50) NOT NULL default '',
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE trackoldpasswd");

// --
// -- Table structure for table 'users'
// --

print("<h3>Creating table users....</h3>");
$select = "CREATE TABLE " . $table_prefix ."users (
  id int(4) NOT NULL auto_increment,
  groupid varchar(10) NOT NULL default '',
  username varchar(20) NOT NULL default '',
  name varchar(50) NOT NULL default '',
  password varchar(50) NOT NULL default '',
  quota_max bigint(20) unsigned NOT NULL default '0',
  quota_current bigint(20) default NULL,
  email varchar(255) default NULL,
  notify int(4) default NULL,
  attachfile int(4) default NULL,
  disabled int(4) default NULL,
  noprefaccess int(4) default '0',
  language varchar(15) default NULL,
  maxsessions int(4) default '0',
  lastlogin datetime NOT NULL default '0000-00-00 00:00:00',
  curlogin datetime NOT NULL default '0000-00-00 00:00:00',
  lastnews int(4) NOT NULL default '0',
  newsadmin int(4) NOT NULL default '0',
  comment_notify int(4) NOT NULL default '0',
  buttonstyle varchar(255) default NULL,
  homedir int(4) default NULL,
  firstdir int(4) default NULL,
  email_tool int(4) default NULL,
  change_paswd_at_login int(4) default NULL,
  login_failed int(4) default NULL,
  passwd_last_changed datetime NOT NULL default '0000-00-00 00:00:00',
  expire_account varchar(80) default NULL,
  user_auth char(2) default NULL,
  logintonewrec int(4) default NULL,
  groupadmin int(4) default NULL,
  user_offset varchar(4) default NULL,
  useradmin int(4) default NULL,
  viewlogs int(4) default NULL,
  viewreports int(4) default NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;";

$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE users");

// --
// -- Data for table 'users'
// --

$select = "INSERT INTO " . $table_prefix ."users VALUES (1,'0','admin','Administrator','21232f297a57a5a743894a0e4a801fc3',0,230648,'bozz',0,0,0,0,'English',0,'2005-11-14 06:18:50','2005-11-15 18:56:06',8,0,1,'rsdx_blue1',1,1,1,0,0,'2005-04-10 22:28:40','','',0,0,'',0);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT 'Administrator' in TABLE users");

$select = "INSERT INTO " . $table_prefix ."users VALUES (2,'1','guest','Anonymous','823f67f159b22b4c9a6a96999d1dea57',0,0,'',0,0,0,1,'English',19,'2004-11-10 05:02:42','2005-10-23 08:22:16',0,0,0,'rsdx_blue1',1,1,0,0,0,'2005-10-23 08:22:16','','0',0,0,'',0);";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not INSERT 'Anonymous' in TABLE users");

// --
// -- Table structure for table 'wordidx'
// --
print("<h3>Creating table wordidx....</h3>");
$select = "CREATE TABLE " . $table_prefix ."wordidx (
  wordid int(4) default NULL,
  word char(128) NOT NULL default '',
  UNIQUE KEY word_index (word)
) TYPE=MyISAM;";
$result = mysql_db_query($database_instance,$select,$dblink) or die ("Could not CREATE TABLE wordidx");



mysql_close($dblink);
?>
<h2> Done !</h2>
</body>
</html>