Beispiel #1
1
}
if (!$smarty->is_cached('article.dwt', $cache_id)) {
    /* 文章详情 */
    $article = get_article_info($article_id);
    if (empty($article)) {
        ecs_header("Location: ./\n");
        exit;
    }
    if (!empty($article['link']) && $article['link'] != 'http://' && $article['link'] != 'https://') {
        ecs_header("location:{$article['link']}\n");
        exit;
    }
    //根据当前的文章id查询文章所属的上一级分类 0828-guan
    $cat_id = $db->getOne("SELECT cat_id FROM " . $ecs->table('article') . " WHERE article_id = '" . $article_id . "' ");
    if (isBabyNurtureArticle($article_id)) {
        $staticPages = getStaticPage();
        $sql = "select personal_pic, nickname, user_name from " . $GLOBALS['ecs']->table('users') . " where user_id='" . $_SESSION['user_id'] . "'";
        $user = $GLOBALS['db']->getRow($sql);
        $smarty->assign('user', $user);
        $smarty->assign('babyNurture', 1);
        $smarty->assign('articleComments', getArticleComments($article_id));
        $smarty->assign('staticPages', $staticPages);
    }
    $smarty->assign('article_categories', article_categories_tree(0, $article['cat_id']));
    //文章分类树
    $smarty->assign('categories', get_categories_tree());
    // 分类树
    $smarty->assign('helps', get_shop_help());
    // 网店帮助
    $smarty->assign('top_goods', get_top10());
    // 销售排行
Beispiel #2
0
            setcookie("ECS[user_id]", '', $time, '/');
            setcookie("ECS[password]", '', $time, '/');
        } else {
            $_SESSION['user_id'] = $row['user_id'];
            $_SESSION['user_name'] = $row['user_name'];
            update_user_info();
        }
    }
    if (isset($smarty)) {
        $smarty->assign('ecs_session', $_SESSION);
    }
}
if ((DEBUG_MODE & 1) == 1) {
    error_reporting(E_ALL);
} else {
    error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
}
if ((DEBUG_MODE & 4) == 4) {
    include ROOT_PATH . 'includes/lib.debug.php';
}
/* 判断是否支持 Gzip 模式 */
if (!defined('INIT_NO_SMARTY') && gzip_enabled()) {
    ob_start('ob_gzhandler');
} else {
    ob_start();
}
/*设置静态页*/
if (isset($smarty)) {
    require_once ROOT_PATH . 'includes/lib_sundries.php';
    $smarty->assign('staticPages', getStaticPage());
}