vicdesigns Posted June 19, 2011 Share Posted June 19, 2011 This one is pretty weird. I hope someone here can shed some light on it because it has me completely baffled. Basically, I want to give the admin the option to disable or enable a footer link. Here is the parameter: $params["show_footer"] = isset($_POST['show_footer']) ? prepare_input($_POST['show_footer']) : $objSettings->GetParameter("show_footer"); The settings code: <tr> <td align="left" width="150px">'._SHOW_FOOTER.':</td> <td align="left" colspan="2"> <select name="show_footer"> <option '.(($params["show_footer"] == "1") ? "selected" : "").' value="1">'._YES.'</option> <option '.(($params["show_footer"] == "0") ? "selected" : "").' value="0">'._NO.'</option> </select> </td> </tr> And, the code to either disable or enable the footer text: if($objSettings->GetParameter("show_footer") != "1"){ echo '<br><br><font color="#FFFFFF">Footer Text Here.';} else { echo '<br><br>';};?> What has me stumped is, in the admin settings, if I select Yes (to allow the footer to be displayed) the footer is disabled. If I select No, it is enabled. I can't for the life of me figure it out. Any help is greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted June 19, 2011 Share Posted June 19, 2011 This says if the value is NOT 1, show the 'footer text here' block, which is the opposite of what it appears you want done as indicated by your <select> field . . . if($objSettings->GetParameter("show_footer") != "1") { echo '<br><br><font color="#FFFFFF">Footer Text Here.'; } else { echo '<br><br>'; } ?> Quote Link to comment Share on other sites More sharing options...
vicdesigns Posted June 20, 2011 Author Share Posted June 20, 2011 Thanks mate. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.