예제 #1
0
 * @package		ArthurXF
 * @subpackage	company
 */
require_once '../config/config.inc.php';
require_once "../class/company.class.php";
require_once '../../useradmin/checklogin.php';
$objWebInit = new company();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//翻页参数
$objWebInit->arrGPage = $arrGPage;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
$arrWhere = array();
$arrLink = array();
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'search') {
        // 构造搜索条件和翻页参数
        $arrLink[] = 'action=search';
        if (!empty($_GET['title'])) {
            $strKeywords = strval(urldecode($_GET['title']));
            if ($strKeywords[0] == '/') {
                //精确查询ID
                $strKeywords = substr($strKeywords, 1);
                if (is_numeric($strKeywords)) {
                    $arrWhere[] = "id = '" . $strKeywords . "'";
                }
            } else {
예제 #2
0
<?php

/**
 * 最新新闻 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	company
 */
if (is_object($objWebInit)) {
    if (!isset($objcompany)) {
        include_once __WEB_ROOT . "/company/class/company.class.php";
        include_once __WEB_ROOT . "/company/config/var.inc.php";
        $objcompany = new company();
        $objcompany->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objcompany->db = $objWebInit->db;
        } else {
            $objcompany->db();
        }
    }
    $arrNewest = array();
    $arrNewest = $objcompany->getInfoList("where pass=1", " ORDER BY clicktimes DESC,submit_date DESC,recommendflag DESC,clicktimes DESC", 0, 5, true);
    unset($arrNewest['COUNT_ROWS']);
    //print_r($arrNewest);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrNewest'] = $arrNewest;
}