Jump to content

add theme setting [member field]


Recommended Posts

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'] );

 

Link to comment
Share on other sites


  • Management

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! >

Link to comment
Share on other sites


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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.