^macro_use[href.cfg] ^macro[header;ЛиТерра-Галереи] ^macro[menu;4]

Галереи

^var[blok;8] ^level[none; ^server[trush:andrew@localhost/literra; ^ifdef[query[]; ^context[quer; ^lsplit[^query[];&] ] ^context[name; ^sql[select * from Gallery_main where id=^item[quer;0]] ] ^context[author; ^sql[select * from Gallery_Author where id=^item[name;id_Author]] ]

^item[author;Name]. ^item[name;Name]

^context[photos; ^sql[select count(*) as kol from Gallery_Illustration where id_main=^item[quer;0]] ^var[vsego;^item[kol]] ^rem[Менюха с постраничностью] ^var[allpages;^eval[^eval[^var[vsego]-1]/blok]] ^cmp[^var[vsego];^var[blok]; ; ;^var[allpages;+;1]]
^for[i;1;allpages; ^cmp[^var[i];^var[allpages]; [ ^eval[i*blok-blok+1]-^eval[i*blok] ]; [ ^eval[allpages*blok-blok+1]-^var[vsego] ]; [ ^eval[i*blok-blok+1]-^eval[i*blok] ] ] ]
^var[first;^eval[^item[quer;1]*blok-blok]] ^cmp[^item[kol];^eval[^item[quer;1]*blok]; ^var[last;^eval[^item[kol]-1]]; ^var[last;^eval[^item[kol]-1]]; ^var[last;^eval[^item[quer;1]*blok-1]] ] ] ^context[photos1; ^sql[select * from Gallery_Illustration where id_main=^item[quer;0]] ^shift[^var[first]] ^var[lefft;0] ^for[i;^var[first];^var[last]; ^switch[^var[lefft]; ^case[0; ^var[lefft;1] ] ^case[1; ^var[lefft;0] ] ] ^shift[+1] ]
] ] ] ] ^macro[footer]