^macro_use[href.cfg] ^macro[header;Леонид Боровиков: Фотоальбом] ^macro[menu;3] ^var[blok;8] ^level[none; ^server[trush:andrew@localhost/literra; ^ifdef[query[]; ^context[quer; ^lsplit[^query[];&] ] ^context[basic; ^sql[select Who, Id_Article from Illustration_main_old where id=^item[quer;0]] ^eq[^item[Who];2; ^context[name; ^sql[select id, Name from Chapter_old where id=^item[basic;Id_Article]]

^item[Name]

] ] ^eq[^item[Who];4; ^context[name; ^sql[select id, Name from Point_old where id=^item[basic;Id_Article]]

^item[Name]

] ] ] ^context[name; ^sql[select * from Illustration_main_old where id=^item[quer;0]]

^item[Name]

] ^context[photos; ^sql[select count(*) as kol from Illustration_old where id_Illustration_main=^item[quer;0]] ^var[vsego;^item[kol]] ^rem[Менюха с постраничностью] ^var[allpages;^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 Illustration_old where Id_Illustration_main=^item[quer;0] order by id] ^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]