load_template('main.tpl'); if (!isset($TPL->result['CONTENT'])) $TPL->result['CONTENT'] = ''; $TPL->set('{CONTENT}', $TPL->result['CONTENT']); $TPL->set('{THEME}', $CONF['http_url'].'skins/' . $CONF['skin']); $TPL->set('{CLASSES_URL}', $CONF['http_url'] . 'kernel/classes'); $TPL->set('{HTTP_URL}', $CONF['http_url']); $TPL->set('{ADMIN_URL}', $CONF['admin_url']); $TPL->set('{PCSE_V}', $CONF['v_id']); $TPL->set('{YEAR}', date('Y')); $ankets=GetAnketsList(); $TPL->set('{ANKETS}', $ankets); $ban=GetBanners(); $headers = <<{H_TITLE} HTML; $TPL->set('{HEADERS}', $headers); if (count($ban)>0) foreach ($ban as $name => $value) { $TPL->set("{".$name."}",$value); }; $mp_links=GetMpAdvert('http://pcse.ru/mp_advert/links.php?nocss=true'); $TPL->set('{MP_LINKS}', $mp_links); $mp_logo=GetMpAdvert('http://massajmsk.ru/link.php'); $TPL->set('{MP_LOGO}', $mp_logo); $TPL->compile('main'); if (strpos($TPL->result ['main'], "[aviable=") !== false) { $TPL->result ['main'] = preg_replace("#\\[aviable=(.+?)\\](.*?)\\[/aviable\\]#ies", "Aviable('\\1', '\\2', '{$do}')", $TPL->result ['main']); } if (strpos($TPL->result ['main'], "[not-aviable=") !== false) { $TPL->result ['main'] = preg_replace("#\\[not-aviable=(.+?)\\](.*?)\\[/not-aviable\\]#ies", "Aviable('\\1', '\\2', '{$do}', false)", $TPL->result ['main']); } if (strpos($TPL->result ['main'], "[video=") !== false) { $TPL->result ['main'] = preg_replace("#\\[video=(.+?)\\]#ies", "Video('\\1')", $TPL->result ['main']); } if (strpos($TPL->result ['main'], "[page=") !== false) { $TPL->result ['main'] = preg_replace("#\\[page=(.+?)\\]#ies", "GetPageByID('\\1')", $TPL->result ['main']); } echo $TPL->result ['main']; } else { // На сайте ведутся работы $TPL->load_template('admin/develop.tpl'); $TPL->set('{THEME}', $CONF['http_url'].'skins/' . $CONF['skin']); $TPL->set('{CLASSES_URL}', $CONF['http_url'] . 'kernel/classes'); $TPL->set('{HTTP_URL}', $CONF['http_url']); $TPL->set('{ADMIN_URL}', $CONF['admin_url']); $TPL->set('{PCSE_V}', $CONF['v_id']); $TPL->set('{YEAR}', date('Y')); $TPL->compile('construt'); echo $TPL->result['construt']; } ?>