i\'ve written my own that works well however i\'m trying to make it so each user can only vote once for an item...
so i\'m storing a cookie called votedata..
which is a serilazed array of:
[$d.\"_\".$id]
$d = type of item
$id = # of item
and then i\'m setting
votedata[\'type_id\'] = $thiervote
then reserializing it
and re-storing it into the cookie.
code
if( isset($HTTP_COOKIE_VARS[\'votedata\'])) {
$votedata = isset( $HTTP_COOKIE_VARS[\'votedata\'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[\'votedata\'])) : \"\";
$voteid = ($d.\"_\".$id);
$votedata[\"\'\".$voteid.\"\'\"] = ($myvote); // sets the var votedata[\'map_2\']=10; for example
$serialized_votedata = serialize($votedata);
setcookie(\'votedata\', $serialized_votedata, $date, \"/\", \"$cookiedomain\", false);
} else {
$votedata = Array();
$voteid = ($d.\"_\".$id);
$votedata[\"\'\".$voteid.\"\'\"] = ($myrank); // sets the var votedata[\'map_2\']=10; for example
$serialized_votedata = serialize($votedata);
}
if any php GURUs would like to clean this code up so my data is in proper format and i can pull it properly It would be very appreciated
thanks 😉
-Ace