this is where i get the problem i think,
692: p.question, p.voting_locked, p.hide_results, p.expire_time, p.max_votes, p.change_vote,
693: p.guest_vote, p.id_member, IFNULL(mem.real_name, p.poster_name) AS poster_name
694: FROM {db_prefix}polls AS p
695: LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = p.id_member)
696: WHERE p.id_poll = {int:id_poll}
697: LIMIT 1',
698: array(
699: 'id_poll' => $topicinfo['id_poll'],
700: )
701: );
702: $pollinfo = $smcFunc['db_fetch_assoc']($request);
703: $smcFunc['db_free_result']($request);
704:
705: $request = $smcFunc['db_query']('', '
706: SELECT COUNT(DISTINCT id_member) AS total
707: FROM {db_prefix}log_polls
708: WHERE id_poll = {int:id_poll}',
709: array(
710: 'id_poll' => $topicinfo['id_poll'],
711: )
==>712: );
713: list ($pollinfo['total']) = $smcFunc['db_fetch_row']($request);
714: $smcFunc['db_free_result']($request);
715:
716: // Get all the options, and calculate the total votes.
717: $request = $smcFunc['db_query']('', '
718: SELECT pc.id_choice, pc.label, pc.votes, IFNULL(lp.id_choice, -1) AS voted_this
719: FROM {db_prefix}poll_choices AS pc
720: LEFT JOIN {db_prefix}log_polls AS lp ON (lp.id_choice = pc.id_choice AND lp.id_poll = {int:id_poll} AND lp.id_member = {int:current_member})
721: WHERE pc.id_poll = {int:id_poll}',
722: array(
723: 'current_member' => $user_info['id'],
724: 'id_poll' => $topicinfo['id_poll'],
725: )
726: );
727: $pollOptions = array();
728: $realtotal = 0;
729: $pollinfo['has_voted'] = false;
730: while ($row = $smcFunc['db_fetch_assoc']($request))
731: {
732: censorText($row['label']);