Page 1 of 1
How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 9:43 am
by AlNaimi
Hi every one....
I couldn't figure out how to build this gallery, You may solve my problem if you can...PLZ
It look like this:
There were 10 albums, Each album contain 25 jpg's. But first pictures in album 1 start from [001-025], The second album start from [025-050], The third album start from [050-075]....etc
When using build gallery in Flashgot, it gave me this formula: What should i do?
http://www.Example.com/album[01-01;1]/name[001-001;1].jpg
Thanks in advanced
Re: How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 2:52 pm
by therube
An expensive way would be something like:
A theoretical way (& I don't know if it can be done, but thinking why can't you do it with JavaScript):
Code: Select all
album[01-10]/name[001-025]+(25*[$001-1])
My
intent with the above is to use a mathematical equation (in JavaScript) - basically the way it is written.
So ...
Code: Select all
001/001+( 25 * 0 ) = 001/001
001/002+( 25 * 0 ) = 001/002
001/003+( 25 * 0 ) = 001/003
...
002/001+( 25 * 1 ) = 002/026
002/002+( 25 * 1 ) = 002/027
002/003+( 25 * 1 ) = 002/028
...
002/001+( 25 * 2 ) = 002/051
002/002+( 25 * 2 ) = 002/052
002/003+( 25 * 2 ) = 002/053
Now whether something like that can be done, I wouldn't have a clue?
Re: How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 3:14 pm
by Giorgio Maone
First enter the following pattern in the "Variable URLs" panel:
Code: Select all
http://www.Example.com/album[by(25, [1-250])]/name[$001].jpg
Then switch to the "JavaScript functions" panel, select the "by" function which should be shown on the top left and past the following code to replace the right text area content:
Code: Select all
return Math.floor((arguments[1] - 1) / arguments[0]) + 1;
For who's interested, the first square bracket group encloses a JavaScript call to the "by" function (which gets defined on the fly), whose arguments are the step (25) and the variable interval
[1-250].
The
[$001] expression is just a backreference to the first variable interval defined in this pattern.
Re: How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 4:51 pm
by AlNaimi
Thanks therube...
********************************************
And you Giorgio Maone, You are the best....
I don't no what i was wrote but i was like a magic formula

...... Please Let me get you a cup of coffee...
Thanks man
I will study the function very well....
Re: How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 5:43 pm
by AlNaimi
BTW, Giorgio Maone.....
If the album was like this: album01, album02...etc . What should we do?
This formula set album1, album2....etc
Re: How to build this gallery? HELP!
Posted: Fri Aug 28, 2009 5:50 pm
by Giorgio Maone
Modify the by() function this way:
Code: Select all
return arguments[1] == 10 ? 10 : "0".concat(Math.floor((arguments[1] - 1) / arguments[0]) + 1)
Re: How to build this gallery? HELP!
Posted: Sat Aug 29, 2009 11:22 am
by AlNaimi
The problem with new new by function was: in with album10 show album010.....
also ablum11 show ablum011....etc...
Thanks
Re: How to build this gallery? HELP!
Posted: Sat Aug 29, 2009 11:39 am
by Giorgio Maone
AlNaimi wrote:There were 10 albums
AlNaimi wrote:also ablum11 show ablum011....etc...
However
Code: Select all
var n = Math.floor((arguments[1] - 1) / arguments[0]) + 1;
return n < 10 ? "0".concat(n) : n;
Re: How to build this gallery? HELP!
Posted: Sat Aug 29, 2009 12:32 pm
by AlNaimi
Thanks....
Forgive my stupidity.
