More Info from New Members

Divinum Fiat

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?
 
aha! Thank you, James. Hopefully this works.

Code:
//({$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:option value="none">{xen:phrase do_nothing}</xen:option>
                <xen:option value="approve">{xen:phrase approve}</xen:option>
                <xen:option 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:option>
            </xen:radiounit>
            <xen:checkboxunit label="">
                <xen:option name="users[{$user.user_id}][notify]">{xen:phrase notify_user_if_action_was_taken}</xen:option>
            </xen:checkboxunit>
        </fieldset>
    </xen:foreach>
    
    <xen:submitunit save="{xen:phrase process_users}" />
</xen:form>
 
I triple checked again and I can't see where I made a mistake. Something strange did happen though. When I find the file in Filezilla I right-click the file and say "edit." I changed the code and then clicked out of the file. Then I tried clicking out of Filezilla and I get a message saying "some files are still being edited or uploaded." I tried waiting and waiting but nothing happens. If I close Filezilla and then reopen the file the code is still there. Not sure if this could have something to do with it?

Code:
// public function actionModerated()
    {
        $users = $this->_getUserModel()->getUsers(array(
            'user_state' => 'moderated'
        ), array('join' => XenForo_Model_User::FETCH_USER_PROFILE));
        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);
 
Yes, that worked! Thank you, Jake! It did do something strange however. When I picked who I accepted and who to reject and clicked "process users" it brought me to the same screen with still 2 users on the page as "reject" even though I had already processed them as "accepted." I accepted them again and processed again and it worked. Will tell you if it does it again. Thank you so much!
 
Edit this file:

library/XenForo/ControllerAdmin/User.php

Add the red code:

Rich (BB 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:

Rich (BB 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:

View attachment 39824

I know this is an old thread, but I need the same thing and tried the above code changes and it did not work. I got "internal server error" when I tried to save the code in the user_moderated template.

I am a new user using the latest version after having used vbulletin for 10 years. I really need this to work so I can view 3 custom profile fields in the "users awaiting approval" list since I manually approve all users and approval is based on data in the 3 custom user fields.

Can someone please help?
 
You will need to check the server error logs to see what triggered the error. Does it save correctly if you don't include the code edits? Make sure that you have the correct fieldid parameter as well.
 
Last edited:
You will need to check the server error logs to see what triggered the error. Does it save correctly if you don't include the code edits? Make sure that you have the correct fieldid parameter as well.

Thank you for your help, but you misunderstand.

The "internal server error" was given when I tried to SAVE the code via the XenForo editing function in the user_moderated template. It was never given a chance to execute, the error was given upon saving.

Maybe Jake Bunce can chime in here since he wrote the original mod.
 
I understood that is not related to the code modification, please re-read what I said:
You will need to check the server error logs to see what triggered the error.
A 500 error is very generic. You need to look into Admin CP -> Tools -> Logs -> Server Error Log or the error logs generated by the server to understand what is the cause of the error, so we can eventually help you further. :)
 
Last edited:
Here is what it said:

Server Error Logs
No errors have been logged
And what about your HTTP server logs. They are normally located in your /var/log directory on the server, unless running centOS with CentMin Mod, in which case they are in the /home/nginx/domains/yourdomain.com/logs location.

If you are on a shared hosting, then you need to see if you can view your apache server logs from whatever panel they use.
 
Nevermind I am going another route with this. I don't want to be changing the php code in the user.php file and having to change it again everytime I upgrade to the latest versions.
 
Edit this file:

library/XenForo/ControllerAdmin/User.php

Add the red code:

Rich (BB 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:

Rich (BB 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:

View attachment 39824

Hey Jake,

The code in user.php file and the user_moderated template is different in version 1.4.3 from that you listed above.

Could you take a look at them and tell me where your code could be applied to 1.4.3?

I would appreciate it, I need this to work. I wish someone would make an add on so I could specify which custom profile fields would appear in the list of users awaiting approval.
 
Back
Top Bottom