table('article'). " WHERE" />

无码人妻视频一区二区三区,亚洲国产精品色一区二区三区色牛,亚洲国产中文精品碰碰,九九视频这里只有精品

1338瀏覽量

ecshop如何根據(jù)分類id調(diào)用文章

來(lái)源: 時(shí)間:2014-01-29
1、打開includes下 init.php
末尾處增加下列代碼——可根據(jù)實(shí)際情況,增刪里面的查詢字段。
function index_get_class_articles($cat_aid, $cat_num)
{
$sql = "SELECT article_id, title,open_type,cat_id,content,file_url,add_time,description FROM " .$GLOBALS['ecs']->table('article'). " WHERE cat_id = ".$cat_aid." and is_open = 1 LIMIT " . $cat_num;
$res = $GLOBALS['db']->getAll($sql);
$arr = array();
foreach ($res AS $idx => $row)
{
$arr[$idx]['id'] = $row['article_id'];
$arr[$idx]['title'] = $row['title'];
$arr[$idx]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ?sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];
$arr[$idx]['cat_name'] = $row['cat_name'];
$arr[$idx]['content'] = $row['content'];
$arr[$idx]['short_content'] = sub_str($row['content'],33);
$arr[$idx]['add_time'] = local_date($GLOBALS['_CFG']['date_format'], $row['add_time']);
$arr[$idx]['url'] = $row['open_type'] != 1 ?build_uri('article', array('aid' => $row['article_id']), $row['title']) : trim($row['file_url']);
$arr[$idx]['cat_url'] = build_uri('article_cat', array('acid' => $row['cat_id']));
$arr[$idx]['file_url']    = trim($row['file_url']);            //圖片路徑
$arr[$idx]['description']    = $row['description'];
$arr[$idx]['short_description']    = sub_str($row['description'],15);
}
return $arr;
}
 
2、在調(diào)用該文章的頁(yè)面添加代碼
 assign('articles',index_get_class_articles(14, 6));               
 ?>

聯(lián)系我們

一次需求提交或許正是成就一個(gè)出色產(chǎn)品的開始。
歡迎填寫表格或發(fā)送合作郵件至: qczsky@126.com

大理青橙科技

電話:13988578755 13988578755

郵箱:qczsky@126.com

地址:大理市下關(guān)龍都春天10層

如果您無(wú)法識(shí)別驗(yàn)證碼,請(qǐng)點(diǎn)圖片更換

贡嘎县| 郸城县| 宣恩县| 神池县| 乳源| 新源县| 西乌珠穆沁旗| 东乌珠穆沁旗| 翁牛特旗| 洪湖市| 哈尔滨市| 宁晋县| 广汉市| 呼图壁县| 新干县| 靖远县| 望都县| 宜川县| 门头沟区| 右玉县| 连云港市| 会同县| 三穗县| 湟中县| 于田县| 阳春市| 鹤峰县| 常山县| 宽城| 调兵山市| 和硕县| 郴州市| 民和| 年辖:市辖区| 张掖市| 扬中市| 青川县| 澜沧| 鄂托克前旗| 延边| 陵川县|