* Lordeagle The script below is what i used to display and show random files @ my homepage http://eaglenet.xtgem.com study and edit to display random files if u need any help send me a private message(pm) or visit my forum http://forum.eaglenet.xtgem.com
<script>
var pg = "<xt:url/>"
if (pg == "http://eaglenet.xtgem.com/index"){
location.replace('http://eaglenet.xtgem.com/index?__filelist_page=<xt:random from="1" to="10" x="1"/>')};
</script>

Copy code
2015-08-20 13:38 (edited 2015-08-22 22:28 by Graham ) · (0)
* Aash * Lordeagle Its ok for limited files. But if we continously upload files, then we also must update this code again and again... The to=""
2015-08-21 00:39 · (0)
* Lordeagle * Aash Yup just set the cold to the uploads maximum pages thats all
2015-08-21 06:28 · (0)
* Aash * Lordeagle Its a nice script though! :thumbs:
2015-08-22 06:49 · (0)
* Lordeagle * Aash Thanks dude I think xtgem paging script can be of help though might be useless when more filelist are used on the page. In the paging there is variable that generates the total available pages in the filelist just check the custom paging script u will see it.
2015-08-22 19:48 · (0)
* Graham This will also do it
Use filecount in a xtscript variable and divide it by the number per page and round it up to give you the total pages
then use that in the random function as a xtscript $$ get variable
<!--parser:xtscript-->
var $c=<xt:filecount folder="/myfolder" />
var $c=call ceil $num=($c/10)
<!--/parser:xtscript-->
<script>
var pg = "<xt:url/>"
if (pg == "http://eaglenet.xtgem.com/index"){
location.replace('http://eaglenet.xtgem.com/index?__filelist_page=<xt:random from="1" to="{_$$c|}" x="1"/>')};
</script>

Copy code

ps your original post had no space after your site url so everything else was being included in the url messing up the layout
2015-08-22 22:58 (edited 2015-08-22 23:13 by Graham ) · (0)
* Aash * Graham Oh, that's a good one, Thanks!
2015-08-23 00:51 · (0)
* Lordeagle * Graham Alright thanks for the new code i really appreciate it.
2015-08-23 03:09 · (0)
* Lordeagle * Lordeagle It can recoded to javascript to get a shorter code
<script>
var c= <xt:filecount folder="/myfolder" />;
num = (c % 10) "+" c/10; // when c is an odd num
var pg = "<xt:url/>";
if (pg == "http://eaglenet.xtgem.com/index"){
location.replace('http://eaglenet.xtgem.com/index?__filelist_page=<xt:random from="1" to="num" x="1"/>')};
</script>

Copy code
2015-08-23 04:13 (edited 2015-08-23 04:43 by Lordeagle ) · (0)
* Lordeagle * Lordeagle Remove quotes (" ") from addition sign in the above code
2015-08-23 04:44 · (0)

Online: Guests: 1