$messagesCount = $get_messages->getMessagesCount(); if (isset($_GET['page'])) { $page = $_GET['page'] - 1; } else { $page = 0; } $start = abs($page * $configData->maxShowPosts); $messages = $get_messages->getMessages($start, 0, $configData->maxShowPosts); // Assign messages to Smarty template $smarty->assign('messages', $messages); // Pages $t_pages = ceil($messagesCount / $configData->maxShowPosts); $pagesText = ''; for ($tstep = 1; $tstep <= $t_pages; $tstep++) { if ($tstep - 1 == $page) { $pagesText .= "<strong>[" . $tstep . "]</strong> "; } else { $pagesText .= '<a href="' . $_SERVER['PHP_SELF'] . '?page=' . $tstep . '">' . $tstep . "</a> "; } } $smarty->assign("Pages", $pagesText); // Show page $userEcho = new class_User(); $userEcho2 = $userEcho->authUser("admin", "amaga911"); echo (int) $userEcho2; $smarty->display('index.tpl'); ?> </body> </html>