[pLog-svn] r1598 - in plugins/trunk: . guestbook guestbook/class
guestbook/class/action guestbook/class/dao
guestbook/class/view guestbook/imgs guestbook/locale
guestbook/templates
mark at devel.plogworld.net
mark at devel.plogworld.net
Thu Mar 24 07:14:03 GMT 2005
Author: mark
Date: 2005-03-24 07:14:02 +0000 (Thu, 24 Mar 2005)
New Revision: 1598
Added:
plugins/trunk/guestbook/
plugins/trunk/guestbook/class/
plugins/trunk/guestbook/class/action/
plugins/trunk/guestbook/class/action/adminguestbookaction.class.php
plugins/trunk/guestbook/class/action/adminupdateguestbookaction.class.php
plugins/trunk/guestbook/class/action/guestbookaction.class.php
plugins/trunk/guestbook/class/action/updateguestbookaction.class.php
plugins/trunk/guestbook/class/dao/
plugins/trunk/guestbook/class/dao/guestbookdata.class.php
plugins/trunk/guestbook/class/dao/guestbookrecord.class.php
plugins/trunk/guestbook/class/view/
plugins/trunk/guestbook/class/view/adminguestbookview.class.php
plugins/trunk/guestbook/imgs/
plugins/trunk/guestbook/imgs/email.gif
plugins/trunk/guestbook/imgs/home.gif
plugins/trunk/guestbook/imgs/ip.gif
plugins/trunk/guestbook/imgs/recycle.gif
plugins/trunk/guestbook/imgs/reply.gif
plugins/trunk/guestbook/locale/
plugins/trunk/guestbook/locale/locale_en_UK.php
plugins/trunk/guestbook/locale/locale_zh_TW.php
plugins/trunk/guestbook/pluginguestbook.class.php
plugins/trunk/guestbook/readme.txt
plugins/trunk/guestbook/templates/
plugins/trunk/guestbook/templates/adminguestbook.template
plugins/trunk/guestbook/templates/guestbook.template
plugins/trunk/guestbook/templates/updateguestbook.template
Log:
Minstrel's guestbook plugin alreadt ported to 1.0. It works very well except "reply" functionality. Minstrel is working on it.
Added: plugins/trunk/guestbook/class/action/adminguestbookaction.class.php
===================================================================
--- plugins/trunk/guestbook/class/action/adminguestbookaction.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/action/adminguestbookaction.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,24 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/view/adminguestbookview.class.php" );
+
+ class AdminGuestbookAction extends AdminAction
+ {
+
+ function AdminGuestbookAction($actionInfo, $request)
+ {
+ $this->AdminAction($actionInfo, $request);
+ }
+
+ function perform()
+ {
+ $this->_view = new AdminGuestbookView($this->_blogInfo);
+
+ $this->setCommonData();
+
+ return true;
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/class/action/adminupdateguestbookaction.class.php
===================================================================
--- plugins/trunk/guestbook/class/action/adminupdateguestbookaction.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/action/adminupdateguestbookaction.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,85 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/view/adminguestbookview.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookdata.class.php" );
+
+ class AdminUpdateGuestbookAction extends AdminAction
+ {
+ var $_pluginEnabled;
+ var $_postPerPage;
+
+ function AdminUpdateGuestbookAction($actionInfo, $request)
+ {
+ $this->AdminAction($actionInfo, $request);
+ }
+
+ function checkTables()
+ {
+ $guestbookData = new GuestbookData();
+
+ $guestbookData->checkTables();
+ }
+
+ function validate()
+ {
+ $this->_pluginEnabled = $this->_request->getValue("pluginEnabled");
+ $this->_pluginEnabled = ($this->_pluginEnabled != "" );
+
+ if($this->_pluginEnabled)
+ {
+ $this->checkTables();
+ }
+
+ $this->_postPerPage = $this->_request->getValue("postPerPage");
+
+ if($this->_postPerPage <= 0 || !ctype_digit($this->_postPerPage))
+ {
+ $this->_view = new AdminGuestbookView($this->_blogInfo);
+ $this->_view->setErrorMessage($this->_locale->tr("guestbook_error_postperpage"));
+ $this->setCommonData();
+
+ return false;
+ }
+
+ return true;
+ }
+
+ function perform()
+ {
+ $blogSettings = $this->_blogInfo->getSettings();
+
+ $blogSettings->setValue("plugin_guestbook_enabled", $this->_pluginEnabled);
+ $blogSettings->setValue("plugin_guestbook_postperpage", $this->_postPerPage);
+
+ $this->_blogInfo->setSettings($blogSettings);
+
+ $blogs = new Blogs();
+
+ if( !$blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo))
+ {
+ $this->_view = new AdminGuestbookView( $this->_blogInfo );
+ $this->_view->setErrorMessage( $this->_locale->tr("error_updating_settings"));
+
+ $this->setCommonData();
+
+ return false;
+ }
+
+ $this->_blogInfo->setSettings($blogSettings);
+ $this->_session->setValue("blogInfo", $this->_blogInfo);
+
+ $this->saveSession();
+
+ $this->_view = new AdminGuestbookView($this->_blogInfo);
+ $this->_view->setSuccessMessage($this->_locale->tr("guestbook_settings_saved_ok"));
+
+ $this->setCommonData();
+
+ CacheControl::resetBlogCache($this->_blogInfo->getId());
+
+ return true;
+ }
+ }
+?>
Added: plugins/trunk/guestbook/class/action/guestbookaction.class.php
===================================================================
--- plugins/trunk/guestbook/class/action/guestbookaction.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/action/guestbookaction.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,159 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/plugintemplatedview.class.php");
+ include_once( PLOG_CLASS_PATH."class/net/client.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookdata.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookrecord.class.php" );
+
+ class GuestbookAction extends BlogAction
+ {
+ var $_pluginEnabled;
+ var $_data;
+
+ var $_owner;
+
+ var $_topic;
+ var $_content;
+ var $_userName;
+ var $_userEmail;
+ var $_userUrl;
+ var $_date;
+ var $_clientIp;
+
+ var $_blogId;
+ var $_pagePosts;
+ var $_totalPosts;
+ var $_totalPages;
+ var $_currentPage;
+ var $_postPerPage;
+
+ function GuestbookAction($actionInfo, $request)
+ {
+ $this->BlogAction($actionInfo, $request);
+
+ $this->_blogId = $this->_blogInfo->getId();
+
+ if($this->_request->getValue("page"))
+ $this->_currentPage = $this->_request->getValue("page");
+ else
+ $this->_currentPage = 1;
+
+ $blogSettings = $this->_blogInfo->getSettings();
+
+ $this->_pluginEnabled = $blogSettings->getValue("plugin_guestbook_enabled");
+ $this->_postPerPage = $blogSettings->getValue("plugin_guestbook_postperpage");
+
+ if(!$this->_pluginEnabled)
+ return;
+
+ $this->_now = new Date();
+ $this->_clientIp = Client::getIp();
+
+ $this->checkOwner();
+
+ $this->_data = new GuestbookData();
+
+ $opId = $this->_request->getValue("op");
+
+ if($opId=="AddGuestbookPost")
+ {
+ $this->addPost();
+ }
+ else if($opId=="ReplyGuestbookPost")
+ {
+ $this->replyPost();
+ }
+ else if($opId=="DeleteGuestbookPost")
+ {
+ $this->deletePost();
+ }
+
+ $this->getPosts();
+ }
+
+ function checkOwner()
+ {
+ $this->_owner = false;
+
+ $userInfo = $this->_session->getValue("userInfo");
+
+ if (isset($userInfo))
+ {
+ if($userInfo->getId()==$this->_blogInfo->getOwner())
+ {
+ $this->_owner = true;
+ }
+ }
+ }
+
+ function getPosts()
+ {
+ $this->_totalPosts = $this->_data->getTotalPosts($this->_blogId);
+ $this->_totalPages = $this->_data->getTotalPages($this->_blogId, $this->_postPerPage);
+
+ if($this->_currentPage>$this->_totalPages)
+ $this->_currentPage = $this->_totalPages;
+
+ $this->_pagePosts = $this->_data->getPagePosts($this->_blogId, $this->_currentPage, $this->_postPerPage);
+ }
+
+ function addPost()
+ {
+ $this->_userEmail = trim($this->_request->getValue("userEmail"));
+ $this->_userUrl = trim($this->_request->getValue("userUrl"));
+ $this->_userName = trim($this->_request->getValue("userName"));
+
+ $this->_content = trim($this->_request->getValue("content"));
+ $this->_topic = trim($this->_request->getValue("topic"));
+
+ $blogId = $this->_blogId;
+ $topic = Db::qstr($this->_topic);
+ $content = Db::qstr($this->_content);
+ $date = $this->_now->getDate();
+ $userEmail = $this->_userEmail;
+ $userUrl = $this->_userUrl;
+ $userName = $this->_userName;
+ $clientIp = $this->_clientIp;
+ $private = $this->_request->getValue("private");
+ $parentId = $this->_request->getValue("parentId");
+ $spamRate = 0;
+
+ $this->_data->insertData($blogId, $topic, $content, $date, $userName, $userEmail, $userUrl, $clientIp, $private, $parentId, $spamRate);
+ }
+
+ function replyPost()
+ {
+ }
+
+ function deletePost()
+ {
+ $id = $this->_request->getValue("id");
+
+ $this->_data->deleteData($id);
+ }
+
+ function setCommonData()
+ {
+ $this->_view->setValue("blogId", $this->_blogId);
+
+ $this->_view->setValue("posts", $this->_pagePosts);
+
+ $this->_view->setValue("totalPosts", $this->_totalPosts);
+ $this->_view->setValue("totalPages", $this->_totalPages);
+ $this->_view->setValue("currentPage", $this->_currentPage);
+ $this->_view->setValue("postPerPage", $this->_postPerPage);
+
+ $this->_view->setValue("owner", $this->_owner);
+
+ return true;
+ }
+
+ function perform()
+ {
+ $this->_view = new PluginTemplatedView($this->_blogInfo, "guestbook", "guestbook", SMARTY_VIEW_CACHE_DISABLED);
+
+ $this->setCommonData();
+ }
+ }
+?>
Added: plugins/trunk/guestbook/class/action/updateguestbookaction.class.php
===================================================================
--- plugins/trunk/guestbook/class/action/updateguestbookaction.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/action/updateguestbookaction.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,63 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/plugintemplatedview.class.php");
+ include_once( PLOG_CLASS_PATH."class/net/client.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookdata.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookrecord.class.php" );
+
+ class UpdateGuestbookAction extends BlogAction
+ {
+ var $_pluginEnabled;
+ var $_data;
+ var $_mode;
+
+ var $_blogId;
+ var $_id;
+ var $_parentContent;
+
+ function UpdateGuestbookAction($actionInfo, $request)
+ {
+ $this->BlogAction($actionInfo, $request);
+
+ $this->_blogId = $this->_blogInfo->getId();
+
+ $blogSettings = $this->_blogInfo->getSettings();
+
+ $this->_pluginEnabled = $blogSettings->getValue("plugin_guestbook_enabled");
+
+ if(!$this->_pluginEnabled)
+ return;
+
+ $this->_mode = $this->_request->getValue("mode");
+
+ if($this->_mode=="reply")
+ {
+ $this->_id = $this->_request->getValue("id");
+
+ $data = new GuestbookData();
+
+ $post = $data->getPost($this->_blogId, $this->_id);
+
+ $this->_parentContent = $post->getContent();
+ }
+ }
+
+ function setCommonData()
+ {
+ $this->_view->setValue("blogId", $this->_blogId);
+ $this->_view->setValue("id", $this->_id);
+ $this->_view->setValue("mode", $this->_mode);
+ $this->_view->setValue("parentContent", $this->_parentContent);
+
+ return true;
+ }
+
+ function perform()
+ {
+ $this->_view = new PluginTemplatedView($this->_blogInfo, "guestbook", "updateguestbook", SMARTY_VIEW_CACHE_DISABLED);
+
+ $this->setCommonData();
+ }
+ }
+?>
Added: plugins/trunk/guestbook/class/dao/guestbookdata.class.php
===================================================================
--- plugins/trunk/guestbook/class/dao/guestbookdata.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/dao/guestbookdata.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,193 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/dao/model.class.php" );
+ include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ include_once( PLOG_CLASS_PATH."plugins/guestbook/class/dao/guestbookrecord.class.php" );
+
+ class GuestbookData extends Model
+ {
+ var $_prefix;
+
+ var $_totalPosts;
+ var $_totalPages;
+
+ function GuestbookModel()
+ {
+ $this->Model();
+
+ $this->_prefix = $this->getPrefix();
+
+ $this->_totalPosts = 0;
+ $this->_totalPages = 0;
+ }
+
+ function checkTables()
+ {
+ $table = $this->_prefix."guestbook";
+
+ $field = "
+ id I(10) NOTNULL AUTO PRIMARY,
+ blog_id I(10) DEFAULT 0 NOTNULL INDEX,
+ topic X NOTNULL DEFAULT '',
+ content X NOTNULL DEFAULT '',
+ date T,
+ user_email C(64) DEFAULT '',
+ user_url C(128) DEFAULT '',
+ user_name C(30) DEFAULT '' NOTNULL,
+ parent_id I(10) DEFAULT 0,
+ client_ip C(15) DEFAULT '0.0.0.0' NOTNULL,
+ private I(1) DEFAULT 0,
+ spam_rate F DEFAULT 0
+ ";
+
+ $dict = NewDataDictionary( $this->_db );
+ $sqlArray = $dict->ChangeTableSQL( $table, $field );
+ $result = $dict->ExecuteSQLArray( $sqlArray );
+
+ $query = Array( "ALTER TABLE ".$table." ADD KEY blog_id(blog_id)",
+ "ALTER TABLE ".$table." ADD KEY parent_id(parent_id)");
+
+ foreach($query as $queryCode)
+ $this->_db->Execute($queryCode);
+
+ return true;
+ }
+
+ function deleteData($id)
+ {
+ $query = "DELETE FROM ".$this->_prefix."guestbook WHERE id = ".$id." LIMIT 1;";
+
+ $result = $this->_db->Execute($query);
+
+ if( $result == false )
+ return false;
+
+ return true;
+ }
+
+ function insertData($blogId, $topic = "", $content = "", $date = null, $userName = "", $userEmail = "", $userUrl = "", $clientIp = "0.0.0.0", $parentId = 0, $private = false, $spamRate = 0)
+ {
+ $tf = new TextFilter();
+
+ $topic = $tf->filterHTML($topic);
+ $content = $tf->filterHTML($content);
+
+ $query = "INSERT INTO ".$this->_prefix."guestbook (blog_id,topic,content,user_name,user_email,user_url,date,client_ip,parent_id,private,spam_rate) VALUES (".$blogId.",'".Db::qstr($topic)."','".Db::qstr($content)."','".$userName."','".$userEmail."','".$userUrl."','".$date."','".$clientIp."','".$parentId."','".$private."','".$spamRate."');";
+
+ $result = $this->_db->Execute($query);
+
+ if( $result == false )
+ return false;
+
+ return true;
+ }
+
+ function getTotalPosts($blogId)
+ {
+ $query = "SELECT * FROM ".$this->_prefix."guestbook WHERE blog_id = ".$blogId.";";
+
+ $result = $this->_db->Execute($query);
+
+ if( $result )
+ $this->_totalPosts = $result->RecordCount();
+ else
+ $this->_totalPosts = 0;
+
+ return $this->_totalPosts;
+ }
+
+ function getTotalPages($blogId, $postPerPage)
+ {
+ if($this->_totalPosts == 0)
+ $this->getTotalPosts($blogId);
+
+ $this->_totalPages = (int)(($this->_totalPosts)/($postPerPage));
+
+ if($this->_totalPosts>(($postPerPage)*($this->_totalPages)))
+ $this->_totalPages += 1;
+
+ return $this->_totalPages;
+ }
+
+ function getPagePosts($blogId, $currentPage, $postPerPage)
+ {
+ if($this->_totalPosts == 0)
+ $this->getTotalPosts($blogId);
+
+ if($this->_totalPages == 0)
+ $this->getTotalPages($blogId, $postPerPage);
+
+ if($currentPage > $this->_totalPages)
+ $currentPage = $this->_totalPages;
+
+ $pageStartPost = ($currentPage - 1)*($postPerPage);
+ $pageEndPost = ($currentPage)*($postPerPage);
+
+ $query = "SELECT * FROM ".$this->_prefix."guestbook WHERE blog_id = ".$blogId;
+ $query .= " ORDER BY date DESC";
+ $query .= " LIMIT ".$pageStartPost.",".$pageEndPost;
+ $query .= ";";
+
+ $result = $this->_db->Execute($query);
+
+ if( !$result )
+ return false;
+
+ $pagePosts = Array();
+
+ while($row = $result->FetchRow())
+ {
+ array_push($pagePosts, $this->_fillRecord($blogId, $row));
+ }
+
+ return $pagePosts;
+ }
+
+ function getPost($blogId, $id)
+ {
+ $query = "SELECT * FROM ".$this->_prefix."guestbook WHERE id = ".$id.";";
+
+ $result = $this->_db->Execute($query);
+
+ if( !$result )
+ return false;
+
+ $post = new GuestbookRecord($blogId);
+
+ $row = $result->FetchRow();
+
+ $post->setId($row["id"]);
+ $post->setTopic($row["topic"]);
+ $post->setContent($row["content"]);
+ $post->setDate($row["date"]);
+ $post->setUserName($row["user_name"]);
+ $post->setUserEmail($row["user_email"]);
+ $post->setUserUrl($row["user_url"]);
+ $post->setClientIp($row["client_ip"]);
+ $post->setParentId($row["parent_id"]);
+ $post->setPrivate($row["private"]);
+ $post->setSpamRate($row["spam_rate"]);
+
+ return $post;
+ }
+
+ function _fillRecord($blogId, $row)
+ {
+ $record = new GuestbookRecord($blogId);
+
+ $record->setId($row["id"]);
+ $record->setTopic($row["topic"]);
+ $record->setContent($row["content"]);
+ $record->setDate($row["date"]);
+ $record->setUserName($row["user_name"]);
+ $record->setUserEmail($row["user_email"]);
+ $record->setUserUrl($row["user_url"]);
+ $record->setClientIp($row["client_ip"]);
+ $record->setParentId($row["parent_id"]);
+ $record->setPrivate($row["private"]);
+ $record->setSpamRate($row["spam_rate"]);
+
+ return $record;
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/class/dao/guestbookrecord.class.php
===================================================================
--- plugins/trunk/guestbook/class/dao/guestbookrecord.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/dao/guestbookrecord.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,169 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
+ include_once( PLOG_CLASS_PATH."class/data/Date.class.php" );
+
+ class GuestbookRecord extends Object
+ {
+ var $_id;
+ var $_blogId;
+ var $_topic;
+ var $_content;
+ var $_userName;
+ var $_userEmail;
+ var $_userUrl;
+ var $_date;
+ var $_clientIp;
+ var $_parentId;
+ var $_private;
+ var $_spamRate;
+
+ function GuestbookRecord($blogId, $topic = "", $content = "", $date = null, $userName = "", $userEmail = "", $userUrl = "", $clientIp = "0.0.0.0", $parentId = 0, $private = false, $spamRate = 0)
+ {
+ $this->Object();
+
+ $this->_blogId = $blogId;
+ $this->_topic = $topic;
+ $this->_content = $content;
+
+ $this->_userName = $userName;
+ $this->_userEmail = $userEmail;
+ $this->_userUrl = $userUrl;
+
+ $this->_clientIp = $clientIp;
+
+ $this->_parentId = $parentId;
+ $this->_private = $private;
+
+ $this->_spamRate = $spamRate;
+
+ if( $date == null )
+ {
+ $t = new Timestamp();
+ $this->_date = $t->getTimestamp();
+ }
+ }
+
+ function getId()
+ {
+ return $this->_id;
+ }
+
+ function setId($id)
+ {
+ $this->_id = $id;
+ }
+
+ function getBlogId()
+ {
+ return $this->_blogId;
+ }
+
+ function setBlogId($blogId)
+ {
+ $this->_blogId = $blogId;
+ }
+
+ function getTopic()
+ {
+ return $this->_topic;
+ }
+
+ function setTopic($topic)
+ {
+ $this->_topic = $topic;
+ }
+
+ function getContent()
+ {
+ return $this->_content;
+ }
+
+ function setContent($content)
+ {
+ $this->_content = $content;
+ }
+
+ function getUserName()
+ {
+ return $this->_userName;
+ }
+
+ function setUserName($userName)
+ {
+ $this->_userName = $userName;
+ }
+
+ function getUserEmail()
+ {
+ return $this->_userEmail;
+ }
+
+ function setUserEmail($userEmail)
+ {
+ $this->_userEmail = $userEmail;
+ }
+
+ function getUserUrl()
+ {
+ return $this->_userUrl;
+ }
+
+ function setUserUrl($userUrl)
+ {
+ $this->_userUrl = $userUrl;
+ }
+
+ function getDate()
+ {
+ $date = new Date($this->_date);
+
+ return $date->getDate();
+ }
+
+ function setDate($date)
+ {
+ $this->_date = $date;
+ }
+
+ function getClientIp()
+ {
+ return $this->_clientIp;
+ }
+
+ function setClientIp($clientIp)
+ {
+ $this->_clientIp = $clientIp;
+ }
+
+ function setParentId($parentId)
+ {
+ $this->_parentId = $parentId;
+ }
+
+ function getParentId()
+ {
+ return $this->_parentId;
+ }
+
+ function setPrivate($private)
+ {
+ $this->_private = $private;
+ }
+
+ function getPrivate()
+ {
+ return $this->_private;
+ }
+
+ function setSpamRate($spamRate)
+ {
+ $this->_spamRate = $spamRate;
+ }
+
+ function getSpamRate()
+ {
+ return $this->_spamRate;
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/class/view/adminguestbookview.class.php
===================================================================
--- plugins/trunk/guestbook/class/view/adminguestbookview.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/class/view/adminguestbookview.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,29 @@
+<?php
+
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminplugintemplatedview.class.php" );
+
+ class AdminGuestbookView extends AdminPluginTemplatedView
+ {
+
+ function AdminGuestbookView($blogInfo)
+ {
+ $this->AdminPluginTemplatedView($blogInfo, "guestbook", "adminguestbook");
+ }
+
+ function render()
+ {
+ $blogSettings = $this->_blogInfo->getSettings();
+
+ $pluginEnabled = $blogSettings->getValue("plugin_guestbook_enabled");
+ $postPerPage = $blogSettings->getValue("plugin_guestbook_postperpage");
+
+ if ($postPerPage == "")
+ $postPerPage = 10;
+
+ $this->setValue("pluginEnabled", $pluginEnabled);
+ $this->setValue("postPerPage", $postPerPage);
+
+ parent::render();
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/imgs/email.gif
===================================================================
(Binary files differ)
Property changes on: plugins/trunk/guestbook/imgs/email.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: plugins/trunk/guestbook/imgs/home.gif
===================================================================
(Binary files differ)
Property changes on: plugins/trunk/guestbook/imgs/home.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: plugins/trunk/guestbook/imgs/ip.gif
===================================================================
(Binary files differ)
Property changes on: plugins/trunk/guestbook/imgs/ip.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: plugins/trunk/guestbook/imgs/recycle.gif
===================================================================
(Binary files differ)
Property changes on: plugins/trunk/guestbook/imgs/recycle.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: plugins/trunk/guestbook/imgs/reply.gif
===================================================================
(Binary files differ)
Property changes on: plugins/trunk/guestbook/imgs/reply.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: plugins/trunk/guestbook/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/guestbook/locale/locale_en_UK.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/locale/locale_en_UK.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,40 @@
+<?php
+$messages["manageGuestbook"] = "Guestbook Management";
+$messages["Guestbook"] = "Guestbook";
+$messages["guestbook"] = "Guestbook";
+
+$messages["guestbook_postperpage"] = "Post Per Page";
+$messages["guestbook_plugin_enabled"] = "Enable this plugin";
+$messages["guestbook_plugin"] = "Guestbook Plugin";
+
+$messages["guestbook_settings_saved_ok"] = "Guestbook settings saved successfully!";
+$messages["guestbook_error_postperpage"] = "Post PerPage Should > 0!";
+
+$messages["label_configuration"] = "Configuration";
+$messages["label_enable"] = "Enable";
+$messages["label_postperpage"] = "Post Per Page";
+
+$messages["label_totalposts"] = "Total Posts: ";
+$messages["label_totalpages"] = "Total Pages: ";
+$messages["label_currentpage"] = "Current Page: ";
+$messages["label_gotopage"] = "Goto Page: ";
+
+$messages["label_author"] = "Author";
+$messages["label_post"] = "Post";
+$messages["label_refresh"] = "Refresh";
+
+$messages["label_firstpage"] = "First Page";
+$messages["label_prevpage"] = "Previous Page";
+$messages["label_nextpage"] = "Next Page";
+$messages["label_endpage"] = "End Page";
+
+$messages["label_guest"] = "Guest";
+
+$messages["label_addpost"] = "Add NewPost";
+$messages["label_baseurl"] = "Back Homepage";
+$messages["label_viewpost"] = "View Post";
+$messages["label_reset"] = "Reset Content";
+
+$messages["label_delete_post"] = "Delete this post?";
+$messages["label_reset_content"] = "Reset content?";
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/guestbook/locale/locale_zh_TW.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/locale/locale_zh_TW.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,40 @@
+<?php
+$messages["manageGuestbook"] = "留言板管理";
+$messages["Guestbook"] = "留言板設定";
+$messages["guestbook"] = "留言板";
+
+$messages["guestbook_postperpage"] = "每頁留言數";
+$messages["guestbook_plugin_enabled"] = "啟動外掛程式";
+$messages["guestbook_plugin"] = "留言板外掛程式";
+
+$messages["guestbook_settings_saved_ok"] = "留言板設定儲存成功。";
+$messages["guestbook_error_postperpage"] = "每頁留言數必須要 > 0!";
+
+$messages["label_configuration"] = "設定";
+$messages["label_enable"] = "啟動";
+$messages["label_postperpage"] = "每頁留言數";
+
+$messages["label_totalposts"] = "總留言數: ";
+$messages["label_totalpages"] = "總頁數: ";
+$messages["label_currentpage"] = "目前頁數: ";
+$messages["label_gotopage"] = "前往頁數: ";
+
+$messages["label_author"] = "留言者";
+$messages["label_post"] = "留言內容";
+$messages["label_refresh"] = "重新整理";
+
+$messages["label_firstpage"] = "首頁";
+$messages["label_prevpage"] = "上頁";
+$messages["label_nextpage"] = "下頁";
+$messages["label_endpage"] = "末頁";
+
+$messages["label_guest"] = "訪客";
+
+$messages["label_addpost"] = "新增留言";
+$messages["label_baseurl"] = "返回首頁";
+$messages["label_viewpost"] = "觀看留言";
+$messages["label_reset"] = "清除內容";
+
+$messages["label_delete_post"] = "確定要刪除此筆留言嗎?";
+$messages["label_reset_content"] = "確定要清除內容嗎?";
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/pluginguestbook.class.php
===================================================================
--- plugins/trunk/guestbook/pluginguestbook.class.php 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/pluginguestbook.class.php 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,66 @@
+<?php
+ include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+ include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
+
+ class PluginGuestbook extends PluginBase
+ {
+ var $_pluginEnabled;
+ var $_postPerPage;
+
+ function PluginGuestbook()
+ {
+ $this->PluginBase();
+
+ $this->id = "guestbook";
+ $this->description = "Provide guestbook for pLog.";
+ $this->author = "Minstrel Chiu";
+ $this->locales = Array("en_UK" , "zh_TW");
+
+ $this->init();
+ }
+
+ function init()
+ {
+ $this->registerBlogAction("Guestbook", "GuestbookAction");
+ $this->registerBlogAction("DeleteGuestbookPost", "GuestbookAction");
+ $this->registerBlogAction("AddGuestbookPost", "GuestbookAction");
+ $this->registerBlogAction("ReplyGuestbookPost", "GuestbookAction");
+ $this->registerBlogAction("GuestbookForm", "UpdateGuestbookAction");
+
+ $this->registerAdminAction("guestbook", "AdminGuestbookAction");
+ $this->registerAdminAction("updateGuestbook", "AdminUpdateGuestbookAction");
+
+ $menu =& Menu::getMenu();
+
+ if(!$menu->entryExists( "/menu/controlCenter/manageGuestbook"))
+ $this->addMenuEntry("/menu/controlCenter", "manageGuestbook", "", "", true, false);
+
+ $this->addMenuEntry("/menu/controlCenter/manageGuestbook", "Guestbook", "?op=guestbook", "");
+ }
+
+ function register()
+ {
+ $blogSettings = $this->blogInfo->getSettings();
+
+ $this->_pluginEnabled = $blogSettings->getValue("plugin_guestbook_enabled");
+ $this->_postPerPage = $blogSettings->getValue("plugin_guestbook_postperpage");
+ }
+
+ function isEnabled()
+ {
+ return $this->_pluginEnabled;
+ }
+
+ function pluginTemplatePage()
+ {
+ $rg = new RawRequestGenerator($this->blogInfo);
+
+ $rg->addParameter( "op", "Guestbook" );
+ $rg->addParameter( "blogId", $this->blogInfo->getId());
+
+ $templatePage = $rg->getIndexUrl().$rg->getRequest();
+
+ return $templatePage;
+ }
+ }
+?>
\ No newline at end of file
Added: plugins/trunk/guestbook/readme.txt
===================================================================
--- plugins/trunk/guestbook/readme.txt 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/readme.txt 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,14 @@
+Plugin: Guest Book
+Author: Minstrel
+Release Date: 2005/03/24
+Version: 1.0
+
+This plugin offers you a complete guest book based on pLog plugin framework.
+
+Install:
+2. Configurate your Guest Book plugin in your pLog control center
+3. Use $guestbook->pluginTemplatePage() to get guest book template page url
+
+Usage:
+Use the following URL to call your pLog Flickr Plugin Page
+http://your-plog/index.php?op=Guestbook&blogId=1
\ No newline at end of file
Added: plugins/trunk/guestbook/templates/adminguestbook.template
===================================================================
--- plugins/trunk/guestbook/templates/adminguestbook.template 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/templates/adminguestbook.template 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,32 @@
+{include file="$admintemplatepath/header.template"}
+{include file="$admintemplatepath/navigation.template" showOpt=Guestbook title=$locale->tr("guestbook_plugin")}
+<form name="GuestbookConfig" method="post">
+ <fieldset class="inputField">
+ <legend>{$locale->tr("label_configuration")}</legend>
+ {include file="$admintemplatepath/successmessage.template"}
+ {include file="$admintemplatepath/errormessage.template"}
+ <div class="field">
+ <label for="pluginEnabled">{$locale->tr("label_enable")}</label>
+ <span class="required"></span>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" name="pluginEnabled" id="pluginEnabled" {if $pluginEnabled} checked="checked" {/if} value="1" />{$locale->tr("guestbook_plugin_enabled")}
+ </div>
+ </div>
+
+ <div class="field">
+ <label for="postPerPage">{$locale->tr("label_postperpage")}</label>
+ <span class="required">*</span>
+ <div class="formHelp">{$locale->tr("guestbook_postperpage")}</div>
+ <input class="text" type="text" name="postPerPage" id="postPerPage" value="{$postPerPage}" width="10" />
+ </div>
+
+ </fieldset>
+
+ <div class="buttons">
+ <input type="hidden" name="op" value="updateGuestbook" />
+ <input type="reset" name="{$locale->tr("reset")}" />
+ <input type="submit" name="{$locale->tr("update_settings")}" value="{$locale->tr("update")}" />
+ </div>
+</form>
+{include file="$admintemplatepath/footernavigation.template"}
+{include file="$admintemplatepath/footer.template"}
Added: plugins/trunk/guestbook/templates/guestbook.template
===================================================================
--- plugins/trunk/guestbook/templates/guestbook.template 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/templates/guestbook.template 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,223 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$locale->getLanguageId()}"
+ lang="{$locale->getLanguageId()}-TW" dir="{$locale->getDirection()}">
+ <head>
+ <meta name="robots" content="noindex,nofollow" />
+ <meta http-equiv="Content-Type" content="text/html;charset={$locale->getCharset()}" />
+ <meta http-equiv="Content-Language" content="{$locale->getLanguageId()}" />
+ <title>{$locale->tr("guestbook")}</title>
+
+ <style>
+ {literal}
+body {
+ margin:0px 0px;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ padding:0px;
+ text-align:center;
+ font:12px arial, times new roman, lucida sans unicode, sans-serif;
+ color:#333;
+ background:#ffffff
+ }
+.banner {
+ text-align:center;
+ font-size:24px;
+ }
+#Container {
+ width:800px;
+ margin:0px auto;
+ text-align:left;
+ padding: 0px;
+ border: 0px solid #ccc;
+ background:#ffffff
+ color: #333;
+ }
+td,tr {
+ font-size:12px;
+ }
+
+a:link {
+ color: #336699;text-decoration:none;
+ }
+
+a:visited {
+ color: #6699FF;text-decoration:none;
+ }
+
+a:hover {
+ color: red
+ }
+
+font {
+ text-decoration: none
+ }
+
+input.text,input.file,select,textarea {
+ color:#000000;
+ background-color:#ffffff;
+ border:1 solid #101010
+ }
+
+input.button {
+ color: #000000;
+ border-width: 1px;
+ padding: 1px;
+ font-size: 12px;
+ border-color: #000000;
+ height: 18px;
+ background-color: #dedfdf;
+ }
+ {/literal}
+ </style>
+
+ </head>
+
+<body>
+ <div id="Container">
+
+<table cellspacing=1 cellpadding=1 align=center style="border:1px solid #ccc; width:97%;">
+<tr><td height=70 border="1">
+<table width=100% align=center cellspacing= cellpadding=0>
+<tr><td class=banner>
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}">{$blog->getBlog()} {$locale->tr("guestbook")}</a></td>
+</td></tr>
+</table>
+</td></tr></table>
+<p>
+
+<table cellspacing=1 border=0 width=95% cellpadding="0" align="center">
+<tr><td valign="bottom" align="left">
+{$locale->tr("label_totalposts")}<font color=#0000ff>{$totalPosts}</font>
+{$locale->tr("label_totalpages")}<font color=#0000ff>{$totalPages}</font></td>
+
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}">
+<td align="right">
+{if $currentPage==1}
+<font color=#000000><font face=webdings >9</font></font>
+<font color=#000000><font face=webdings >7</font></font>
+{else}
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page=1" title="{$locale->tr("label_firstpage")}"><font color=#000000><font face=webdings >9</font></font></a>
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$currentPage-1}" title="{$locale->tr("label_prevpage")}"><font color=#000000><font face=webdings >7</font></font></a>
+{/if}
+<font color=#0000ff>{$locale->tr("label_currentpage")}{$currentPage}</font>
+{if $currentPage==$totalPages}
+<font color=#000000><font face=webdings >8</font></font>
+<font color=#000000><font face=webdings >:</font></font>
+{else}
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$currentPage+1}" title="{$locale->tr("label_nextpage")}"><font color=#000000><font face=webdings >8</font></font></a>
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$totalPages}" title="{$locale->tr("label_endpage")}"><font color=#000000><font face=webdings >:</font></font></a>
+{/if}
+
+{$locale->tr("label_gotopage")}<input type="text" name="page" size="1" value=1>
+</td>
+</form>
+</tr></table>
+
+<table border=0 cellpadding=0 cellspacing=0 width="97%" align="center"><tr bgcolor=#dcdcdc><td>
+<table width=100% border=0 cellspacing=1 cellpadding=4><tr bgcolor="#6699ff">
+<td valign="middle" width=25%><font color=#ffffff>{$locale->tr("label_author")}</font><br></td>
+<td valign="middle" width=75%><font color=#ffffff>{$locale->tr("label_post")}</font></td>
+</tr></table></td></tr></table>
+
+{foreach from=$posts item=post}
+<table width="97%" border="0" cellpadding="0" cellspacing="0" align="center">
+ <tr bgcolor=#dcdcdc>
+ <td>
+ <table width="100%" border="0" cellspacing="1" cellpadding="4">
+ <tr bgcolor=#f7f7f7>
+ <td rowspan="3" width="25%" valign="top" align="center">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td align="center" width="100%" height=120><font color=#0000ff>{if $post->getUserName()}{$post->getUserName()}{else}{$locale->tr("label_guest")}{/if}</font></td>
+ </tr>
+ <tr>
+ <td align="center" width="100%" valign="bottom">
+ <font color=#000000>{$post->getDate()}</font>
+ <img src="{$url->getBaseUrl()}/plugins/guestbook/imgs/ip.gif" alt="{$post->getClientIp()}" align="absmiddle" border=0 width=13 height=13>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td align="left" valign="top" height="15">
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" valign="top">
+ <tr>
+ <td width=70%>{$locale->tr("comment_topic")}: <b>{$post->getTopic()}</b></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr bgcolor=#f7f7f7 width=82%>
+ <td align="left" valign="top" height="90">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td valign="top" style='WORD-BREAK: break-all'>
+ {$post->getContent()}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr bgcolor=#f7f7f7>
+ <td valign="bottom">
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" height="15">
+ <tr>
+ <td valign="bottom" width=30%>
+ {if $post->getUserEmail()}<img src="{$url->getBaseUrl()}/plugins/guestbook/imgs/email.gif" alt="{$locale->tr("email")}" align="absmiddle" border=0 width=16 height=16><a href="mailto:{$post->getUserEmail()}">{$locale->tr("email")}</a>{/if}
+ {if $post->getUserUrl()}<img src="{$url->getBaseUrl()}/plugins/guestbook/imgs/home.gif" alt="{$locale->tr("url")}" align="absmiddle" border=0 width=16 height=16><a href="{$post->getUserUrl()}" target="_blank">{$locale->tr("url")}</a>{/if}
+ </td>
+ <td valign="bottom" align=right>
+ {if $owner}
+ <img src="{$url->getBaseUrl()}/plugins/guestbook/imgs/reply.gif" alt="{$locale->tr("reply")}" align="absmiddle" border=0 width=16 height=16><a href="{$url->getBaseUrl()}/index.php?op=GuestbookForm&blogId={$blogId}&id={$post->getId()}&mode=reply">{$locale->tr("reply")}</a>
+ <img src="{$url->getBaseUrl()}/plugins/guestbook/imgs/recycle.gif" alt="{$locale->tr("delete")}" align="absmiddle" border=0 width=16 height=16><a href="{$url->getBaseUrl()}/index.php?op=DeleteGuestbookPost&blogId={$blogId}&id={$post->getId()}" onclick="if(confirm('{$locale->tr("label_delete_post")}')) return true; else return false;">{$locale->tr("delete")}</a>
+ {/if}
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+{/foreach}
+
+<table border=0 width=97% cellspacing=4 cellpadding=4 align="center">
+<tr>
+<td align="center" width=15%>
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=GuestbookForm&blogId={$blogId}">
+ <input type="submit" class=button value="{$locale->tr("label_addpost")}">
+ <input type="hidden" value="add" name="mode">
+</form>
+</td>
+<td align="center" width=15%>
+<form method="post" action="{$url->getBaseUrl()}/index.php?blogId={$blogId}">
+ <input type="submit" class=button value="{$locale->tr("label_baseurl")}">
+</form>
+</td>
+<td align="right">
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}">
+<td align="right">
+{if $currentPage==1}
+<font color=#000000><font face=webdings >9</font></font>
+<font color=#000000><font face=webdings >7</font></font>
+{else}
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page=1" title="{$locale->tr("label_firstpage")}"><font color=#000000><font face=webdings >9</font></font></a>
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$currentPage-1}" title="{$locale->tr("label_prevpage")}"><font color=#000000><font face=webdings >7</font></font></a>
+{/if}
+<font color=#0000ff>{$locale->tr("label_currentpage")}{$currentPage}</font>
+{if $currentPage==$totalPages}
+<font color=#000000><font face=webdings >8</font></font>
+<font color=#000000><font face=webdings >:</font></font>
+{else}
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$currentPage+1}" title="{$locale->tr("label_nextpage")}"><font color=#000000><font face=webdings >8</font></font></a>
+<a href="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}&page={$totalPages}" title="{$locale->tr("label_endpage")}"><font color=#000000><font face=webdings >:</font></font></a>
+{/if}
+
+{$locale->tr("label_gotopage")}<input type="text" name="page" size="1" value=1>
+</td>
+</form>
+</td></tr></table>
+
+</div>
+</body>
+</html>
Added: plugins/trunk/guestbook/templates/updateguestbook.template
===================================================================
--- plugins/trunk/guestbook/templates/updateguestbook.template 2005-03-24 07:13:22 UTC (rev 1597)
+++ plugins/trunk/guestbook/templates/updateguestbook.template 2005-03-24 07:14:02 UTC (rev 1598)
@@ -0,0 +1,156 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$locale->getLanguageId()}"
+ lang="{$locale->getLanguageId()}-TW" dir="{$locale->getDirection()}">
+ <head>
+ <meta name="robots" content="noindex,nofollow" />
+ <meta http-equiv="Content-Type" content="text/html;charset={$locale->getCharset()}" />
+ <meta http-equiv="Content-Language" content="{$locale->getLanguageId()}" />
+ <title>{$locale->tr("guestbook")}</title>
+
+ <style>
+ {literal}
+body {
+ color:#000000;
+ background-color:#ffffff;
+ font-size:12px;
+ font-family:tahoma,verdana,ms sans serif,courier new;
+ }
+
+td,tr {
+ font-size:12px;
+ }
+
+a:link {
+ color: #336699;
+ text-decoration:none;
+ }
+
+a:visited {
+ color: #6699FF;
+ text-decoration:none;
+ }
+
+a:hover {
+ color: red
+ }
+
+font {
+ text-decoration: none
+ }
+
+input.text,input.file,select,textarea {
+ color:#000000;
+ background-color:#ffffff;
+ border:1 solid #101010
+ }
+
+input.button {
+ color: #000000;
+ border-width: 1px;
+ padding: 1px;
+ font-size: 12px;
+ border-color: #000000;
+ height: 18px;
+ background-color: #dedfdf;
+ }
+ {/literal}
+ </style>
+
+ </head>
+
+<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 rightmargin=0>
+<div align="center">
+
+<br/>
+
+<table border=0 cellpadding=0 cellspacing=0 width=70%>
+<tr><td valign="top" align="left">
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=Guestbook&blogId={$blogId}">
+ <input type="submit" class=button value="{$locale->tr("label_viewpost")}" name="View">
+</form>
+</td></tr></table>
+
+{if $mode=="add"}
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=AddGuestbookPost&blogId={$blogId}">
+{else}
+<form method="post" action="{$url->getBaseUrl()}/index.php?op=ReplyGuestbookPost&blogId={$blogId}&id={$id}">
+ <input type="hidden" value="{$id}" name="parentId">
+{/if}
+<table border=0 cellpadding=0 cellspacing=0 width="70%">
+<tr>
+<td bgcolor=#dcdcdc>
+<table border=0 cellpadding=4 cellspacing=1 width=100%>
+
+<tr bgcolor=#6699ff>
+<td width="16%">
+<FONT color=#ffffff></font>
+</td>
+<td valign="top">
+<font color=#ffffff></font>
+</td>
+</tr>
+
+<tr bgcolor=#f7f7f7>
+<td width="16%" align="center">
+{$locale->tr("comment_username")}
+</td>
+<td align="left">
+<input type="text" class=text value="" name="userName" size="15" maxlength="15">
+</td>
+</tr>
+
+<tr bgcolor=#f7f7f7>
+<td width="16%" align="center">
+{$locale->tr("comment_email")}
+</td>
+<td valign="top" align="left">
+<input type="text" class=text value="" name="userEmail" size="35" value="" maxlength="50">
+</td>
+</tr>
+
+<tr bgcolor=#ffffff>
+<td width="16%" align="center">
+{$locale->tr("comment_url")}
+</td>
+<td valign="top" align="left">
+<input class=text type="text" value="http://" name="userUrl" size=55 maxlength=70>
+</td>
+</tr>
+
+<tr bgcolor=#ffffff>
+<td width="16%" align="center">
+{$locale->tr("comment_topic")}
+</td>
+<td valign="top" align="left">
+<input class=text type="text" name="topic" size=55 maxlength=70>
+</td>
+</tr>
+
+<tr bgcolor=#ffffff>
+<td width="16%" valign="top" align="center">
+{$locale->tr("comment_text")}
+</td>
+<td align="left">
+{if $mode=="reply"}
+> {$parentContent}
+<br/><br/>
+{/if}
+<textarea name="content" cols="55" rows="5">
+</textarea>
+</td>
+</tr>
+
+</table>
+</td>
+</tr>
+</table>
+
+<center><br>
+<input type="Submit" class=button name="submit" value="{$locale->tr("label_addpost")}">
+<input type="reset" class=button name="reset" value="{$locale->tr("label_reset")}" onclick="if(confirm('{$locale->tr("label_reset_content")}')) return true; else return false;">
+</center>
+</form>
+
+</div>
+</body>
+</html>
More information about the pLog-svn
mailing list