Files and media

The gallery page of an Energine 2.13 site with demo content, with a row of four image thumbnails
Energine 2.13 with demo content — the gallery (interface in Russian)

Files live in the file repository: a tree of folders and files kept in the database and in htdocs/uploads/public/, shared by all sites of the install.

The file repository

«Файловый репозиторий» (File repository) on the page toolbar opens it; so do the file fields of forms and the editor's picture, file and video buttons. Its toolbar: «Открыть» (Open), «Загрузить» (Upload), «Копировать» (Copy), «Создать папку» (Create folder), «Редактировать» (Edit), «Переместить в папку» (Move to folder) and «Удалить» (Delete).

  • An uploaded file is stored under a generated name, <time><number>.<extension>, and keeps its title; images get their width and height.
  • Files the web server could run are refused — php and its variants, phtml, phar, cgi, fcgi, pl, py, sh, .htaccess, .htpasswd — with «Файлы этого типа загружать нельзя: сервер выполнит их как программу» (Files of this type cannot be uploaded: the server would run them as a program).
  • A replacement must have the same type. Deleting a folder deletes everything in it. Uploading a zip archive is not available in 2.13.
  • The size limit is PHP's and the web server's; the nginx example allows 64 MB.
  • php index.php setup syncUploads, from htdocs/, registers files copied into htdocs/uploads/public/ by hand.

Extra sizes of an image

The configuration's thumbnails lists named sizes — small is 140×107, for example. The file form then has a tab «Маленькое изображение для:» (Small image for:) with an upload for each size.

The image resizer

/resizer/w<width>-h<height>/<path> returns a resized copy of a picture through TimThumb 2.8.13 (htdocs/resizer/timthumb.php): fitted with borders, at most 1500×1500 pixels, from a source of at most 10 MB, cached in the system's temporary folder. TimThumb also fetches images from a list of other sites; see Known risks.

Repositories

repositories.mapping of the configuration ties a repository's type to its class: repo/local — the starter's «Локальный репозиторий» (Local repository) — repo/ftp with its connections in repositories.ftp, and the read-only repo/ftpro and repo/ro. There is no screen to add a repository: it is a root row of share_uploads with its configuration.

Pictures and files in texts

The editor's picture window, ImageManager, sets the file, width, height, margins, alignment and alt text of a picture. Records whose table has a <table>_uploads companion — news, for example — have attached files.