That makes a lot of sense. I didn't notice CLIENTINFO_CLIENT_INDEX in the include I was trying to write this from. Hopefully this works.
Edit: It worked
now to translate the integer into a yes or no. I'm trying to understand this portion of the handler. I got this code from ckSurf and I'm confused how it gets this:
PHP Code:
if (item_info[0][VOTEINFO_ITEM_INDEX] == 0) { // If the winner is Yes
votesYes = item_info[0][VOTEINFO_ITEM_VOTES];
if (num_items > 1) {
votesNo = item_info[1][VOTEINFO_ITEM_VOTES];
}
}
else { // If the winner is No
votesNo = item_info[0][VOTEINFO_ITEM_VOTES];
if (num_items > 1) {
votesYes = item_info[1][VOTEINFO_ITEM_VOTES];
}
}
What is this checking "item_info[0][VOTEINFO_ITEM_INDEX] == 0" in the if statement and why do the votesNo and votesYes change places depending on the outcome of the if statement?
__________________