Changeset 19
- Timestamp:
- May 27, 2003, 10:56:13 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r17 r19 37 37 //------------------------------ verification and registration of modifications 38 38 $conf_infos = 39 array( 'prefix e_thumbnail','webmaster','mail_webmaster','acces',39 array( 'prefix_thumbnail','webmaster','mail_webmaster','access', 40 40 'session_id_size','session_time','session_keyword','max_user_listbox', 41 41 'show_comments','nb_comment_page','upload_available', … … 47 47 'template' ); 48 48 $error = array(); 49 $i = 0; 50 if ( $_GET['valider'] == 1 ) 49 if ( isset( $_POST['submit'] ) ) 51 50 { 52 51 //purge de la table des session si demandé 53 52 if ( $_POST['empty_session_table'] == 1 ) 54 53 { 55 $query = ' delete from'.PREFIX_TABLE.'sessions';56 $query.= ' whereexpiration < '.time().';';54 $query = 'DELETE FROM '.PREFIX_TABLE.'sessions'; 55 $query.= ' WHERE expiration < '.time().';'; 57 56 mysql_query( $query ); 58 57 } 59 58 // deletion of site as asked 60 $query = ' selectid';61 $query.= ' from'.PREFIX_TABLE.'sites';62 $query.= " wheregalleries_url <> './galleries/';";59 $query = 'SELECT id'; 60 $query.= ' FROM '.PREFIX_TABLE.'sites'; 61 $query.= " WHERE galleries_url <> './galleries/';"; 63 62 $result = mysql_query( $query ); 64 63 while ( $row = mysql_fetch_array( $result ) ) 65 64 { 66 65 $site = 'delete_site_'.$row['id']; 67 if ( $_POST[$site] == 1 ) 66 if ( $_POST[$site] == 1 ) delete_site( $row['id'] ); 67 } 68 // thumbnail prefix must not contain accentuated characters 69 $old_prefix = $_POST['prefix_thumbnail']; 70 $prefix = strtr( $_POST['prefix_thumbnail'], $Caracs ); 71 if ( $old_prefix != $prefix ) 72 { 73 array_push( $error, $lang['conf_err_prefixe'] ); 74 } 75 // mail mail must be formatted as follows : name@server.com 76 $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; 77 if ( !preg_match( $pattern, $_POST['mail_webmaster'] ) ) 78 { 79 array_push( $error, $lang['conf_err_mail'] ); 80 } 81 // periods must be integer values, they represents number of days 82 if ( !is_int( $_POST['short_period'] ) 83 or !is_int( $_POST['long_period'] ) ) 84 { 85 array_push( $error, $lang['err_periods'] ); 86 } 87 else 88 { 89 // long period must be longer than short period 90 if ( $_POST['long_period'] <= $_POST['short_period'] 91 or $_POST['short_period'] <= 0 ) 68 92 { 69 delete_site( $row['id'] );93 array_push( $error, $lang['err_periods_2'] ); 70 94 } 71 95 } 72 // le préfixe des thumbnails ne doit pas comporter d'accent 73 $ancien_prefixe = $_POST['prefixe_thumbnail']; 74 $prefixe = strtr( $_POST['prefixe_thumbnail'], $Caracs ); 75 if ( $ancien_prefixe != $prefixe ) 76 { 77 $error[$i++] = $lang['conf_err_prefixe']; 78 } 79 // le mail doit être conforme à qqch du type : nom@serveur.com 80 if ( !ereg( "([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)", 81 $_POST['mail_webmaster'] ) ) 82 { 83 $error[$i++] = $lang['conf_err_mail']; 84 } 85 // les période doivent être des entiers, il représentent des nombres de jours 86 if ( !ereg( "^[0-9]*$", $_POST['short_period'] ) 87 || !ereg("^[0-9]*$", $_POST['long_period'] ) ) 88 { 89 $error[$i++] = $lang['err_periods']; 90 } 91 else 92 { 93 // la période longue doit être supérieure à la période courte 94 if ( $_POST['long_period'] <= $_POST['short_period'] 95 || $_POST['short_period'] <= 0 ) 96 { 97 $error[$i++] = $lang['err_periods_2']; 98 } 99 } 100 //la taille de l'id de session doit être un entier entre 4 et 50 101 if ( !ereg( "^[1-9][0-9]*$", $_POST['session_id_size'] ) 102 || $_POST['session_id_size'] < 4 103 || $_POST['session_id_size'] > 50 ) 104 { 105 $error[$i++] = $lang['conf_err_sid_size']; 106 } 107 // la durée de la session doit être un entier 108 // supérieur à 5 et inférieur à 60 minutes 109 if ( !ereg( "^[1-9][0-9]?$", $_POST['session_time'] ) 110 || $_POST['session_time'] < 5 111 || $_POST['session_time'] > 60 ) 112 { 113 $error[$i++] = $lang['conf_err_sid_time']; 114 } 115 // max_user_listbox doit être un entier compris entre 0 et 255 inclus 116 if ( !ereg( "^[0-9]{0,3}$", $_POST['max_user_listbox'] ) 117 || $_POST['max_user_listbox'] < 0 118 || $_POST['max_user_listbox'] > 255 ) 119 { 120 $error[$i++] = $lang['conf_err_max_user_listbox']; 121 } 122 // le nombre de commentaires par page doit être compris entre 5 en 50 inclus 123 if ( !ereg( "^[1-9][0-9]?$", $_POST['nb_comment_page'] ) 124 || $_POST['nb_comment_page'] < 5 125 || $_POST['nb_comment_page'] > 50 ) 126 { 127 $error[$i++] = $lang['conf_err_comment_number']; 128 } 129 // le poids maximum des fichiers uploadé doit être un entier, 130 // compris entre 10 et 1000 131 if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxfilesize'] ) 132 || $_POST['upload_maxfilesize'] < 10 133 || $_POST['upload_maxfilesize'] > 1000 ) 134 { 135 $error[$i++] = $lang['conf_err_upload_maxfilesize']; 136 } 137 // la largeur maximum des images uploadées doit être un entier, 138 // supérieur à 10 139 if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxwidth'] ) 140 || $_POST['upload_maxwidth'] < 10 ) 141 { 142 $error[$i++] = $lang['conf_err_upload_maxwidth']; 143 } 144 // la hauteur maximum des images uploadées doit être un entier, 145 // supérieur à 10 146 if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxheight'] ) 147 || $_POST['upload_maxheight'] < 10 ) 148 { 149 $error[$i++] = $lang['conf_err_upload_maxheight']; 150 } 151 // la largeur maximum des miniatures uploadées doit être un entier, 152 // supérieur à 10 153 if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxwidth_thumbnail'] ) 154 || $_POST['upload_maxwidth_thumbnail'] < 10 ) 155 { 156 $error[$i++] = $lang['conf_err_upload_maxwidth_thumbnail']; 157 } 158 // la hauteur maximum des miniatures uploadées doit être un entier, 159 // supérieur à 10 160 if ( !ereg( "^[1-9][0-9]*$", $_POST['upload_maxheight_thumbnail'] ) 161 || $_POST['upload_maxheight_thumbnail'] < 10 ) 162 { 163 $error[$i++] = $lang['conf_err_upload_maxheight_thumbnail']; 164 } 96 // session_id size must be an integer between 4 and 50 97 if ( !is_int( $_POST['session_id_size'] ) 98 or $_POST['session_id_size'] < 4 99 or $_POST['session_id_size'] > 50 ) 100 { 101 array_push( $error, $lang['conf_err_sid_size'] ); 102 } 103 // session_time must be an integer between 5 and 60, in minutes 104 if ( !is_int( $_POST['session_time'] ) 105 or $_POST['session_time'] < 5 106 or $_POST['session_time'] > 60 ) 107 { 108 array_push( $error, $lang['conf_err_sid_time'] ); 109 } 110 // max_user_listbox must be an integer between 0 and 255 included 111 if ( !is_int( $_POST['max_user_listbox'] ) 112 or $_POST['max_user_listbox'] < 0 113 or $_POST['max_user_listbox'] > 255 ) 114 { 115 array_push( $error, $lang['conf_err_max_user_listbox'] ); 116 } 117 // the number of comments per page must be an integer between 5 and 50 118 // included 119 if ( !is_int( $_POST['nb_comment_page'] ) 120 or $_POST['nb_comment_page'] < 5 121 or $_POST['nb_comment_page'] > 50 ) 122 { 123 array_push( $error, $lang['conf_err_comment_number'] ); 124 } 125 // the maximum upload filesize must be an integer between 10 and 1000 126 if ( !is_int( $_POST['upload_maxfilesize'] ) 127 or $_POST['upload_maxfilesize'] < 10 128 or $_POST['upload_maxfilesize'] > 1000 ) 129 { 130 array_push( $error, $lang['conf_err_upload_maxfilesize'] ); 131 } 132 // the maximum width of uploaded pictures must be an integer superior to 133 // 10 134 if ( !is_int( $_POST['upload_maxwidth'] ) 135 or $_POST['upload_maxwidth'] < 10 ) 136 { 137 array_push( $error, $lang['conf_err_upload_maxwidth'] ); 138 } 139 // the maximum height of uploaded pictures must be an integer superior to 140 // 10 141 if ( !is_int( $_POST['upload_maxheight'] ) 142 or $_POST['upload_maxheight'] < 10 ) 143 { 144 array_push( $error, $lang['conf_err_upload_maxheight'] ); 145 } 146 // the maximum width of uploaded thumbnails must be an integer superior to 147 // 10 148 if ( !is_int( $_POST['upload_maxwidth_thumbnail'] ) 149 or $_POST['upload_maxwidth_thumbnail'] < 10 ) 150 { 151 array_push( $error, $lang['conf_err_upload_maxwidth_thumbnail'] ); 152 } 153 // the maximum width of uploaded thumbnails must be an integer superior to 154 // 10 155 if ( !is_int( $_POST['upload_maxheight_thumbnail'] ) 156 or $_POST['upload_maxheight_thumbnail'] < 10 ) 157 { 158 array_push( $error, $lang['conf_err_upload_maxheight_thumbnail'] ); 159 } 160 $test = ''; 161 if ( is_int( $test ) ) echo 'salut'; exit(); 165 162 if ( $_POST['maxwidth'] != '' ) 166 163 { 167 164 if ( !ereg( "^[0-9]{2,}$", $_POST['maxwidth'] ) 168 ||$_POST['maxwidth'] < 50 )165 or $_POST['maxwidth'] < 50 ) 169 166 { 170 167 $error[$i++] = $lang['err_maxwidth']; … … 174 171 { 175 172 if ( !ereg( "^[0-9]{2,}$", $_POST['maxheight'] ) 176 ||$_POST['maxheight'] < 50 )173 or $_POST['maxheight'] < 50 ) 177 174 { 178 175 $error[$i++] = $lang['err_maxheight']; … … 186 183 $query = 'insert into '.PREFIX_TABLE.'config'; 187 184 $query.= ' ('; 188 for ( $i = 0; $i < sizeof( $conf_infos ); $i++ ) 189 { 190 if ( $i > 0 ) 191 { 192 $query.= ','; 193 } 194 $query.= $conf_infos[$i]; 185 foreach ( $conf_infos as $i => $conf_info ) { 186 if ( $i > 0 ) $query.= ','; 187 $query.= $conf_info; 195 188 } 196 189 $query.= ')'; 197 190 $query.= ' values'; 198 191 $query.= ' ('; 199 for ( $i = 0; $i < sizeof( $conf_infos ); $i++ ) 200 { 201 if ( $i > 0 ) 202 { 203 $query.= ','; 204 } 205 if ( $_POST[$conf_infos[$i]] == '' ) 192 foreach ( $conf_infos as $i => $conf_info ) { 193 if ( $i > 0 ) $query.= ','; 194 if ( $_POST[$conf_info] == '' ) $query.= 'NULL'; 195 else $query.= "'".$_POST[$conf_info]."'"; 196 } 197 $query.= ')'; 198 $query.= ';'; 199 echo $query; 200 mysql_query( $query ); 201 202 $tab_theme = explode( ' - ', $_POST['theme'] ); 203 $_POST['theme'] = $tab_theme[0].'/'.$tab_theme[1]; 204 205 $query = 'UPDATE '.PREFIX_TABLE.'users'; 206 $query.= ' SET'; 207 foreach ( $default_user_infos as $i => $default_user_info ) { 208 if ( $i > 0 ) $query.= ','; 209 else $query.= ' '; 210 $query.= $default_user_info; 211 $query.= ' = '; 212 if ( $_POST[$default_user_info] == '' ) 206 213 { 207 214 $query.= 'NULL'; … … 209 216 else 210 217 { 211 $query.= "'".$_POST[$ conf_infos[$i]]."'";218 $query.= "'".$_POST[$default_user_info]."'"; 212 219 } 213 220 } 214 $query.= ')';221 $query.= " WHERE username = 'guest'"; 215 222 $query.= ';'; 216 echo $query;217 223 mysql_query( $query ); 218 219 $tab_theme = explode( ' - ', $_POST['theme'] );220 $_POST['theme'] = $tab_theme[0].'/'.$tab_theme[1];221 222 $query = 'update '.PREFIX_TABLE.'users';223 $query.= ' set';224 for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ )225 {226 if ( $i > 0 )227 {228 $query.= ',';229 }230 else231 {232 $query.= ' ';233 }234 $query.= $default_user_infos[$i];235 $query.= ' = ';236 if ( $_POST[$default_user_infos[$i]] == '' )237 {238 $query.= 'NULL';239 }240 else241 {242 $query.= "'".$_POST[$default_user_infos[$i]]."'";243 }244 }245 $query.= " where username = 'guest';";246 mysql_query( $query );247 224 } 248 225 //--------------------------------------------------------- data initialization 249 for ( $i = 0; $i < sizeof( $conf_infos ); $i++ ) 250 { 251 $$conf_infos[$i] = $_POST[$conf_infos[$i]]; 252 } 253 for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ ) 254 { 255 $$default_user_infos[$i] = $_POST[$default_user_infos[$i]]; 226 foreach ( $conf_infos as $conf_info ) { 227 $$conf_info = $_POST[$conf_info]; 228 } 229 foreach ( $default_user_infos as $default_user_info ) { 230 $$default_user_info = $_POST[$default_user_info]; 256 231 } 257 232 } … … 259 234 { 260 235 //--------------------------------------------------------- data initialization 261 $query = 'select'; 262 for ( $i = 0; $i < sizeof( $conf_infos ); $i++ ) 263 { 264 if ( $i > 0 ) 265 { 266 $query.= ','; 267 } 268 else 269 { 270 $query.= ' '; 271 } 272 $query.= $conf_infos[$i]; 273 } 274 $query .= ' from '.PREFIX_TABLE.'config;'; 275 236 $query = 'SELECT'; 237 foreach ( $conf_infos as $i => $conf_info ) { 238 if ( $i > 0 ) $query.= ','; 239 else $query.= ' '; 240 $query.= $conf_info; 241 } 242 $query .= ' FROM '.PREFIX_TABLE.'config;'; 276 243 $row = mysql_fetch_array( mysql_query( $query ) ); 277 278 for ( $i = 0; $i < sizeof( $conf_infos ); $i++ ) 279 { 280 $$conf_infos[$i] = $row[$conf_infos[$i]]; 281 } 282 $query = 'select'; 283 for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ ) 284 { 285 if ( $i > 0 ) 286 { 287 $query.= ','; 288 } 289 else 290 { 291 $query.= ' '; 292 } 293 $query.= $default_user_infos[$i]; 294 } 295 $query .= ' from '.PREFIX_TABLE.'users'; 296 $query.= " where username = 'guest'"; 244 foreach ( $conf_infos as $conf_info ) { 245 $$conf_info = $row[$conf_info]; 246 } 247 248 $query = 'SELECT'; 249 foreach ( $default_user_infos as $i => $default_user_info ) { 250 if ( $i > 0 ) $query.= ','; 251 else $query.= ' '; 252 $query.= $default_user_info; 253 } 254 $query.= ' FROM '.PREFIX_TABLE.'users'; 255 $query.= " WHERE username = 'guest'"; 297 256 $query.= ';'; 298 299 257 $row = mysql_fetch_array( mysql_query( $query ) ); 300 301 for ( $i = 0; $i < sizeof( $default_user_infos ); $i++ ) 302 { 303 $$default_user_infos[$i] = $row[$default_user_infos[$i]]; 258 foreach ( $default_user_infos as $default_user_info ) { 259 $$default_user_info = $row[$default_user_info]; 304 260 } 305 261 } … … 327 283 } 328 284 //-------------------------------------------------------- confirmation display 329 if ( sizeof( $error ) == 0 && $_GET['valider'] == 1)285 if ( count( $error ) == 0 and isset( $_POST['submit'] ) ) 330 286 { 331 287 $vtp->addSession( $sub, 'confirmation' ); … … 333 289 } 334 290 //----------------------------------------------------------------- form action 335 $form_action = add_session_id( './admin.php?page=configuration &valider=1' );291 $form_action = add_session_id( './admin.php?page=configuration' ); 336 292 $vtp->setVar( $sub, 'form_action', $form_action ); 337 293 //------------------------------------------------------- general configuration … … 386 342 $vtp->addSession( $sub, 'group' ); 387 343 $vtp->addSession( $sub, 'radio' ); 388 $vtp->setVar( $sub, 'radio.name', 'acces ' );389 $vtp->setVar( $sub, 'radio.value', ' libre' );344 $vtp->setVar( $sub, 'radio.name', 'access' ); 345 $vtp->setVar( $sub, 'radio.value', 'free' ); 390 346 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_1'] ); 391 347 $checked = ''; 392 if ( $acces == 'libre' ) 393 { 394 $checked = ' checked="checked"'; 395 } 396 $vtp->setVar( $sub, 'radio.checked', $checked ); 397 $vtp->closeSession( $sub, 'radio' ); 398 $vtp->addSession( $sub, 'radio' ); 399 $vtp->setVar( $sub, 'radio.name', 'acces' ); 400 $vtp->setVar( $sub, 'radio.value', 'restreint' ); 348 echo $access.'<br />'; 349 if ( $access == 'free' ) 350 { 351 $checked = ' checked="checked"'; 352 } 353 $vtp->setVar( $sub, 'radio.checked', $checked ); 354 $vtp->closeSession( $sub, 'radio' ); 355 $vtp->addSession( $sub, 'radio' ); 356 $vtp->setVar( $sub, 'radio.name', 'access' ); 357 $vtp->setVar( $sub, 'radio.value', 'restricted' ); 401 358 $vtp->setVar( $sub, 'radio.option', $lang['conf_general_access_2'] ); 402 359 $checked = ''; 403 if ( $acces == 'restreint' )360 if ( $access == 'restricted' ) 404 361 { 405 362 $checked = ' checked="checked"'; -
trunk/admin/create_listing_file.php
r10 r19 1 1 <?php 2 $prefix e_thumbnail = 'TN-';2 $prefix_thumbnail = 'TN-'; 3 3 4 4 $conf['picture_ext'] = array ( 'jpg', 'gif', 'png', 'JPG', 'GIF', 'PNG' ); … … 71 71 function TN_exists( $dir, $file ) 72 72 { 73 global $conf, $prefix e_thumbnail;73 global $conf, $prefix_thumbnail; 74 74 75 75 $titre = get_filename_wo_extension( $file ); … … 77 77 for ( $i = 0; $i < sizeof ( $conf['picture_ext'] ); $i++ ) 78 78 { 79 $base_tn_name = $dir.'/thumbnail/'.$prefix e_thumbnail.$titre.'.';79 $base_tn_name = $dir.'/thumbnail/'.$prefix_thumbnail.$titre.'.'; 80 80 $ext = $conf['picture_ext'][$i]; 81 81 if ( is_file( $base_tn_name.$ext ) ) … … 85 85 } 86 86 echo 'The thumbnail is missing for '.$dir.'/'.$file; 87 echo '-> '.$dir.'/thumbnail/'.$prefix e_thumbnail.$titre.'.xxx';87 echo '-> '.$dir.'/thumbnail/'.$prefix_thumbnail.$titre.'.xxx'; 88 88 echo ' ("xxx" can be : '; 89 89 for ( $i = 0; $i < sizeof ( $conf['picture_ext'] ); $i++ ) -
trunk/admin/edit_cat.php
r14 r19 1 1 <?php 2 2 /*************************************************************************** 3 * edit_cat.php is*3 * edit_cat.php * 4 4 * ------------------- * 5 5 * application : PhpWebGallery 1.3 * … … 92 92 if ( $option == $row['status'] ) 93 93 { 94 $vtp->setVar( $sub, 'status_option. selected', ' selected="selected"' );94 $vtp->setVar( $sub, 'status_option.checked', ' checked="checked"' ); 95 95 } 96 96 $vtp->closeSession( $sub, 'status_option' ); -
trunk/admin/include/functions.php
r14 r19 54 54 $filename = get_filename_wo_extension( $file ); 55 55 foreach ( $conf['picture_ext'] as $ext ) { 56 $test = $dir.'/thumbnail/'.$conf['prefix e_thumbnail'].$filename.'.'.$ext;56 $test = $dir.'/thumbnail/'.$conf['prefix_thumbnail'].$filename.'.'.$ext; 57 57 if ( is_file ( $test ) ) 58 58 { -
trunk/admin/infos_images.php
r15 r19 220 220 } 221 221 $thumbnail_url.= 'thumbnail/'; 222 $thumbnail_url.= $conf['prefix e_thumbnail'].$file.".".$row['tn_ext'];222 $thumbnail_url.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext']; 223 223 $vtp->setVar( $sub, 'picture.thumbnail_url', $thumbnail_url ); 224 224 $vtp->closeSession( $sub, 'picture' ); -
trunk/admin/install.php
r10 r19 335 335 periode_courte smallint(5) unsigned NOT NULL default '7', 336 336 periode_longue smallint(5) unsigned NOT NULL default '14', 337 prefix e_thumbnail varchar(10) NOT NULL default 'TN-',337 prefix_thumbnail varchar(10) NOT NULL default 'TN-', 338 338 webmaster varchar(255) NOT NULL default '', 339 339 mail_webmaster varchar(255) NOT NULL default '', -
trunk/admin/thumbnail.php
r2 r19 160 160 mkdir( $path."thumbnail", 0777 ); 161 161 } 162 $dest_file = $path."thumbnail/".$conf['prefix e_thumbnail'].substr ( $image, 0, strrpos ( $image, ".") ).".".$extension;162 $dest_file = $path."thumbnail/".$conf['prefix_thumbnail'].substr ( $image, 0, strrpos ( $image, ".") ).".".$extension; 163 163 164 164 // création et sauvegarde de l'image finale … … 178 178 'height' => $taille_image[1], 179 179 'size' => $size, 180 'tn_name' => $conf['prefix e_thumbnail'].substr ( $image, 0, strrpos ( $image, ".") ).".".$extension,180 'tn_name' => $conf['prefix_thumbnail'].substr ( $image, 0, strrpos ( $image, ".") ).".".$extension, 181 181 'tn_width' => $tn_taille_image[0], 182 182 'tn_height' => $tn_taille_image[1], -
trunk/admin/update.php
r10 r19 162 162 { 163 163 $lien_image = $rep.'/'.$row['file']; 164 $lien_thumbnail = $rep.'/thumbnail/'.$conf['prefix e_thumbnail'];164 $lien_thumbnail = $rep.'/thumbnail/'.$conf['prefix_thumbnail']; 165 165 $lien_thumbnail.= get_filename_wo_extension( $row['file'] ); 166 166 $lien_thumbnail.= '.'.$row['tn_ext']; … … 230 230 $output.= $lang['update_missing_tn'].' : '.$file; 231 231 $output.= ' (<span style="font-weight:bold;">'; 232 $output.= $conf['prefix e_thumbnail'];232 $output.= $conf['prefix_thumbnail']; 233 233 $output.= get_filename_wo_extension( $file ).'.XXX</span>'; 234 234 $output.= ', XXX = '; -
trunk/admin/waiting.php
r10 r19 40 40 { 41 41 $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); 42 unlink( ".".$cat['dir']."thumbnail/".$conf['prefix e_thumbnail'].$file.".".$row['tn_ext'] );42 unlink( ".".$cat['dir']."thumbnail/".$conf['prefix_thumbnail'].$file.".".$row['tn_ext'] ); 43 43 } 44 44 } … … 90 90 { 91 91 $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); 92 echo "<a target=\"_blank\" href=\"".$cat_names[$row['cat_id']]['dir']."thumbnail/".$conf['prefix e_thumbnail'].$file.".".$row['tn_ext']."\">".$conf['prefixe_thumbnail'].$file.".".$row['tn_ext'];92 echo "<a target=\"_blank\" href=\"".$cat_names[$row['cat_id']]['dir']."thumbnail/".$conf['prefix_thumbnail'].$file.".".$row['tn_ext']."\">".$conf['prefix_thumbnail'].$file.".".$row['tn_ext']; 93 93 } 94 94 else -
trunk/category.php
r17 r19 187 187 $vtp->addSession( $handle, 'summary' ); 188 188 $vtp->setVar( $handle, 'summary.url', 189 add_session_id( './about.php? expand='.$page['expand'] ) );189 add_session_id( './about.php?'.$_SERVER['QUERY_STRING'] ) ); 190 190 $vtp->setVar( $handle, 'summary.title', $lang['hint_about'] ); 191 191 $vtp->setVar( $handle, 'summary.name', replace_space( $lang['about'] ) ); -
trunk/include/config.inc.php
r17 r19 54 54 // Example : 55 55 // prefixe_thumbnail --> $conf['prefixe_thumbnail'] 56 $infos = array( 'prefix e_thumbnail', 'webmaster', 'mail_webmaster', 'acces',56 $infos = array( 'prefix_thumbnail', 'webmaster', 'mail_webmaster', 'access', 57 57 'session_id_size', 'session_keyword', 'session_time', 58 58 'max_user_listbox', 'show_comments', 'nb_comment_page', … … 62 62 63 63 $query = 'SELECT'; 64 for ( $i = 0; $i < sizeof( $infos ); $i++ ) 65 { 66 if ( $i > 0 ) 67 { 68 $query.= ','; 69 } 70 else 71 { 72 $query.= ' '; 73 } 74 $query.= $infos[$i]; 64 foreach ( $infos as $i => $info ) { 65 if ( $i > 0 ) $query.= ','; 66 else $query.= ' '; 67 $query.= $info; 75 68 } 76 $query 69 $query.= ' FROM '.PREFIX_TABLE.'config;'; 77 70 78 71 $row = mysql_fetch_array( mysql_query( $query ) ); … … 80 73 // affectation of each field of the table "config" to an information of the 81 74 // array $conf. 82 for ( $i = 0; $i < sizeof( $infos ); $i++ ) 83 { 84 $conf[$infos[$i]] = $row[$infos[$i]]; 75 foreach ( $infos as $info ) { 76 $conf[$info] = $row[$info]; 85 77 // If the field is true or false, the variable is transformed into a boolean 86 78 // value. 87 if ( $row[$info s[$i]] == 'true' || $row[$infos[$i]] == 'false' )79 if ( $row[$info] == 'true' or $row[$info] == 'false' ) 88 80 { 89 $conf[$info s[$i]] = get_boolean( $row[$infos[$i]] );81 $conf[$info] = get_boolean( $row[$info] ); 90 82 } 91 83 } -
trunk/include/functions_category.inc.php
r17 r19 406 406 $sql_search = array(); 407 407 foreach ( $words as $i => $word ) { 408 // if the user searchs any of the words, the where statement must 409 // be : 410 // field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ... 411 // OR field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ... 408 412 if ( $_GET['mode'] == 'OR' ) 409 413 { … … 414 418 } 415 419 } 420 // if the user searchs all the words : 421 // ( field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ) 422 // AND ( field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ) 416 423 else if ( $_GET['mode'] == 'AND' ) 417 424 { -
trunk/language/english.php
r2 r19 436 436 $lang['help_remote_title'] = "Remote site"; 437 437 $lang['help_remote'][0] = "PhpWebGallery offers the possibility to use several servers to store the images which will compose your gallery. It can be useful if your gallery is installed on one limited space and that you have a big quantity of images to be shown. Please , follow this procedure : "; 438 $lang['help_remote'][1] = "1. edit file \"create_listing_file.php\" (you will find it in the directory \"admin\"), by modifying the line \"$prefix e_thumbnail = \"TN-\";\" if the prefix for your thumbnails is not \"TN-\".";438 $lang['help_remote'][1] = "1. edit file \"create_listing_file.php\" (you will find it in the directory \"admin\"), by modifying the line \"$prefix_thumbnail = \"TN-\";\" if the prefix for your thumbnails is not \"TN-\"."; 439 439 $lang['help_remote'][2] = "2. place file \"create_listing_file.php\" modified on your distant website, in the root directory of your directories of images (as the directory \"galleries\" of this website) by ftp."; 440 440 $lang['help_remote'][3] = "3. launch script using the url http://domaineDistant/repGalerie/create_listing_file.php, a file listing.xml has just been created."; -
trunk/language/francais.php
r17 r19 185 185 $lang['search_mode_or'] = 'au moins un mot'; 186 186 $lang['search_mode_and'] = 'tous les mots'; 187 $lang['search_comments'] = 'espacer les différents mots avec un espace'; 187 188 // end version 1.3 188 189 $lang['search_field_search'] = 'Rechercher'; -
trunk/picture.php
r17 r19 194 194 $file = substr ( $row['file'], 0, strrpos ( $row['file'], '.' ) ); 195 195 $lien_thumbnail = $cat_directory.'/thumbnail/'; 196 $lien_thumbnail.= $conf['prefix e_thumbnail'].$file.".".$row['tn_ext'];196 $lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext']; 197 197 198 198 $prev_title = $lang['previous_image'].' : '; … … 443 443 $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") ); 444 444 $lien_thumbnail = $cat_directory."thumbnail/"; 445 $lien_thumbnail.= $conf['prefix e_thumbnail'].$file.".".$row['tn_ext'];445 $lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext']; 446 446 447 447 if ( $row['name'] != "" ) -
trunk/search.php
r17 r19 53 53 //----------------------------------------------------- template initialization 54 54 $vtp = new VTemplate; 55 $handle = $vtp->Open( './template/default/search.vtp' ); 56 // language 57 $vtp->setGlobalVar( $handle, 'search_page_title',$lang['search_title'] ); 58 $vtp->setGlobalVar( $handle, 'search_title', $lang['search_title'] ); 59 $vtp->setGlobalVar( $handle, 'search_return_main_page', 60 $lang['search_return_main_page'] ); 61 $vtp->setGlobalVar( $handle, 'submit', $lang['submit'] ); 62 // user 63 $vtp->setGlobalVar( $handle, 'page_style', $user['style'] ); 64 // structure 65 $vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() ); 66 $vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() ); 67 $vtp->setGlobalVar( $handle, 'frame_end', get_frame_end() ); 55 $handle = $vtp->Open( './template/'.$user['template'].'/search.vtp' ); 56 initialize_template(); 57 58 $tpl = array( 'search_title','search_return_main_page','submit', 59 'search_comments' ); 60 templatize_array( $tpl, 'lang', $handle ); 68 61 //----------------------------------------------------------------- form action 69 62 $vtp->setGlobalVar( $handle, 'form_action', add_session_id( './search.php' ) ); … … 83 76 // search field 84 77 $vtp->addSession( $handle, 'line' ); 85 $vtp->setVar( $handle, 'line.name', $lang['search_field_search'] );78 $vtp->setVar( $handle, 'line.name', $lang['search_field_search'].' *' ); 86 79 $vtp->addSession( $handle, 'text' ); 87 80 $vtp->setVar( $handle, 'text.size', '40' ); -
trunk/template/default/about.vtp
r2 r19 1 1 <html> 2 2 <head> 3 {# page_style}3 {#style} 4 4 <title>{#about_page_title}</title> 5 5 </head> 6 6 <body> 7 {#header} 7 8 <table style="width:100%;height:100%"> 8 9 <tr align="center" valign="middle"> … … 18 19 {#frame_end} 19 20 <div style="text-align:center;margin:5px;"> 20 <a onclick="history.back()" style="font-style:italic;font-family:verdana,arial,sans-serif;font-size:12px;">{#about_return}</a>21 <a href="{#back_url}">{#about_return}</a> 21 22 </div> 22 23 <div style="text-align:center;margin:5px;"> … … 26 27 </tr> 27 28 </table> 29 {#footer} 28 30 </body> 29 31 </html> -
trunk/template/default/admin/configuration.vtp
r11 r19 81 81 <tr> 82 82 <td colspan="3" align="center"> 83 <input type="submit" value="{#submit}">83 <input type="submit" name="submit" value="{#submit}"> 84 84 </td> 85 85 </tr> -
trunk/template/default/admin/edit_cat.vtp
r15 r19 29 29 <td style="width:20%;">{#editcat_status}</td> 30 30 <td class="row2"> 31 <select name="status"> 32 <!--VTP_status_option--> 33 <option{#selected}>{#option}</option> 34 <!--/VTP_status_option--> 35 </select> 31 <!--VTP_status_option--> 32 <input type="radio" name="status" value="{#option}"{#checked} />{#option} 33 <!--/VTP_status_option--> 34 {#editcat_status_info} 35 </td> 36 </tr> 37 <tr> 38 <td style="width:20%;">{#editcat_visible}</td> 39 <td class="row2"> 40 <!--VTP_visible_option--> 41 <input type="radio" name="visible" value="{#option}"{#checked} />{#option} 42 <!--/VTP_visible_option--> 36 43 {#editcat_status_info} 37 44 </td> -
trunk/template/default/search.vtp
r17 r19 1 1 <html> 2 2 <head> 3 {# page_style}4 <title>{#search_ page_title}</title>3 {#style} 4 <title>{#search_title}</title> 5 5 </head> 6 6 <body> 7 {#header} 7 8 <table style="width:100%;height:100%"> 8 9 <tr align="center" valign="middle"> … … 66 67 </td> 67 68 </tr> 69 <tr> 70 <td colspan="2"> 71 <div style="margin-top:10px;">* : {#search_comments}</div> 72 </td> 73 </tr> 68 74 </table> 69 75 </form> … … 73 79 </tr> 74 80 </table> 81 {#footer} 75 82 </body> 76 83 </html> -
trunk/upload.php
r10 r19 34 34 $result = array(); 35 35 $result['error'] = array(); 36 $i = 0;37 36 //echo $_FILES['picture']['name']."<br />".$temp_name; 38 37 $extension = get_extension( $_FILES['picture']['name'] ); 39 38 if ( $extension != 'gif' and $extension != 'jpg' and $extension != 'png' ) 40 39 { 41 $result['error'][$i++] = $lang['upload_advise_filetype'];40 array_push( $result['error'], $lang['upload_advise_filetype'] ); 42 41 return $result; 43 42 } … … 45 44 { 46 45 // do we even have a file? 47 $result['error'][$i++] = "You did not upload anything!";46 array_push( $result['error'], "You did not upload anything!" ); 48 47 } 49 48 else if ( $_FILES['picture']['size'] > $my_max_file_size * 1024 ) 50 49 { 51 $result['error'][$i++] =52 $lang['upload_advise_width'].$my_max_file_size.' KB';50 array_push( $result['error'], 51 $lang['upload_advise_width'].$my_max_file_size.' KB' ); 53 52 } 54 53 else … … 58 57 if ( !move_uploaded_file( $_FILES['picture']['tmp_name'], $temp_name ) ) 59 58 { 60 $result['error'][$i++] = $lang['upload_cannot_upload'];59 array_push( $result['error'], $lang['upload_cannot_upload'] ); 61 60 } 62 61 else … … 67 66 and $size[0] > $image_max_width ) 68 67 { 69 $result['error'][$i++] =70 $lang['upload_advise_width'].$image_max_width." px";68 array_push( $result['error'], 69 $lang['upload_advise_width'].$image_max_width.' px' ); 71 70 } 72 71 if ( isset( $image_max_height ) … … 74 73 and $size[1] > $image_max_height ) 75 74 { 76 $result['error'][$i++] =77 $lang['upload_advise_height'].$image_max_height." px";75 array_push( $result['error'], 76 $lang['upload_advise_height'].$image_max_height.' px' ); 78 77 } 79 78 // $size[2] == 1 means GIF 80 79 // $size[2] == 2 means JPG 81 80 // $size[2] == 3 means PNG 82 if ( $size[2] != 1 and $size[2] != 2 and $size[2] != 3)81 switch ( $size[2] ) 83 82 { 84 $result['error'][$i++] = $lang['upload_advise_filetype']; 85 } 86 else 87 { 88 switch ( $size[2] ) 89 { 90 case 1 : 91 $result['type'] = 'gif'; break; 92 case 2 : 93 $result['type'] = 'jpg'; break; 94 case 3 : 95 $result['type'] = 'png'; break; 96 } 83 case 1 : $result['type'] = 'gif'; break; 84 case 2 : $result['type'] = 'jpg'; break; 85 case 3 : $result['type'] = 'png'; break; 86 default : 87 array_push( $result['error'], $lang['upload_advise_filetype'] ); 97 88 } 98 89 } … … 127 118 { 128 119 echo '<div style="text-align:center;">'.$lang['upload_forbidden'].'<br />'; 129 echo '<a href="'.add_session_id_to_url( './ diapo.php' ).'">';120 echo '<a href="'.add_session_id_to_url( './category.php' ).'">'; 130 121 echo $lang['thumbnails'].'</a></div>'; 131 122 exit();
Note: See TracChangeset
for help on using the changeset viewer.