Ejemplo n.º 1
0
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	Newspapers_magazines
 */
require_once 'config/config.inc.php';
require_once "class/Newspapers_magazines.class.php";
$objWebInit = new Newspapers_magazines();
//数据库连接参数
$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) {
    $arrTopNewspapers_magazines[$k] = array();
    if (is_array($v)) {
        $arrTopNewspapers_magazines[$k]['type_title'] = $v['type_title'];
        $arrTopNewspapers_magazines[$k]['type_id'] = $v['type_id'];
    } else {
        $arrTopNewspapers_magazines[$k]['type_title'] = $v;
        $arrTopNewspapers_magazines[$k]['type_id'] = $k;
    }
    $arrTopNewspapers_magazines[$k]['datas'] = $objWebInit->getInfoList("where pass=1 and type_id=" . $arrTopNewspapers_magazines[$k]['type_id'], "  ORDER BY recommendflag DESC,clicktimes DESC,submit_date DESC", 0, 12, true, '', false);
}
Ejemplo n.º 2
0
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	Newspapers_magazines
 */
if (is_object($objWebInit)) {
    if (!isset($objNewspapers_magazines)) {
        include_once __WEB_ROOT . "/Newspapers_magazines/class/Newspapers_magazines.class.php";
        include_once __WEB_ROOT . "/Newspapers_magazines/config/var.inc.php";
        $objNewspapers_magazines = new Newspapers_magazines();
        $objNewspapers_magazines->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objNewspapers_magazines->db = $objWebInit->db;
        } else {
            $objNewspapers_magazines->db();
        }
    }
    if (isset($arrInfo['tag']) && !empty($arrInfo['tag'])) {
        $arrTag = explode(',', $arrInfo['tag']);
        $where = array();
        foreach ($arrTag as $strTag) {
            $where[] = "'%" . $strTag . "%'";
        }
        //echo $arrInfo['id'];
        //print_r($where);
        $strWhere = implode(" || ", $where);
        $strWhere = 'where (tag like ' . $strWhere . ')';
    }
    //echo $strWhere;
    $arrRelative = array();