View Single Post
  #3 (permalink)  
Old 07-20-2007, 01:41 AM
tbones tbones is offline
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,071
Thanks: 53
Thanked 25 Times in 23 Posts
Question

Is the vote value unknown in that context? If yes, I could provide a solution in pseudo code:

The dataset is unique with user_id and story_id because the user can´t vote multiple times. So give a marker value as parameter. Let´s say -20.

unvote (user_id, story_id, -20)

function userid (user_id, story_id, vote_value)
{

if {vote_value = -20}

vote_value = SELECT vote_value FROM pligg_votes WHERE user_id = user_id AND story_id = story_id

else {}

.... (function as it is now)

}


My other hot topics:
v9.5: Submit step 3 related sidebar
v9.5: Comments to discarded stories

Last edited by tbones; 07-20-2007 at 01:46 AM..
Reply With Quote