I suppose that it might be possible. But there is the issue of PHP (the server actually) generally needing to know what the values are when the page is served. I think getpics could be modified to make a server variable that could then be used here like:
PHP Code:
var dimension="5x<?php=$_rows?>"
Not sure If I have my PHP syntax right. The bigger issue is whether the $_rows would be ready in time or not. Since this is already a javascript though, I'd try passing the value directly (worked here in local testing):
Code:
var dimension="5x"+Math.ceil(galleryarray.length/5);
Also (unrelated to this particular question), if you are going to use this for various galleries where the path might be different than:
and on pages that might have other scripts than we've already covered, this (be sure to use the added semicolon on the targetlinkdr line):
Code:
. . . iptionprefix=[0, ""]
var gsortorder=""
var targetlinkdir="http://www.billmyrickartist.com/img/lg/"; //large gallery
(function(){
for (var i = galleryarray.length-1, j ; i > -1 ; --i)
for (j = slides.length-1 ; j > -1 ; --j)
if(slides[j][0].replace(/^.*\//,'') == galleryarray[i][0])
galleryarray[i][1]=slides[j][1];
})();
</script>
would be better than:
Code:
. . . iptionprefix=[0, ""]
var gsortorder=""
var targetlinkdir="http://www.billmyrickartist.com/img/lg/" //large gallery
for (var i = galleryarray.length-1, j ; i > -1 ; --i)
for (j = slides.length-1 ; j > -1 ; --j)
if(slides[j][0].replace(/\/img\/lg\//,'') == galleryarray[i][0])
galleryarray[i][1]=slides[j][1];
</script>
Bookmarks