ArashDev Posted July 7, 2023 Posted July 7, 2023 hi again my lord I wanna use below method in theme setting to get member names, Everything works fine, but after saving the settings, instead of displaying usernames, their IDs are shown in the field. <?php return new \IPS\Helpers\Form\member( "core_theme_setting_title_{$row['sc_id']}", $value, FALSE, array('multiple' => NULL), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] );
Management terabyte Posted July 8, 2023 Management Posted July 8, 2023 You're passing the $value variable directly, but you need to load the member data first: <?php $members = NULL; if ( !empty($value) ) { $members = array(); foreach( explode( ',', $value ) AS $member ) { $members[] = \IPS\Member::load( $member ); } } return new \IPS\Helpers\Form\member( "core_theme_setting_title_{$row['sc_id']}", $members, FALSE, array('multiple' => NULL), NULL, NULL, NULL, 'theme_setting_' . $row['sc_key'] ); Board Rules - Available Products - Need a Custom Work? < Don't PM me for support, post in the forum or submit a ticket from the client area instead! >
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now