1
Dona_Brasil
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!

2
kerkyra
Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION
  • 2008/6/11 11:59

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


you could try in the template with smarty

Quote:

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

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

OK, I'm gonna try this...

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

Yippeeeee! It works! Thanks!

5
dodhelp
Re: Increasing the usability of XOOPS comments: one TIP and one QUESTION
  • 2008/7/5 7:56

  • dodhelp

  • Just popping in

  • Posts: 2

  • Since: 2008/7/5 7


I had this same problem, thanks

Login

Who's Online

298 user(s) are online (178 user(s) are browsing Support Forums)


Members: 0


Guests: 298


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits