View Module:Client Area

The Client Area module provides a semi-secure client area through which clients are able to download files and navigate a file/folder structure. It provides the facility to wrap XHTML and CSS around the output of the module, and allows the user to traverse the relevant client folders and display file and folder names, dates, file sizes and file extensions.

There is no ‘hard’ log-in but instead clients access their files area via a unique URL.

Installation

Copy the file lang.clientarea.php into system/languages/english.
Copy the clientarea directory into system/modules.

In the Control Panel, go to Modules. The Client Area module should be listed. Click on Install in the right hand column.

Configuration

In the Modules tab, click on Client Area. Click on Configure Client Area in the top right hand corner to get to the module settings.

Tags

The following code provides an example to display a client’s private download area:

{exp:clientarea}

{invalid_account}<h1>Sorry, this account is not valid</h1>{/invalid_account}

<h1>Client name: {clientname}</h1>
<h2>Client path: {path}</h2>
<p>Breadcrumb: {breadcrumb}</p>

<h2>File listing:</h2>

<table>
    <thead>
        <tr>
            <th>Filename</th>
            <th>Type</th>
            <th>Size</th>
            <th>Date</th>
            <th>Extension</th>
        </tr>
    </thead>
    <tbody>
        {files}
        <tr class="{switch="one|two"}">
            <td><a href="{url}" class="icon-{filetype}">{filename}</a></td>
            <td>{filetype}</td>
            <td>{size}</td>
            <td>{date}</td>
            <td>{extension}</td>
        </tr>
        {/files}
        {if no_files}<tr><td colspan="5">There are no files in this directory</td></tr>{/if}
    </tbody>
</table>

{/exp:clientarea}

Parameters

Variables

{clientname}

{clientname}

Displays the client’s name

{path}

{path}

Displays the current path

{breadcrumb}

{breadcrumb}

Displays a breadcrumb to the current directory

The {files} variable pair

The {files} variable pair marks where the file listing of the current directory begins and ends. Within the {files} tags can be the following variables:

The {invalid_account} variable pair

{invalid_account}Invalid account{invalid_account}

The message displayed if an attempt is made to view an invalid directory.

{if no_files} conditional

The {if no_files}...{/if} conditional can be used to display a message if there are no files in the current directory.