[pLog-svn] r3510 - plugins/trunk/cocomment
pwestbro at devel.lifetype.net
pwestbro at devel.lifetype.net
Fri Jun 2 17:19:29 GMT 2006
Author: pwestbro
Date: 2006-06-02 17:19:27 +0000 (Fri, 02 Jun 2006)
New Revision: 3510
Modified:
plugins/trunk/cocomment/plugincocomment.class.php
Log:
Fixed the cocomment plugin so it displays when included in the template.
Modified: plugins/trunk/cocomment/plugincocomment.class.php
===================================================================
--- plugins/trunk/cocomment/plugincocomment.class.php 2006-06-02 04:42:14 UTC (rev 3509)
+++ plugins/trunk/cocomment/plugincocomment.class.php 2006-06-02 17:19:27 UTC (rev 3510)
@@ -42,36 +42,34 @@
return $this->pluginEnabled;
}
- function show()
+ function show($postId)
{
$locale = $this->blogInfo->getLocale();
+
+ // articles object
+ $articles = new Articles;
+
$rg = $this->blogInfo->getBlogRequestGenerator();
$baseUrl = $rg->getBaseUrl();
+ $post = $articles->getBlogArticle($postId);
$str = '';
$str = '<script type="text/javascript">';
$str .= 'var blogTool = "LifeType";';
- $str .= 'var blogURL = "{$url->blogLink()}";';
- $str .= 'var blogTitle = "{$blog->getBlog()}";';
- $str .= 'var postURL = "{$url->postPermalink($post)}";';
- $str .= 'var postTitle = "{$post->getTopic()} ";';
- if ( $user_ID ) {
- $str .= 'var commentAuthor = "'.$user_identity.'"';
- } else {
- $str.= 'var commentAuthorFieldName = "author";';
- }
- $str .= 'var commentAuthorLoggedIn =';
- if ( !$user_ID ) {
- $str .= false.';';
- }else {
- $str .=true.';';
- }
- $str .='var commentFormID = "commentform";';
+ $str .= 'var blogURL = "'.$rg->blogLink().'";';
+ $str .= 'var blogTitle = "'.$this->blogInfo->getBlog().'";';
+ $str .= 'var postURL = "'.$rg->postPermalink($post).'";';
+ $str .= 'var postTitle = "'.$post->getTopic().'";';
+ $str .= 'var commentAuthorFieldName = "userName";';
+ $str .= 'var commentAuthorLoggedIn = false;';
+ $str .='var commentFormID = "NewComment";';
$str .='var commentTextFieldName = "commentText";';
- $str .='var commentButtonName = "post";';
- $str .='var cocomment_force = false;';
+ $str .='var commentButtonName = "Add";';
+// $str .='var cocomment_force = false;';
$str .='</script>';
+ $str .='<script id="cocomment-fetchlet" src="http://www.cocomment.com/js/enabler.js"></script>';
+
return $str;
}
}
More information about the pLog-svn
mailing list