Jump to content

Another if Issue


vicdesigns

Recommended Posts

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.

Link to comment
Share on other sites

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>';
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.