@sections[][title] #$title[$sections.section] ^if($MAIN:show_sections eq "1"){ # ^generate_year_sections[] }{ $works_sections[^table::load[/admin/cfg/works_sections.cfg]] $sections[^works_sections.select($works_sections.type eq "$MAIN:show_sections")] }

^sections.menu{$title[$sections.section]$i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^if(^MAIN:section_.int(0) eq "$sections.id"){^l2img_red[$letter]}{^l2img[$letter]}^i.inc[]}}[
]
@content[] $how(12) $works_by_type[^table::load[/admin/cfg/works_by_type.cfg]] ^if(^s_values:uri.count[] eq "0"){ ### ### Главная страница ### $works[^table::load[/admin/cfg/works.cfg]}] ^works.sort($works.id)[desc] $z(0) $offset(^if(def $MAIN:page){^MAIN:page.int(0)}{0}) ^works.offset(+${offset}) ^while($z < $how && $z < ^works.count[]){ ^if($z eq "0"){ $MAIN:current_date[$works.published] $MAIN:client[$works.client] $MAIN:current_title[$works.title] $MAIN:current_section[$works.type] $MAIN:current_work[$works.id] $MAIN:current_link[$works.link] $MAIN:current_description[$works.description] } # ^z.inc[] ^works.offset(+1) }
$i(0)^while($i < ^works.title.length[]){$letter[^works.title.mid($i;1)]^if($z eq "0"){^l2img_red[$letter]}{^l2img[$letter]}^i.inc[]}
$maxlimit($how) $total(^works.count[]) $x(1)$i(0) ^while($i < ^if(^eval($how * 7) < $total){^eval($how * 7)}{$total}){ ^if($x eq "^eval($offset / $maxlimit + 1)"){ }{ } ^if(^eval($i / 7) eq ^eval($i / 7)[%.0f]){} }
^l2img_white[$x]^i.inc($maxlimit)^x.inc[]^l2img_ul[$x]^i.inc($maxlimit)^x.inc[]
#^if(^works_by_type.locate[id;${works.type}]){$works_by_type.title}/ } ^if(^s_values:uri.count[] eq "1"){ ### ### Чего-то выбрали ### ^if(^works_by_type.locate[title;$s_values:uri_last]){ $MAIN:title[$works_by_type.title] $works_sections[^table::load[/admin/cfg/works_sections.cfg]] $sections[^works_sections.select($works_sections.type eq "$works_by_type.id")] ^if(^sections.count[] > 0){ $MAIN:show_sections($works_by_type.id) }{ ^if($works_by_type.id eq "1"){ # ^generate_year_sections[] # $MAIN:show_sections($works_by_type.id) }{ $MAIN:show_sections(0) } } $MAIN:work_title[$works_by_type.title] $works[^table::load[/admin/cfg/works.cfg]}] $works[^works.select($works.type eq "$works_by_type.id")] ^if(^MAIN:section_.int(0) ne "0"){ ^if($works_by_type.id eq "1"){ $works[^works.select(^works.published.left(4) eq "^if(^sections.locate[id;^MAIN:section_.int(0)]){$sections.section}")] }{ $works[^works.select($works.section_id eq "^MAIN:section_.int(0)")] } } ^if(^works.count[] > 0){ ^works.sort($works.id)[desc] $z(0) $offset(^if(def $MAIN:page){^MAIN:page.int(0)}{0}) ^works.offset(+${offset}) $z(0) ^while($z < $how && ^eval($z + $offset) < ^works.count[]){ ^if($z eq "0"){ $MAIN:client[$works.client] $MAIN:current_date[$works.published] $MAIN:current_title[$works.title] $MAIN:current_section[$works.type] $MAIN:current_work[$works.id] $MAIN:current_link[$works.link] $MAIN:current_description[$works.description] } ^z.inc[]^works.offset(+1)}
# # $i(0)^while($i < ^works.title.length[]){$letter[^works.title.mid($i;1)]^if($z eq "0"){^l2img_red[$letter]}{^l2img[$letter]}^i.inc[]} #
}{ $title[Cooming soon...] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img[$letter]^i.inc[]} } } $maxlimit($how) ^if(!def $works){$works[^table::load[/admin/cfg/works.cfg]}]} $total(^works.count[]) $x(1)$i(0) ^while($i < ^if(^eval($how * 7) < $total){^eval($how * 7)}{$total}){ ^if($x eq "^eval($offset / $maxlimit + 1)"){ }{ } ^if(^eval($i / 7) eq ^eval($i / 7)[%.0f]){} }
^l2img_white[$x]^i.inc($maxlimit)^x.inc[]^l2img_ul[$x]^i.inc($maxlimit)^x.inc[]
} ^if(^s_values:uri.count[] eq "2"){ ### ### Чего-то выбрали второй раз. наверное работа с подкатегорией :-) ### ^if(^works_by_type.locate[title;$s_values:uri.piece]){ $MAIN:title[$works_by_type.title] $works_sections[^table::load[/admin/cfg/works_sections.cfg]] $sections[^works_sections.select($works_sections.type eq "$works_by_type.id")] ^if(^sections.count[] > 0){ $MAIN:show_sections($works_by_type.id) }{ #$MAIN:show_sections(0) ^if($works_by_type.id eq "1"){ ^generate_year_sections[] $MAIN:show_sections($works_by_type.id) }{ $MAIN:show_sections(0) } } $MAIN:work_title[$works_by_type.title] $works[^table::load[/admin/cfg/works.cfg]}] $works[^works.select($works.type eq "$works_by_type.id")] # ^if(^MAIN:section_.int(0) ne "0"){$works[^works.select($works.section_id eq "^MAIN:section_.int(0)")]} ^if(^MAIN:section_.int(0) ne "0"){ ^if($works_by_type.id eq "1"){ $works[^works.select(^works.published.left(4) eq "^if(^sections.locate[id;^MAIN:section_.int(0)]){$sections.section}")] }{ $works[^works.select($works.section_id eq "^MAIN:section_.int(0)")] } } ^if(^works.locate[id;$s_values:uri_last]){ $selected_position[^works.line[]] ^if(^works.count[] > 0){ ^works.sort($works.id)[desc] # ^eval(^eval(^eval($selected_position - 1) / 12)[%.1d] * 12) $z(0) $offset(^eval(^eval(^eval($selected_position - 1) / 12)[%.1d] * 12)) ^works.offset(+${offset}) $z(0) ^while($z < $how && ^eval($z + $offset) < ^works.count[]){ ^if($works.id eq "$s_values:uri_last"){ $MAIN:title[$works.title] } ^z.inc[] ^works.offset(+1) }
# # $i(0)^while($i < ^works.title.length[]){$letter[^works.title.mid($i;1)]^if($works.id eq "$s_values:uri_last"){$MAIN:client[$works.client]$MAIN:current_date[$works.published]$MAIN:current_section[$works.type]$MAIN:current_work[$works.id]$MAIN:current_link[$works.link]$MAIN:current_description[$works.description]$MAIN:current_title[$works.title]^l2img_red[$letter]}{^l2img[$letter]}^i.inc[]} #
}{ $title[Cooming soon...] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img[$letter]^i.inc[]} } }{ $response:status[404] $title[404] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img[$letter]^i.inc[]}
$title[Return to Home Page] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img[$letter]^i.inc[]} } } $maxlimit($how) $total(^works.count[]) $x(1)$i(0) ^while($i < ^if(^eval($how * 7) < $total){^eval($how * 7)}{$total}){ ^if($x eq "^eval($offset / $maxlimit + 1)"){ }{ } ^if(^eval($i / 7) eq ^eval($i / 7)[%.0f]){} }
^l2img_white[$x]^i.inc($maxlimit)^x.inc[]^l2img_ul[$x]^i.inc($maxlimit)^x.inc[]
} @description[][title] #^if(def $MAIN:current_title){ # $title[$MAIN:current_title] # $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
#} ^if(def ${MAIN:client} && $MAIN:client ne "-"){ $title[Client: $MAIN:client] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def $MAIN:current_description){ $title[$MAIN:current_description] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def $MAIN:current_date){ $title[^s_values:reverse[$MAIN:current_date]] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def ${MAIN:current_link}){ $title[$MAIN:current_link]  ^;$i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_blue[$letter]^i.inc[]}
} @description2[][title;work;ii;i] ^works.sort($works.id)[desc] ^works.offset(+${offset}) $ii(0) ^while($ii < $how && $ii < ^works.count[]){
^if(def ${works.client} && $works.client ne "-"){ $title[Client: $works.client] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def $works.description){ $title[$works.description] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def $works.published){ $title[^s_values:reverse[$works.published]] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_green[$letter]^i.inc[]}
} ^if(def ${works.link}){ $title[$works.link]  ^;$i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img_blue[$letter]^i.inc[]}
}
^works.offset(+1)^ii.inc[] } @copyright[][title] $title[Copyright 2005 - foxie's graphic design - foxie@foxie.ru] $i(0)^while($i < ^title.length[]){$letter[^title.mid($i;1)]^l2img[$letter]^i.inc[]}
@generate_year_sections[][start;i;now] $start(2000)$now($s_values:now.year)$i(1) ^while($now >= $start){^sections.append{$i 1 $now}^now.dec[]^i.inc[]}