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.
You can download the files here (sitelokfiletree.zip)
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"); ?>
<link href="/phpfiletree/styles/default/default.css" rel="stylesheet" type="text/css" media="screen" /> <script src="/phpfiletree/php_file_tree.js" type="text/javascript"></script>
5) At the point in the page where you want it to appear insert
<?php echo php_file_tree($FileLocations["files"], "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 *