Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Voting System
Pages: [1]   Go Down
  Print  
Author Topic: Voting System  (Read 2637 times)
0 Members and 1 Guest are viewing this topic.
sancho
Newbie
*

Karma: 0
Offline Offline

Posts: 4


« on: August 07, 2012, 12:36:52 »

Hi Smart,

I finally got through in implementing the code you gave. Thanks for that. However, I have one more request. Is it possible to remove the positive sign "+" and the negative sign "-" in the numbers and display it in one line as opposed to two lines that it is displaying now.

Also, when voting, I would like the thumbs up/down to be replaced with 'Like' and 'Dislike', can you tell me which file to modify to achieve this?  

Lastly, how can I display 0 (zero) in the both the dislike and like when there are no votes yest. Right now, it's displaying blank.

Thanks for your help again.


Regards,


sancho


You could change this in JComments template:

1. Open file /components/com_jcomments/tpl/default/tpl_comment.php
2. Find code:
Code: (php)
<span class="vote-<?php echo $class?>"><?php echo $value?></span>
and replace with:
Code: (php)
<span class="vote-good"><?php echo $comment->isgood != '+' $comment->isgood ''?></span>/<span class="vote-poor"><?php echo $comment->ispoor != '-' $comment->ispoor ''?></span>
Logged
mark stephens
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #1 on: November 12, 2012, 23:27:55 »

Just have to replace the isgood : ''; and ispoor : ''; parts with  isgood : '0'; and ispoor : '0';

This would be the full chunk of code:
Code:
<span class="vote-good"><?php echo $comment->isgood != '+' $comment->isgood '0'?></span>/<span class="vote-poor"><?php echo $comment->ispoor != '-' $comment->ispoor '0'?></span>

That will show zeros in both the good and poor comments places when there are no votes yet.
« Last Edit: November 12, 2012, 23:58:10 by mark stephens » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Suggestions, Wishlists & Feature Requests    Topic: Voting System
 
Jump to: