XVideoSharing: Templates Guide


XVideoSharing using very simple template engine via HTML::Template perl module.
All pages templates are just a regular HTML files in /cgi-bin/Templates folder with some special tags inside.

Most usefull templates reference:

  • main.html - global site template. Other templates being included into this one
  • download0.html - pre-view page with countdown and Ads
  • download1.html - video player page with over-player Ads
  • video_embed.html - embed video player page with over-player Ads
  • index_page.html - template for index page with top/recent videos included from /static/ subfolder


Template tags short guide

Basic logic samples:
<TMPL_IF var1> code for var1 with some value </TMPL_IF>
<TMPL_UNLESS var1> code for empty var1 </TMPL_UNLESS>
<TMPL_IF var1> ENABLED <TMPL_ELSE> DISABLED </TMPL_IF>
var1 value = <TMPL_VAR var1>
List: <TMPL_LOOP files> <TMPL_VAR file_title>, </TMPL_LOOP>

Here goes some quick receipts that you may want to use on your site pages:
1. Code for Logged-In users only
Works on: All pages
<TMPL_IF my_login>...code for logged users...</TMPL_IF>
<TMPL_UNLESS my_login>...code for anonymous users...</TMPL_UNLESS>
My username: <TMPL_VAR my_login>
2. Misc user flags
Works on: All pages
<TMPL_IF premium>...code for Premium users...</TMPL_IF>
<TMPL_IF admin>...code for Admin user...</TMPL_IF>
3. Ads code insert
Works on: All pages
This code will be shown only to users with Ads enabled:
<TMPL_IF ads>...Ads code here...</TMPL_IF>
4. Download page variables
Works on: download0.html, download1.html, download_original.html
file_title - video title
file_descr - video description
file_adult - Adult video flag
file_code  - video URL 12-chars code
download_link - video page URL
vid_length2 - video length MM:SS
video_img_url - video thumbnail URL


Copyright © 2016 Sibsoft Ltd