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

Disallow polls

Discussion in 'XenForo Questions and Support' started by Temery, Nov 13, 2011.

  1. Temery

    Temery Active Member

    Can I turn off the option to start a poll?
    ragtek likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't see any option or permission to disable polls. But you can remove it from the templates:

    Admin CP -> Appearance -> Templates -> thread_create

    Find and remove this block of code:

    	<h3 class="textHeading">{xen:phrase post_poll}</h3>	
    	<dl class="ctrlUnit">
    		<dt><label for="ctrl_poll_question">{xen:phrase question}:</label></dt>
    		<dd><input type="text" name="poll[question]" class="textCtrl" id="ctrl_poll_question" maxlength="100" /></dd>
    	<dl class="ctrlUnit">
    		<dt>{xen:phrase possible_responses}:</dt>
    			<ul class="PollResponseContainer">
    				<xen:foreach loop="$pollExtraArray" value="$null">
    					<li class="PollNonJsInput"><input type="text" name="poll[responses][]" class="textCtrl" placeholder="{xen:phrase poll_choice}..." maxlength="100" /></li>
    				<li><input type="text" name="poll[responses][]" class="textCtrl" placeholder="{xen:phrase poll_choice}..." maxlength="100" /></li>
    				<li><input type="text" name="poll[responses][]" class="textCtrl" placeholder="{xen:phrase poll_choice}..." maxlength="100" /></li>
    			<input type="button" value="{xen:phrase add_additional_response}" class="button smallButton FieldAdder JsOnly" data-source="ul.PollResponseContainer li" data-maxfields="{$xenOptions.pollMaximumResponses}" />
    	<!-- slot: after_poll_responses -->
    	<dl class="ctrlUnit">
    				<li><label for="ctrl_poll_multiple"><input type="checkbox" name="poll[multiple]" value="1" id="ctrl_poll_multiple" /> {xen:phrase allow_selection_of_multiple_responses}</label></li>
    				<li><label for="ctrl_poll_public_votes"><input type="checkbox" name="poll[public_votes]" value="1" id="ctrl_poll_public_votes" /> {xen:phrase display_votes_publicly}</label></li>
    				<li><label for="ctrl_poll_close"><input type="checkbox" name="poll[close]" value="1" class="Disabler" id="ctrl_poll_close" /> {xen:phrase close_this_poll_after}:</label>
    					<ul id="ctrl_poll_close_Disabler">
    							<input type="text" size="5" name="poll[close_length]" value="7" class="textCtrl autoSize" />
    							<select name="poll[close_units]" class="textCtrl autoSize">
    								<option value="hours">{xen:phrase hours}</option>
    								<option value="days" selected="selected">{xen:phrase days}</option>
    								<option value="weeks">{xen:phrase weeks}</option>
    								<option value="months">{xen:phrase months}</option>
    ragtek likes this.
  3. Mancunian

    Mancunian Member

    This really should be a configuration option.
    The User Groups have an option to restrict the ability to vote on a poll - so the same ability should exist to disallow the initial creation of a poll..

    This should be an enhancement request to the Devs.
    ragtek and Digital Doctor like this.
  4. tekgirl

    tekgirl Active Member

    Thanks for posting that code, Jake. I was trying to figure out how to eliminate the poll feature. I had no idea that it could not be toggled on or off.

    I would not mind a poll feature as long as it was not attached to every post.

    P.S. Removing the code worked perfectly! Thanks again.
    ragtek likes this.
  5. Digital Doctor

    Digital Doctor Well-Known Member

    Co-mingling of [New Threads] and [New Polls] where you have the option to start a poll with every new thread you create is weird.
    Only vBulletin was like that.
    The fact that Xenforo adopted that is weird.

    There are 22,200 threads here.
    There are probably ? 75 polls. (Note: it is too hard to find polls ! I can't count them .. because they can't be found).

    To offer something up 22,200 times when only 75 times people wanted it ... just doesn't make good sense.
    ragtek and Fuhrmann like this.
  6. Mancunian

    Mancunian Member

    Can this not go to the Devs for a formal solution to limit the ability to start a poll? Or at least an acknowledgement of this being a 'problem' with the intent of doing something about it?
    ragtek likes this.
  7. tekgirl

    tekgirl Active Member

    I would think it should.

    ragtek likes this.
  8. swatme

    swatme Well-Known Member

    hopyfully new new versions will have the ability to disable/enable polls in certain nodes
    ragtek likes this.
  9. Neil E.

    Neil E. Active Member

    I would like to see polls covered by the permission settings (I haven't gone through all the permissions yet, does this already exist?). I'm used to allowing post creation only by admins and voting only by registered users. Thus polls are for something important. It's been my experience that most people want to voice their opinion anyways, and they do this by replying after a poll. At that point I might as well just ask the question and not bother with the poll.
    Mian Shahid and (deleted member) like this.
  10. Main Company

    Main Company Active Member

    I see this option, but I also see the option located at the following thread.

    Which one to use?
  11. AndyB

    AndyB Well-Known Member

    Main Company likes this.
  12. Main Company

    Main Company Active Member

Share This Page