» Xtgem Coding Help » View post
<div class="zxfourborder"><div class="comments" align="right">Random Related Files</div></div>
<div class="zxfourborder" align="justify">
<!--parser:xtscript-->
# Path to files folder
var $path_to_folder=
# this removes files with no extension
var $filter= *.*
# 0 for all items
var $number_of_items = 5
# un-encoded filelist template
var $filelist_template = <a href="/download?file=.file_name.&name=.file_name_parsed.&type=.file_mime.&size=.file_size.&ext=.file_type.&link=.file_url.&date=.file_date.&time=.file_time.&fold={_$fold|2go/2gov6}">.file_name_parsed.</a><b> - </b>
# Process variables
var $filelist_template = call htmlspecialchars $val=$filelist_template
if not $number_of_items
var $number_of_items = list.length-1
endif
<!--/parser:xtscript-->
<script type="text/javascript">
function shuffleArray(array) {
for (var i = array.length - 2; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];array[j] = temp;}
return array;}
var list=[<xt:filelist folder="{_$fold|2go/2gov6}" template=" '{_$$filelist_template |}', " filter="{_$$filter|}"/>];
var list = shuffleArray(list);for(var i=0;i<{_$$number_of_items |};i++){
document.write(list[i]);}
</script>
[<a href="#more">+More</a>]
</div>
Copy code
<div class="zxfourborder" align="justify">
<!--parser:xtscript-->
# Path to files folder
var $path_to_folder=
# this removes files with no extension
var $filter= *.*
# 0 for all items
var $number_of_items = 5
# un-encoded filelist template
var $filelist_template = <a href="/download?file=.file_name.&name=.file_name_parsed.&type=.file_mime.&size=.file_size.&ext=.file_type.&link=.file_url.&date=.file_date.&time=.file_time.&fold={_$fold|2go/2gov6}">.file_name_parsed.</a><b> - </b>
# Process variables
var $filelist_template = call htmlspecialchars $val=$filelist_template
if not $number_of_items
var $number_of_items = list.length-1
endif
<!--/parser:xtscript-->
<script type="text/javascript">
function shuffleArray(array) {
for (var i = array.length - 2; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];array[j] = temp;}
return array;}
var list=[<xt:filelist folder="{_$fold|2go/2gov6}" template=" '{_$$filelist_template |}', " filter="{_$$filter|}"/>];
var list = shuffleArray(list);for(var i=0;i<{_$$number_of_items |};i++){
document.write(list[i]);}
</script>
[<a href="#more">+More</a>]
</div>
Copy code
» Xtgem Coding Help » View post
Guests: 1
zf_mackie (Admin)