/[gentoo-src]/glep15/create.php
Gentoo

Contents of /glep15/create.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Nov 22 15:40:37 2003 UTC (10 years, 4 months ago) by hythloday
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Added skeleton upload and viewing capabilities.

1 <?php
2 /***************************************************************************
3 * create.php
4 *
5 * Fri Oct 17 15:57:24 2003
6 * Copyright 2003 lisa seelye
7 * Copyright 2003 Gentoo Technologies, Inc.
8 * lisa@gentoo.org - www.gentoo.org
9 *
10 * $Header: /home/cvsroot/gentoo-src/glep15/create.php,v 1.1 2003/10/30 21:52:52 lisa Exp $
11 ***************************************************************************
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 **************************************************************************/
26 @require("mysql.php");
27
28 $default_comment_display = 1; //display by default
29 $default_script_display = 1; //display by deafult
30
31 $auth_sql = "CREATE TABLE $mysql_user_table (
32 uid INT(5) unsigned NOT NULL auto_increment,
33 uname VARCHAR(8) NOT NULL,
34 upw VARCHAR(32) NOT NULL,
35 email VARCHAR(50) NOT NULL,
36 priveleges TINYINT(4) NOT NULL default '0',
37 warning TINYINT(2) NOT NULL default '0',
38 PRIMARY KEY(uid),
39 KEY uid(uid)
40 )";
41 $category_sql = "CREATE TABLE $mysql_category_table (
42 cid INT(3) unsigned NOT NULL auto_increment,
43 catname VARCHAR(50) NOT NULL,
44 childof INT(3) NOT NULL default '0',
45 PRIMARY KEY(cid),
46 KEY cid(cid)
47 )";
48 $comment_sql = "CREATE TABLE $mysql_comment_table (
49 cid INT(6) unsigned NOT NULL auto_increment,
50 submitter INT(5) unsigned NOT NULL,
51 dateadded DATETIME(14) NULL,
52 body TEXT NOT NULL,
53 display TINYINT(1) NOT NULL default '$default_comment_display',
54 onscript INT(6) NOT NULL,
55 PRIMARY KEY(cid),
56 KEY cid(cid)
57 )";
58 $script_sql = "CREATE TABLE $mysql_script_table (
59 sid INT(6) unsigned NOT NULL auto_increment,
60 submitter INT(5) unsigned NOT NULL,
61 category INT(3) unsigned NOT NULL,
62 rank TINYINT(2) NOT NULL default '0',
63 dateadded DATETIME(14) NULL,
64 name VARCHAR(100) NOT NULL,
65 descript TEXT NOT NULL,
66 display TINYINT(1) NOT NULL default '1',
67 approved INT(5) unsigned NOT NULL,
68 script TEXT NOT NULL,
69 PRIMARY KEY(sid),
70 KEY sid(sid)
71 )";
72
73 mysql_query($auth_sql,$link) or die("Could not create user table:<br />$auth_sql<br />" . mysql_error());
74 mysql_query($category_sql,$link) or die("Could not create category table:<br />$category_sql<br />" . mysql_error());
75 mysql_query($comment_sql,$link) or die("Could not create comments table:<br />$comment_sql<br />" . mysql_error());
76 mysql_query($script_sql,$link) or die("Could not create script storage table:<br />$script_sql<br />" . mysql_error());
77
78 printf("All tables created, please remove <em>%s</em> from your document root\n",$_SERVER['PHP_SELF']);
79 ?>

  ViewVC Help
Powered by ViewVC 1.1.20