execute($sql); $viewed_videos = $rs->getrows(); $viewed_total = count($viewed_videos); $sql = "SELECT VID, title, duration, addtime, thumb, thumbs, viewnumber, rate, likes, dislikes, type, hd FROM video" .$sql_add. " ORDER BY addtime DESC LIMIT " .$config['recent_per_page']; $rs = $conn->execute($sql); $recent_videos = $rs->getrows(); $total = $rsc->fields['total_videos']; $pagination = new Pagination($config['videos_per_page']); $limit = $pagination->getLimit($total); $sql = "SELECT * FROM video" .$sql_add. " LIMIT " .$limit; $videos = $rs->getrows(); $page_link = $pagination->getPagination('videos'); $start_num = $pagination->getStartItem(); $end_num = $pagination->getEndItem(); $smarty->assign('videos_total', $total); $smarty->assign('start_num', $start_num); $smarty->assign('end_num', $end_num); $smarty->assign('page_link', $page_link); $smarty->assign('errors',$errors); $smarty->assign('messages',$messages); $smarty->assign('menu', 'home'); $smarty->assign('index', true); $smarty->assign('viewed_total', $viewed_total); $smarty->assign('viewed_videos', $viewed_videos); $smarty->assign('recent_videos', $recent_videos); $smarty->assign('self_title', $seo['index_title']); $smarty->assign('self_description', $seo['index_desc']); $smarty->assign('self_keywords', $seo['index_keywords']); $smarty->display('header.tpl'); $smarty->display('errors.tpl'); $smarty->display('messages.tpl'); $smarty->display('index.tpl'); $smarty->display('footer.tpl'); $smarty->gzip_encode(); ?>