Tribiq CMS

Choose your language

5.6 Document/File Handling

The DOCU-standard template is used to display the details of a file and offer a link to the temporary, secure download. You can embed the details of a file and provide a link, using the following snippet, and saving your template as DOCU-standard.tpl.php:

<?php
include 
"templateincludes/document.inc.php";
?>


A Document page can be built through the CMS once this template file has been 
installed through the admin panel. It can be selected through the Document 
Content Definition tab. You will then be asked to upload a file of your choice.

5.6.1 Instant Downloads

In some cases you may want files to download as soon as the user clicks the link to the file. This may be useful if you wish to start the download from a link in the Menu for example.

You might want to build two templates - one that uses instant download, and one that has the visitor click a second link.

To add an instant download mode to your documents, add the following snippet at the top of your template.

<?php
if (!$_SESSION['admin_username']) {
    header("Location: " . buildDownload($cID,$cVersion));
}
?>

Any site visitor who then visits your document content item will start the download instantly.

Top of Page