show(); } /* smarty init */ $smarty = new Smarty(); $smarty->compile_dir = 'templates_c'; $smarty->template_dir = 'templates'; $smarty->cache_dir = 'cache'; $smarty->config_dir = 'configs'; $tags = new Tags($smarty); /* print_r($_POST); print_r($_GET); */ /* */ $language = new Language(); $l = $language->get_language($url); define('l', $l['l_id']); define('lg', ($l['l_pre'] ? $l['l_pre'].'/' : '')); $url = $l['url_id']; /* */ @session_start(); if (!empty($_SESSION)) extract($_SESSION); $users = new Users(); if (isset($logout)) $users->logout(); $user = $users->login($login, $pwd); if ($user['u_login'] && $user['u_pwd']) { if ($dologin) { header("location: ".$_SERVER['HTTP_REFERER']); exit; } define('SECURE', 1); $users->add_stat($user['u_login']); $smarty->assign($user); $user_form = $smarty->fetch(lg."user_info_form.html"); } else { if ($login || $pwd || $dologin) { header("location: ".HOME.lg."login-fail.html"); exit; } define('SECURE', 0); $user_form = $smarty->fetch(lg."user_login_form.html"); } /* */ if (isset($search) && $search) { $search = trim($search); $categories = new Categories(); $res = $categories->search($search); $smarty->assign('lines', $res); $smarty->assign('search', $search); } $search_form = $smarty->fetch(lg."search_form.html"); /* ADD USER */ $REG_USER = new manageUsers($smarty); if (isset($user_add) && isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring']) { if ($REG_USER->saveUser($r)) { header('Location: '.HOME.lg.PAGE_REG_MAIL_VALIDATE); exit; } } elseif (isset($code)) { $REG_USER->validateUserEmail($code); } /* Shoping cart */ $CART = new Cart($smarty); if (isset($cart_action)) { switch ($cart_action) { case 'add': $CART->add($product); header('Location: '.HOME.lg.'cart.html'); exit; break; case 'order': $CART->order($c); header('Location: '.HOME.lg.'thanks.html'); exit; break; case 'recalculate': $CART->recalculate_card($prod); header('Location: '.HOME.lg.'cart.html'); exit; break; } } /* */ if (isset($tag) && $tag) { $index = $tags->get_index($id, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y, PER_PAGE); $smarty->assign('index', $index['index']); $smarty->assign('pages', $index['pages']); $smarty->assign('tags_filter', $tags->filter($tag, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y)); } /* */ $menu = new Menu($smarty); if (!isset($url)) $m_item = $menu->get_home(); else $m_item = $menu->get_info_url($url); /* */ $parent_id = $m_item['p_id']; $ref = $m_item['p_id']; define('REF', $ref); /* $ref = $menu->getRefererId(); if ($ref) { $m_item['p_id'] = $ref; } */ ////////////// //print_r($m_item); $m_item['tags'] = $menu->tags_to_links($m_item['tags']); // if (in_array($m_item['type_'], array('0')) && !isset($search) && !isset($tag)) // { $index = $menu->get_index($m_item['id'], $m_item['url_id'], $page, PER_PAGE, $f, $price_s); $smarty->assign('index', $index['index']); $smarty->assign('pages', $index['pages']); //$tags = new Tags($smarty); $smarty->assign('tags_filter', $tags->filter($tag, $from_d, $from_m, $from_y, $to_d, $to_m, $to_y)); } elseif (in_array($m_item['type_'], array('3')) && !isset($search) && !isset($tag)) // { if (!isset($image)) $image = 0; $image_block = $menu->get_image($m_item['id'], $m_item['url_id'], $image, 1); $smarty->assign('photo', $image_block); /* if ($image) { $image_block = $menu->get_image($m_item['id'], $m_item['url_id'], $image); $smarty->assign('photo', $image_block); } else { $index = $menu->get_gallery($m_item['id'], $m_item['url_id'], $page, PER_PAGE); $smarty->assign('index', $index['index']); $smarty->assign('pages', $index['pages']); } */ } //// if ($m_item['type_'] == 4) // { if (!isset($image)) $image = 0; $images = $menu->get_image($m_item['id'], $m_item['url_id'], $image, 2); $smarty->assign('images', $images); } ///// if (MENU) { $sub_menu = explode(',', $menu->get_sub_menus(MENU, $m_item['id'])); if (in_array($m_item['id'], $sub_menu)) { $n = $menu->view_menu($m_item['id']); } else { $n = $menu->view_menu(MENU); } } else $n = $menu->view_menu($m_item['id']); //print_r($n); $menu->view_menu_tree(MENU_LEVEL); // //$menu->menu_tree; $smarty->assign('menu', $menu->build_menu()); $smarty->assign('n1', $menu->n(1, '', true)); //$smarty->assign('n1', $menu->n(1)); // $smarty->assign('n2', $menu->n(2)); $smarty->assign('n3', $menu->n(3)); //$smarty->assign('tree', $menu->tree($m_item['id'])); $tree = $menu->tree($m_item['id']); $smarty->assign('tree', $tree); $smarty->assign('menu_id', $tree[0]['url']); $smarty->assign($m_item); $smarty->assign('home', HOME); $smarty->assign('user_form', $user_form); $smarty->assign('search_form', $search_form); $smarty->assign('see_also', $menu->seeAlso($parent_id, 9)); $smarty->assign('filter_who', $menu->viewFilter(' ', $f)); $smarty->assign('filter_event', $menu->viewFilter(' ', $f)); $filter_title = rtrim(ucwords(implode(', ', $f)),','); if ($filter_title) { $smarty->assign('title', $filter_title); } $smarty->assign('price_options', $menu->optionsPrice()); $smarty->assign('price_s', $price_s); $smarty->assign('do_filter', $do_filter); ////// poll // include "/home/cscgrou/public_html/manutd.org.ua/poll/poll_cookie.php"; // include_once "/home/cscgrou/public_html/manutd.org.ua/poll/booth.php"; //$php_poll->set_template_set(""); // $poll = $php_poll->poll_process("newest"); // $smarty->assign('poll', $poll); /////////////////// if ($m_item['url_id'] == 'sitemap') { $smarty->assign('description', str_replace("%SITEMAP%", $menu->sitemap(0, 1), $m_item['description'])); } $smarty->assign('search_result', $search_result); if ($search) $html = $smarty->fetch(lg.'search_result.html'); else { $comments = new Comments($smarty); $comments->buildComments($m_item['id']); $smarty->assign('comments', $comments->viewComments($m_item['id'])); $html = $smarty->fetch(lg.$menu->get_template($m_item['template_id'])); } header('Content-Type: text/html; charset=windows-1251'); $macros = new Macros($smarty); $macros->apply($html); echo ""; ?>