{sync_folder}

Tag {sync_folder} synchronises folders between the file system and CMS, it also synchronises albums in file system based galleries. Since version 4.2.4.

Parameters

  • id - folder ID or album ID (in file system based gallery) to synchronise. If "id" is not defined then alternative parameter "path" is used.
  • path - relative path of the folder to synchronise.

Example

Synchronise one (active) album in file system based gallery

{if $in_editor}
<form name="custom_conf_vars" action="{$self}" method="GET">
<fieldset>
<input type="hidden" name="sync_id" value="folder_id_you_wish_to_sync">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="sync" value="1">
<input type="submit" name="submit_button" value= "Synchronise folder">
</fieldset>
</form>
{if $smarty.get.sync == 1}{sync_folder id = $smarty.get.sync_id}{/if}
{/if}

{init_file}

Tag {init_file} fetches specific file. Since version 4.4.0.

Parameters

  • name - variable name where the returned data is saved. Default value is "file".
  • buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete".
  • profile - defines the profile of the files. Value must exactly match the profile name in the site's administration area.
  • icons - relative path to the icons folder, eg "extensions/saurus4/images/file_icons/"

Attributes

  • id - ID number of the file
  • parent_id - ID number of parent object.
  • href - link to the file
  • url - URL to the file
  • title - title of the file
  • buttons - action-buttons, available only for editors.
  • parent - parent folder ID
  • fullpath - absolute path to the file, including filename
  • filename - filename
  • mimetype - MIME type of the file, eg "image/gif"
  • profile_id - profile ID of the file
  • extension - extension of the filename, eg "gif"
  • icon - relative path to file type icon
  • class - class name of the object.
  • date - date of the file
  • fdate - date of the file in database default format, eg yyyy-mm-dd.
  • datetime - date and time of the file, format dd.mm.yyyy hh:mm. 4.4.1
  • fdatetime - date and time of the file in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
  • created_user_id - user ID who initially created the object.
  • created_user_name - user full name who initially created the object.
  • changed_user_id - user ID who made the last object saving.
  • changed_user_name - user full name who made the last object saving.
  • created_time - creating time of the object in format dd.mm.yyyy hh:ii.
  • fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • changed_time - last saving time of the object in format dd.mm.yyyy hh:ii.
  • fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • comment_count - the number of comments.
  • last_commented_time - the last comment time in format dd.mm.yyyy hh:ii.

if the file is an image (determined by mimetype) and is included in a gallery (see init_images) the following attributes become available:

  • thumb_path - relative path to the thumbnail image
  • thumb_height - height of the thumbnail image in pixels
  • thumb_width - width of the thumbnail image in pixels
  • image_path - relative path to the image
  • image_height - height of the image in pixels
  • image_width - width of the image in pixels
  • actual_image_path - relative path to the original image
  • actual_image_height - height of the original image in pixels
  • actual_image_width - width of the original image in pixels

General tags

  • <name>_newbutton - prints "New" action-button for creating a new object.
  • <name>_count - the number of returned objects.  If parameter "limit" is set then count equals to "limit" value.
  • <name>_counttotal - the total number of objects found, not affected by "limit" parameter.

Example

{init_file name="image" id=12852 icons="extensions/saurus4/images/file_icons/"}

{$image->buttons}
{if $image->extension == 'gif' || $image->extension == 'jpg'}
    <img src="{$image->url}" width="{$image->actual_image_width}" height="{$image->actual_image_width}">
{else}
    <a href="{$image->href}"><img src="{$image->icon}">{$image->title}</a>
{/if}

{init_files}

Tag {init_files} displayes files from one folder. Since version 4.1.0.

Parameters

  • parent - folder ID value(s) where to get the files. Multiple ID values must be comma separated. If parent is not defined then folder "public/" ID is used.
  • parent_dir - a relative path to the files, eg "public/documents" overrides "parent. 4.5.0
  • name - variable name where the returned data is saved. Default value is "files".
  • buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete".
  • start - the starting row number to return.
  • limit - the number of rows to return. You must use this parameter always with "start" parameter.
  • order - defines how files are sorted.
  • profile - defines the profile(s) of the files. Value must exactly match the profile name in the site's administration area. Multiple profile name values must be separated by comma.
  • icons - relative path to the icons folder, eg "extensions/saurus4/images/file_icons/"
  • where additional filtering criteria using WHERE SQL syntax.
  • select - additional table fields to return using SELECT SQL syntax.

Attributes

  • id - ID number of the file
  • parent_id - ID number of parent object.
  • href - link to the file
  • title - title of the file
  • buttons - action-buttons, available only for editors.
  • parent - parent folder ID
  • folder_fullpath - absolute path to the parent folder
  • fullpath - absolute path to the file, including filename
  • filename - filename
  • mimetype - MIME type of the file, eg "image/gif"
  • profile_id - profile ID of the file
  • extension - extension of the filename, eg "gif"
  • icon - relative path to file type icon
  • class - class name of the object.
  • date - date of the file
  • fdate - date of the file in database default format, eg yyyy-mm-dd.
  • datetime - date and time of the file, format dd.mm.yyyy hh:mm. 4.4.1
  • fdatetime - date and time of the file in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
  • created_user_id - user ID who initially created the object.
  • created_user_name - user full name who initially created the object.
  • changed_user_id - user ID who made the last object saving.
  • changed_user_name - user full name who made the last object saving.
  • created_time - creating time of the object in format dd.mm.yyyy hh:ii.
  • fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • changed_time - last saving time of the object in format dd.mm.yyyy hh:ii.
  • fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii.
  • comment_count - the number of comments.
  • last_commented_time - the last comment time in format dd.mm.yyyy hh:ii.

General tags

  • <name>_newbutton - prints "New" action-button for creating a new object.
  • <name>_count - the number of returned objects.  If parameter "limit" is set then count equals to "limit" value.
  • <name>_counttotal - the total number of objects found, not affected by "limit" parameter.

Example

{init_files parent=$folder_id icons="extensions/saurus4/images/file_icons/"}
{foreach from=$files item="file"}
    {if $file->icon}
        <a href="{$file->href}" target="_blank" class="DocumentIcon"><img src="{$file->icon}" alt=""></a>
    {/if}
    
    {$file->buttons}<a href="{$file->href}" target="_blank">{$file->title}</a>
    {$file->date}
    {$file->size}
    {$file->extension}
{foreachelse}
    {$files_newbutton}
{/foreach}

{init_folders}

Tag {init_folders} displayes sub-folders from one folder. Since version 4.1.0.

Parameters

  • parent - parent folder ID where to get the sub-folders. If parent is not defined then "public/" folder ID is used.
  • parent_dir - parent folder name where to get the folders. If parent_dir is not defined then "public" is used.
  • name - variable name where the returned data is saved. Default value is "folders".

Attributes

  • id - ID number of the folder
  • parent_id - ID number of parent object.
  • title - folder name
  • parent - parent folder ID
  • fullpath - absolute path to the folder
  • file_count - the number of files in the folder

Example

{init_folders parent_dir="public" name="folders"}
{foreach from=$folders item="fldr"}
   {$fldr->title}<br />
{/foreach}