Hello All,
I plan to use 5 star rating for my upcoming site, but is there a way to allow user to change his votes at a latter point of time.
Currently I am also struck with how to indicate the indicate the user that he has already voted and is about to change his votes by trying to click on the stars again. Any ideas to help me - pls.
Thanks for your help.
![]() |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| |
| ||||
|
Right now it works just like normal voting, if you vote you can't vote again. I would have to look into the code to see where you could possibly modify this to let users vote multiple times. The hard thing about this is that it wouldn't chang their vote, the website would increase the vote count as if another person voted. So their needs to be modifications for that too if you want to let users change their vote. The 5 star rating should already change the colors of the stars for when people have already voted on something. I haven't tested it in a long time so maybe it doesn't work anymore but it should.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| ||||
|
Thanks for replying. The color indication is working, was wondering if we could identify the votes of the particular user and change it directly into the DB. But my site is planned to have anonymous voting :( - which would complicate the issues further (but I can disable it for now). |
| ||||
|
We just did this modification to the insert function in vote.php - which should allow a provision to change votes, but the javascript:menealo(); is not calling this insert function at all (except for the first time). We could not trace execution of this function properly. it would be great if anyone who worked on it could comment on how to allow it call the insert again. Code: function insert() {
global $db, $the_template;
if(empty($this->ip)) {
require_once(mnminclude.'check_behind_proxy.php');
$this->ip=check_ip_behind_proxy();
}
$this->value=intval($this->value);
// check to see if user already voted for the story - if yes - update, esle insert
$asd =$db->get_var("SELECT count(*) FROM pligg_votes WHERE vote_link_id = '$this->link' and vote_user_id='$this->user'");
if($asd==0)
{
$sql="INSERT INTO " . table_votes . " (vote_type, vote_user_id, vote_link_id, vote_value, vote_ip) VALUES ('$this->type', $this->user, $this->link, $this->value, '$this->ip')";
}
else
{
$sql="UPDATE " . table_votes . " set vote_value='$this->value',vote_ip='$this->ip' WHERE vote_link_id = '$this->link' and vote_user_id='$this->user'";
}
return $db->query($sql);
}
|
| |||
|
Any news on this? I am interested in allowing users to change their vote later. Say, I like the story at first and give it a five. Then I read more or think about it more and want to give it 3 stars. An example of this is how the star ratings work on Google Video pages.
|
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Star rating images? | PurpleCow | Template Support | 2 | 06-17-2007 02:30 AM |
| Display only Star rating and the title by default | PurpleCow | Template Support | 0 | 06-16-2007 04:24 AM |
| Average Star Rating | aaronpais | General Help | 0 | 05-20-2007 10:38 AM |
| star rating bug | boardsource | Bug Report | 6 | 05-16-2007 10:10 AM |
| Star Rating System | Aqui | General Help | 1 | 01-24-2007 12:30 AM |




Linear Mode

