<?php require_once 'inc.php'; $table = 'cn_along'; $action = empty($_GET["action"]) ? '' : $_GET["action"]; $tpid = empty($_GET["type_id"]) ? '' : $_GET["type_id"]; $tpid2 = ''; $list_mokuai = alla2("cn_mokuai", "", "order by id asc", '*'); $smarty->assign('list_mokuai', $list_mokuai); if ($action == "") { $where = ''; #产品分类递归 if (!empty($_GET['type_id'])) { $typeid_str = ''; getall_producttype_parent_id("cn_along_type", $typeid_str, $_GET['type_id']); $typeid_str = $_GET['type_id'] . $typeid_str; $where = " AND type_id in(" . $typeid_str . ")"; } $where .= @$_GET['keyword'] != '' ? " AND (title LIKE '%" . @$_GET['keyword'] . "%')" : ''; $order = ' ORDER BY sort asc,id DESC'; $page_size = 20; $current_page = !@$_GET['p'] ? 1 : @$_GET['p']; $nums = $db->query_count($table, $where); $productList = ''; $result = $db->query_page_list($table, $page_size, $current_page, $order, $where); while ($row = $db->fetch($result)) { $result2 = $db->query('SELECT name FROM cn_along_type WHERE id=' . $row['type_id']); $type = $db->fetch($result2); $productList[] = array('id' => $row['id'], 'title' => $row['title'], 'type_name' => $type['name'], 'time' => date('Y-m-d', $row['time']), 'sort' => $row['sort'], 'guishu' => $row['guishu']); } $pager = new Pager($page_size, $nums, $current_page, 8);
<?php require_once '../inc2.php'; $yemianid = "business"; $smarty->assign('yemianid', $yemianid); $whatid = empty($_GET["whatid"]) ? '' : $_GET["whatid"]; $smarty->assign('id', $whatid); $smarty->assign('id2', $whatid); $whatid1 = $db->fetch($db->query("select * from cn_business_type where id={$whatid} ")); $smarty->assign('whatid', $whatid1["parent_id"]); $smarty->assign('type_name', $whatid1); $right = alla2("cn_business", " and type_id={$whatid}", " order by sort asc,time desc", "id,title,image,type_id"); $smarty->assign('right', $right); $id = empty($_GET["whattid"]) ? '' : $_GET["whattid"]; if ($id != '') { $xiangqing = $db->fetch($db->query("select * from cn_business where id={$id} ")); } else { $xiangqing = $db->fetch($db->query("select * from cn_business order by sort asc,time desc limit 0,1")); } $smarty->assign('xiangqing', $xiangqing); $xiangqingshang = ''; $results = $db->query("select * from cn_business where time>{$xiangqing['time']} order by time asc,sort asc limit 0,1"); $resultss = $db->fetch($results); if ($resultss['id'] != '') { $xiangqingshang = '<a href="/business/business-xq.php?whattid=' . $resultss['id'] . '&whatid=' . $resultss['type_id'] . '" >' . $resultss['title'] . '</a>'; } else { $xiangqingshang = "暂无"; } $smarty->assign('xiangqingshang', $xiangqingshang); //下一篇 $xiangqingxia = '';