Copy this and paste first
Now paste this code below the above code
<!--parser:xtscript-->
# Path to files folder
var $path_to_folder = /uploads
# this removes files with no extension
var $filter= *.*
# 0 for all items
var $number_of_items = 5
# un-encoded filelist template
var $filelist_template = <div style="border-bottom:1px solid;margin:1px;padding:1px"><img src="http://xtgem.com/images/icons/mimes/.file_type..png" alt="*" /><a href=".file_url."> .file_name_base_parsed.</a> <br />.file_size. .file_mime.</div>
# 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-->
Copy code
# Path to files folder
var $path_to_folder = /uploads
# this removes files with no extension
var $filter= *.*
# 0 for all items
var $number_of_items = 5
# un-encoded filelist template
var $filelist_template = <div style="border-bottom:1px solid;margin:1px;padding:1px"><img src="http://xtgem.com/images/icons/mimes/.file_type..png" alt="*" /><a href=".file_url."> .file_name_base_parsed.</a> <br />.file_size. .file_mime.</div>
# 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-->
Copy code
Now paste this code below the above code
<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="{_$$path_to_folder |}" template=" '{_$$filelist_template |}', " filter="{_$$filter|}"/>'dummy_entry'];
var list = shuffleArray(list);for(var i=0;i<{_$$number_of_items |};i++){
document.write(list[i]);}
</script>
Copy code
add ur folda link where u c /uploads, study more nd edit to ur taste!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="{_$$path_to_folder |}" template=" '{_$$filelist_template |}', " filter="{_$$filter|}"/>'dummy_entry'];
var list = shuffleArray(list);for(var i=0;i<{_$$number_of_items |};i++){
document.write(list[i]);}
</script>
Copy code
-
·
- rated(0)