session_begin(); $user->setup(); $template->set_filenames(array( 'body' => 'index_body.html' )); $template->assign_var('U_HOME', true); /** * banners */ $sql = 'SELECT * FROM banners WHERE banner_ativo = 1 AND banner_idioma = \'' . SEO_LANGUAGE . '\' ORDER BY banner_ordem'; $banners = Make($sql, 'banner', false, false, array(new MakeFunction('makeUrl'))); foreach ($banners as $key => $ba) { $template->assign_block_vars('numero_banners', array('numero' => $key + 1)); } function makeUrl(&$row, $loop) { global $app_root_path; if (! preg_match('#^https?://#', $row['banner_link'])) { $url = $row['banner_link']; $params = ''; if (false !== ($p = strpos($row['banner_link'], '?'))) { $params = substr($url, $p); $url = substr($url, 0, $p); } $row['banner_link'] = RelativeToAbsolute($app_root_path . $url) . $params; } } /** * - */ page_header(); page_footer();