Changeset 17302 for trunk/admin/include/functions.php
- Timestamp:
- Aug 1, 2012, 9:03:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r17210 r17302 1570 1570 return false; 1571 1571 } 1572 1572 1573 1573 // let's first break links with all albums but their "storage album" 1574 1574 $query = ' … … 1580 1580 ;'; 1581 1581 pwg_query($query); 1582 1582 1583 1583 if (is_array($categories) and count($categories) > 0) 1584 1584 { … … 2277 2277 function clear_derivative_cache($types='all') 2278 2278 { 2279 $pattern='#.*-'; 2280 if ($types == 'all') 2279 if ($types === 'all') 2281 2280 { 2282 2281 $types = ImageStdParams::get_all_types(); … … 2288 2287 } 2289 2288 2289 for ($i=0; $i<count($types); $i++) 2290 { 2291 $type = $types[$i]; 2292 if ($type == IMG_CUSTOM) 2293 { 2294 $type = derivative_to_url($type).'[a-zA-Z0-9]+'; 2295 } 2296 elseif (in_array($type, ImageStdParams::get_all_types())) 2297 { 2298 $type = derivative_to_url($type); 2299 } 2300 else 2301 {//assume a custom type 2302 $type = derivative_to_url(IMG_CUSTOM).'_'.$type; 2303 } 2304 $types[$i] = $type; 2305 } 2306 2307 $pattern='#.*-'; 2290 2308 if (count($types)>1) 2291 2309 { 2292 $type_urls = array(); 2293 foreach($types as $dtype) 2294 { 2295 $type_urls[] = derivative_to_url($dtype); 2296 } 2297 $pattern .= '(' . implode('|',$type_urls) . ')'; 2310 $pattern .= '(' . implode('|',$types) . ')'; 2298 2311 } 2299 2312 else 2300 2313 { 2301 $pattern .= derivative_to_url($types[0]);2302 } 2303 2304 $pattern.='(_[a-zA-Z0-9]+)*\.[a-zA-Z0-9]{3,4}$#'; 2314 $pattern .= $types[0]; 2315 } 2316 $pattern.='\.[a-zA-Z0-9]{3,4}$#'; 2317 2305 2318 if ($contents = @opendir(PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR)) 2306 2319 {
Note: See TracChangeset
for help on using the changeset viewer.