Размер файла: 1.53Kb
<?php
$page = isset( $_GET['page'] ) ? (int) ($_GET['page'] - 1) : 0;
$template_vars['header'] = array(
'TITLE' => $lang['UNCHECKED'],
'CSS' => $css
);
$template->set_vars('header', $template_vars['header']);
$query = "SELECT COUNT(*) FROM `" . CATALOGUE_SITES . "` WHERE `checked` = 0;";
if( !$sql->query($query) )
{
put_error(DBMS_ERROR, htmlspecialchars($sql->error['message']), __LINE__, __FILE__);
}
$total = $sql->result($sql->result, 0);
$maxpage = maxpage($total, $config['catalogue_onpage']);
$limit = limit($page, $config['catalogue_onpage']);
if( !($qresult = $sql->query("SELECT * FROM `" . CATALOGUE_SITES . "` WHERE `checked` = 0 ORDER BY `id` DESC LIMIT " . $limit . ";")) )
{
put_error(DBMS_ERROR, htmlspecialchars($sql->error['message']), __LINE__, __FILE__);
}
for( $i = 1; $site = $sql->fetch_assoc($qresult); $i++ )
{
$template->set_block_vars('body', 'site', array(
'PLACE' => $page * $config['catalogue_onpage'] + $i,
'LINK_OUT' => gen_uri('out', $site['id']),
'SITE' => output( $site['site'] )
));
}
$pages = pages($page, $maxpage, $config['catalogue_onpage'], 2, '', gen_uri($m));
$template_vars['body'] = array(
'PAGES' => $pages,
'STAT_HREF' => gen_uri('statistics'),
'STAT' => $lang['STAT'],
'BACK_HREF' => gen_uri('index'),
'BACK' => $lang['BACK']
);
$template_vars['footer'] = array(
'SWITCH_VERSION' => switch_version($m, '', $nocache),
'COUNTER' => ''
);
$template->set_vars('body', $template_vars['body']);
$template->set_vars('footer', $template_vars['footer']);
?>