scottybwoy Posted September 1, 2006 Share Posted September 1, 2006 I have this function :[code]<?phpif (! empty($pref['autotip']) && $pref['autotip']==1) { $template->set_var('TIP_STATUS1', 'checked'); } else { $template->set_var('TIP_STATUS1', ''); } if (! empty($pref['autotip']) && $pref['autotip']==0) { $template->set_var('TIP_STATUS2', 'checked'); } else { $template->set_var('TIP_STATUS2', ''); } $template->set_var('PREF_MNGR', $PREF_MNGR); if (isset($this->update) && $this->update) { $template->set_var('UPDATE_MSG', $this->getMessage('PREFERENCES_UPDATED') ); } else $template->set_var('UPDATE_MSG', ''); $themeTemplate->set_var('CONTENT_BLOCK', $template->parse('mblock', 'mainBlock')); $template->parse('contentBlock', 'fh1'); $themeTemplate->parse('cnblock', 'contentBlock'); $themeTemplate->parse('mmblock', 'mmainBlock'); $themeTemplate->pparse('output', 'fh'); }?>[/code]And I want 'autotip' to always == 1 for 'TIP_STATUS1' i.e $template->set_var('TIP_STATUS1', 'checked');So it will not have to get info from the form.And I always want it to be like that so it never really needs to be updated. And if it never really needs to be updated it won't need to be stored in the database.So could someone help me re-write this please. Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/19376-need-to-get-rid-of-this-if/ Share on other sites More sharing options...
scottybwoy Posted September 5, 2006 Author Share Posted September 5, 2006 *PROBE* Anyone know haow to help me on this one ? Quote Link to comment https://forums.phpfreaks.com/topic/19376-need-to-get-rid-of-this-if/#findComment-86315 Share on other sites More sharing options...
ober Posted September 5, 2006 Share Posted September 5, 2006 I may be a little confused, by if you don't want that status to change, why not just comment out that first if/else block? Quote Link to comment https://forums.phpfreaks.com/topic/19376-need-to-get-rid-of-this-if/#findComment-86324 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.