Exemple #1
0
 */
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);
}
// 输出到模板
$arrMOutput["smarty_assign"]['arrTopNewspapers_magazines'] = $arrTopNewspapers_magazines;
$arrMOutput["smarty_assign"]['arrMType'] = $arrMType;
$arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'index.html';
$objWebInit->output($arrMOutput);
Exemple #2
0
<?php

/**
 * 最新新闻 列表文件
 *
 * @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();
        }
    }
    $arrNewest = array();
    $arrNewest = $objNewspapers_magazines->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;
}
Exemple #3
0
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();
    $arrRelative = $objNewspapers_magazines->getInfoList($strWhere . " and pass=1 and id!=" . $arrInfo['id'], " ORDER BY clicktimes DESC,submit_date DESC,recommendflag DESC,clicktimes DESC", 0, 5, true);
    unset($arrRelative['COUNT_ROWS']);
    //print_r($arrRelative);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrRelative'] = $arrRelative;
}
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();
        }
    }
    $arrCommendNewspapers_magazines = array();
    $intMax = $objNewspapers_magazines->getRecordsG($objNewspapers_magazines->tablename2, 'where pass=1 and recommendflag = 1');
    if ($intMax < 1) {
        $intMax = $objNewspapers_magazines->getRecordsG($objNewspapers_magazines->tablename2, 'where pass=1 and recommendflag = 0');
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendNewspapers_magazines = $objNewspapers_magazines->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10);
    } else {
        if ($intMax > 10) {
            $intMax -= 10;
        }
        $arrCommendNewspapers_magazines = $objNewspapers_magazines->getInfoList('where pass=1 and recommendflag = 1', ' order by submit_date desc', rand(0, $intMax), 10);
    }
    unset($intMax);
    unset($arrCommendNewspapers_magazines['COUNT_ROWS']);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrCommendNewspapers_magazines'] = $arrCommendNewspapers_magazines;
}
Exemple #5
0
        if (is_numeric($strKeywords)) {
            $arrWhere[] = "id = '" . $strKeywords . "'";
        }
    } else {
        $arrWhere[] = "title LIKE '%" . $_GET['title'] . "%'";
    }
    $arrLink[] = 'title=' . $_GET['title'];
}
$strWhere = implode(' AND ', $arrWhere);
if (!empty($strWhere)) {
    $strWhere = ' WHERE ' . $strWhere;
}
if (!isset($_GET['page']) || $_GET['page'] == '') {
    $_GET['page'] = $arrGPage['page'];
}
$arrData = $objWebInit->getInfoList($strWhere, ' ORDER BY submit_date DESC', ($_GET['page'] - 1) * $arrGPage['page_size'], $arrGPage['page_size'], true);
if ($arrData == "") {
    $arrData = null;
}
//翻页跳转link
$strLink = '';
if (!empty($arrLink)) {
    $strLink = implode('&', $arrLink);
}
$strPage = $objWebInit->makeInfoListPage($arrData['COUNT_ROWS'], $strLink);
unset($arrData['COUNT_ROWS']);
// 取类别标题
if (is_array($arrMType) && !empty($arrMType)) {
    foreach ($arrData as $k => $data) {
        foreach ($arrMType as $k1 => $type) {
            if ($data['type_id'] == $k1) {
Exemple #6
0
 * @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();
        }
    }
    $arrTopNewspapers_magazines1 = array();
    $arrTopNewspapers_magazines1[0] = $objNewspapers_magazines->getInfoList("where type_id=1 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 1);
    unset($arrTopNewspapers_magazines1[0]['COUNT_ROWS']);
    $arrTopNewspapers_magazines1[1] = $objNewspapers_magazines->getInfoList("where type_id=2 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
    unset($arrTopNewspapers_magazines1[1]['COUNT_ROWS']);
    $arrTopNewspapers_magazines1[2] = $objNewspapers_magazines->getInfoList("where type_id=3 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
    unset($arrTopNewspapers_magazines1[2]['COUNT_ROWS']);
    $arrTopNewspapers_magazines1[3] = $objNewspapers_magazines->getInfoList("where type_id=4 and pass=1", "  ORDER BY recommendflag DESC,submit_date DESC", 0, 10);
    unset($arrTopNewspapers_magazines1[3]['COUNT_ROWS']);
    $arrTopNewspapers_magazines1['FileCallPath'] = $arrGPic['FileCallPath'];
    //print_r($arrTopNewspapers_magazines1);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrTopNewspapers_magazines1'] = $arrTopNewspapers_magazines1;
}
Exemple #7
0
$arrWhere[] = "pass='******'";
if (!empty($_GET['type_id'])) {
    $intTypeID = intval($_GET['type_id']);
    $arrWhere[] = "type_id='" . $intTypeID . "'";
    $arrLink[] = 'type_id=' . $intTypeID;
    if (is_array($arrMType) && !empty($arrMType)) {
        $arrMOutput["smarty_assign"]['strTypeTitle'] = $arrMType[$intTypeID];
    } else {
        $arrTypeInfo = $objWebInit->getTypeInfo($intTypeID);
        $strTypeTitle = $arrTypeInfo['type_title'];
        $arrMOutput["smarty_assign"]['strTypeTitle'] = $strTypeTitle;
    }
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = 'where ' . $strWhere;
$arrInfoList = $objWebInit->getInfoList($strWhere, ' ORDER BY topflag DESC,submit_date DESC', ($intPage - 1) * $arrGPage['page_size'], $arrGPage['page_size'], true);
$intRows = $arrInfoList['COUNT_ROWS'];
unset($arrInfoList['COUNT_ROWS']);
//静态url处理
$strLink = '';
if ($arrGWeb['URL_static']) {
    if (!empty($arrLink)) {
        $strLink = str_replace('=', '-', implode('-', $arrLink));
    }
} else {
    if (!empty($arrLink)) {
        $strLink = implode('&', $arrLink);
    }
}
//翻页跳转link
$strPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = $arrGWeb['URL_static']);
Exemple #8
0
if ($arrInfo['user_id'] != $_SESSION['user_id']) {
    check::AlertExit("错误:此信息不是您发布的,您无权修改!", -1);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['type_id']) || empty($_POST['title']) || empty($_POST['intro'])) {
        check::AlertExit("错误:有必填选项没填!", -1);
    }
    $arrTemp = explode('|', $_POST['type_id']);
    $_POST['type_id'] = $arrTemp[0];
    $_POST['type_roue_id'] = $arrTemp[1];
    if ($_POST['title'] != '') {
        $_POST['title_md5'] = md5($_POST['title']);
    }
    //判断文章信息
    if ($_POST['title_md5'] != $arrInfo['title_md5']) {
        $arrTemp = $objWebInit->getInfoList("where title_md5='{$_POST['title_md5']}' and user_id = '{$_SESSION['user_id']}' and type_id='{$_POST['type_id']}'", "", 0, 1);
        if ($arrTemp['COUNT_ROWS'] != 0) {
            check::AlertExit("错误:相同的信息请不要重复发布!需要刷新排列的话,请使用列表下方“提前”选项!", -1);
        }
    }
    //还原图片数组
    $_POST['photo'] = array();
    if (!empty($_POST['savephoto'])) {
        foreach ($_POST['savephoto'] as $key => $val) {
            $arrTemp = array();
            $arrTemp['photo'] = $val;
            if (!empty($_POST['photo_narrate' . $key])) {
                $arrTemp['photo_narrate'] = $_POST['photo_narrate' . $key];
            }
            $_POST['photo'][$key] = $arrTemp;
        }