Hi guys,
I've looked around on this site and have seen a few topics regarding displaying the poll to guests but most of them seem to be outdated so i thought i'd just start a new one. I hope im not going against the rules.
Anyways this is what I want:
I want a block that displays the poll even to guest. They might not have voting powers but it should display [maybe when they click on Vote thats when they get told to login/register] or alternatively there could be not button for them. The guests should NOT also see the results of the poll.
I have tried using the ssi php block and its not showing anything to guests...so what'd make them register if they can't even see?
I hope someone can help.
Cheers
In your membergroup permissions check to make sure that it is set so guests can view polls.
Also, check to see that a guest can view the block.
Thanks for the reply.
I have both checked and still there's nothing. I am running smf 1.1.10 by the way. On the portal page the block just appears empty.
Are you using ssi_showPoll? If so, open up SSI.php, find function ssi_showPoll and delete the lines
$boardsAllowed = boardsAllowedTo('poll_view');
if (empty($boardsAllowed))
return array();
and change
$request = db_query("
SELECT
p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD
FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
WHERE p.ID_POLL = t.ID_POLL
AND t.ID_TOPIC = $topic
AND b.ID_BOARD = t.ID_BOARD
AND $user_info[query_see_board]" . (!in_array(0, $boardsAllowed) ? "
AND b.ID_BOARD IN (" . implode(', ', $boardsAllowed) . ")" : '') . "
LIMIT 1", __FILE__, __LINE__);
to
$request = db_query("
SELECT
p.ID_POLL, p.question, p.votingLocked, p.hideResults, p.expireTime, p.maxVotes, b.ID_BOARD
FROM ({$db_prefix}topics AS t, {$db_prefix}polls AS p, {$db_prefix}boards AS b)
WHERE p.ID_POLL = t.ID_POLL
AND t.ID_TOPIC = $topic
AND b.ID_BOARD = t.ID_BOARD
LIMIT 1", __FILE__, __LINE__);
This should allow everyone to be able to see every poll on your forum, including polls that might be in admin-only boards. I haven't tested it, but it seems that these are the lines that are preventing guests from seeing the polls.
Thanks a lot. That did it, with a few tweaks though :)
Great work, I like how its looking now.
Cheers
Oh, yeah. There's always tweakage to be done. ;) I figure if I point you in the right direction, you can figure out how to get to where you want to go.