How to: hide files that are not images / audio / video

I was sick of seeing *.CR2 (RAW images), Thumbs.db, and other random files that should not be in an album by default (this may also be a potential security hole for some servers).

My quick fix:

1. comment out this else block in main.php (roughly around line 1220):

=========================================
}else if(is_audio($fn)){
//check for screenshot
$changed=true;
db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"type"=>"A","screenshot"=>$screenshot));
}
/* REMOVED THIS TO PREVENT "OTHER" FILES FROM BEING ADDED TO THE DBASE
else
{
//check for screenshot
$changed=true;
db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"type"=>"O","screenshot"=>$screenshot));
}
*/
=========================================

2. This will only work for newly added folders. To update your existing albums you must re-build your database. I do this by going to the setup page, "Main setup" tab, and changing the "Album directory" to an empty directory (which must have the valid permissions, just make an empty one where your existing albums are), applying this, then changing it back again and applying (this can take some time, depending on the size of your photo folders).


style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-8698264690166658"
data-ad-slot="4417389723">