^macro_use[href.cfg] ^macro[header;ЛиТерра-Детское творчество] ^macro[menu;9]

Детское творчество

^var[blok;8] ^server[trush:andrew@localhost/literra; ^ifdef[query[]; ^context[quer; ^lsplit[^query[];&] ] ^context[photos; ^sql[select count(*) as kol from Illust_gallery where id_IllustSEctions=^item[quer;0]] ^var[vsego;^item[kol]] ^rem[Менюха с постраничностью] ^var[allpages;^eval[^var[vsego]/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[name; ^sql[select Name from IllustSections where id=^item[quer;0]]

^item[Name]

] ^context[photos1; ^sql[select * from Illust_gallery where id_IllustSections=^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]