Sitemap   About   Print view   Deutsch

CMSimple_XH Plugins

Last update:
March 23, 2017, 01:56


Protected Download

This add-on has been turned into a plugin and given the new name Downloadcontrol.

The old add-on is still working and presents no security risk. However it will not be further developed.

Description of old add-on package

If you want to offer downloadable files in your reserved member pages, these files can be downloaded by anyone who knows the download path. To prevent this, you can install the little add-on Protected Download.

New in v. 1.5: File names may contain any characters and may even be Windows-1252 encoded.


(P.S. An alternative solution as full plugin is available from To receive the download the visitor has to submit his name and email and the download will be send as email attachment.)


Unpack and you will find 2 folders, cmsimple and downloads. If you don't have an userfuncs.php file in the folder cmsimple, you can copy the unzipped download simply into your main CMSimple_XH folder. This will add the file userfuncs.php to the cmsimple folder and the folder protected to the download folder. The folder "protected" comes with an .htacces file to protect files from direct download.

If you already have a userfuncs.php file, don't put the unpacked folder into your CMSimple_XH main folder. Open your userfuncs.php with an editor and add the contents of userfuncs.php to it. Take care that <?php appears only once at the beginning of the file and ?> only once at the end. ?> at the end is not necessary.

The folder structure of the download is according to XH 1.6, i.e. the downloads folder is a subfolder of the userfiles. For XH 1.5 installations the downloads folder usually is a subfolder of the base folder, and here you have to place the protected folder accordingly.


Put your download files that need protection into the "protected/" folder and offer a download on your memberpages with this call:

{{{protecteddownload('here name of your file');}}}

This will result in:

Function protecteddownload() is not defined!

You can also use subfolders of the "protected/" folder

Function protecteddownload() is not defined!
Function protecteddownload() is not defined!
Function protecteddownload() is not defined!