Cyclone3 Skin

542-file list.lite.mdl

From Cyclone3 Wiki

Standard file list with paging

Contents

Input parameters

db_name

  • description: database name
  • format: domain_tld
  • default: domain's default database

sql_limit

  • description: count of items in list, with defined offset
  • format: pagecount[,pageoffset]
  • default: 1

sql_where

  • description: user-defined sql constraints
  • format: sql statement
  • default: 1

sql_order_by

  • description: world status values
  • format: sql statement
  • default: file.name, file.name_ext ASC

file_attrs.status

  • description: non-separated list of status values
  • format: Y[ND]
  • default: Y

file_attrs.ID_category

  • description: ;-separated file category ID list, asterisk symbolizes recursion
  • format: ID[*][,ID[*]] ... [,ID[*]]
  • default:

file.ID

  • description: ;-separated file ID_entity list
  • format: ID[,ID] ... [,ID]
  • default:

file.ID_entity

  • description: ;-separated file ID_entity list
  • format: ID_entity[,ID_entity] ... [,ID_entity]
  • default:

image[.linenumber].ID_format

  • description: (specific file line's) image format ID
  • format: image format ID
  • default: default thumbnail format ID, usually 3

Output templates

Default output

  • definition: TMP
  • description: mandatory.
  • example
<DEFINITION id="TMP">
 File list:<br />

 First file in list:<br />
<#item.1#>
 
 Other files:<br />
 <ul>
<#item#>
 </ul>

<#previous#> <#next#>
</DEFINITION>
Replaced gateways and variables
<#item[.linenumber]#> Placeholder for item template, or item with specific ordinal
<#previous#> Placeholder for previous template
<#next#> Placeholder for next template
<%total_count%> Total count of displayed items
<%category_name%> File category name (only replaced, when a single category ID or ID with asterisk is specified)
<%category_name_url%> File category name (only replaced, when a single category ID or ID with asterisk is specified)

List item template

  • definition: item
  • description: mandatory. default list item template.
  • variations:
    • item.linenumber - overrides both default and odd line templates, 1-based
    • item.odd - overrides default line template for odd line number items
  • example:
<DEFINITION id="item">
  <li>
<#gallery_mark#><#rating_top_mark#><#video_mark#>
   <a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>">
    <%db_name%><br />
   </a>
   <%db_abstract%><br />
  </li>
<#item#>
</DEFINITION>

<DEFINITION id="item.1">
   Our latest file:<br />
   <a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>">
    <%db_name%><br />
   </a>
   <%db_abstract%><br />
</DEFINITION>
Replaced variables
<#item#> Placeholder for the following item. If it doesn't exist, only the first item will be inserted into the main template and further items won't be.
<%db_name%> Item's name
<%db_name_url%> Item's name in url format
<%db_file_ext%> Item's file extension
<%db_file_size[.gb/.mb/.kb]%> Item's file size in bytes (GB, MB, kB)
<%db_file_downloads%> Item's download count
<%db_hash_secure%> Item's security hash
<%item_number%> File list item ordinal
<%db_datetime_create.variable%> Creation date values. Available variables: year, month, month.name, month.name.long, mday (month day), hour, min, sec
<%db_datetime_modify.variable%> Last modification date values. Available variables: year, month, month.name, month.name.long, mday (month day), hour, min, sec

thumbnail

  • description: template for file preview thumbnail
  • example
<DEFINITION id="thumbnail">
	<div class="item_image">
		<a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>" target="_blank">
			<img src="<$tom::H_media>/a501/image/file/<%db_file_path%>" />
		</a>
	</div>
	<div class="item_icon">
		<img src="<$tom::H_grf>/file_list_<%item.db_file_ext%>.png" />
	</div>
	<div class="item_name">
		<a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>" target="_blank">
			<%item.db_name%>
		</a>
	</div>
</DEFINITION>

thumbnail.empty

  • description: template for file preview, when no thumbnail is available
  • example
<DEFINITION id="thumbnail.empty">
	<div class="item_image">
		<a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>" target="_blank">
			<img src="<$tom::H_grf>/sample_image.png" />
		</a>
	</div>
	<div class="item_icon">
		<img src="<$tom::H_grf>/file_list_<%item.db_file_ext%>.png" />
	</div>
	<div class="item_name">
		<a href="<$tom::H_www>/download.pl?hash=<%item.db_hash_secure%>&ID=<%item.db_ID_file%>" target="_blank">
			<%item.db_name%>
		</a>
	</div>
</DEFINITION>

next

  • description: template for next listing page link
  • example
<DEFINITION id="next">
<a href="?|?|offset=<%offset%>">older files</a>
</DEFINITION>

previous

  • description: template for previous listing page link
  • example
<DEFINITION id="previous">
<a href="?|?|offset=<%offset%>">newer files</a>
</DEFINITION>

TMP.empty

  • description: template used, when no file items are available
  • example
<DEFINITION id="TMP.empty">
 File list:<br />

 Sorry, no files are available in this section.
</DEFINITION>

Examples and notes