1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

null vote if viewing vote results

Discussion in 'XenForo Questions and Support' started by optrex, Dec 14, 2011.

  1. optrex

    optrex Active Member

    when a poll is running, I would like to prevent people from viewing the results before they vote. This could be done by:

    Hiding the view results button until after someone has voted
    Or by preventing them casting a vote if they view the results first (mulling the vote)

    Is this currently possible by way of file edit or addon?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> poll_block_vote

    Remove the red code:

    <xen:edithint template="polls.css" />
    	<ol class="pollOptions">
    		<xen:foreach loop="$poll.responses" key="$pollResponseId" value="$response">
    			<li class="pollOption"><label><xen:if is="{$poll.multiple}">
    				<input type="checkbox" name="response_multiple[]" value="{$pollResponseId}" /><xen:else />
    				<input type="radio" name="response" value="{$pollResponseId}" /></xen:if>
    	<div class="buttons">
    		<xen:if hascontent="true">
    			<div class="pollNotes">
    				<xen:if is="{$poll.multiple}">
    					<span class="multipleNote muted">{xen:phrase multiple_votes_allowed}</span>
    				<xen:if is="{$poll.public_votes}">
    					<span class="publicWarning muted">{xen:phrase your_vote_will_be_publicly_visible}</span>
    		<input type="submit" class="button primary" value="{xen:phrase cast_your_vote}" accesskey="s" />
    		<input type="button" value="{xen:phrase view_results}" class="button OverlayTrigger" data-href="{xen:link threads/poll/results, $thread}" />
    		<noscript><a href="{xen:link threads/poll/results, $thread}" class="button">{xen:phrase view_results}</a></noscript>
    That will hide the results button. They can only view results by voting.
    optrex likes this.
  3. optrex

    optrex Active Member

    thank you very much indeed :)

Share This Page