APLTemplate error code (Can't locate object method "affected_rows" via package "DBI::st" at (eval 186) line 22. ) my $date_text = ''; my $margin_left = '0px'; if ( $articles::show_date == 1 ) { $margin_left = '65px'; } $articles::page_items_number = 0; $articles::code = ''; my @code = (); my $cond_subgroup = ''; if ( length $articles::subgroup ) { $cond_subgroup = " and subgroup = '$articles::subgroup' "; } my $code = " select * from ".($variables::language_current)."_article_data where public = 1 and type = '$articles::cur_cat_id' $cond_subgroup order by date DESC, title ASC "; my $sth = SQL::MySqlLayer->query( $object::sql, $code); return if !defined $sth || $sth->affected_rows < 1; my @items_list = (); my $items_number = $sth->affected_rows; for ( $i=0; $i<$items_number; $i++ ) { my %data = SQL::MySqlLayer->get_hash($sth); foreach (keys %data) { $items_list[$i]{$_} = $data{$_}; } } my $items_per_page = $articles::items_per_page; my $page = $object::cgi->param('page'); ( $articles::cur_page, $articles::total_pages, $articles::start_item, $articles::page_items_number ) = MISC::Html->pages_calc( $items_number, $items_per_page, $page ); my $i; my $date; for ( $i=$articles::start_item; $i<$articles::start_item+$articles::page_items_number; $i++ ) { $date_text = ''; if ( $articles::show_date == 1 ) { $date_text = MISC::Date->time2string($items_list[$i]{'date'}); } push @code, '

'.($items_list[$i]{'title'}).'

'; $date = MISC::Date->time2string($items_list[$i]{'date'}); push @code, qq~

$date

~; push @code, ''.( $items_list[$i]{'anons'} ).''; my %h = (); my $link = ''; if ( length $items_list[$i]{'text'} ) { $h{'page'} = $page if $page > 1; $h{'id'} = $items_list[$i]{'id'}; # $link = ''.( $variables::page_current_data{'url'} ).'?page='.($page).'&id='.($items_list[$i]{'id'}).''; $link = MISC::Html->add_url_params('', %h); } elsif ( length $items_list[$i]{'link'} ) { $link = $items_list[$i]{'link'}; } if ( length $link ) { push @code, '

Подробнее »»

'; } } $articles::code = join "\n", @code; $articles::pages_link = ''.( $variables::page_current_data{'url'} ).'?group='.( $articles::cur_cat_id ).'&';