The default setting for value (option value="0")

Started by innaahtina, May 16, 2018, 02:41:01 PM

Previous topic - Next topic

innaahtina

Hello, Tell me how to make default settings. I tried it, but it didn't work.

function template_initq()
{
global $context, $settings, $options, $txt;

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['pm_prefs'] = 0;
}


Initially there was a menu with 3 options, but I want to remove it and make the default specific option.
Here's the code with value:
<dt>
<label for="pm_prefs">', $txt['pm_display_mode'], ':</label>
</dt>
<dd>
<select name="pm_prefs" id="pm_prefs" onchange="if (this.value == 2 &amp;&amp; !document.getElementById(\'copy_to_outbox\').checked) alert(\'', $txt['pm_recommend_enable_outbox'], '\');">
<option value="0"', $context['display_mode'] == 0 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_all'], '</option>
<option value="1"', $context['display_mode'] == 1 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_one'], '</option>
<option value="2"', $context['display_mode'] == 2 ? ' selected="selected"' : '', '>', $txt['pm_display_mode_linked'], '</option>
</select>
</dd>


as I understand it, i need to insert this value at the beginning of the file, but how to do it with value (option value="0")?

Sir Osis of Liver

If you want to remove the select menu and force the same option on all members, this may do what you want -

PersonalMessage.php



// Preferences...
$context['display_mode'] = WIRELESS ? 0 : $user_settings['pm_prefs'] & 3;

$context['display_mode'] = 1;

$subActions = array(


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

innaahtina


Advertisement: