From 21c86e53de160f00a626cdd1c8afcc7ebbf8448e Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 2 Jul 2006 16:37:09 +0000 Subject: Removed comments from quickstart. It will be added to pradosoft.com. --- .gitattributes | 4 - demos/quickstart/protected/application.xml | 4 - .../quickstart/protected/comments/CommentList.php | 58 ------- .../quickstart/protected/comments/CommentList.tpl | 105 ------------- .../protected/comments/QuickStartComments.php | 175 --------------------- demos/quickstart/protected/comments/comments.db | Bin 6144 -> 0 bytes demos/quickstart/protected/controls/Layout.tpl | 1 - 7 files changed, 347 deletions(-) delete mode 100644 demos/quickstart/protected/comments/CommentList.php delete mode 100644 demos/quickstart/protected/comments/CommentList.tpl delete mode 100644 demos/quickstart/protected/comments/QuickStartComments.php delete mode 100644 demos/quickstart/protected/comments/comments.db diff --git a/.gitattributes b/.gitattributes index a124b9d9..aa284132 100644 --- a/.gitattributes +++ b/.gitattributes @@ -696,10 +696,6 @@ demos/quickstart/index.php -text demos/quickstart/index2.php -text demos/quickstart/protected/.htaccess -text demos/quickstart/protected/application.xml -text -demos/quickstart/protected/comments/CommentList.php -text -demos/quickstart/protected/comments/CommentList.tpl -text -demos/quickstart/protected/comments/QuickStartComments.php -text -demos/quickstart/protected/comments/comments.db -text demos/quickstart/protected/controls/DocLink.php -text demos/quickstart/protected/controls/Layout.php -text demos/quickstart/protected/controls/Layout.tpl -text diff --git a/demos/quickstart/protected/application.xml b/demos/quickstart/protected/application.xml index 79ee4529..3e2374d8 100644 --- a/demos/quickstart/protected/application.xml +++ b/demos/quickstart/protected/application.xml @@ -16,12 +16,8 @@ - - - - \ No newline at end of file diff --git a/demos/quickstart/protected/comments/CommentList.php b/demos/quickstart/protected/comments/CommentList.php deleted file mode 100644 index 3bfb7239..00000000 --- a/demos/quickstart/protected/comments/CommentList.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @version : $ Sat May 27 17:53:15 AZOST 2006 $ - * @package Demo.Quickstart.comments - * @since 3.0 - */ -class CommentList extends TTemplateControl -{ - private $_exclude = array( - 'Comments', - 'Markdown', - 'Search', - 'GettingStarted.Introduction'); - - private $_quickstart; - - public function onLoad($param) - { - parent::onLoad($param); - - $this->_quickstart = new QuickStartComments(); - - $page = $this->getService()->getRequestedPagePath(); - - $this->listComments($page); - } - - protected function listComments($page) - { - $this->comments->setDataSource($this->_quickstart->getComments($page)); - $this->comments->dataBind(); - } - - public function addComment_Clicked($sender, $param) - { - $page = $this->getService()->getRequestedPagePath(); - $this->_quickstart->addNewComment($page, - $this->email->getText(), $this->content->getText()); - $this->multiView1->setActiveViewIndex(1); - } - - public function setVisible($value) - { - $page = $this->getService()->getRequestedPagePath(); - if(in_array($page, $this->_exclude)) - parent::setVisible(false); - else - parent::setVisible($value); - } -} - -?> \ No newline at end of file diff --git a/demos/quickstart/protected/comments/CommentList.tpl b/demos/quickstart/protected/comments/CommentList.tpl deleted file mode 100644 index 06cddd1e..00000000 --- a/demos/quickstart/protected/comments/CommentList.tpl +++ /dev/null @@ -1,105 +0,0 @@ -
- - - -

Comments - > - ( Add your comments ) - -

-
- -
- <%# $this->ItemIndex+1 %> - - - DataItem['date_added']) %> /> - -
- - - <%# $this->DataItem['comment'] %> - - -
-
-
-
- - > - -
-

Post a comment

-

Note: - Please only use the comments in relation to this page for -

    -
  • questions/critcisms/suggestions on the documentation,
  • -
  • small notes that can solve or clarify a particular problem or task.
  • -
- If you experience errors please file a ticket - or ask at the forum. - Please use the Prado wiki for longer pieces and detailed solutions. -

-

