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

XF 1.2 I want only mods to be able to create poll's.

Discussion in 'Styling and Customization Questions' started by Lee123456789, Nov 29, 2013.

  1. Lee123456789

    Lee123456789 Member

    how do i turn off the "post a poll" option in "create thread" for all users except for admins?

    thanks in advance
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Edit: There is no permission for creating a poll, only voting on them.
     
  3. Lee123456789

    Lee123456789 Member

    Thanks Brogan,
    So, in that case how do I remove the "post a poll" option totally?
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You would need to edit the thread_create template and comment out the code.
    Or wrap it in a conditional statement for the user group IDs you want to be able to use it.
     
  5. Lee123456789

    Lee123456789 Member

    can you tell me what code to comment out please?
    do i need to make a backup of the thread_create template? if I get it all wrong?
    thanks!
     
  6. AndyB

    AndyB Well-Known Member

    To comment out a section of code in a template you use the following two commands:

    <xen:comment>

    code

    </xen:comment>

    This is the section of code you want to comment out:

    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>
    	<dl class="ctrlUnit">
    		<dt>{xen:phrase possible_responses}:</dt>
    		<dd>
    			<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>
    				</xen:foreach>
    				<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>
    			</ul>
    			<input type="button" value="{xen:phrase add_additional_response}" class="button smallButton FieldAdder JsOnly" data-source="ul.PollResponseContainer li" data-maxfields="{$xenOptions.pollMaximumResponses}" />
    		</dd>
    	</dl>
    
    	<!-- slot: after_poll_responses -->
    	<dl class="ctrlUnit">
    		<dt></dt>
    		<dd>
    			<ul>
    				<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">
    						<li>
    							<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>
    							</select>
    						</li>
    					</ul>
    				</li>
    			</ul>
    		</dd>
    	</dl>
    
     
  7. Jeremy

    Jeremy XenForo Moderator Staff Member

    That will remove it globally, not just non-staff. He'll need to use a conditional like @Brogan stated.
     
  8. arms

    arms Active Member

  9. Lee123456789

    Lee123456789 Member

    Evening all,
    thanks to all that have helped so far!

    I used the method set out bu AndyB yesterday and it did the job, but i like the look of the method that arms has pointed to!
    will that do what I asked in the first place?

    anyway here is my problem:

    [​IMG]

    as you can see in the picture I have 2 create thread and preview buttons! how do I remove the bottom two and also the bit i have highlighted can we remove those options also?

    thanks
     
  10. BassMan

    BassMan Well-Known Member

    There should be an option in the core to disable poll creating or at least an add-on.
     
  11. AndyB

    AndyB Well-Known Member

    Lee,

    You need to create a new thread for each question. Make sure your thread title explains clearly what you need help with. Also be sure to use Google or the search here to find answers to questions you may have.
     

Share This Page