コード例 #1
0
ファイル: index.php プロジェクト: BackupTheBerlios/core-svn
require_once PATH_TO_CLASSES . '/cls_fast_template.php';
// warto¶æ pocz±tkowa zmiennej $start -> potrzebna przy stronnicowaniu
$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
// inicjowanie klasy, wkazanie katalogu przechowuj±cego szablony
$ft = new fast_template('./templates/' . $lang . '/tpl');
$ft->define(array('main' => "main.tpl", 'main_loader' => "main_loader.tpl", 'rows' => "rows.tpl", 'form_login' => "form_login.tpl"));
$ft->assign(array('TITLE' => $i18n['index'][0], 'ERROR_MSG' => '', 'CSS_HREF' => 'templates/' . $lang . '/css/style.css'));
// deklaracja zmiennej $p
$p = empty($_GET['p']) ? '' : $_GET['p'];
if ($p == "log") {
    $login = trim($_POST['login']);
    $password = trim(md5($_POST['password']));
    if (empty($login) or empty($password)) {
        // U¿ytkownik nie uzupe³ni³ wszystkich pól::form
        $ft->assign('ERROR_MSG', $i18n['index'][1]);
        $ft->parse('ROWS', ".form_login");
    } else {
        $db = new DB_SQL();
        $query = sprintf("\r\n            SELECT \r\n                active \r\n            FROM \r\n                %1\$s \r\n            WHERE \r\n                login = '******' \r\n            AND \r\n                password = '******'", TABLE_USERS, $login, $password);
        $db->query($query);
        if ($db->num_rows()) {
            if ($db->f("active") != "N") {
                // Rejestrujemy zmienne sesyjne
                $_SESSION["login"] = $login;
                $_SESSION["loggedIn"] = TRUE;
                header("Location: main.php");
                break;
            } else {
                // U¿ytkownik nie zaaktywowa³ konta::db
                $ft->assign('ERROR_MSG', $i18n['index'][2]);
                $ft->parse('ROWS', ".form_login");
コード例 #2
0
ファイル: main.php プロジェクト: BackupTheBerlios/core-svn
            case '14':
                $this->mod = 'edit_templates';
                break;
            case '15':
                $this->mod = 'transfer_note';
                break;
            default:
                $this->mod = 'main';
        }
        $this->mod = $this->name_cleaner($this->mod);
        if ($this->mod == "") {
            $this->return_dead();
        }
        if (!@file_exists(PATH_TO_MODULES . '/' . $this->mod . $this->MODULE_EXTENSION)) {
            $this->return_dead();
        }
    }
    function name_cleaner($name)
    {
        return preg_replace("/[^a-zA-Z0-9\\-\\_]/", "", $name);
    }
    function return_dead()
    {
        $this->mod = 'main';
    }
}
$loader = new loader();
require_once PATH_TO_MODULES . '/' . $loader->mod . $loader->MODULE_EXTENSION;
$ft->parse('MAIN_CONTENT', array("main_loader", "index"));
$ft->FastPrint();
exit;
コード例 #3
0
ファイル: install.php プロジェクト: BackupTheBerlios/core-svn
define('SQL_SCHEMA', 'dbschema/');
function __autoload($classname)
{
    require_once PATH_TO_CLASSES . '/cls_' . $classname . EXTENSION;
}
$lang = !empty($_POST['lang']) ? $_POST['lang'] : 'pl';
require_once 'i18n/' . $lang . '/i18n' . EXTENSION;
require_once '../inc/common_lib' . EXTENSION;
$ft = new fast_template("./templates/" . $lang);
$ft_path = $ft->get_root();
$ft->define('main', "main.tpl");
$ft->assign('CSS_HREF', $ft_path . "/style/style.css");
if (!empty($_POST['post'])) {
    $doit = new install();
} else {
    $ft->define('main_content', 'main_content.tpl');
    $ft->define_dynamic('lang_row', 'main_content');
    $templates_dir = 'templates/';
    $read_dir = @dir($templates_dir);
    while ($d = $read_dir->read()) {
        if ($d[0] != '.') {
            $ft->assign(array('SELECTED_LANG' => $d, 'CURRENT' => $lang == $d ? 'selected="selected"' : ''));
            $ft->parse('LANG_ROW', '.lang_row');
        }
    }
    $ft->assign(array('HOST' => 'localhost', 'PREFIX' => 'core_'));
    $ft->parse('ROWS', "main_content");
}
$ft->parse('MAIN', 'main');
$ft->FastPrint();
exit;
コード例 #4
0
ファイル: rss.php プロジェクト: BackupTheBerlios/core-svn
        $date = $db->f("date");
        $title = $db->f("title");
        $text = $db->f("text");
        $author = $db->f("author");
        $id = $db->f("id");
        $image = $db->f("image");
        $comments_allow = $db->f("comments_allow");
        // Przypisanie zmiennej $comments
        $comments = $db->f("comments");
        // zmiana formatu wy¶wietlania daty
        $date = coreRssDateConvert($date);
        $pattern = array("&", "<br />", "<", ">");
        $replacement = array(" &amp; ", "&lt;br /&gt;", "&lt;", "&gt;");
        $text = str_replace($pattern, $replacement, $text);
        list_assigned_categories($id);
        if ((bool) $rewrite) {
            $comments_link = sprintf('%s1,%s,2,item.html', $http_root, $id);
            $permanent_link = sprintf('%s1,%s,1,item.html', $http_root, $id);
        } else {
            $comments_link = sprintf('%sindex.php?p=2&amp;id=%s', $http_root, $id);
            $permanent_link = sprintf('%sindex.php?p=1&amp;id=%s', $http_root, $id);
        }
        $ft->assign(array('DATE' => $date, 'TITLE' => $title, 'AUTHOR' => $author, 'PERMALINK' => $permanent_link, 'TEXT' => $text, 'COMMENTS_LINK' => $comments_link, 'DISPLAY_XML' => true));
        $ft->parse('XML_ROW', ".xml_row");
    }
} else {
    $ft->assign('DISPLAY_XML', false);
    $ft->parse('XML_ROW', ".xml_row");
}
$ft->parse('CONTENT', "xml_feed");
$ft->FastPrint('CONTENT');
コード例 #5
0
ファイル: photo.php プロジェクト: BackupTheBerlios/core-svn
$lang = get_config('language_set');
require_once 'i18n/' . $lang . '/i18n.php';
if (isset($_COOKIE['devlog_design']) && is_dir('./templates/' . $lang . '/' . $_COOKIE['devlog_design'] . '/tpl/')) {
    $theme = $_COOKIE['devlog_design'];
} elseif (is_dir('./templates/' . $lang . '/main/tpl')) {
    $theme = 'main';
} else {
    printf('<div style="font-family: Arial, sans-serif; font-size: 16px; background-color: #ccc; border: 1px solid red; padding: 15px; text-align: center;">%s</div>', $i18n['design'][0]);
    exit;
}
@setcookie('devlog_design', $theme, time() + 3600 * 24 * 365);
// inicjowanie klasy, wkazanie katalogu przechowuj±cego szablony
$ft = new fast_template('./templates/' . $lang . '/' . $theme . '/tpl/');
$db = new DB_SQL();
$ft->define('photo_main', 'photo_main.tpl');
$ft->assign('TITLE', get_config('title_page'));
$query = sprintf("\r\n    SELECT \r\n        image \r\n    FROM \r\n        %1\$s \r\n    WHERE \r\n        id = '%2\$d' \r\n    LIMIT 1", $table = empty($_GET['p']) ? TABLE_MAIN : TABLE_PAGES, $_GET['id']);
$db->query($query);
$db->next_record();
$image = $db->f('image');
if (!empty($image)) {
    list($width, $height) = getimagesize("photos/" . $image);
    $ft->assign(array('IMAGE_NAME' => $image, 'IMAGE_WIDTH' => $width, 'IMAGE_HEIGHT' => $height, 'LANG' => $lang, 'THEME' => $theme));
    $ft->parse('CONTENT', 'photo_main');
} else {
    // jesli ktos probuje grzebac w adresie url
    header("Location: index.php");
    exit;
}
$ft->FastPrint('CONTENT');
exit;
コード例 #6
0
ファイル: index.php プロジェクト: BackupTheBerlios/core-svn
    {
        $this->mod = 'main_view';
    }
}
// wyznaczamy szablon jaki ma byc parsowany, sprawdzajac
// czy faktycznie znajduje sie on w katalogu z szablonami
if (!isset($assigned_tpl) || !file_exists('./templates/' . $lang . '/' . $theme . '/tpl/' . $assigned_tpl . '_page.tpl')) {
    $assigned_tpl = 'main_page';
}
$ft->define_dynamic("alternate_design_row", $assigned_tpl);
while ($d = $read_dir->read()) {
    if ($d[0] != '.') {
        // link do alternatywnego szablonu
        $template_link = (bool) $rewrite ? sprintf('2,%s,item.html', $d) : 'design.php?issue=' . $d;
        $ft->assign(array('ALTERNATE_TEMPLATE' => $d, 'TEMPLATE_LINK' => $template_link));
        $ft->parse('ALTERNATE_DESIGN_ROW', ".alternate_design_row");
    }
}
$loader = new loader();
require_once PATH_TO_MODULES . '/' . $loader->mod . $loader->MODULE_EXTENSION;
// tablica includowanych modulow
$modules = array('category_list', 'pages_list', 'links_list');
while (list($m) = each($modules)) {
    require_once PATH_TO_MODULES . '/' . $modules[$m] . '.php';
}
if ((bool) $show_calendar) {
    $ft->assign('SHOW_CALENDAR', true);
    $calendar = new calendar();
    $calendar->display_calendar();
} else {
    $ft->assign('SHOW_CALENDAR', false);