Changeset 1094
- Timestamp:
- Mar 23, 2006, 2:49:04 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/notification_by_mail.php
-
Property
svn:eol-style
set to
native
-
Property
svn:keywords
set to
Author Date Id Revision
r1091 r1094 8 8 // | branch : BSF (Best So Far) 9 9 // | file : $RCSfile$ 10 // | last update : $Date : 2005-09-21 00:04:57 +0200 (mer, 21 sep 2005)$11 // | last modifier : $Author : plg$12 // | revision : $Revision : 870$10 // | last update : $Date$ 11 // | last modifier : $Author$ 12 // | revision : $Revision$ 13 13 // +-----------------------------------------------------------------------+ 14 14 // | This program is free software; you can redistribute it and/or modify | … … 87 87 // Set null mail_address empty 88 88 $query = ' 89 update 89 update 90 90 '.USERS_TABLE.' 91 91 set … … 282 282 array( 283 283 'U_TABSHEET_TITLE' => l10n('nbm_'.$page['mode'].'_mode'), 284 'U_HELP' => add_url_param (get_root_url().'/popuphelp.php', 'page=notification_by_mail'),285 'U_PARAM_MODE' => add_url_param ($base_url.get_query_string_diff(array('mode')), 'mode=param'),286 'U_SUBSCRIBE_MODE' => add_url_param ($base_url.get_query_string_diff(array('mode')), 'mode=subscribe'),287 'U_SEND_MODE' => add_url_param ($base_url.get_query_string_diff(array('mode')), 'mode=send'),284 'U_HELP' => add_url_params(get_root_url().'/popuphelp.php', array('page'=>'notification_by_mail') ), 285 'U_PARAM_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'param') ), 286 'U_SUBSCRIBE_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'subscribe') ), 287 'U_SEND_MODE' => add_url_params($base_url.get_query_string_diff(array('mode')), array('mode'=>'send') ), 288 288 'F_ACTION'=> $base_url.get_query_string_diff(array()) 289 289 )); -
Property
svn:eol-style
set to
-
trunk/category.php
r1092 r1094 191 191 'U_REGISTER' => get_root_url().'register.php', 192 192 'U_LOST_PASSWORD' => get_root_url().'password.php', 193 'U_LOGOUT' => add_url_param (make_index_URL(), 'act=logout'),193 'U_LOGOUT' => add_url_params(make_index_URL(), array('act'=>'logout') ), 194 194 'U_ADMIN'=> get_root_url().'admin.php', 195 195 'U_PROFILE'=> get_root_url().'profile.php', … … 397 397 array( 398 398 'URL' => 399 add_url_param (duplicate_index_url(),'caddie=1')399 add_url_params(duplicate_index_url(), array('caddie'=>1) ) 400 400 ) 401 401 ); … … 447 447 array( 448 448 'DISPLAY' => $orders[$i][0], 449 'URL' => add_url_param ( duplicate_index_URL(), 'image_order='.$i),449 'URL' => add_url_params( duplicate_index_URL(), array('image_order'=>$i) ), 450 450 'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : ''), 451 451 ) -
trunk/include/category_default.inc.php
r1092 r1094 86 86 'image_id' => $row['id'], 87 87 'image_file' => $row['file'] 88 ) 88 ), 89 array('start') 89 90 ); 90 91 -
trunk/include/config_default.inc.php
r1087 r1094 416 416 $conf['history_admin'] = false; 417 417 418 // +-----------------------------------------------------------------------+ 419 // | urls | 420 // +-----------------------------------------------------------------------+ 421 422 // question_mark_in_urls : the generated urls contain a ? sign. This can be 423 // changed to false only if the server translates PATH_INFO variable 424 // (depends on the server AcceptPathInfo directive configuration) 425 $conf['question_mark_in_urls'] = true; 426 427 // picture_url_style : one of 'id' 'id-file' or 'file'. 'id-file' or 'file' 428 // mean that the file name (without extension will appear in the url). 429 // Note that one aditionnal sql query will occur if 'file' is choosen. 430 // Note that you might experience navigation issues if you choose 'file' 431 // and your file names are not unique 432 $conf['picture_url_style'] = 'id'; 433 434 435 // php_extension_in_urls : if true, the urls generated for picture and 436 // category will not contain the .php extension. This will work only if 437 // .htaccess defines Options +MultiViews parameter or url rewriting rules 438 // are active. 439 $conf['php_extension_in_urls'] = true; 440 418 441 ?> -
trunk/include/functions.inc.php
r1092 r1094 1026 1026 /** 1027 1027 * adds one or more _GET style parameters to an url 1028 * example: add_url_param ('/x', 'a=b') returns /x?a=b1029 * add_url_param ('/x?cat_id=10', 'a=b') returns /x?cat_id=10&a=b1028 * example: add_url_params('/x', array('a'=>'b')) returns /x?a=b 1029 * add_url_params('/x?cat_id=10', array('a'=>'b')) returns /x?cat_id=10&a=b 1030 1030 * @param string url 1031 * @param string param1031 * @param array params 1032 1032 * @return string 1033 1033 */ 1034 function add_url_param($url, $param) 1035 { 1036 $url .= ( strstr($url, '?')===false ) ? '?' :'&'; 1037 $url .= $param; 1034 function add_url_params($url, $params) 1035 { 1036 if ( !empty($params) ) 1037 { 1038 assert( is_array($params) ); 1039 $is_first = true; 1040 foreach($params as $param=>$val) 1041 { 1042 if ($is_first) 1043 { 1044 $is_first = false; 1045 $url .= ( strstr($url, '?')===false ) ? '?' :'&'; 1046 } 1047 else 1048 { 1049 $url .= '&'; 1050 } 1051 $url .= $param; 1052 if (isset($val)) 1053 { 1054 $url .= '='.$val; 1055 } 1056 } 1057 } 1038 1058 return $url; 1039 1059 } … … 1047 1067 function make_index_URL($params = array()) 1048 1068 { 1049 $url = 1050 get_root_url().'category.php?' 1051 .'/'.make_section_in_URL($params) 1052 ; 1053 1069 global $conf; 1070 $url = get_root_url().'category'; 1071 if ($conf['question_mark_in_urls']) 1072 { 1073 } 1074 if ($conf['php_extension_in_urls']) 1075 { 1076 $url .= '.php'; 1077 } 1078 $url.= make_section_in_URL($params); 1054 1079 $url = add_well_known_params_in_url($url, $params); 1055 1056 1080 return $url; 1057 1081 } … … 1135 1159 function make_picture_URL($params) 1136 1160 { 1161 global $conf; 1137 1162 if (!isset($params['image_id'])) 1138 1163 { … … 1140 1165 } 1141 1166 1142 $url = 1143 get_root_url().'picture.php?' 1144 .'/'.make_section_in_URL($params) 1145 ; 1167 $url = get_root_url().'picture'; 1168 if ($conf['php_extension_in_urls']) 1169 { 1170 $url .= '.php'; 1171 } 1172 if ($conf['question_mark_in_urls']) 1173 { 1174 $url .= '?'; 1175 } 1176 $url .= make_section_in_URL($params); 1146 1177 $url = add_well_known_params_in_url($url, $params); 1147 $url.= '/'. 1148 $params['image_id']//.'-'. 1149 //get_filename_wo_extension($params['image_file']).'.htm' 1150 ; 1178 $url.= '/'; 1179 switch ( $conf['picture_url_style'] ) 1180 { 1181 case 'id-file': 1182 $url .= $params['image_id'].'-'; 1183 case 'file': 1184 $url .= get_filename_wo_extension($params['image_file']).'.htm'; 1185 break; 1186 default: 1187 $url .= $params['image_id']; 1188 } 1151 1189 return $url; 1152 1190 } … … 1222 1260 if (!isset($params['category'])) 1223 1261 { 1224 $section_string.= 'categories';1262 //$section_string.= '/categories'; 1225 1263 } 1226 1264 else 1227 1265 { 1228 $section_string.= ' category/'.$params['category'];1266 $section_string.= '/category/'.$params['category']; 1229 1267 } 1230 1268 … … 1238 1276 } 1239 1277 1240 $section_string.= ' tags';1278 $section_string.= '/tags'; 1241 1279 1242 1280 foreach ($params['tags'] as $tag) … … 1254 1292 } 1255 1293 1256 $section_string.= ' search/'.$params['search'];1294 $section_string.= '/search/'.$params['search']; 1257 1295 1258 1296 break; … … 1265 1303 } 1266 1304 1267 $section_string.= ' list/'.implode(',', $params['list']);1305 $section_string.= '/list/'.implode(',', $params['list']); 1268 1306 1269 1307 break; … … 1271 1309 default : 1272 1310 { 1273 $section_string.= $params['section'];1311 $section_string.= '/'.$params['section']; 1274 1312 } 1275 1313 } -
trunk/include/functions_calendar.inc.php
-
Property
svn:keywords
set to
Author Date Id Revision
r1090 r1094 6 6 // | branch : BSF (Best So Far) 7 7 // | file : $RCSfile$ 8 // | last update : $Date : 2006-01-27 02:11:43 +0100 (ven, 27 jan 2006)$9 // | last modifier : $Author : rvelices$10 // | revision : $Revision : 1014$8 // | last update : $Date$ 9 // | last modifier : $Author$ 10 // | revision : $Revision$ 11 11 // +-----------------------------------------------------------------------+ 12 12 // | This program is free software; you can redistribute it and/or modify | … … 179 179 180 180 $must_show_list = true; // true until calendar generates its own display 181 if (basename($_SERVER['SCRIPT_ NAME']) == 'category.php')181 if (basename($_SERVER['SCRIPT_FILENAME']) == 'category.php') 182 182 { 183 183 $template->assign_block_vars('calendar', array()); -
Property
svn:keywords
set to
-
trunk/include/picture_comment.inc.php
-
Property
svn:eol-style
set to
native
-
Property
svn:keywords
set to
Author Date Id Revision
r1090 r1094 7 7 // | branch : BSF (Best So Far) 8 8 // | file : $RCSfile$ 9 // | last update : $Date : 2006-03-09 00:14:53 +0100 (jeu, 09 mar 2006)$10 // | last modifier : $Author : rub$11 // | revision : $Revision : 1070$9 // | last update : $Date$ 10 // | last modifier : $Author$ 11 // | revision : $Revision$ 12 12 // +-----------------------------------------------------------------------+ 13 13 // | This program is free software; you can redistribute it and/or modify | … … 187 187 array( 188 188 'U_COMMENT_DELETE' => 189 add_url_param( $url_self, 190 'action=delete_comment&comment_to_delete='.$row['id'] 189 add_url_params( 190 $url_self, 191 array( 192 'action'=>'delete_comment', 193 'comment_to_delete'=>$row['id'] 194 ) 191 195 ) 192 196 ) -
Property
svn:eol-style
set to
-
trunk/include/picture_rate.inc.php
r1092 r1094 114 114 array( 115 115 'OPTION' => $mark, 116 'URL' => add_url_param($url_self,'action=rate&rate='.$mark), 116 'URL' => add_url_params( 117 $url_self, 118 array( 119 'action'=>'rate', 120 'rate'=>$mark 121 ) 122 ), 117 123 'SEPARATOR' => ($num > 0 ? '|' : ''), 118 124 ) -
trunk/include/section_init.inc.php
r1092 r1094 84 84 85 85 $next_token = 0; 86 if (basename($_SERVER['SCRIPT_ NAME']) == 'picture.php')86 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php') 87 87 { // the last token must be the identifier for the picture 88 88 $token = array_pop($tokens); … … 94 94 { 95 95 preg_match('/^(\d+-)?((.*)[_\.]html?)?$/', $token, $matches); 96 if ( isset($matches[1]) and is_numeric($matches[1]) )96 if (isset($matches[1]) and is_numeric($matches[1]=rtrim($matches[1],'-')) ) 97 97 { 98 98 $page['image_id'] = $matches[1]; … … 101 101 $page['image_file'] = $matches[3]; 102 102 } 103 103 104 } 104 105 else … … 508 509 } 509 510 510 if (basename($_SERVER['SCRIPT_ NAME']) == 'picture.php'511 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php' 511 512 and !isset($page['image_id']) ) 512 513 { 513 $query = ' 514 if ( !empty($page['items']) ) 515 { 516 $query = ' 514 517 SELECT id,file 515 518 FROM '.IMAGES_TABLE .' … … 517 520 AND file LIKE "' . $page['image_file'] . '.%" ESCAPE "|"' 518 521 ; 519 $result = pwg_query($query); 520 if (mysql_num_rows($result)>0) 521 { 522 list($page['image_id'], $page['image_file']) = mysql_fetch_row($result); 522 $result = pwg_query($query); 523 if (mysql_num_rows($result)>0) 524 { 525 list($page['image_id'], $page['image_file']) = mysql_fetch_row($result); 526 } 527 } 528 if ( !isset($page['image_id']) ) 529 { 530 $page['image_id'] = -1; // will fail in picture.php 523 531 } 524 532 } -
trunk/index.php
r675 r1094 28 28 define('PHPWG_ROOT_PATH','./'); 29 29 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 30 redirect( 'category.php');30 redirect( make_index_url() ); 31 31 ?> -
trunk/install/phpwebgallery_structure.sql
r1085 r1094 261 261 `need_update` enum('true','false') NOT NULL default 'true', 262 262 `forbidden_categories` text, 263 `nb_total_images` mediumint(8) ,263 `nb_total_images` mediumint(8) unsigned, 264 264 PRIMARY KEY (`user_id`) 265 265 ) TYPE=MyISAM; -
trunk/picture.php
r1092 r1094 358 358 ; 359 359 360 $url_slide = add_url_param (360 $url_slide = add_url_params( 361 361 $picture['current']['url'], 362 'slideshow='.$conf['slideshow_period'] ); 362 array( 'slideshow'=>$conf['slideshow_period'] ) 363 ); 363 364 364 365 $title = $picture['current']['name']; … … 367 368 { 368 369 $refresh= $_GET['slideshow']; 369 $url_link = add_url_param($picture['next']['url'], 'slideshow='.$refresh); 370 $url_link = add_url_params( 371 $picture['next']['url'], 372 array('slideshow'=>$refresh) 373 ); 370 374 } 371 375 … … 411 415 if ( !isset($_GET['metadata']) ) 412 416 { 413 $url_metadata = add_url_param ( $url_metadata, 'metadata');417 $url_metadata = add_url_params( $url_metadata, array('metadata'=>null) ); 414 418 } 415 419 } … … 527 531 'representative', 528 532 array( 529 'URL' => add_url_param($url_self, 'action=set_as_representative') 533 'URL' => add_url_params($url_self, 534 array('action'=>'set_as_representative') 535 ) 530 536 ) 531 537 ); … … 538 544 'caddie', 539 545 array( 540 'URL' => add_url_param($url_self, 'action=add_to_caddie') 546 'URL' => add_url_params($url_self, 547 array('action'=>'add_to_caddie') 548 ) 541 549 ) 542 550 ); … … 564 572 'FAVORITE_HINT' => $lang['add_favorites_hint'], 565 573 'FAVORITE_ALT' => $lang['add_favorites_alt'], 566 'U_FAVORITE' => add_url_param($url_self, 'action=add_to_favorites'), 574 'U_FAVORITE' => add_url_params( 575 $url_self, 576 array('action'=>'add_to_favorites') 577 ), 567 578 ) 568 579 ); … … 576 587 'FAVORITE_HINT' => $lang['del_favorites_hint'], 577 588 'FAVORITE_ALT' => $lang['del_favorites_alt'], 578 'U_FAVORITE' => add_url_param($url_self, 'action=remove_from_favorites'), 589 'U_FAVORITE' => add_url_params( 590 $url_self, 591 array('action'=>'remove_from_favorites') 592 ) 579 593 ) 580 594 );
Note: See TracChangeset
for help on using the changeset viewer.