Turn off Automatic Scan

Is there a way to turn off the automatic scan option?

patrik's picture

No without editing main.php

No without editing main.php file.

Quite on the end of main.php you can find following code:

<?php
/*full-scanning directories evry 1 day*/
if($pa_setup["last_dir_scan"]<time()-24*60*60 && is_dir($pa_setup["album_dir"])){
   
scan_photos_directories("");
   
delete_old_ecards();
   
delete_old_anitspam();
}
?>

if you delete the line "scan_photos_directories("");" it wont be scanned automatically.

how do you lower the scan to

how do you lower the scan to when somebody uploads a picture or every 10 minutes rather than stop it ? 24 hours is too long for me.

Thanks

steleung's picture

If you want to scan the

If you want to scan the folders every ten minutes, you can change the code to:

<?php
/*full-scanning directories evry 10 minutes*/
if($pa_setup["last_dir_scan"]<time()-10*60 && is_dir($pa_setup["album_dir"])){
   
scan_photos_directories("");
   
delete_old_ecards();
   
delete_old_anitspam();
}
?>

The "10*60" means the time between each scan in seconds, ie 10 minutes but pls be noted that high frequency of scan may increase the work load of the server.

http://www.maomao.hk

I put the new code in but

I put the new code in but its very slow at loading up even though I set it at 10 minutes.

Also I dont see the new photos appear after 10 minutes. When I check the gallery in the setup and I click on update database, the next time it says its to update/refresh is the actual time that I refreshed it even though I set it at 10*60 for 10 minutes.

Would there be any way of creating a button to refresh the database or an action after I upload my photos via uberload that refreshes the database ?

Thanks in advance

Dicko

patrik's picture

You can refresh/rescan

You can refresh/rescan photos in Setup->Galleries, or Setup->Pictures.

There is a link with which you can rescan photos.

I know that there is a link

I know that there is a link within the setup but Id like to refresh the database everytime somebody uploads a picture. I am not bothered about a particular time or minutes. Just when a new picture is uploaded.

I have seen in one forum question that you can add a button to the main.php and let the user do it but when I tried to add it. it didnt work.

Does anyone have a main.php that already has this feature included and working that they could send me ?

Thanks

Dicko

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.