Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: alpinestaRR - maaliskuu 03, 2005, 11:23:15 IP

Otsikko: Checkbox staying checked...
Kirjoitti: alpinestaRR - maaliskuu 03, 2005, 11:23:15 IP
Ok, i'm trying to add a checkbox in Profile.template so that when it's checked, it will show "2005 $ite $upporter" under the person's name in their posts. I have it all done, so when i check the checkbox and hit "change profile" it DOES show up under there name, but when I go back into the profile to uncheck it, I hit save but the checkbox keeps showing as checked afterwards and continues to show under their name.

Here is my code in Profile.template:

//Checkbox to say if they are a site supporter or not
if ($user_info['is_admin'])
{
echo '
                                         <tr>
<td><b>Site Supporter: </b></td>
<td><input type="checkbox" name="default_options[site_supporter]" value="1"', @$context['member']['options']['site_supporter'] ? ' checked="checked"' : '', ' class="check" /></td>
         </tr>';
}


and Here is my code in Display.template:

//Show "Site Supporter" if they ahve donated for the current year
if (!empty($message['member']['options']['site_supporter']))
{
echo '<b>2005 $ite $upporter</b><br />';
}


i copied this right from http://www.unknownbrackets.com/tutorials/custom-profile so i'm not sure what's wrong. How can I fix this?

Help?
Otsikko: Re: Checkbox staying checked...
Kirjoitti: alpinestaRR - maaliskuu 05, 2005, 11:24:41 AP
Nobody knows? Any help is very much appreciated! I've searched and searched.
Otsikko: Re: Checkbox staying checked...
Kirjoitti: [Unknown] - maaliskuu 06, 2005, 04:16:45 AP

// Checkbox to say if they are a site supporter or not.
if ($user_info['is_admin'])
{
echo '
<tr>
<td><b>Site Supporter: </b></td>
<td><input type="hidden" name="default_options[site_supporter]" value="0" /><input type="checkbox" name="default_options[site_supporter]" value="1"', @$context['member']['options']['site_supporter'] ? ' checked="checked"' : '', ' class="check" /></td>
</tr>';
}


-[Unknown]
Otsikko: Re: Checkbox staying checked...
Kirjoitti: alpinestaRR - maaliskuu 06, 2005, 12:47:22 IP
Thank you! Thank you! Thank you!

SMF and its support are amazing!