Go Back   Pligg CMS Forum > Pligg Help > General Help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-27-2007, 11:55 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Exclamation Changing votes on 5 star rating

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.
Reply With Quote
  #2 (permalink)  
Old 02-28-2007, 11:37 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Any suggestions? Currently we are forced to think into one direction, so a small diversion should help us strike a different idea.
Reply With Quote
  #3 (permalink)  
Old 02-28-2007, 11:42 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
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.
Reply With Quote
  #4 (permalink)  
Old 02-28-2007, 11:48 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
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).
Reply With Quote
  #5 (permalink)  
Old 03-01-2007, 07:50 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
Arrow Need help from dev who worked/ know abt menealo - pls

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);
	}
Thanks for your help.
Reply With Quote
  #6 (permalink)  
Old 06-01-2007, 10:51 AM
Casual Pligger
 
Join Date: May 2007
Posts: 36
Thanks: 1
Thanked 0 Times in 0 Posts
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.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
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


Search Engine Friendly URLs by vBSEO 3.2.0