$module_template_path = dirname(__FILE__) . "/templates/"; require_once LEPTON_PATH . "/modules/lib_twig/classes/class.twig_utilities.php"; $twig_util = new twig_utilities($parser, $loader, $module_template_path, $frontend_template_path); $twig_util->template_namespace = "news"; // End of template-engines settings. require_once LEPTON_PATH . '/modules/captcha_control/captcha/captcha.php'; // Get comments page template details from db $query_settings = $database->query("SELECT `use_captcha`,`commenting` FROM `" . TABLE_PREFIX . "mod_news_settings` WHERE `section_id` = '" . SECTION_ID . "'"); if ($query_settings->numRows() == 0) { header("Location: " . LEPTON_URL . PAGES_DIRECTORY . ""); exit(0); } else { $settings = $query_settings->fetchRow(MYSQL_ASSOC); // Print comments page $vars = array('POST_TITLE' => POST_TITLE, 'TEXT_COMMENT' => $MOD_NEWS['TEXT_COMMENT']); $twig_util->resolve_path("comments_page.lte"); echo $parser->render('@news/comments_page.lte', $vars); $current_time = time(); $_SESSION['submitted_when'] = $current_time; /** * Here we go: */ $form_data = array('LEPTON_URL' => LEPTON_URL, 'SECTION_ID' => SECTION_ID, 'PAGE_ID' => PAGE_ID, 'POST_ID' => POST_ID, 'ENABLED_ASP' => ENABLED_ASP ? 1 : 0, 'TEXT' => $TEXT, 'MOD_NEWS' => $MOD_NEWS, 'captcha_error' => isset($_SESSION['captcha_error']) ? 1 : 0, 'captcha_error_message' => isset($_SESSION['captcha_error']) ? $_SESSION['captcha_error'] : "", 'use_captcha' => $settings['use_captcha'], 'call_captcha' => $twig_util->capture_echo("call_captcha();"), 'comment_title' => isset($_SESSION['comment_title']) ? $_SESSION['comment_title'] : "", 'comment_body' => isset($_SESSION['comment_body']) ? $_SESSION['comment_body'] : "", 'leptoken' => isset($_GET['leptoken']) ? $_GET['leptoken'] : "", 'date_w' => date('W'), 'form_submitted_when' => $current_time); echo $parser->render('@news/comments_form.lte', $form_data); if (isset($_SESSION['comment_title'])) { unset($_SESSION['comment_title']); } if (isset($_SESSION['comment_body'])) { unset($_SESSION['comment_body']); } if (isset($_SESSION['captcha_error'])) {
} $out_of = $position + 1 . '-' . $num_of . ' ' . strtolower($TEXT['OUT_OF']) . ' ' . $total_num; $of = $position + 1 . '-' . $num_of . ' ' . strtolower($TEXT['OF']) . ' ' . $total_num; $display_previous_next_links = ''; } else { $display_previous_next_links = 'none'; } if ($num_posts === 0) { $setting_header = ''; $setting_post_loop = ''; $setting_footer = ''; $setting_posts_per_page = ''; } // Print header $header_vars = array('NEXT_PAGE_LINK' => $display_previous_next_links == 'none' ? '' : $next_page_link, 'NEXT_LINK' => $display_previous_next_links == 'none' ? '' : $next_link, 'PREVIOUS_PAGE_LINK' => $display_previous_next_links == 'none' ? '' : $previous_page_link, 'PREVIOUS_LINK' => $display_previous_next_links == 'none' ? '' : $previous_link, 'OUT_OF' => $display_previous_next_links == 'none' ? '' : $out_of, 'OF' => $display_previous_next_links == 'none' ? '' : $of, 'DISPLAY_PREVIOUS_NEXT_LINKS' => $display_previous_next_links); if (true === $twig_util->resolve_path("header.lte")) { echo $parser->render("@news/header.lte", $header_vars); } if ($num_posts > 0) { if ($query_extra != '') { ?> <div class="selected-group-title"> <?php print '<a href="' . htmlspecialchars(strip_tags($_SERVER['SCRIPT_NAME'])) . '">' . PAGE_TITLE . '</a> >> ' . $groups[$_GET['g']]['title']; ?> </div> <?php } /** * Aldus! */