Old school Swatch Watches
-

- - - -




* GistBirD FILELIST WITH HITS COUNTER AND FILE RATING.

This requires a registration at the XtCat site
And xtcat widgets to be installed from the market page.


You cannot add xt:widgets directly in a xt:filelist template (wrong parsing
order)
But due to a quirk of xtscript you can add them if the xt:filelist is in a
xtscript variable
which is then printed by the xtscript.
The xtcat counter and ratings widgets use the file_name variable as their
call value
xtcat's counter widget has a display only mode (type="display1") this
mode is used in the xt:filelist template
The counter is incremented on the landing page by a normal xtcat counter
which you could hide by giving it a type="none"
The rating widget for each file is on the landing page
This demo includes the landing page into the same page and xtscript as the
xt:filelist


Copy Script.
<!--parser:xtscript-->
var $path=/PATH/TO/FILES
var $xtuser=YOUR XTCAT USERNAME
var $key=YOUR XTCAT KEY
get file_name
var $template=<a href="? file_name=.file_name.&amp;__filelist_page=$__filelist_page" />.file_name_base_parsed. </a><br />Type .file_mime.<br />Size .file_size.<br />Date .file_datetime.<br />Hits <xt:widget id="xt.c.a.t." tool="Counter" type="display1" key="$key" xtuser= "$xtuser" call=".file_name."/><hr />
 var $template=call htmlspecialchars $val=$template
 var $list =<xt:filelist sort_type="name" sort_dir="desc" folder="$path" template="$template" per_page="3" filter="*.*"/>
 print $list
 else
 # landing page
 # Template must be all on one line
 var $template=Download <a href=".file_url."> .file_name_parsed.</a><br />.file_size.<br />.file_datetime.<br />Hits <xt:widget id="xt.c.a.t." tool="Counter"  key="$key" xtuser= "$xtuser" call="$file_name"/><br/><xt:widget id="xt.c.a.t." tool="Ratings" text1="Rate $file_name" text2="Not Yet Rated. Be The First." text3="Your Rating" text4="Out Of" text5="Total Votes" button1="Rate It!"  key="$key" xtuser= "$xtuser" call="$file_name" /><hr />
 var $template=call htmlspecialchars $val=$template
 var $list=<xt:filelist folder="$path" template="$template"  filter="$file_name"/>
 print $list
 print <a href="?__filelist_page=$__filelist_page"/>Back</a>
 endif
<!--/parser:xtscript-->

Copy code
2014-10-23 07:03 · Reply · (0)


Online: Guests: 1

SITE STATISTICS
Online Users 1 / 63 Today

Registered members 52 / 28 Subscribed members