* @author Arthur(ArthurXF@gmail.com) * @copyright (c) 2006 by bizeway.com * @version $Id$ * @package ArthurXF * @subpackage car_ad */ require_once 'config/config.inc.php'; require_once "class/car_ad.class.php"; $objWebInit = new car_ad(); //数据库连接参数 $objWebInit->setDBG($arrGPdoDB); //smarty参数 $objWebInit->arrGSmarty = $arrGSmarty; //翻页参数 $objWebInit->arrGPage = $arrGPage; $objWebInit->db(); if (!is_array($arrMType) || empty($arrMType)) { $arrMType = $objWebInit->getTypeList(); $arrMType = $objWebInit->formatTypeList(0, $arrMType); } foreach ($arrMType as $k => $v) { $arrTopcar_ad[$k] = array(); if (is_array($v)) { $arrTopcar_ad[$k]['type_title'] = $v['type_title']; $arrTopcar_ad[$k]['type_id'] = $v['type_id']; } else { $arrTopcar_ad[$k]['type_title'] = $v; $arrTopcar_ad[$k]['type_id'] = $k; } $arrTopcar_ad[$k]['datas'] = $objWebInit->getInfoList("where pass=1 and type_id=" . $arrTopcar_ad[$k]['type_id'], " ORDER BY recommendflag DESC,clicktimes DESC,submit_date DESC", 0, 12, true, '', false); }
* @author Arthur(ArthurXF@gmail.com) * @copyright (c) 2006 by bizeway.com * @version $Id$ * @package ArthurXF * @subpackage car_ad */ if (is_object($objWebInit)) { if (!isset($objcar_ad)) { include_once __WEB_ROOT . "/car_ad/class/car_ad.class.php"; include_once __WEB_ROOT . "/car_ad/config/var.inc.php"; $objcar_ad = new car_ad(); $objcar_ad->setDBG($arrGPdoDB); if (is_object($objWebInit->db)) { $objcar_ad->db = $objWebInit->db; } else { $objcar_ad->db(); } } $arrCommendcar_ad = array(); $intMax = $objcar_ad->getRecordsG($objcar_ad->tablename2, 'where pass=1 and recommendflag = 1'); if ($intMax < 1) { $intMax = $objcar_ad->getRecordsG($objcar_ad->tablename2, 'where pass=1 and recommendflag = 0'); if ($intMax > 10) { $intMax -= 10; } $arrCommendcar_ad = $objcar_ad->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10); } else { if ($intMax > 10) { $intMax -= 10; } $arrCommendcar_ad = $objcar_ad->getInfoList('where pass=1 and recommendflag = 1', ' order by submit_date desc', rand(0, $intMax), 10);