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

More Info from New Members

Discussion in 'XenForo Questions and Support' started by Core Freedom, Jan 24, 2013.

  1. Core Freedom

    Core Freedom Well-Known Member

    I'm trying to give my community the feel of it being a private community. All members are currently manually approved. What I'd like to add is a field where people have to give an explanation as to why they think they would make a good fit for our community when they register rather than just adding a screen name and email address. Can this area be customized some?
     
    erich37 likes this.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Users -> Custom User Fields

    A field can be made to show on the reg form.
     
    MattW and Core Freedom like this.
  3. Core Freedom

    Core Freedom Well-Known Member

    I'm looking in all the wrong places! It worked. Awesome, thanks Jake!
     
    MattW likes this.
  4. Core Freedom

    Core Freedom Well-Known Member

    Jake, while the added on fields were easy to implement, they are not showing up in the "users to be manually approved." The whole point of the extra fields is for them to state who referred them or tell us more about why they want to join. These answers are there in their profile but only after I approve them, which is too late. Is there any way I can have these answers show up in the "users awaiting approval" page?
     
    erich37 likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Edit this file:

    library/XenForo/ControllerAdmin/User.php

    Add the red code:

    Code:
    	public function actionModerated()
    	{
    		$users = $this->_getUserModel()->getUsers(array(
    			'user_state' => 'moderated'
    		), array('join' => XenForo_Model_User::FETCH_USER_PROFILE | XenForo_Model_User::FETCH_USER_OPTION));
    		if (!$users)
    		{
    			return $this->responseMessage(new XenForo_Phrase('no_users_awaiting_approval'));
    		}
    
    		$users = $this->_getUserModel()->prepareUserCards($users);
    
    		$viewParams = array(
    			'users' => $users
    		);
    
    		return $this->responseView('XenForo_ViewAdmin_User_Moderated', 'user_moderated', $viewParams);
    	}
    
    Edit this template:

    Admin CP -> Development -> Admin Templates -> user_moderated

    Add the red code:

    Code:
    <xen:title>{xen:phrase users_awaiting_approval}</xen:title>
    
    <xen:form action="{xen:adminlink 'users/moderated/update'}">
    	<xen:foreach loop="$users" value="$user">
    		<fieldset>
    			<xen:controlunit label="{xen:phrase user}:"><a href="{xen:adminlink users/edit, $user}" target="_blank">{$user.username}</a> ({$user.email}) ({$user.customFields.fieldid})</xen:controlunit>
    			<xen:radiounit label="{xen:phrase action}:" name="users[{$user.user_id}][action]">
    				<xen:option value="none" selected="true">{xen:phrase do_nothing}</xen:option>
    				<xen:option value="approve">{xen:phrase approve}</xen:option>
    				<xen:option value="reject">
    					<xen:label>{xen:phrase reject_and_delete_with_rejection_reason}:</xen:label>
    					<xen:textbox placeholder="{xen:phrase optional}" name="users[{$user.user_id}][reject_reason]" size="45" />
    				</xen:option>
    			</xen:radiounit>
    			<xen:checkboxunit label="">
    				<xen:option name="users[{$user.user_id}][notify]" selected="true">{xen:phrase notify_user_if_action_was_taken}</xen:option>
    			</xen:checkboxunit>
    		</fieldset>
    	</xen:foreach>
    	
    	<xen:submitunit save="{xen:phrase process_users}" />
    </xen:form>
    
    That will show the value of that custom field on the moderation page, like so:

    Screen shot 2013-01-27 at 4.25.41 PM.png
     
  6. Core Freedom

    Core Freedom Well-Known Member

    It didn't work. I did a test registration and it tell me that I have 1 "user awaiting approval." I got the following. I'm assuming it's because I added the "field ID" exactly how you added it in blue above. Wasn't quite sure if that needed to be amended and if so, to what

    Server Error

    Undefined index: show_dob_date
    1. XenForo_Application::handlePhpError() in XenForo/Model/UserProfile.php at line 56
    2. XenForo_Model_UserProfile->getUserAge() in XenForo/Model/User.php at line 1189
    3. XenForo_Model_User->prepareUserCard() in XenForo/Model/User.php at line 1206
    4. XenForo_Model_User->prepareUserCards() in XenForo/ControllerAdmin/User.php at line 605
    5. XenForo_ControllerAdmin_User->actionModerated() in XenForo/FrontController.php at line 310
    6. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    7. XenForo_FrontController->run() in /home/corefree/public_html/admin.php at line 13

    On another note, after I confirmed the website link (as the test user) I got to a place where it asks me to introduce myself and add my gender. But when I click on it I get a message that I have no permission to do so. This is probably because as the admin I had not approved this person yet. Not to confuse the people it would be nice to have a message somewhere on this page where they're also told that they are awaiting manual approval before they can post any changes. Where do I do that?
     
  7. Core Freedom

    Core Freedom Well-Known Member

    by the way, Jake, the approval process is asking them to explain in a few sentences why they are right for the forum. Is the place behind their email address the right place for all this information to show up? Any way we can make it can show under the 'user' field but before the 'action' field?
     
  8. Core Freedom

    Core Freedom Well-Known Member

    Okay, I tried adding the following to the user_moderated template:

    I changed this:

    ({$user.customFields.fieldid})

    to this:

    ({$user.customFields.who_referred_you.more_about_you})
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Looks like you didn't do the file edit correctly. Review my instructions again.
     
    Core Freedom likes this.
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That's an invalid field_id. It can only contain alphanumeric and underscore (_).
     
    Core Freedom likes this.
  11. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes you can move it to anywhere in that template.
     
  12. Core Freedom

    Core Freedom Well-Known Member

    where do I get the field ID number from? What exactly is supposed to go in this blue area?
     
  13. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Core Freedom likes this.
  14. Core Freedom

    Core Freedom Well-Known Member

    That's what I did but it's still not working.

    userfield.png
     
  15. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Therefore:

    Code:
    ({$user.customFields.who_referred_you})
    
     
    Core Freedom likes this.
  16. Core Freedom

    Core Freedom Well-Known Member

    the trouble is that there are two custom fields that need to be added. The second one is more_about_you.
    Where do I put that?
     
  17. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add both:

    Code:
    ({$user.customFields.who_referred_you})
    ({$user.customFields.more_about_you})
    
     
    Core Freedom likes this.
  18. Core Freedom

    Core Freedom Well-Known Member

    It's still not working, still getting this:

    Server Error

    Undefined index: show_dob_date
    1. XenForo_Application::handlePhpError() in XenForo/Model/UserProfile.php at line 56
    2. XenForo_Model_UserProfile->getUserAge() in XenForo/Model/User.php at line 1189
    3. XenForo_Model_User->prepareUserCard() in XenForo/Model/User.php at line 1206
    4. XenForo_Model_User->prepareUserCards() in XenForo/ControllerAdmin/User.php at line 605
    5. XenForo_ControllerAdmin_User->actionModerated() in XenForo/FrontController.php at line 310
    6. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    7. XenForo_FrontController->run() in /home/corefree/public_html/admin.php at line 13
     
  19. erich37

    erich37 Well-Known Member

    I am also looking for something like this.

    I would like to add several "Custom Profile Fields" and also the Avatar-image-uploader onto the Register-Form.
    And then approve members manually.

    However, it should be possible to see the field-input in the ACP. Wondering why this data is not showing in ACP as "Blueprint4Love" is reporting it... or if this is just a feature which has not been implemented yet ?

    Is this an idea for an Add-on ?
     
  20. Core Freedom

    Core Freedom Well-Known Member

    Jake, I really need help with this. I have user awaiting approval and I can't approve them because I get this silly error message. I've reviewed the code and can't figure out where I went wrong. Does it have to do with the code (below) or could it be because of the php form change?

    ({$user.email})<xen:title>{xen:phrase users_awaiting_approval}</xen:title>

    <xen:form action="{xen:adminlink 'users/moderated/update'}">
    <xen:foreach loop="$users" value="$user">
    <fieldset>
    <xen:controlunit label="{xen:phrase user}:"><a href="{xen:adminlink users/edit, $user}" target="_blank">{$user.username}</a> ({$user.email})({$user.customFields.who_referred_you})
    ({$user.customFields.more_about_you})</xen:controlunit>
    <xen:radiounit label="{xen:phrase action}:" name="users[{$user.user_id}][action]">
    <xen:eek:ption value="none">{xen:phrase do_nothing}</xen:eek:ption>
    <xen:eek:ption value="approve">{xen:phrase approve}</xen:eek:ption>
    <xen:eek:ption value="reject" selected="true">
    <xen:label>{xen:phrase reject_and_delete_with_rejection_reason}:</xen:label>
    <xen:textbox placeholder="{xen:phrase optional}" name="users[{$user.user_id}][reject_reason]" size="45" />
    </xen:eek:ption>
    </xen:radiounit>
    <xen:checkboxunit label="">
    <xen:eek:ption name="users[{$user.user_id}][notify]">{xen:phrase notify_user_if_action_was_taken}</xen:eek:ption>
    </xen:checkboxunit>
    </fieldset>
    </xen:foreach>

    <xen:submitunit save="{xen:phrase process_users}" />
    </xen:form>
     

Share This Page