Tuesday, August 14, 2007

Recent comments plugin or not

Tinyau gave me valuable comments on this theme. He thinks the 'bottombar' may be of same width of the content. I have to think about that because I may not have sufficient width for the content.

My first attempt for a plugin was to display recent comments. My requirment is very simple, i.e. just display a few (user selectable) comments with links to the post and how long ago that comment was posted. Tinyau has been using a fairly complicated one for his blogs and he introduced that Brian's recent comments plugin to me which Tinyau also ported to Habari. That's far too much for a dummy like me.

I decided to go back to basic. The Habari wiki has a great example to follow. The only addition I did was to add a function to compute the time difference between time() and when the comment was posted to tell 'how long ago'. That function is placed within the CustomTheme class so I just call it like this


customtheme::timediff($comment->date,2,0,'ago ');


where 2nd argument of the timediff function is number of digits, 3rd is for timezone difference and last argument is text to append the output number.

No comments:

Post a Comment