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

remove guest names?

Discussion in 'XenForo Questions and Support' started by zaiger, Nov 10, 2011.

  1. zaiger

    zaiger Active Member

    I am trying to remove my guest's ability to choose their own name. I would like every guest post to come from the same username. Preferably I would like guests to post from a pre-defined user account, but that may be too complicated. Having every guest post as a "Guest" with the username "Guest" would work almost as well for me. Any ideas?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Appearance -> Templates -> thread_reply

    Replace this code:

    Code:
    	<xen:if is="{$visitor.user_id} == 0">
    		<dl class="ctrlUnit">
    			<dt><label for="ctrl_guestUsername">{xen:phrase name}:</label></dt>
    			<dd><input type="text" name="_guestUsername" value="{$visitor.username}" class="textCtrl" /></dd>
    		</dl>
    	</xen:if>
    
    With this:

    Code:
    	<xen:if is="{$visitor.user_id} == 0">
    		<input type="hidden" name="_guestUsername" value="Guest" />
    	</xen:if>
    
    You need to make the same change to this template:

    Admin CP -> Appearance -> Templates -> thread_create

    Just make sure no one registers the name "Guest" or guests will no longer be able to post because the name is in use.
     
    zaiger likes this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    You could add it to the list of disallowed words in Options -> User Registration

    I presume that won't stop the name being used, just registered with.
     
    zaiger likes this.
  4. zaiger

    zaiger Active Member

    Thanks a lot guys. I forgot that you couldn't have a guest with the same name as a registered user, which makes total sense, I just didn't think about that. Would it be terribly difficult to assign all guests to a single account? I have seen addons like the 'anonymous posting' or the 'ragtek new user notification system' where automated and manual posts are assigned to a user in the ACP, however I don't need a fancy options menu. Would that work if I put the user ID that I would like guests to post from into the template in the same way? Like say here:
    Code:
    xen:if is="{$visitor.user_id} == 0"
    and then changed the value underneath it to that account?
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That cannot be done with a template edit. An addon is required.
     
  6. zaiger

    zaiger Active Member

    Boooo :oops:

    Maybe this is a good opportunity to make my first addon. Any advice as to the best way to implement an extension for the specific changes I am looking for?
     

Share This Page