System calls

‹ back to Settings


Images are stored in the MyPortal's database in three different sizes (+ original if backup is set). To display images you should use one of the following options:

<img src="<?=$MP['path'];?>/image/small/<?=$content['image1'];?>" />
<img src="<?=$MP['path'];?>/image/medium/<?=$content['image1'];?>" />
<img src="<?=$MP['path'];?>/image/large/<?=$content['image1'];?>" />
<img src="<?=$MP['path'];?>/image/original/<?=$content['image1'];?>" />

The $MP['path'] is a global variable which stores the physical folder of your project (root folder).

The $content['image1'] should contain the IID number of the image you want to display.


Files are stored in the files folder, but additional data is stored into the database. To open or download file from your website you should use one of the followig options:

<a href="<?=$MP['path'];?>/file/open/<?=$content['file1'];?>">Click to open</a>
<a href="<?=$MP['path'];?>/file/download/<?=$content['file1'];?>">Download</a>

The $content['file1'] contains the namehash of the file you want to access. The namehash is an unique string (16 characters), which is created when the file is uploaded to MyPortal. The physical file is put into the files folder and renamed in order to avoid duplicates. The namehash is automatically set when using files in articles, otherwise you have to get it from the DB.

System scripts

You can access all system scripts using the reserved sys display. First you should create a php script, put it into the template/system folder and name it such as sys_{some-name}.php. The script can be called this way:

<form method="post" action="<?=$MP['path'];?>/sys/{some-name}">

The {some-name} is the name of you script without sys_ and .php.There is no need to create a special displays just to use your own system scripts.

Some existing system function templates under template/system/*.php:

  • sys_403 - forbiden template
  • sys_404 - not found template
  • sys_captcha - captcha image
  • sys_comment - add comment function template
  • sys_rssfeed - rss output function template

‹ back to Settings

Try myPortal 2: