Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Jotade29 on March 20, 2025, 05:10:37 PM

Title: Where i should defined this variable?
Post by: Jotade29 on March 20, 2025, 05:10:37 PM
V: 2.0.19

In profile-modify, in the part.

'secret_answer_2' => array(
'type' => 'text',
'label' => 'Verifica respuesta secreta',
'enabled' => empty($cur_profile['openid_uri']),
'size' => 20,
'value2' => $value2,
'permission' => 'profile_identity',
'is_dummy' => true,
),

In error_logs, one error say me: undefined $value2. Where should i defined this variable?

Before array for example? $value2 = ''; ?
Title: Re: Where i should defined this variable?
Post by: Sir Osis of Liver on March 20, 2025, 05:31:19 PM
If you do that and $value2 has a value, it will be removed and possibly cause a problem.  Try this before the array -


if (!isset($value2))
$value2 = null;

Title: Re: Where i should defined this variable?
Post by: Jotade29 on March 20, 2025, 06:16:37 PM
Quote from: Sir Osis of Liver on March 20, 2025, 05:31:19 PMIf you do that and $value2 has a value, it will be removed and possibly cause a problem.  Try this before the array -


if (!isset($value2))
$value2 = null;



Thnxx uu