* Lordeagle * Graham Alrite thanks for the info.
2015-08-23 05:25 · (0)
* Aash I think doing these things with JavaScript is not a smart choice for me... I would prefer if there's any server-side scripting..
2015-08-23 02:37 · (0)
* Graham * Lordeagle That will probably not work xt:random is a server side function that is parsed before the page is even sent to the browser where javascript is run
you would need to use a javascript random function not xt:random
2015-08-23 01:49 (edited 2015-08-23 01:54 by Graham ) · (0)
* Lordeagle * Lordeagle Remove quotes (" ") from addition sign in the above code
2015-08-22 19:44 · (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-22 19:13 (edited 2015-08-22 19:43 by Lordeagle ) · (0)
* Lordeagle * Graham Alright thanks for the new code i really appreciate it.
2015-08-22 18:09 · (0)
* Aash * Graham Oh, that's a good one, Thanks!
2015-08-22 15:51 · (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 13:58 (edited 2015-08-22 14:13 by Graham ) · (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 10:48 · (0)
* Aash * Lordeagle Its a nice script though! :thumbs:
2015-08-21 21:49 · (0)

Online: Guests: 1