We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Customize Browse Users section | Forum

Guna
Guna Nov 18 '14
I have added the browse users page content(http://mysitename.com/admin/users/recent) in my plugin page.


It is listing all users including the admin.


I need to list and search one specific user role?


How to accomplish this?


I believe i need to change the below code. But I don't know what need to be changed?


$question = OW::getConfig()->getValue('base', 'display_name_question');   


$searchQ = array( $question => $this->text('base', 'questions_question_'.$question.'_label'),

                                                            'email' => $this->text('base', 'questions_question_email_label'),

                                                             'students' => $this->text('base','questions_account_type_7f82cd596777fb464d3dccc36e8144e8') );


  $this->assign('searchQ', $searchQ);


  $this->assign('currentSearch', array('question' => !empty($_GET['search_by']) ? $_GET['search_by'] : '',                                                    

 'value' => !empty($_GET['search']) ? htmlspecialchars($_GET['search']) : ''        ));


  $this->assign('userSearchUrl', OW::getRouter()->urlForRoute('admin_users_browse'));


Please help friends

The Forum post is edited by Guna Nov 20 '14
Guna
Guna Dec 1 '14
I have completed the task. Please change the status of the questions to be solved.
Daisy Team
Daisy Dec 10 '14
Guna, could you please share the solution. We are sure that this feature will be useful for other oxwallers.
Guna
Guna Dec 11 '14

Solution:


I have used this code in many custom pages.


if ( !empty($_GET['search']) && !empty($_GET['search_by']) )

{

   $extra = array('question' => $_GET['search_by'], 'value' => $_GET['search']);

   $type = 'search';

}

else

{

$extra = array('roleId'=>specify the role id);

        $type = isset($params['list']) ? $params['list'] : 'role';

}

$par = new ADMIN_UserListParams();

$par->setType($type);

$par->setExtra($extra);


$usersCmp = new ADMIN_CMP_UserList($par);

$this->addComponent('userList', $usersCmp);


Also in html template, call the userList variable to display userlist in the frontend.


The Forum post is edited by Guna Dec 11 '14
Umair
Umair Mar 27 '15
Guna,

What can be done with this and how can I add it any where on the website?
Guna
Guna Mar 28 '15
@Umair Hope you know how to create a plugin. In a plugin page, you can show the browse users section
Umair
Umair Mar 28 '15
oh thanks. No I dont know how to create a plugin. No development skills.
Guna
Guna Apr 1 '15
Please see https://docs.oxwall.org/dev:crash-course to develop a plugin.