Startpage >> Plog >> PluginCookieComments

Plugin Cookie Comments

<< 迴響加上表情符號支援 | Plog.HomePage | 加上文章逆向連結 >>


迴響加上 Cookie 的支援

請依照下面的步驟,將 Cookie 的功能增加到 pLog 上面:

  1. 下載 Mark 從 MT 擷取下來的 Cookie.zip,另外這次有點複雜,所以請同時下載 my_template.zip 以便參考!
  2. 將檔案解壓縮後上傳到 /your-blog/js/cookie 的目錄下
  3. 修改模版。

以的 Mark's Place 為例子,是採用 grey 這個模版,所以必須修改 header.template 與 commentform.template 這 2 個模版。修改前請先確認 From 的名字為 NewComment,Textarea 的名字為 commentText,如果不一樣,請自行修改模版或是 Javascript 的程式。確定後,請將下面的修改程式自行安排在適當位置(請參考 my_template.zip 的例子):

 <script type="text/javascript" src="js/cookie/cookie.js"></script>
 <script type="text/javascript">var HOST = 'blog.markplace.net';</script>
 <form name="NewComment" action="{$url->getBaseUrl()}/index.php" method="post">
 置換為
 <form name="NewComment" action="{$url->getBaseUrl()}/index.php" method="post" 
onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">
  記錄個人資訊<input type="radio" id="bakecookie" name="bakecookie" /> 
<label for="bakecookie">是</label><input type="radio" id="forget" name="bakecookie"
onclick="forgetMe(this.form)" value="Forget Info" style="margin-left: 15px;" />
<label for="forget">否</label><br style="clear: both;" />
    {literal}
    <script type="text/javascript" language="javascript">
    <!--
    document.NewComment.userEmail.value = getCookie("mtcmtmail");
    document.NewComment.userName.value = getCookie("mtcmtauth");
    document.NewComment.userUrl.value = getCookie("mtcmthome");
    if (getCookie("mtcmtauth")) {
        document.NewComment.bakecookie[0].checked = true;
    } else {
        document.NewComment.bakecookie[1].checked = true;
    }
    //-->
    </script>
    {/literal}

感謝:在發表迴響時,可以記錄個人的資料,方便在常發表文章時,不用一再重覆輸入, powered by Mark(102)


<< 迴響加上表情符號支援 | Plog.HomePage | 加上文章逆向連結 >>

頁面最後更新於 2005 年 01 月 11 日,10:56 PM