Esempio n. 1
0
// check if module language file exists for the language set by the user (e.g. DE, EN)
$lang = dirname(__FILE__) . '/languages/' . LANGUAGE . '.php';
require_once !file_exists($lang) ? dirname(__FILE__) . '/languages/EN.php' : $lang;
/**
 *	Try to get the template-engine.
 *
 */
global $parser, $loader;
if (!isset($parser)) {
    require_once LEPTON_PATH . "/modules/lib_twig/library.php";
}
$loader->prependPath(dirname(__FILE__) . "/templates/", "news");
$frontend_template_path = LEPTON_PATH . "/templates/" . DEFAULT_TEMPLATE . "/frontend/news/";
$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();
Esempio n. 2
0
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
// end include class.secure.php
//initialize twig template engine
global $parser, $loader;
if (!isset($parser)) {
    require_once LEPTON_PATH . "/modules/lib_twig/library.php";
}
// prependpath to make sure, twig is looking in this module template folder first
$loader->prependPath(dirname(__FILE__) . "/css/");
//load classes
require_once LEPTON_PATH . "/modules/lib_twig/classes/class.twig_utilities.php";
$twig_util = new twig_utilities($parser, $loader);
// End of template-engines settings.
// ----------------- edit cases depending on the pages -----------------
switch (PAGE_ID) {
    case 1:
        $template_name = "start.lte";
        break;
    case 100:
        $template_name = "left_sidebar.lte";
        break;
    case 2:
    case 3:
        $template_name = "full_width.lte";
        break;
    case 101:
        $template_name = "no_sidebar_centered.lte";
Esempio n. 3
0
//overwrite php.ini on Apache servers for valid SESSION ID Separator
if (function_exists('ini_set')) {
    ini_set('arg_separator.output', '&amp;');
}
/**	*******************************
 *	Try to get the template-engine.
 */
global $parser, $loader;
if (!isset($parser)) {
    require_once LEPTON_PATH . "/modules/lib_twig/library.php";
}
$loader->prependPath(dirname(__FILE__) . "/templates/", "news");
$frontend_template_path = LEPTON_PATH . "/templates/" . DEFAULT_TEMPLATE . "/frontend/news/templates/";
$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.
// Check if there is a start point defined
if (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p'] >= 0) {
    $position = $_GET['p'];
} else {
    $position = 0;
}
// Get user's username, display name, email, and id - needed for insertion into post info
$users = array();
$all_users = array();
$database->execute_query("SELECT `user_id`,`username`,`display_name`,`email` FROM `" . TABLE_PREFIX . "users`", true, $all_users);
if (count($all_users) > 0) {
    foreach ($all_users as &$user) {
        // Insert user info into users array
Esempio n. 4
0
 */
if (!defined("LOGIN_URL")) {
    define("LOGIN_URL", "");
}
if (!defined("LOGOUT_URL")) {
    define("LOGOUT_URL", "");
}
if (!defined("FORGOT_URL")) {
    define("FORGOT_URL", "");
}
if (!defined("PREFERENCES_URL")) {
    define("PREFERENCES_URL", "");
}
require_once __DIR__ . "/info.php";
/**	*******************************
 *	Initialize Twig template engine
 */
global $parser, $loader;
if (!isset($parser)) {
    require_once LEPTON_PATH . "/modules/lib_twig/library.php";
}
// prependpath to make sure, Twig is looking in this module template folder first
$loader->prependPath(dirname(__FILE__) . "/templates/");
// Load additional classes
require_once LEPTON_PATH . "/modules/lib_twig/classes/class.twig_utilities.php";
$twig_util = new twig_utilities($parser, $loader);
/**
 *	Collecting the pagedata
 */
$page_content = array('LEPTON_URL' => LEPTON_URL, 'DEFAULT_CHARSET' => DEFAULT_CHARSET, 'WEBSITE_TITLE' => WEBSITE_TITLE, 'page_title' => PAGE_TITLE, 'TEMPLATE_DIR' => TEMPLATE_DIR, 'PAGE_EXTENSION' => PAGE_EXTENSION, 'LOGIN_URL' => LOGIN_URL, 'LOGIN_URL' => LOGIN_URL, 'FORGOT_URL' => FORGOT_URL, 'FRONTEND_SIGNUP' => is_numeric(FRONTEND_SIGNUP) ? 1 : 0, 'FRONTEND_LOGIN_ADMIN_0' => (FRONTEND_LOGIN and !$admin->is_authenticated()) ? 1 : 0, 'FRONTEND_LOGIN_ADMIN_1' => (FRONTEND_LOGIN and $admin->is_authenticated()) ? 1 : 0, 'LOGOUT_URL' => LOGOUT_URL, 'PREFERENCES_URL' => PREFERENCES_URL, 'admin_display_name' => $admin->get_display_name(), 'module_files' => $twig_util->capture_echo("get_page_headers();"), 'SHOW_SEARCH' => defined('SHOW_SEARCH') ? 1 : 0, 'TEXT_SEARCH' => $TEXT['SEARCH'], 'template_version' => $template_version, 'main_menu_1' => show_menu2(1, SM2_ROOT, SM2_ROOT + 1, SM2_TRIM | SM2_PRETTY | SM2_XHTML_STRICT | SM2_NO_TITLE | SM2_BUFFER), 'page_content' => $twig_util->capture_echo("page_content();"), 'TEXT' => $TEXT, 'MENU' => $MENU, 'page_description' => page_description(true), 'page_keywords' => page_keywords(true), 'WEBSITE_FOOTER' => WEBSITE_FOOTER);
echo $parser->render('page.lte', $page_content);