Trying to disable the Image Handler v3 Hover effect for certain pages. I like how it is functional on the product page, however, I don't like the effect on the Home page under the Review and Featured Items is displayed.
Thanks
Printable View
Trying to disable the Image Handler v3 Hover effect for certain pages. I like how it is functional on the product page, however, I don't like the effect on the Home page under the Review and Featured Items is displayed.
Thanks
Hello, i have a problem with bmz_cache. It have too many files.
I have a -sort-of-solution ---> lets do cron the job.
But when i configure cron.php (code below) it do not work.
I have this cron solution for -cache-admin-.log- problem. ^^ but that do not work for bmz_cache.
:frusty:
Can you help me?
--script---
-my-sort-of-solution for -cache-admin-.log- problem----PHP Code:
<?php
function recursiveDelete($str){
if(is_file($str)){
return @unlink($str);
}
elseif(is_dir($str)){
$scan = glob(rtrim($str,'/data/web/juwelen.sk/web/bmz_cache/').'/*');
foreach($scan as $index=>$path){
recursiveDelete($path);
}
return @rmdir($str);
}
}
function delete_folder($tmp_path){
}
?>
PHP Code:
<?php
if ('deletespecificfiles.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('<h2>Direct File Access Prohibited</h2>');
}
else {
$foldertodelete = '/data/web/juwelen.sk/web/cache/';
//DELETE LOG FILES
$fileTypes1 = '*.log';
$expire_time1 = 3;
foreach (glob($foldertodelete . $fileTypes1) as $Filename1) {
$FileCreationTime1 = filectime($Filename1);
$FileAge1 = time() - $FileCreationTime1;
if ($FileAge1 > ($expire_time1 * 60)){
unlink($Filename1);
}
}
}
?>
OK. I find solution myself. For sake of those who have those errors, try this solution.
**this solution needs Cron setup**
*************
Error n1.:
This kind of error i can repair. It is because of filename. Is in my language and i can not find a solution (i try many solutions -FAIL), only delete error log.HTML Code:charset `windows-1250' not supported, assuming iso-8859-1 in .../bmz_image_handler.class.php on line 690
cron setup -> time- * * * * * ,, cron script put in directory"../cron/"
create a file cron1.php (and copy code)
when cron start - in every 1minute - he delete only log files in /cachePHP Code:
<?php
if ('deletespecificfiles.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('<h2>Direct File Access Prohibited</h2>');
}
else {
$foldertodelete = ' --your path to--/web/cache/ ';
//DELETE Log FILES
$fileTypes1 = '*.log';
$expire_time1 = 3;
foreach (glob($foldertodelete . $fileTypes1) as $Filename1) {
$FileCreationTime1 = filectime($Filename1);
$FileAge1 = time() - $FileCreationTime1;
if ($FileAge1 > ($expire_time1 * 60)){
unlink($Filename1);
}
}
}
?>
*************
Error n2.:
BIG //bmz_cache//.
cron setup -> time- 0 12 * * 7 ,, cron script put in directory"../cron/"
I setup cron to start every Sunday midnight (because, bmz_cache needs to be filled /for some time/ because if bmz_cache is clear, image handler must create new cache - that slows server (tested on localhost and live shop).
create a file cron2.php (and copy code)
----------------------PHP Code:
<?php
if ('deleteallfiles.php' == basename($_SERVER['SCRIPT_FILENAME'])) {
die ('<h2>Direct File Access Prohibited</h2>');
}
else {
$foldertodelete = ' -- your path to -- web/bmz_cache/0/';
$fileTypes1 = '*.*';
$expire_time1= 3;
foreach (glob($foldertodelete . $fileTypes1) as $Filename1) {
$FileCreationTime1 = filectime($Filename1);
$FileAge1 = time() - $FileCreationTime1;
if ($FileAge1 > ($expire_time1 * 60)){
unlink($Filename1);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/1/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/2/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/3/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/4/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/5/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/6/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/7/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/8/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/9/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/a/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/b/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/c/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/d/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/e/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
$foldertodelete = ' -- your path to -- web/bmz_cache/f/';
$fileTypes2 = '*.*';
$expire_time2 = 3;
foreach (glob($foldertodelete . $fileTypes2) as $Filename2) {
$FileCreationTime2 = filectime($Filename2);
$FileAge2 = time() - $FileCreationTime2;
if ($FileAge2 > ($expire_time2 * 60)){
unlink($Filename2);
}
}
}
?>
Disclaimer
*Use it wisely.
*It is not, that my solution is the best. Is only solution which works well for me. If you have a better solution -- share it please with community.
*I am not a Jenius - i only edit some PHP code from internet.
(original page is here -http://www.devshed.com/c/a/Administr...cript-Example/)
*cron setup is different on "different" server.
*And the last -- sorry my english - i am not native U.S. I am only a student :smartalec:
[QUOTE=Querk;1095893]Hello, i have a problem with bmz_cache. It have too many files.
I have a -sort-of-solution ---> lets do cron the job.
But when i configure cron.php (code below) it do not work.
I have this cron solution for -cache-admin-.log- problem. ^^ but that do not work for bmz_cache.
:frusty:
Can you help me?
How many files is "too many files"?
What error are you receiving?
or is it a hosting restriction?
Huh? I thought the point of Image Handler was that it cached the files. If you delete them then what is the point of having Image handler? If the store has any level of traffic whatsoever the cached images are just going to be re-created pretty much straight away and you just slow down the page load for some customers.
A much better solution would be to have a server that has enough disk space to store all the images that are needed for your store.
Nods in agreement..:yes:
I agree with niccol.. Your solution is NOT recommended for ANYONE.. The point of the cache folders is to help improve site performance. (A HUGE reason to use Image Handler) Your solution trashes this feature and in fact will probably slow performance down..
My "better solution" (since you asked)?? As niccol points out, host your site on a server that will not put restrictions on your site that will prevent you from using Image Handler. Chances are these restrictions will eventually limit your ability to run any kind of decent website anyway..
Hold on Querk, I think there's a confusion between bmz_cache and cache here. This charset problem produces thousands of log files in the cache folder. On the other hand, the bmz_cache folder holds cached images which are required and will be generated again when you delete them.
I had the same problem with thousands (not just too many) files created in the cache folder every day. If you go back a few pages to post #676, you will see how I solved it based on a previous suggestion by niccol. No cron jobs or anything else: just a one-line change in a file. Read the post, see if this is really the issue and leave the bmz_cache alone.