Changeset 3137 for branches/2.0/include/functions.inc.php
- Timestamp:
- Feb 13, 2009, 2:02:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/include/functions.inc.php
r3123 r3137 134 134 // $start represents the position of the next '<' character 135 135 // $end represents the position of the next '>' character 136 $start = 0; 137 $end = 0; 138 $start = strpos ( $remaining, '<' ); // -> 0 136 ; // -> 0 139 137 $end = strpos ( $remaining, '>' ); // -> 16 140 138 // as long as a '<' and his friend '>' are found, we loop 141 while ( is_numeric( $start ) and is_numeric( $end ) ) 139 while ( ($start=strpos( $remaining, '<' )) !==false 140 and ($end=strpos( $remaining, '>' )) !== false ) 142 141 { 143 142 // $treatment is the part of the string to treat … … 154 153 // loop 155 154 $remaining = substr ( $remaining, $end + 1, strlen( $remaining ) ); 156 $start = strpos ( $remaining, '<' );157 $end = strpos ( $remaining, '>' );158 155 } 159 156 $treatment = str_replace( ' ', ' ', $remaining ); … … 243 240 if ( !is_writable($dir) ) 244 241 { 245 if ( !is_writable($dir) ) 246 { 247 !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no_write_access')); 248 return false; 249 } 242 !($flags&MKGETDIR_DIE_ON_ERROR) or fatal_error( "$dir ".l10n('no_write_access')); 243 return false; 250 244 } 251 245 return true; … … 465 459 { 466 460 $path = PHPWG_ROOT_PATH.'language/'.$file; 467 if ( is_dir($path) and!is_link($path) and file_exists($path.'/iso.txt'))461 if (!is_link($path) and file_exists($path.'/iso.txt')) 468 462 { 469 463 list($language_name) = @file($path.'/iso.txt'); … … 527 521 528 522 $tags_string = null; 529 if (isset($page['section']) and $page['section'] == 'tags') 530 { 531 $tag_ids = array(); 532 foreach ($page['tags'] as $tag) 533 { 534 array_push($tag_ids, $tag['id']); 535 } 536 537 $tags_string = implode(',', $tag_ids); 523 if ('tags'==@$page['section']) 524 { 525 $tags_string = implode(',', $page['tag_ids']); 538 526 } 539 527 … … 912 900 if (!empty($element_info['filesize'])) 913 901 { 914 $thumbnail_title .= ' : '. l10n_dec('%d Kb', '%d Kb', $element_info['filesize']);902 $thumbnail_title .= ' : '.sprintf(l10n('%d Kb'), $element_info['filesize']); 915 903 } 916 904 … … 1140 1128 1141 1129 /** 1142 * which upgrades are available ?1143 *1144 * @return array1145 */1146 function get_available_upgrade_ids()1147 {1148 $upgrades_path = PHPWG_ROOT_PATH.'install/db';1149 1150 $available_upgrade_ids = array();1151 1152 if ($contents = opendir($upgrades_path))1153 {1154 while (($node = readdir($contents)) !== false)1155 {1156 if (is_file($upgrades_path.'/'.$node)1157 and preg_match('/^(.*?)-database\.php$/', $node, $match))1158 {1159 array_push($available_upgrade_ids, $match[1]);1160 }1161 }1162 }1163 natcasesort($available_upgrade_ids);1164 1165 return $available_upgrade_ids;1166 }1167 1168 /**1169 1130 * Add configuration parameters from database to global $conf array 1170 1131 * … … 1275 1236 foreach (array('SCRIPT_NAME', 'SCRIPT_FILENAME', 'PHP_SELF') as $value) 1276 1237 { 1277 $continue = !empty($_SERVER[$value]); 1278 if ($continue) 1238 if (!empty($_SERVER[$value])) 1279 1239 { 1280 1240 $filename = strtolower($_SERVER[$value]); 1281 1282 if ($conf['php_extension_in_urls']) 1283 { 1284 $continue = get_extension($filename) === 'php'; 1285 } 1286 1287 if ($continue) 1288 { 1289 $basename = basename($filename, '.php'); 1290 $continue = !empty($basename); 1291 } 1292 1293 if ($continue) 1241 if ($conf['php_extension_in_urls'] and get_extension($filename)!=='php') 1242 continue; 1243 $basename = basename($filename, '.php'); 1244 if (!empty($basename)) 1294 1245 { 1295 1246 return $basename; … … 1297 1248 } 1298 1249 } 1299 1300 1250 return ''; 1301 1251 }
Note: See TracChangeset
for help on using the changeset viewer.