1 (edited by ps21 2003-09-27 21:04)

Topic: Help with MOD Please

I am trying to add a couple of radio button options to admin_options.php.
I have added the items without any difficulty and they work perfectly in that
they post the relevant info to the database. However, the radio buttons won't stay
illuminated i.e. after submitting the radio buttoms return to being blank.
I am sure I am missing something really basic. This is the code which is really
no more than a cut and paste job from the existing options.

        <!--Start Ranking Graphics Mod-->
        <tr>
            <td class="puncon1right" style="width: 140px; white-space: nowrap">Ranking Graphics  </td>
            <td class="puncon2">
                <table class="punplain" cellpadding="6">
                    <tr>
                        <td class="punright" style="width: 35%"><a name="rank_p"><b>Use Graphics for Ranks</b></a><br>Enable this to use graphics to represent user ranks. See <a href="admin_ranks.php">Ranks</a> for more info.</td>
                        <td style="width: 65%"><input type="radio" name="form[rank_p]" value="1"<?php if ($options['rank_p'] == '1') print ' checked' ?>> Yes   <input type="radio" name="form[rank_p]" value="0"<?php if ($options['rank_p'] == '0') print ' checked' ?>> No</td>
                    </tr>
                    <tr>
                        <td class="punright" style="width: 35%"><a name="rank_adv"><b>Use Advanced Settings</b></a><br>Enable this to enable advanced settings for rank graphics. See <a href="admin_ranks.php">Ranks</a> for more info.</td>
                        <td style="width: 65%"><input type="radio" name="form[rank_adv]" value="1"<?php if ($options['rank_adv'] == '1') print ' checked' ?>> Yes   <input type="radio" name="form[rank_adv]" value="0"<?php if ($options['rank_adv'] == '0') print ' checked' ?>> No</td>
                    </tr>
                </table>
            </td>
        </tr>
        <!--End Ranking Graphics Mod-->

[EDIT]

I think I fixed it.
// The first 48 elements should be options and the rest permissions
list($options, $permissions) = array_chunk($optperm, 50, true);

Kennel, if you read this could you confirm that changing 48 elements to 50
elements does not mess anything else up.

Re: Help with MOD Please

Nope, if you added two field to the options table, it's correct.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3

Re: Help with MOD Please

Thanks. Everything seems to be working OK now.