Example #1
0
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;
Example #2
0
    }
    function name_cleaner($name)
    {
        return preg_replace("/[^a-zA-Z0-9\\-\\_]/", "", $name);
    }
    function return_dead()
    {
        $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';
}
Example #3
0
require PATH_TO_CLASSES . "/cls_db_mysql.php";
// dodawanie pliku konfigurujacego bibliotekê baz danych
require PATH_TO_CLASSES . '/cls_fast_template.php';
require "administration/inc/config.php";
require "inc/common_lib.php";
require "inc/main_lib.php";
// mysql_server_version
get_mysql_server_version();
$db = new DB_SQL();
$query = sprintf("\n    SELECT \n        a.*, b.*, c.comments_id, count(DISTINCT c.id) \n    AS \n        comments \n    FROM \n        %1\$s a, \n        %2\$s b \n    LEFT JOIN \n        %3\$s c \n    ON \n        a.id = c.comments_id \n    LEFT JOIN \n        %4\$s d \n    ON \n        a.id = d.news_id\n    WHERE \n        published = '1' \n    GROUP BY \n        a.date \n    DESC \n    LIMIT \n        %5\$d", TABLE_MAIN, TABLE_CATEGORY, TABLE_COMMENTS, TABLE_ASSIGN2CAT, 10);
$db->query($query);
$rewrite = get_config('mod_rewrite');
$lang = get_config('language_set');
$ft = new fast_template('./templates/' . $lang . '/main/tpl/');
$ft->define('xml_feed', 'xml_feed.tpl');
$ft->define_dynamic('xml_row', 'xml_feed');
$ft->define_dynamic("cat_row", "xml_feed");
$http_root = get_httproot();
$ft->assign(array('MAINSITE_LINK' => 'http://' . $http_root, 'NEWS_FEED' => true));
if ($db->num_rows() > 0) {
    while ($db->next_record()) {
        $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
require PATH_TO_CLASSES . "/cls_db_mysql.php";
// dodawanie pliku konfigurujacego bibliotekê baz danych
require PATH_TO_CLASSES . '/cls_fast_template.php';
require "administration/inc/config.php";
require "inc/common_lib.php";
require "inc/main_lib.php";
// mysql_server_version
get_mysql_server_version();
$db = new DB_SQL();
$query = sprintf("\r\n    SELECT \r\n        b.*, a.id, a.title \r\n    FROM \r\n        %1\$s b \r\n    LEFT JOIN \r\n        %2\$s a \r\n    ON \r\n        b.comments_id = a.id \r\n    GROUP BY \r\n        date \r\n    DESC \r\n    LIMIT \r\n        %3\$d", TABLE_COMMENTS, TABLE_MAIN, 10);
$db->query($query);
$rewrite = get_config('mod_rewrite');
$lang = get_config('language_set');
$ft = new fast_template('./templates/' . $lang . '/main/tpl/');
$ft->define('xml_feed', 'xml_feed.tpl');
$ft->define_dynamic('xml_row', 'xml_feed');
$http_root = get_httproot();
$ft->assign(array('MAINSITE_LINK' => 'http://' . $http_root, 'NEWS_FEED' => false));
if ($db->num_rows() > 0) {
    while ($db->next_record()) {
        $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");
        $comments = $db->f("comments");
        $date = coreRssDateConvert($date);
        $pattern = array("&", "<br />", "<", ">");
        $replacement = array(" &amp; ", "&lt;br /&gt;", "&lt;", "&gt;");