Ejemplo n.º 1
0
/**
 * 公司风采后台管理栏目修改文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	shelter_ad
 */
require_once '../config/config.inc.php';
require_once "../class/shelter_ad.class.php";
require_once '../..' . __WEBADMIN_ROOT . '/checklogin.php';
$objWebInit = new shelter_ad();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;
//图片上传参数
$objWebInit->arrGPic = $arrGPic;
$objWebInit->db();
//访问权限检查
if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) {
    check::AlertExit('对不起,您没有权限访问此页', -1);
}
// 取得文章信息
$arrInfo = $objWebInit->getInfo($_REQUEST['id']);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['type_id']) || empty($_POST['title']) || empty($_POST['intro'])) {
        check::AlertExit("错误:有必填选项没填!", -1);
    }
Ejemplo n.º 2
0
/**
 * 促销产品大block文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	shelter_ad
 */
if (is_object($objWebInit)) {
    if (!isset($objshelter_ad)) {
        include_once __WEB_ROOT . "/shelter_ad/class/shelter_ad.class.php";
        include_once __WEB_ROOT . "/shelter_ad/config/var.inc.php";
        $objshelter_ad = new shelter_ad();
        $objshelter_ad->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objshelter_ad->db = $objWebInit->db;
        } else {
            $objshelter_ad->db();
        }
    }
    $arrCommendshelter_ad = array();
    $intMax = $objshelter_ad->getRecordsG($objshelter_ad->tablename2, 'where pass=1 and recommendflag = 1');
    if ($intMax < 1) {
        $intMax = $objshelter_ad->getRecordsG($objshelter_ad->tablename2, 'where pass=1 and recommendflag = 0');
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendshelter_ad = $objshelter_ad->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10);
    } else {