Recent comments plugin or not

August 15, 2007

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: