Changeset 1748
- Timestamp:
- Jan 23, 2007, 11:03:06 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r1744 r1748 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 129 129 { 130 130 //echo '<pre>'; print_r($_POST); echo '</pre>'; 131 $result = pwg_query('SELECT *FROM '.CONFIG_TABLE);131 $result = pwg_query('SELECT param FROM '.CONFIG_TABLE); 132 132 while ($row = mysql_fetch_array($result)) 133 133 { … … 154 154 array_push($page['infos'], $lang['conf_confirmation']); 155 155 } 156 } 157 158 //------------------------------------------------------ $conf reinitialization 159 $result = pwg_query('SELECT param,value FROM '.CONFIG_TABLE); 160 while ($row = mysql_fetch_array($result)) 161 { 162 $conf[$row['param']] = $row['value']; 156 157 //------------------------------------------------------ $conf reinitialization 158 load_conf_from_db(); 163 159 } 164 160 … … 187 183 case 'general' : 188 184 { 189 $lock_yes = ($conf['gallery_locked']== 'true')?'checked="checked"':'';190 $lock_no = ($conf['gallery_locked']== 'false')?'checked="checked"':'';185 $lock_yes = ($conf['gallery_locked']==true)?'checked="checked"':''; 186 $lock_no = ($conf['gallery_locked']==false)?'checked="checked"':''; 191 187 192 188 $template->assign_block_vars( … … 195 191 'GALLERY_LOCKED_YES'=>$lock_yes, 196 192 'GALLERY_LOCKED_NO'=>$lock_no, 197 ($conf['rate']== 'true'?'RATE_YES':'RATE_NO')=>$html_check,198 ($conf['rate_anonymous']== 'true'193 ($conf['rate']==true?'RATE_YES':'RATE_NO')=>$html_check, 194 ($conf['rate_anonymous']==true 199 195 ? 'RATE_ANONYMOUS_YES' : 'RATE_ANONYMOUS_NO')=>$html_check, 200 196 'CONF_GALLERY_TITLE' => $conf['gallery_title'], … … 208 204 'general', 209 205 array( 210 strtoupper($checkbox) => ($conf[$checkbox]== 'true')?$html_check:''206 strtoupper($checkbox) => ($conf[$checkbox]==true)?$html_check:'' 211 207 ) 212 208 ); … … 227 223 'comments', 228 224 array( 229 strtoupper($checkbox) => ($conf[$checkbox]== 'true')?$html_check:''225 strtoupper($checkbox) => ($conf[$checkbox]==true)?$html_check:'' 230 226 ) 231 227 ); … … 235 231 case 'default' : 236 232 { 237 $show_yes = ($conf['show_nb_comments']== 'true')?'checked="checked"':'';238 $show_no = ($conf['show_nb_comments']== 'false')?'checked="checked"':'';239 $expand_yes = ($conf['auto_expand']== 'true')?'checked="checked"':'';240 $expand_no = ($conf['auto_expand']== 'false')?'checked="checked"':'';233 $show_yes = ($conf['show_nb_comments']==true)?'checked="checked"':''; 234 $show_no = ($conf['show_nb_comments']==false)?'checked="checked"':''; 235 $expand_yes = ($conf['auto_expand']==true)?'checked="checked"':''; 236 $expand_no = ($conf['auto_expand']==false)?'checked="checked"':''; 241 237 242 238 $template->assign_block_vars( -
trunk/admin/notification_by_mail.php
r1571 r1748 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |6 // | Copyright (C) 2006 Ruben ARNAUD - team@phpwebgallery.net|5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 // | Copyright (C) 2006-2007 Ruben ARNAUD - team@phpwebgallery.net | 7 7 // +-----------------------------------------------------------------------+ 8 8 // | branch : BSF (Best So Far) … … 415 415 case 'param' : 416 416 { 417 $updated_param_count = 0;418 // Update param419 $result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\'');420 while ($nbm_user = mysql_fetch_array($result))421 {422 if (isset($_POST['param_submit']) and !is_adviser())417 if (isset($_POST['param_submit']) and !is_adviser()) 418 { 419 $updated_param_count = 0; 420 // Update param 421 $result = pwg_query('select param, value from '.CONFIG_TABLE.' where param like \'nbm\\_%\''); 422 while ($nbm_user = mysql_fetch_array($result)) 423 423 { 424 424 if (isset($_POST[$nbm_user['param']])) … … 428 428 $query = ' 429 429 update 430 431 set 430 '.CONFIG_TABLE.' 431 set 432 432 value = \''. str_replace("\'", "''", $value).'\' 433 433 where … … 437 437 } 438 438 } 439 440 $conf[$nbm_user['param']] = $nbm_user['value'];441 442 // if the parameter is present in $_POST array (if a form is submited), we443 // override it with the submited value444 if (isset($_POST[$nbm_user['param']]) and !is_adviser())445 {446 $conf[$nbm_user['param']] = stripslashes($_POST[$nbm_user['param']]);447 }448 449 // If the field is true or false, the variable is transformed into a450 // boolean value.451 if ($conf[$nbm_user['param']] == 'true' or $conf[$nbm_user['param']] == 'false')452 {453 $conf[$nbm_user['param']] = get_boolean($conf[$nbm_user['param']]);454 }455 }456 439 457 if ($updated_param_count != 0)458 {459 440 array_push($page['infos'], sprintf(l10n('nbm_updated_param_count'), $updated_param_count)); 441 442 // Reload conf with new values 443 load_conf_from_db('param like \'nbm\\_%\''); 460 444 } 461 445 } -
trunk/include/functions.inc.php
r1727 r1748 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 1008 1008 function l10n_dec($singular_fmt_key, $plural_fmt_key, $decimal) 1009 1009 { 1010 return sprintf(l10n(($decimal > 1 ? $plural_fmt_key : 1010 return sprintf(l10n(($decimal > 1 ? $plural_fmt_key : 1011 1011 $singular_fmt_key)), $decimal); 1012 1012 } … … 1095 1095 * @return void 1096 1096 */ 1097 function load_conf_from_db( )1097 function load_conf_from_db($condition = '') 1098 1098 { 1099 1099 global $conf; 1100 1100 1101 1101 $query = ' 1102 SELECT param, value1102 SELECT param, value 1103 1103 FROM '.CONFIG_TABLE.' 1104 '.(!empty($condition) ? 'WHERE '.$condition : '').' 1104 1105 ;'; 1105 1106 $result = pwg_query($query); 1106 1107 1107 if ( mysql_num_rows($result) == 0)1108 if ((mysql_num_rows($result) == 0) and !empty($condition)) 1108 1109 { 1109 1110 die('No configuration data'); -
trunk/include/functions_html.inc.php
r1744 r1748 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 289 289 $output.= '<a class=""'; 290 290 $output.= ' href="' 291 . duplicate_index_url(291 .make_index_url( 292 292 array( 293 293 'category'=>$id, 294 294 'cat_name'=>$name 295 ), 296 array('start') 295 ) 297 296 ) 298 297 .'">'; -
trunk/language/en_UK.iso-8859-1
-
Property
svn:ignore
set to
local.lang.php
-
Property
svn:ignore
set to
-
trunk/language/fr_FR.iso-8859-1
-
Property
svn:ignore
set to
local.lang.php
-
Property
svn:ignore
set to
Note: See TracChangeset
for help on using the changeset viewer.