Display a secure tree view of files for download in Sitelok
Sitelok allows you to secure download links using the siteloklink() function. This works by generating a secure link which only works for the logged in user and hides the location where the file is located. In most cases this works fine but if you have a whole folder of files (perhaps with subfolders) it might be hard to create all the links. To make a neat solution for this situation we have modified the open source phpfiletree script so that it will display files and folders from a Sitelok download location and automatically secure links. You can place the file tree object on any secured page and looks something like this.
1) First of all we should make a Sitelok file location that points to where you store your files. This needs to be on the same domain as Sitelok. To do this go to Tools - Configuration and scroll down to Download Locations. Create an additional location called files and enter the full file path to the folder on your server. It should look something like this.
<?php $groupswithaccess="ALL"; require_once("slpw/sitelokpw.php"); include("phpfiletree/php_file_tree.php"); ?>
5) At the point in the page where you want it to appear insert
<?php echo php_file_tree($FileLocation["files"], "", array("gif", "jpg", "jpeg", "png","pdf")); ?>
You can adjust the list of file types to show. Other types will be ignored.
order allow,deny deny from *