Manual

tips

enable statistics on image

add stat as fourth of fifth get

{{lang:php}}
<img src="<?=$MP['pathlang'];?>/image/medium/123/stat" />

enable statistics on file

add stat as fourth of fifth get

{{lang:php}}
<a href="<?=$MP['pathlang'];?>/file/download/123/stat">download</a>

or even better option to get more realistic statistics

{{lang:php}}
<a href="#" onclick="location.href='<?=$MP['pathlang'];?>/file/download/123/stat'">download</a>

static content links

static elements as images(/template//template/manual/images/xxx) or files must be presigned with $MP[path]

disable caching in user session

set

{{lang:php}}
$_SESSION['nocache'] = true;

nocache is automaticly set when you login to myportal

web page user session require

{{lang:php}}
$_SESSION['username'], $_SESSION['user_id'], $_SESSION['user_cid']

downloading / opening files and statistics

url formatting

/file/download/1_1_34r234r234r234r   ..offers file to download
/file/open/1_1_34r234r234r234r   ..file is opened directly
/file/open/1_1_34r234r234r234r/stat  ..enabled statistics

print view

append GET (?|&)action=print to display. don't forget to set the print template

custom global functions

you can add your custom global functions to template/helpers/custom.php which is already included. helpers added via loadthelper are included in template scope and should be loaded only when you need them.

calling system function templates

there are two way of calling system function templates * direct (/template/system/sys_group.php) - script is indipendent and have no db connection * via sys display (/sys/group) - script already include db connection and all display predefined variables

minimising requests

scripts and css files can be grouped as one file. This will minimise number of requestis and decrese server load. Recommended for more then one javascript/css includes.

{{lang:php}}
<script type="text/javascript" src="<?=$MP['path'];?>/template/system/sys_group.php?files=email.js,statistics.js,validate.js"></script>
<link rel="stylesheet" type="text/css" href="<?=$MP['path'];?>/template/system/sys_group.php?files=style.css,forms.css" />
Try myPortal 2: