query('SELECT * FROM site_news WHERE type=0 OR type=2 ORDER BY date DESC LIMIT 0, ' . MAX_SITE_NEWS); while($row = $db -> fetch_array()) { $row['date'] = date("d-m-Y H:i:s", $row['date']); $site_news[] = $row; } //Getting site articles $db -> query('SELECT * FROM articles WHERE location=0 ORDER BY date DESC LIMIT 0, ' . MAX_SITE_NEWS); while($row = $db -> fetch_array()) { $row['date'] = date("d-m-Y H:i:s", $row['date']); if($row['position'] == 0) $articles_left[] = $row; else $articles_right[] = $row; } //If possible trying to log user in if(login() == false) { $tpl -> assign('zle_dane', 'zle_dane'); } //Sending fetched data to templates engine $tpl -> assign('SITE_NEWS', $site_news); $tpl -> assign('articles_left', $articles_left); $tpl -> assign('articles_right', $articles_right); $tpl -> assign('USER_ID', $user_id); $tpl -> assign('USER', $user); //Display settings $tpl -> assign('naglowek', naglowek('NowoĊ›ci')); $tpl -> assign('naglowek2', naglowek('Logowanie do serwisu')); $tpl -> assign('head_open', "head_wydawcy.tpl"); $tpl -> assign('strona_open', "index.tpl"); $tpl -> display('srodek_bezmarginesow.tpl'); ?>