Comments will be periodically reviewed, integrated into the documentation and removed. - You may use markdown syntax in your comment.

- -
- - - - -
-
- - -
- -
-
- content->Text) %> > -
-

Preview comment

-
- - - <%= $this->content->Text %> - - -
-
-
-
- - -
-
-
- -
-
Thank you, your comment is quequed for moderation.
-
-

Preview comment

-
- - - <%= $this->content->Text %> - - -
-
-
-
-
-
\ No newline at end of file diff --git a/demos/quickstart/protected/comments/QuickStartComments.php b/demos/quickstart/protected/comments/QuickStartComments.php deleted file mode 100644 index 7b504caf..00000000 --- a/demos/quickstart/protected/comments/QuickStartComments.php +++ /dev/null @@ -1,175 +0,0 @@ - - * @version : $ Sat May 27 16:49:19 AZOST 2006 $ - * @package Demos.QuickStart.comments - * @since 3.0 - */ -class QuickStartComments -{ - /** - * @var string sqlite database source. - */ - private $_database; - /** - * @var sqlite connection. - */ - private $_connection; - - /** - * Sets the sqlite comment database file. - */ - public function __construct() - { - $this->_database = realpath(dirname(__FILE__).'/comments.db'); - } - - /** - * Closed the database connection. - */ - public function __destruct() - { - if(!is_null($this->_connection)) - sqlite_close($this->_connection); - } - - /** - * @return resource sqlite database connection. - */ - protected function getConnection() - { - if(is_null($this->_connection)) - $this->_connection = sqlite_open($this->_database); - return $this->_connection; - } - - /** - * Quote database input data. - */ - protected function quote($value) - { - return sqlite_escape_string($value); - } - - /** - * Executes an sqlite query. - * @param string SQL - * @return mixed query results. - */ - protected function query($sql) - { - return sqlite_query($this->getConnection(), $sql); - } - - /** - * Returns a row from the sqlite result. - * @param resource sqlite result - * @return array database record. - */ - protected function fetch($resource) - { - if($resource !== false) - return sqlite_fetch_array($resource); - else - return false; - } - - /** - * Fetch all the records for given SQL query. - * @param string SQL query. - * @return array result set. - */ - protected function fetchAll($sql) - { - $rs = $this->query($sql); - $rows = array(); - while($row = $this->fetch($rs)) - $rows[] = $row; - return $rows; - } - - /** - * Returns all the comments for a given page. - * @param string specific page comments - * @return array list of comments - */ - public function getComments($pageID) - { - $page = $this->quote($pageID); - $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 - * @param string email address of the commenter - * @param string comment contents - */ - public function addNewComment($pageID, $email, $comment) - { - $page = $this->quote($pageID); - $email = $this->quote($email); - $comment = $this->quote($comment); - $date_added = time(); - $sql = <<query($sql); - } - - /** - * Update an existing comment. - * @param string comment ID - * @param string page ID - * @param string email address - * @param string updated comment. - */ - public function updateComment($commentID, $page, $email, $content) - { - $ID = intval($commentID); - $email = $this->quote($email); - $comment = $this->quote($content); - $page = $this->quote($page); - $sql = <<query($sql); - } - - /** - * Delete a comment. - * @param string comment ID - */ - public function deleteComment($commentID) - { - $ID = intval($commentID); - $this->query("DELETE FROM comments WHERE id=$ID"); - } - - /** - * @return array all the quequed comments. - */ - public function getQuequedComments() - { - return $this->fetchAll("SELECT * FROM comments WHERE approved != 1"); - } - - /** - * Approve a quequed comment. - * @param string comment ID. - */ - public function approveComment($commentID) - { - $ID = intval($commentID); - $this->query("UPDATE comments SET approved = 1 WHERE id=$ID"); - } -} - -?> \ No newline at end of file diff --git a/demos/quickstart/protected/comments/comments.db b/demos/quickstart/protected/comments/comments.db deleted file mode 100644 index b81d7123..00000000 Binary files a/demos/quickstart/protected/comments/comments.db and /dev/null differ diff --git a/demos/quickstart/protected/controls/Layout.tpl b/demos/quickstart/protected/controls/Layout.tpl index 733bf6e1..52ab5bc4 100644 --- a/demos/quickstart/protected/controls/Layout.tpl +++ b/demos/quickstart/protected/controls/Layout.tpl @@ -32,7 +32,6 @@
- -- cgit v1.2.3