xoops forums

Dona_Brasil

Not too shy to talk
Posted on: 2008/6/11 10:51
Dona_Brasil
Dona_Brasil (Show more)
Not too shy to talk
Posts: 153
Since: 2005/10/28
#1

Increasing the usability of XOOPS comments: one TIP and one QUESTION

I'm trying to improve the usability of the comments in XOOPS. Technically, the systems works perfect, but it needs two things to make it appealing to users:

- If people are not logged in, they should see a message like "Please login to comment"
- If there are no comments, there should be a message "no comments yet". Otherwise, many non-technical people simply don't understand what the comments section is for.

I resolved one of these two issues, I'm still looking for a solution for the second one. So I have a tip and a question!

TIP: Show "Please login to comment" message below your articles to people who are not logged in

I wrote a small howto on how to get that message displayed on your site, it is posted here. The trick has also been implemented on that site, so you can see how it looks like. I hope it helps more people, it would be great if it would be implemented on XOOPS.org



QUESTION: How do I show a message "no comments yet" when the number of comments is 0

I admit, I am a bad programmer, but what I am missing is only one line. In human language, this line should say

"If the number of comments is equal to zero, then..."

I know how to make an if-then construction in PHP, I simply don't know how to let XOOPS count the number of comments.

And did some research in the templates. I found the lines where the comments are taken from the database, and I expect that a this info is needed to formulate the line:

<{include file="db:system_comment.html" comment=$comments[i]}>


and

<{foreach item=reply from=$comments[i].replies}>


Is there any PHP-guru who can tell me how to count the number of comments so that I can make the if-then construction?? Many thanks!

kerkyra

Just can't stay away
Posted on: 2008/6/11 11:59
kerkyra
kerkyra (Show more)
Just can't stay away
Posts: 553
Since: 2005/2/14
#2

Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION

you could try in the template with smarty

Quote:

<{if count($comments) == 0}>
There are no comments in here...:)
<{/if}>
www.guidemap.gr - Beta is out...

Dona_Brasil

Not too shy to talk
Posted on: 2008/6/11 12:26
Dona_Brasil
Dona_Brasil (Show more)
Not too shy to talk
Posts: 153
Since: 2005/10/28
#3

Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION

OK, I'm gonna try this...

Dona_Brasil

Not too shy to talk
Posted on: 2008/6/11 12:40
Dona_Brasil
Dona_Brasil (Show more)
Not too shy to talk
Posts: 153
Since: 2005/10/28
#4

Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION

Yippeeeee! It works! Thanks!

dodhelp

Just popping in
Posted on: 2008/7/5 7:56
dodhelp
dodhelp (Show more)
Just popping in
Posts: 2
Since: 2008/7/5 7
#5

Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION

I had this same problem, thanks