Changeset 1565 for trunk/admin/configuration.php
- Timestamp:
- Oct 19, 2006, 2:41:07 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r1250 r1565 47 47 $page['section'] = $_GET['section']; 48 48 } 49 //------------------------------------------------------ $conf reinitialization50 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE);51 while ($row = mysql_fetch_array($result))52 {53 $conf[$row['param']] = $row['value'];54 // if the parameter is present in $_POST array (if a form is submited), we55 // override it with the submited value56 if (isset($_POST[$row['param']]))57 {58 $conf[$row['param']] = $_POST[$row['param']];59 if ( 'page_banner'==$row['param'] )60 { // should we do it for all ?61 $conf[$row['param']] = stripslashes( $conf[$row['param']] );62 }63 }64 }65 49 //------------------------------ verification and registration of modifications 66 50 if (isset($_POST['submit'])) … … 75 59 array_push($page['errors'], $lang['conf_gallery_url_error']); 76 60 } 61 $_POST['log'] = empty($_POST['log'])?'false':'true'; 62 $_POST['history_admin'] = empty($_POST['history_admin'])?'false':'true'; 63 $_POST['history_guest'] = empty($_POST['history_guest'])?'false':'true'; 64 $_POST['login_history'] = empty($_POST['login_history'])?'false':'true'; 77 65 break; 78 66 } … … 120 108 if (count($page['errors']) == 0) 121 109 { 122 //echo '<pre>'; print_r($_POST); echo '</pre>';110 //echo '<pre>'; print_r($_POST); echo '</pre>'; 123 111 $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); 124 112 while ($row = mysql_fetch_array($result)) … … 148 136 } 149 137 138 //------------------------------------------------------ $conf reinitialization 139 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE); 140 while ($row = mysql_fetch_array($result)) 141 { 142 $conf[$row['param']] = $row['value']; 143 } 144 150 145 //----------------------------------------------------- template initialization 151 146 $template->set_filenames( array('config'=>'admin/configuration.tpl') ); … … 172 167 $html_check='checked="checked"'; 173 168 174 $history_yes = ($conf['log']=='true')?'checked="checked"':'';175 $history_no = ($conf['log']=='false')?'checked="checked"':'';176 169 $lock_yes = ($conf['gallery_locked']=='true')?'checked="checked"':''; 177 170 $lock_no = ($conf['gallery_locked']=='false')?'checked="checked"':''; 171 $history_users = ($conf['log']=='true')?$html_check:''; 172 $history_admin = ($conf['history_admin']=='true')?$html_check:''; 173 $history_guest = ($conf['history_guest']=='true')?$html_check:''; 174 $login_history = ($conf['login_history']=='true')?$html_check:''; 178 175 179 176 $template->assign_block_vars( 180 177 'general', 181 178 array( 182 'HISTORY_YES'=>$history_yes, 183 'HISTORY_NO'=>$history_no, 179 'HISTORY_USERS'=>$history_users, 180 'HISTORY_ADMIN'=>$history_admin, 181 'HISTORY_GUEST'=>$history_guest, 182 'LOGIN_HISTORY'=>$login_history, 184 183 'GALLERY_LOCKED_YES'=>$lock_yes, 185 184 'GALLERY_LOCKED_NO'=>$lock_no,
Note: See TracChangeset
for help on using the changeset viewer.