I'd like to implement CoComment in my blog, but unfortunately I don't have Java- or Smarty-Skills. The following code is needed in the comments-form (WordPress-Example):
<script type="text/javascript">
var blogTool = "WordPress";
var blogURL = "<?php echo get_option('siteurl'); ?>";
var blogTitle = "<?php bloginfo('name'); ?>";
var postURL = "<?php the_permalink() ?>";
var postTitle = "<?php the_title(); ?>";<?php if ( $user_ID ) : ?>
var commentAuthor = "<?php echo $user_identity; ?>";<?php else : ?>
var commentAuthorFieldName = "author";<?php endif; ?>
var commentAuthorLoggedIn = <?php if ( !$user_ID ) { echo "false"; } else { echo "true"; } ?>;
var commentFormID = "commentform";
var commentTextFieldName = "comment";
var commentButtonName = "submit";
<script type="text/javascript">
var blogTool = 'WordPress'; // Use Serendipity here?
var blogURL = '{$serendipityBaseURL|@escape:javascript}';
var blogTitle = '{$blogTitle|@escape:javascript}';
var postURL = '{$commentform_entry.rdf_ident|@escape:javascript}';
var postTitle = '{$commentform_entry.title|@escape:javascript}';
var commentAuthor = '{$commentform_name}';
var commentAuthorFieldName = 'serendipity[name]';
var commentAuthorLoggedIn = '{if $is_logged_in}true{else}false{/if}';
var commentFormID = 'serendipity_comment';
var commentTextFieldName = 'serendipity[comment]';
var commentButtonName = 'serendipity[submit]';
</script>
If that works, please tell us or the coComment people, so that we could include it somewhere?
Maybe you need to change the things like commentButtonName to use the ID fields instead of the NAME HTML attributes...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
It works.... partially. Actually I have little problems with the automatic coComment-login and the detection if coComment is available on the visited site or not.
Are you sure about this line:
var commentAuthorLoggedIn = '{if $is_logged_in}true{else}false{/if}';
This line is undocumented by coComment and I guess, the problem is here.
I will place a post in the coComment-Blog, maybe they can help.
I keep you informed.
The "logged_in" feature actually requires a change to the serendipity_smarty_init() function, which I've committed to the 1.0 source tree. It requires a line like:
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
The yesterday mentioned problems were not serendipity-problems. Your code work properly. I had only to reboot my notebook and afterwards it was working.
On my blog I stored a installation-description (in german) for serendipity0.9.1. In addition I sended coComment the mentioned description with your logo (s9y_banner_small.png).
Cool! Please let me know if the guys from CoComment add anything about us
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fatal error: Smarty error: [in file:xxx/commentform.tpl line 4]: syntax error: unrecognized tag ‘tool’ (Smarty_Compiler.class.php, line 580) in xxx/bundled-libs/Smarty/libs/Smarty.class.php on line 1088
Is this a s9y-specific issue or do the cocomment guys have to fix something or ..?
If that works maybe you can submit this change to the cocomment guys?
Regards,
Garin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking wrote:If that works maybe you can submit this change to the cocomment guys?
It works, thanks. Someone already noticed this in the cocomment teamblog, so I'll just report that this code works and ask to change it in their code example.
Seems like they have some work left to do, though. Right now, I'm getting the cocomment bar under the textarea I'm writing this post in. Weird.