本文整理汇总了PHP中article_related_goods函数的典型用法代码示例。如果您正苦于以下问题:PHP article_related_goods函数的具体用法?PHP article_related_goods怎么用?PHP article_related_goods使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了article_related_goods函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_cat_articles
/**
* 获得文章分类下的文章列表
*
* @access public
* @param integer $cat_id
* @param integer $page
* @param integer $size
*
* @return array
*/
function get_cat_articles($cat_id, $page = 1, $size = 20, $requirement = '')
{
//取出所有非0的文章
if ($cat_id == '-1') {
$cat_str = 'cat_id > 0';
} else {
$cat_str = get_article_children($cat_id);
}
//增加搜索条件,如果有搜索内容就进行搜索
if ($requirement != '') {
$sql = 'SELECT article_id, title, description, author, add_time, file_url, open_type' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' WHERE is_open = 1 AND title like \'%' . $requirement . '%\' ' . ' ORDER BY article_type DESC, article_id DESC';
} else {
$sql = 'SELECT article_id, title, description, author, add_time, file_url, open_type' . ' FROM ' . $GLOBALS['ecs']->table('article') . ' WHERE is_open = 1 AND ' . $cat_str . ' ORDER BY article_type DESC, article_id DESC';
}
$res = $GLOBALS['db']->selectLimit($sql, $size, ($page - 1) * $size);
$arr = array();
if ($res) {
while ($row = $GLOBALS['db']->fetchRow($res)) {
$article_id = $row['article_id'];
$arr[$article_id]['id'] = $article_id;
$arr[$article_id]['title'] = $row['title'];
$arr[$article_id]['description'] = $row['description'];
$arr[$article_id]['title_pic'] = $row['file_url'];
$arr[$article_id]['short_title'] = $GLOBALS['_CFG']['article_title_length'] > 0 ? sub_str($row['title'], $GLOBALS['_CFG']['article_title_length']) : $row['title'];
$arr[$article_id]['author'] = empty($row['author']) || $row['author'] == '_SHOPHELP' ? $GLOBALS['_CFG']['shop_name'] : $row['author'];
$arr[$article_id]['url'] = build_uri('article', array('aid' => $article_id), $row['title']);
$arr[$article_id]['add_time'] = date($GLOBALS['_CFG']['date_format'], $row['add_time']);
$arr[$article_id]['goods_list'] = article_related_goods($article_id);
}
}
return $arr;
}
示例2: recommendGoods
public function recommendGoods () {
$article_id = isset($_GET['id']) ? intval($_GET['id']) : 14;
$article = array();
if($article_id > 0)
{
//文章详细信息
$article = get_article_info($article_id);
//文章关联产品
$article_related_goods = article_related_goods($article_id);
$articleArr = array('article'=>$article,'article_related_goods'=>$article_related_goods);
}
//var_dump($articleArr);exit;
jsonExit($articleArr);
}
示例3: get_categories_tree
//文章分类树
$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());
/* 验证码相关设置 */
if (intval($_CFG['captcha']) & CAPTCHA_COMMENT && gd_version() > 0) {
$smarty->assign('enabled_captcha', 1);
$smarty->assign('rand', mt_rand());
}
$smarty->assign('article', $article);
$smarty->assign('keywords', htmlspecialchars($article['keywords']));
$smarty->assign('description', htmlspecialchars($article['description']));
$catlist = array();
示例4: index_get_new_articles
{
$cat_id = 13;
$related_articles = index_get_new_articles($cat_id);
//var_dump($related_articles);exit;
jsonExit($related_articles);
}
//精品推荐
else if ($act = 'recommendGoods') {
$article_id = isset($_GET['id']) ? intval($_GET['id']) : 14;
$article = array();
if($article_id > 0)
{
//文章详细信息
$article = get_article_info($article_id);
//文章关联产品
$article_related_goods = article_related_goods($article_id);
$articleArr = array('article'=>$article,'article_related_goods'=>$article_related_goods);
}
//var_dump($articleArr);exit;
jsonExit($articleArr);
}
/**
* 获得最新的文章列表。
*
* @access private
* @return array
*/
function index_get_new_articles($id=0)
{