* ============================================================================ * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liubo $ * $Id: article.php 17217 2011-01-19 06:29:08Z liubo $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; $id = findIdByName('企业新闻'); $news = $id ? queryListByCatId($id) : array(); $id = findIdByName('企业公告'); $notice = $id ? queryListByCatId($id) : array(); $smarty->assign('news', $news); $smarty->assign('notice', $notice); $smarty->display('our.dwt'); function findIdByName($cat_name) { $sql = "SELECT cat_id FROM `ecs_article_cat` WHERE cat_name = '" . $cat_name . "'"; return $GLOBALS['db']->getOne($sql); } function queryListByCatId($cat_id) { $sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name, a.content ' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . " WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_id = {$cat_id}" . ' ORDER BY a.article_type DESC, a.add_time DESC LIMIT 2'; $res = $GLOBALS['db']->getAll($sql); $arr = array(); foreach ($res as $idx => $row) { $arr[$idx]['id'] = $row['article_id'];
* ECSHOP 文章内容 * ============================================================================ * * 版权所有 2005-2012 上海商派网络科技有限公司,并保留所有权利。 * 网站地址: http://www.ecshop.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ * $Author: liubo $ * $Id: article.php 17217 2011-01-19 06:29:08Z liubo $ */ define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; $cat_id = $_REQUEST['cat_id'] ? intval($_REQUEST['cat_id']) : 0; $parent = findSerById($cat_id); $children = queryListByCatId($cat_id); $id = $_REQUEST['id'] ? intval($_REQUEST['id']) : ($children ? $children[0]['cat_id'] : 0); $content = findSerById($id); $smarty->assign('parent', $parent); $smarty->assign('children', $children); $smarty->assign('content', $content); $smarty->display('service_list.dwt'); function findSerById($cat_id) { $sql = "SELECT cat_id,cat_name,keywords,cat_desc FROM ecs_article_cat WHERE cat_id = " . $cat_id; return $GLOBALS['db']->getRow($sql); } function queryListByCatId($cat_id) { $sql = "SELECT cat_id,cat_name,keywords,cat_desc FROM ecs_article_cat WHERE parent_id = " . $cat_id; $res = $GLOBALS['db']->getAll($sql);
<?php define('IN_ECS', true); require dirname(__FILE__) . '/includes/init.php'; $id = findIdByName('佳音服务'); $service_list = $id ? queryListByCatId($id) : array(); $smarty->assign('service_list', $service_list); $smarty->display('service.dwt'); function findIdByName($cat_name) { $sql = "SELECT cat_id FROM `ecs_article_cat` WHERE cat_name = '" . $cat_name . "'"; return $GLOBALS['db']->getOne($sql); } function queryListByCatId($cat_id) { $sql = 'SELECT cat_id,cat_name,keywords,cat_desc FROM ' . $GLOBALS['ecs']->table('article_cat') . ' WHERE parent_id = ' . $cat_id; $res = $GLOBALS['db']->getAll($sql); return $res; }
//继续传递的搜索关键词 /* 获得文章列表 */ if (isset($_REQUEST['keywords'])) { $keywords = addslashes(htmlspecialchars(urldecode(trim($_REQUEST['keywords'])))); $pager['search']['keywords'] = $keywords; $search_url = substr(strrchr($_POST['cur_url'], '/'), 1); $smarty->assign('search_value', stripslashes(stripslashes($keywords))); $smarty->assign('search_url', $search_url); $count = get_article_count($cat_id, $keywords); $pages = $count > 0 ? ceil($count / $size) : 1; if ($page > $pages) { $page = $pages; } $goon_keywords = urlencode($_REQUEST['keywords']); } $news_list = queryListByCatId($cat_id, $page, $size, $keywords); $smarty->assign('news_list', $news_list); $smarty->assign('cat_id', $id); /* 分页 */ assign_pager('news_list', $id, $count, $size, '', '', $page, $goon_keywords); $smarty->display('news_list.dwt'); function findIdByName($cat_name) { $sql = "SELECT cat_id FROM `ecs_article_cat` WHERE cat_name = '" . $cat_name . "'"; return $GLOBALS['db']->getOne($sql); } function queryListByCatId($cat_id, $page, $size, $keywords) { $sql = 'SELECT a.article_id, a.title, ac.cat_name, a.add_time, a.file_url, a.open_type, ac.cat_id, ac.cat_name, a.content ' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' AS a, ' . $GLOBALS['ecs']->table('article_cat') . ' AS ac' . " WHERE a.is_open = 1 AND a.cat_id = ac.cat_id AND ac.cat_id = {$cat_id}" . ' ORDER BY a.article_type DESC, a.add_time DESC LIMIT ' . $size * ($page - 1) . ',' . $size * $page; $res = $GLOBALS['db']->getAll($sql); $arr = array();