Home › ImageCache does not work when switched off "clean url"
ImageCache does not work when switched off "clean url"
Hide all descriptions
Submitted by Marat Farkhulin on Wednesday, 03.24.2010
tags:
Error description:
Error occurs when installing the module ImageCache If there'sa "cleaner url." The image is not generated.
To resolve this problem would have to edit the file imagecache.module, to do so, open it in the editor and look for the function:
<?php
function imagecache_create_url($presetname, $filepath, $bypass_browser_cache = FALSE) {
$path = _imagecache_strip_file_directory($filepath);
if (module_exists('transliteration')) {
$path = transliteration_get($path);
}
$args = array('absolute' => TRUE, 'query' => empty($bypass_browser_cache) ? NULL : time());
switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
case FILE_DOWNLOADS_PUBLIC:
return url($GLOBALS['base_url'] . '/' . file_directory_path() .'/imagecache/'. $presetname .'/'. $path, $args);
case FILE_DOWNLOADS_PRIVATE:
return url('system/files/imagecache/'. $presetname .'/'. $path, $args);
}
}
?>Then replace it with a corrected function:
<?php
function imagecache_create_url($presetname, $filepath, $bypass_browser_cache = FALSE) {
$path = _imagecache_strip_file_directory($filepath);
if (module_exists('transliteration')) {
$path = transliteration_get($path);
}
$args = array('absolute' => TRUE, 'query' => empty($bypass_browser_cache) ? NULL : time());
switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
case FILE_DOWNLOADS_PUBLIC:
if( variable_get('clean_url', 0) ) {
return url($GLOBALS['base_url'] . '/' . file_directory_path() .'/imagecache/'. $presetname .'/'. $path, $args) ;
} else {
return url($GLOBALS['base_url'] . '/index.php?q=' . file_directory_path() .'/imagecache/'. $presetname .'/'. $path, $args);
}
case FILE_DOWNLOADS_PRIVATE:
return url($GLOBALS['base_url'] . '/' . file_directory_path() .'/imagecache/'. $presetname .'/'. $path, $args);
}
}
?>Who's new
- rkd
- buharovvn
- regsat2010
- Marat Farkhulin
Who's online
There are currently 0 users and 2 guests online.
Search
Work schedule
Feedback
Workdays
Monday to Friday
Working time
from 10 to 18 Moscow time, GMT +3
Break
from 13 to 14