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

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: Thumbs Up/Down
Pages: [1]   Go Down
  Print  
Author Topic: Thumbs Up/Down  (Read 1485 times)
0 Members and 1 Guest are viewing this topic.
womanw
Jr. Member
**

Karma: 0
Offline Offline

Posts: 12


« on: July 17, 2012, 00:42:49 »

Hi
I've had a lot of abuse of the rating system recently (from guests).
I wonder is there any way to leave the Thumbs Up vote option ONLY? (and remove Thumbs Down vote)
thanks!
Logged
ABTOP
Sr. Member
****

Karma: 17
Offline Offline

Posts: 406



WWW
« Reply #1 on: July 17, 2012, 00:50:28 »

Not out off the box there isn't such an option.
However, if you know CSS enough, you can remove the minus button in the template.
Logged

No personal messages unless you are a friend or you have money for me.
womanw
Jr. Member
**

Karma: 0
Offline Offline

Posts: 12


« Reply #2 on: July 17, 2012, 01:20:31 »

any chance you provide a bit more details?
at least which file exactly has to be edited..


or can you suggest how to add different mark for Thumbs Up? for example
when someone votes Thumbs Up you get 3 points instead of 1.
« Last Edit: July 17, 2012, 01:23:16 by womanw » Logged
ABTOP
Sr. Member
****

Karma: 17
Offline Offline

Posts: 406



WWW
« Reply #3 on: July 17, 2012, 03:31:04 »

any chance you provide a bit more details?
at least which file exactly has to be edited..
the file is
components/com_jcomments/tpl/default/tpl_comment.php

Voting is done by getCommentVote function with is in line 166
Markup for the buttons starts at line 179

or can you suggest how to add different mark for Thumbs Up? for example
when someone votes Thumbs Up you get 3 points instead of 1.

I guess the easiest way to change weight of the positive votes would be by changing the resulting calculated value. The button hits will stay as they are, but they would be counted differently.

There is getCommentVoteValue function n line 189 and it has the calculation of the final voting result in it (line 191)
$value = intval($comment->isgood - $comment->ispoor);

As you see, there we have a simple subtraction of negative votes from positive ones. You can multiply the positive vote count by whatever number you want and thus give it a different weight. For example, as you asked for a multiple of 3,
$value = intval(($comment->isgood*3) - $comment->ispoor);
will make positive votes count three times as much as negative ones.

I hope it helps.
« Last Edit: July 17, 2012, 04:05:55 by ABTOP » Logged

No personal messages unless you are a friend or you have money for me.
womanw
Jr. Member
**

Karma: 0
Offline Offline

Posts: 12


« Reply #4 on: July 17, 2012, 10:44:36 »

great component, great support!
many thanks!  Kiss
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: Thumbs Up/Down
 
Jump to: