1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
<div class="block">
<ul>
<link>1<link>
<link>2<link>
<link>3<link>
<link>4<link>
</ul>
</div>
//
if( $count_films == 1 OR $count_films == 5 OR $count_films == 9 OR $count_films == 13 OR $count_films == 17 )
$first = '<div class="block"><ul>'; else $first = '';
if( $count_films%4 == 0 )
$last = '</ul></div>';
else $last = '';
$tpl->set('{laast}', $last);
$tpl->set('{fiirst}', $first);
//
{fiirst}<link>{news-id}</link>{last}