summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorxue <>2006-06-28 11:24:19 +0000
committerxue <>2006-06-28 11:24:19 +0000
commit2121ac351266a79adee962a824aa58b1a643c980 (patch)
tree2fe93c139f49ca2215adb4152984de5b4f497fbf /demos
parent98ffb7a2cb6144de626093bdf5009444661f957c (diff)
Some minor fixes.
Diffstat (limited to 'demos')
-rw-r--r--demos/quickstart/protected/application.xml3
-rw-r--r--demos/quickstart/protected/comments/QuickStartComments.php34
-rw-r--r--demos/quickstart/protected/index/api/_0.cfsbin378721 -> 0 bytes
-rw-r--r--demos/quickstart/protected/index/api/deletablebin4 -> 0 bytes
-rw-r--r--demos/quickstart/protected/index/api/segmentsbin27 -> 0 bytes
5 files changed, 17 insertions, 20 deletions
diff --git a/demos/quickstart/protected/application.xml b/demos/quickstart/protected/application.xml
index 1765230b..79ee4529 100644
--- a/demos/quickstart/protected/application.xml
+++ b/demos/quickstart/protected/application.xml
@@ -13,9 +13,6 @@
<module id="quickstart_search"
class="Application.index.ZendSearch"
IndexDataDirectory="Application.index.quickstart" />
- <module id="api_search"
- class="Application.index.ZendSearch"
- IndexDataDirectory="Application.index.api" />
</modules>
<paths>
<using namespace="Application.controls.*" />
diff --git a/demos/quickstart/protected/comments/QuickStartComments.php b/demos/quickstart/protected/comments/QuickStartComments.php
index c138bd94..7b504caf 100644
--- a/demos/quickstart/protected/comments/QuickStartComments.php
+++ b/demos/quickstart/protected/comments/QuickStartComments.php
@@ -18,7 +18,7 @@ class QuickStartComments
* @var sqlite connection.
*/
private $_connection;
-
+
/**
* Sets the sqlite comment database file.
*/
@@ -26,7 +26,7 @@ class QuickStartComments
{
$this->_database = realpath(dirname(__FILE__).'/comments.db');
}
-
+
/**
* Closed the database connection.
*/
@@ -35,7 +35,7 @@ class QuickStartComments
if(!is_null($this->_connection))
sqlite_close($this->_connection);
}
-
+
/**
* @return resource sqlite database connection.
*/
@@ -45,7 +45,7 @@ class QuickStartComments
$this->_connection = sqlite_open($this->_database);
return $this->_connection;
}
-
+
/**
* Quote database input data.
*/
@@ -53,7 +53,7 @@ class QuickStartComments
{
return sqlite_escape_string($value);
}
-
+
/**
* Executes an sqlite query.
* @param string SQL
@@ -63,7 +63,7 @@ class QuickStartComments
{
return sqlite_query($this->getConnection(), $sql);
}
-
+
/**
* Returns a row from the sqlite result.
* @param resource sqlite result
@@ -76,7 +76,7 @@ class QuickStartComments
else
return false;
}
-
+
/**
* Fetch all the records for given SQL query.
* @param string SQL query.
@@ -90,7 +90,7 @@ class QuickStartComments
$rows[] = $row;
return $rows;
}
-
+
/**
* Returns all the comments for a given page.
* @param string specific page comments
@@ -99,10 +99,10 @@ class QuickStartComments
public function getComments($pageID)
{
$page = $this->quote($pageID);
- $sql = "SELECT * FROM comments WHERE page=\"$page\" AND approved = 1 ORDER BY date_added ASC";
+ $sql = "SELECT * FROM comments WHERE page='$page' AND approved = 1 ORDER BY date_added ASC";
return $this->fetchAll($sql);
}
-
+
/**
* Adds a new comment for moderation.
* @param string ID of the page to comment belongs
@@ -117,11 +117,11 @@ class QuickStartComments
$date_added = time();
$sql = <<<EOD
INSERT INTO comments(page, email, comment, date_added)
- VALUES ("$page", "$email", "$comment", "$date_added")
+ VALUES ('$page', '$email', '$comment', '$date_added')
EOD;
return $this->query($sql);
}
-
+
/**
* Update an existing comment.
* @param string comment ID
@@ -136,13 +136,13 @@ EOD;
$comment = $this->quote($content);
$page = $this->quote($page);
$sql = <<<EOD
- UPDATE comments SET
- email = "$email", comment = "$comment", page = "$page"
+ UPDATE comments SET
+ email = '$email', comment = '$comment', page = '$page'
WHERE id = $ID;
EOD;
$this->query($sql);
}
-
+
/**
* Delete a comment.
* @param string comment ID
@@ -152,7 +152,7 @@ EOD;
$ID = intval($commentID);
$this->query("DELETE FROM comments WHERE id=$ID");
}
-
+
/**
* @return array all the quequed comments.
*/
@@ -160,7 +160,7 @@ EOD;
{
return $this->fetchAll("SELECT * FROM comments WHERE approved != 1");
}
-
+
/**
* Approve a quequed comment.
* @param string comment ID.
diff --git a/demos/quickstart/protected/index/api/_0.cfs b/demos/quickstart/protected/index/api/_0.cfs
deleted file mode 100644
index b5eb219b..00000000
--- a/demos/quickstart/protected/index/api/_0.cfs
+++ /dev/null
Binary files differ
diff --git a/demos/quickstart/protected/index/api/deletable b/demos/quickstart/protected/index/api/deletable
deleted file mode 100644
index 593f4708..00000000
--- a/demos/quickstart/protected/index/api/deletable
+++ /dev/null
Binary files differ
diff --git a/demos/quickstart/protected/index/api/segments b/demos/quickstart/protected/index/api/segments
deleted file mode 100644
index da225127..00000000
--- a/demos/quickstart/protected/index/api/segments
+++ /dev/null
Binary files differ