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()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); // 推荐商品 $smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品 $smarty->assign('hot_goods', get_recommend_goods('hot')); // 热点文章 $smarty->assign('promotion_goods', get_promote_goods()); // 特价商品
/*------------------------------------------------------ */ //-- PROCESSOR /*------------------------------------------------------ */ /* 获得页面的缓存ID */ $cache_id = sprintf('%X', crc32($cat_id . '-' . $page . '-' . $_CFG['lang'])); if (!$smarty->is_cached('article_cat.dwt', $cache_id)) { /* 如果页面没有被缓存则重新获得页面的内容 */ assign_template('a', array($cat_id)); $position = assign_ur_here($cat_id); $smarty->assign('page_title', $position['title']); // 页面标题 $smarty->assign('ur_here', $position['ur_here']); // 当前位置 $smarty->assign('categories', get_categories_tree(0)); // 分类树 $smarty->assign('article_categories', article_categories_tree($cat_id)); //文章分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); $smarty->assign('new_goods', get_recommend_goods('new')); $smarty->assign('hot_goods', get_recommend_goods('hot')); $smarty->assign('promotion_goods', get_promote_goods()); $smarty->assign('promotion_info', get_promotion_info()); /* Meta */ $meta = $db->getRow("SELECT keywords, cat_desc,cat_name FROM " . $ecs->table('article_cat') . " WHERE cat_id = '{$cat_id}'"); if ($meta === false || empty($meta)) { /* 如果没有找到任何记录则返回首页 */ ecs_header("Location: ./\n");
}else{ $article = get_article_info_jg($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; } $smarty->assign('article_categories', article_categories_tree($article_id)); //文章分类树 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); // 推荐商品 $smarty->assign('new_goods', get_recommend_goods('new')); // 最新商品 $smarty->assign('hot_goods', get_recommend_goods('hot')); // 热点文章 $smarty->assign('promotion_goods', get_promote_goods()); // 特价商品 $smarty->assign('related_goods', article_related_goods($_REQUEST['id'])); // 特价商品 $smarty->assign('id', $article_id); $smarty->assign('username', $_SESSION['user_name']); $smarty->assign('email', $_SESSION['email']); $smarty->assign('type', '1'); $smarty->assign('promotion_info', get_promotion_info()); /* 验证码相关设置 */