summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/protected/pages/Day2
diff options
context:
space:
mode:
authorxue <>2007-04-08 21:33:23 +0000
committerxue <>2007-04-08 21:33:23 +0000
commitff32eed01f783ee33caeacb0f7315612f0994f8f (patch)
tree7b42ed14181d56632160f88f8063b54b17f176af /demos/blog-tutorial/protected/pages/Day2
parent773bf1d0299246d936dcad2ac2ca01bca9d64ca4 (diff)
Added Day 2 tutorial.
Diffstat (limited to 'demos/blog-tutorial/protected/pages/Day2')
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/CreateAR.page2
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/CreateDB.page12
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/ER.gifbin4919 -> 5172 bytes
-rw-r--r--demos/blog-tutorial/protected/pages/Day2/ER.vsdbin73216 -> 73216 bytes
4 files changed, 7 insertions, 7 deletions
diff --git a/demos/blog-tutorial/protected/pages/Day2/CreateAR.page b/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
index d8b8b8ce..00ac1166 100644
--- a/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
+++ b/demos/blog-tutorial/protected/pages/Day2/CreateAR.page
@@ -61,7 +61,7 @@ Here we used the <a href="http://www.pradosoft.com/demos/quickstart/?page=Fundam
We should see the following directory structure with two new files under <tt>protected/database</tt>:
</p>
-<img src="<%~ directories2.gif %>" />
+<img src="<%~ directories2.gif %>" class="output" />
<p>
If we check the <tt>PostRecord</tt> class file, we should see the following content.
diff --git a/demos/blog-tutorial/protected/pages/Day2/CreateDB.page b/demos/blog-tutorial/protected/pages/Day2/CreateDB.page
index 291b20e4..eebda4c1 100644
--- a/demos/blog-tutorial/protected/pages/Day2/CreateDB.page
+++ b/demos/blog-tutorial/protected/pages/Day2/CreateDB.page
@@ -10,7 +10,7 @@ Most Web applications use database to keep data. Our blog system is not an excep
For tutorial purpose, we have simplified the requirements of our blog system so that it only needs to deal with user and post data. We thus create two database tables, <tt>users</tt> and <tt>posts</tt>, as shown in the following entity-relationship (ER) diagram.
</p>
-<img src="<%~ ER.gif %>" />
+<img src="<%~ ER.gif %>" class="output" />
<p>
We use a SQLite 3 database to keep our data. We first convert the ER diagram into the following SQL statements and save them in the file <tt>protected/schema.sql</tt>.
@@ -20,8 +20,8 @@ We use a SQLite 3 database to keep our data. We first convert the ER diagram int
/* create users table */
CREATE TABLE users (
username VARCHAR(128) NOT NULL PRIMARY KEY,
- email VARCHAR(128) NOT NULL UNIQUE,
- password VARCHAR(128) NOT NULL, /* plain text password */
+ email VARCHAR(128) NOT NULL,
+ password VARCHAR(128) NOT NULL, /* in plain text */
role INTEGER NOT NULL, /* 0: normal user, 1: administrator */
first_name VARCHAR(128),
last_name VARCHAR(128)
@@ -33,13 +33,13 @@ CREATE TABLE posts (
author VARCHAR(128) NOT NULL, /* references users.username */
create_time INTEGER NOT NULL, /* UNIX timestamp */
title VARCHAR(256) NOT NULL, /* title of the post */
- content TEXT NOT NULL /* content of the post */
+ status INTEGER NOT NULL /* 0: published; 1: draft; 2: pending; 2: denied */
);
/* insert some initial data records for testing */
INSERT INTO users VALUES ('admin', 'admin@example.com', 'demo', 1, 'Qiang', 'Xue');
INSERT INTO users VALUES ('demo', 'demo@example.com', 'demo', 0, 'Wei', 'Zhuo');
-INSERT INTO posts VALUES (NULL, 'admin', 1175708482, 'first post', 'this is my first post');
+INSERT INTO posts VALUES (NULL, 'admin', 1175708482, 'first post', 'this is my first post', 0);
</com:TTextHighlighter>
<com:NoteBox>
@@ -58,7 +58,7 @@ sqlite3 blog.db < ../schema.sql
The database has been created as <tt>protected/data/blog.db</tt> and we shall see the following directories and files:
</p>
-<img src="<%~ directories.gif %>" />
+<img src="<%~ directories.gif %>" class="output" />
<com:NoteBox>
It is required by SQLite that both the directory <tt>protected/data</tt> and the database file <tt>protected/data/blog.db</tt> be set writable by the Web server process.
diff --git a/demos/blog-tutorial/protected/pages/Day2/ER.gif b/demos/blog-tutorial/protected/pages/Day2/ER.gif
index 13e2d15b..90e4c1ea 100644
--- a/demos/blog-tutorial/protected/pages/Day2/ER.gif
+++ b/demos/blog-tutorial/protected/pages/Day2/ER.gif
Binary files differ
diff --git a/demos/blog-tutorial/protected/pages/Day2/ER.vsd b/demos/blog-tutorial/protected/pages/Day2/ER.vsd
index 2b59897a..95cf7f32 100644
--- a/demos/blog-tutorial/protected/pages/Day2/ER.vsd
+++ b/demos/blog-tutorial/protected/pages/Day2/ER.vsd
Binary files differ