« Pay Absolutely No Attention to the Fact... | HomePage | Minor tdaxp Redesign »

Sunday, July 24, 20051122218157

More Blogspirit Problems (Almost Got Gravatars Working)

is... interesting. I believe it is one of the best blogging platforms available for beginning bloggers. But problems keep popping up. And I'm not just talking about the shoddy HTML editor which makes it a nightmare to produce even ugly pages. Or Younghusband's problem with the nonfunctional "subscribe to thread" option. Or the fact I can't trackback to my own blog anymore. I'm talking about how some features are intentionally broken.

For instance, I almost got gravatars (little pictures that go along with user email addresses) working.

Blogspirit works with templates. Using one stadandard smarty elements -- the email address of the commentator -- and standard client-side javascript, I should have been able to create gravatars with this code

<script src="http://pajhome.org.uk/crypt/md5/md5.js" type="text/javascript"></script>
<script type="text/javascript">
 {literal}
 hash = hex_md5({$comment.email}); document.write("<img src="http://www.gravatar.com/avatar.php?gravatar_id=" + hash + "" />");
 {/literal}
 </script>



Instead -- nothing.   Every part of that code works except getting the commentator's email address (in the "permalink" template).  Blogspirit intentionally broke my ability to see the email addresses of the users on the display page, even though I didn't need to display the email addresses publicly in any way and I can see the email addresses in blogspirit's administration interface anyway.

Brilliant, blogspirit. Just brilliant.

PS: WHILE WRITING THIS POST blogspirit ate the "include code" that I used to give an example of the problem!!!

Comments

You have some bugs in your code, maybe this is the reason.

{literal} tags are useful when you have some { or } in your javascript. They are forbidden when using {$variable}. So first thing, try to remove these tags.
Second, there is something strange with the document.write line, you should escape the " caracters : this one is a javascript error.

good luck.

Posted by: thomas | Monday, July 25, 2005

Thomas, thank you for your help.

The non-escaped quotation is a BLOGSPIRIT error. I copy-and-pasted the correct code into the HTML editor. The escape character showed up correctly. However, after I saved the post the "" disappeared.

At least this is better than the two times when blogspirit just ate the html code completely! Or the times blogspirit eats my entire post when I "Preview."

The new HTML editor is very dysfunctional. It can make big errors, and as your comment over " vs. " indicate, even small changes can change the meaning of a post.

-Dan

Posted by: Dan tdaxp | Monday, July 25, 2005

Doing what you did (or tried to do) is a little dangerous - it exposes the email address of the commenter to any nasty spambots floating by.

I came across the exact same issue, and solved it the same way - or rather, believed I had solved it, until I realised I was exposing the email address(es).

Here is the post about how I got it working, and why I chose to disable it.

Posted by: Matt Schinckel | Tuesday, August 23, 2005

Post a comment