Comments: Enabled
Some of you may have noticed a few weeks ago that a text area for submitting comments appeared in the Pictures section of the site. Unfortunately, entering comments into the comment box would never actually produce any results. Good news! Commenting is now enabled. Feel free to browse through pictures and leave a comment if the mood strikes.
As you're posting your comments, you may find it peculiar that you don't have to sign in to anything to leave a comment and you may wonder why that is, given that Picasa does not allow anonymous comments. Well my philosophy has always been that if you have a feature that you want people to use, you should make it as easy and accessible to the user as possible. I saw having to login to your Google account as obtrusive and a barrier that would probably stop a lot of people from leaving comments. And having to leave this site for Google's login page sort of ruins the continuity of the site. I've had anonymous commenting enabled on my blog for several months now and moderating hasn't been overly time consuming, so I thought up a solution.
The solution is a big workaround and one that a lot of people probably won't be comfortable for themselves. If you'll notice when you view an image on my site (for instance), the comment author is not always the same as when you view an image directly from the PicasaWeb site (for instance). Essentially what I've done is allowed any user to post a comment on any of my photos through my own username. Once a comment is submitted, it logs the person into my Picasa account and posts the comment as though I had said it. Then to keep track of who the poster says they are, the name they entered is appended to the end of the comment, surrounded by a sequence of characters. You can see in PicasaWeb that the sequence of characters is "-={". Any time that sequence is found in a post, the text inside is stripped and set as the author. Anything after the author is discarded.
This method has a few obvious problems. First of all, PicasaWeb is going to fill up with comments posted by me and I can't really control what is posted for a time. It's not like my site gets a lot of traffic from people I don't know, though, so I think that will be fine, and I'm emailed the comments every day so that I can easily moderate them. Just to be safe, a disclaimer is tagged to the bottom of each comment, which you'll only see on the PicasaWeb site. The second problem is that this method is certainly not supported by Google. I doubt they really want me doing this, as it sort of damages the integrity of their comments and accounts. I think they likely have bigger things to worry about, but we'll see. The interesting thing is that the current version of the Google's Picasa API has a bug that will not allow a comment to be posted to an image by anyone except the owner of the Picasa account, so this is actually the only way that anyone except myself could comment on my photos through this site.
So begins the great comment experiment. It was a lot of work, but if it doesn't prove to be successful, I can always switch over to standard, authenticated commenting without too much trouble once the bug is fixed. I'm excited about this new feature and hope that it will be a way to make the site more interactive and get people more interested in seeing what new photos have been posted. Keep in mind that I finished this feature a few hours ago and I do expect some bugs (particularly if you're using Internet Explorer, but you should switch to Firefox anyway) so if it doesn't work for you, let me know and keep trying! I've done several tests and they've been successful thus far. Like I said, it was a lot of work to get comments up and running so I'll post the PHP code for how I got it working soon. I'll also be adding it to version 3.0 of my Picasa API, so look for that in the next month or two.
Comments
Hallo Cameron,
I have some problems to write the code for posting new comments to a pic. Have you some example for me? I am working with typo3 and I would like to write an extension for it. I hope you can help me.
Great work. I love it
Hi Cameron,
Having comments about your photos stored as comments submitted using your Picassa account is a cool workaround to requiring users to login, and your hack may really be the only solution for bloggers who don't have access to a datasource.
I was just thinking, however, that if you do have access to a datasource, such as a database or XML file, you could store comments about your photos on your server!
For instance, if you have a picture called "ducks08.jpg" and someone leaves a comment, you could store the comment in a table with 3 columns, one for the filename/url, one for the comment, and one for the name of the user who left the comment.
An XML mapping could solve the problem as well, but I always get tied in knots with XML :)
However, since I use Blogger, your solution may be the only way someone like me, without access to a server, could enable comments on photos. Excellent article!