Ejemplo n.º 1
0
        }
        if (!empty($_GET['type_id'])) {
            $intTypeID = intval($_GET['type_id']);
            $arrWhere[] = "type_id='" . $intTypeID . "' or type_roue_id like '%:{$intTypeID}:%'";
            $arrLink[] = 'type_id=' . $intTypeID;
        }
    } else {
        $objWebInit->doInfoAction($_GET['action'], $_POST['select']);
    }
}
$strWhere = implode(' AND ', $arrWhere);
$strWhere = " WHERE user_id='{$_SESSION['user_id']}'" . $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']);
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) {
Ejemplo n.º 2
0
/**
 * 最新未解决知识问答文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	ask
 */
if (is_object($objWebInit)) {
    if (!isset($objask)) {
        include_once dirname(__FILE__) . "/../class/ask.class.php";
        include_once dirname(__FILE__) . "/../config/var.inc.php";
        $objask = new ask();
        $objask->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objask->db = $objWebInit->db;
        } else {
            $objask->db();
        }
    }
    $arrTopask = array();
    $arrTopask['datas'] = $objask->getInfoList('where is_answer =0 and pass=1 ', '  ORDER BY clicktimes asc', 0, 10);
    $arrTopask['COUNT_ROWS'] = $arrTopask['datas']['COUNT_ROWS'];
    //用来判断是否有数据之用,无特别需要本行可删除
    unset($arrTopask['datas']['COUNT_ROWS']);
    $arrTopask['FileCallPath'] = $arrGPic['FileCallPath'];
    //print_r($arrTopask);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrTopaskUN'] = $arrTopask;
}
Ejemplo n.º 3
0
$arrWhere[] = "is_answer='" . $is_answer . "'";
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']);
Ejemplo n.º 4
0
 * @subpackage	ask
 */
if (is_object($objWebInit)) {
    if (!isset($objask)) {
        include_once dirname(__FILE__) . "/../class/ask.class.php";
        include_once dirname(__FILE__) . "/../config/var.inc.php";
        $objask = new ask();
        $objask->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objask->db = $objWebInit->db;
        } else {
            $objask->db();
        }
    }
    $arrTopask = array();
    $arrTopask['datas'] = $objask->getInfoList('where pass=1 ', '  ORDER BY clicktimes asc', 0, 9);
    $arrTopask['COUNT_ROWS'] = $arrTopask['datas']['COUNT_ROWS'];
    //用来判断是否有数据之用,无特别需要本行可删除
    unset($arrTopask['datas']['COUNT_ROWS']);
    //print_r($arrTopask);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrTopaskHot'] = $arrTopask;
    $arrTopask = array();
    $arrTopask['datas'] = $objask->getInfoList('where pass=1 ', '  ORDER BY submit_date desc', 0, 9);
    $arrTopask['COUNT_ROWS'] = $arrTopask['datas']['COUNT_ROWS'];
    //用来判断是否有数据之用,无特别需要本行可删除
    unset($arrTopask['datas']['COUNT_ROWS']);
    //print_r($arrTopask);
    // 输出到模板
    $arrMOutput["smarty_assign"]['arrTopaskNew'] = $arrTopask;
}
Ejemplo n.º 5
0
 * @subpackage	ask
 */
if (is_object($objWebInit)) {
    if (!isset($objask)) {
        include_once dirname(__FILE__) . "/../class/ask.class.php";
        include_once dirname(__FILE__) . "/../config/var.inc.php";
        $objask = new ask();
        $objask->setDBG($arrGPdoDB);
        if (is_object($objWebInit->db)) {
            $objask->db = $objWebInit->db;
        } else {
            $objask->db();
        }
    }
    $arrTopask = array();
    $arrTopask['datas'] = $objask->getInfoList('where is_answer =1 and pass=1 ', '  ORDER BY  submit_date DESC', 0, 10);
    $arrTopask['COUNT_ROWS'] = $arrTopask['datas']['COUNT_ROWS'];
    //用来判断是否有数据之用,无特别需要本行可删除
    unset($arrTopask['datas']['COUNT_ROWS']);
    $arrTopask['FileCallPath'] = $arrGPic['FileCallPath'];
    foreach ($arrTopask['datas'] as $k => $v) {
        switch ($v['type_id']) {
            case 1:
                $arrTopask['datas'][$k]['type_title_color'] = 'red';
                break;
            case 2:
                $arrTopask['datas'][$k]['type_title_color'] = 'blue';
                break;
            case 3:
                $arrTopask['datas'][$k]['type_title_color'] = 'yellow';
                break;
Ejemplo n.º 6
0
$objWebInit->db();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    if (empty($_POST['submitpass']) || $_POST['submitpass'] != $_SESSION['submitpasskey']) {
        exit;
    }
    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']);
    }
    //判断文章信息
    $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);
    }
    if ($_FILES['Filedata']['name'] != "") {
        $_POST['photo'] = $objWebInit->uploadInfoImage($_FILES['Filedata'], '', $_POST['FileListPicSize'], $_POST['csize0']);
    }
    if ($_POST['summary'] == '') {
        $_POST['summary'] = check::csubstr(trim(str_replace(" ", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, $arrGWeb['db_summary_len']);
    }
    if (is_array($_POST['photo'])) {
        $_POST['thumbnail'] = $_POST['photo'][0]['photo'];
    } else {
        $_POST['thumbnail'] = $_POST['photo'];
    }
    $objWebInit->saveInfo($_POST, 0);
Ejemplo n.º 7
0
$objWebInit->db();
//获取分类信息
if (!is_array($arrMType) || empty($arrMType)) {
    $arrMType = $objWebInit->getTypeList();
    $arrMType = $objWebInit->formatTypeList(0, $arrMType);
}
//有问必答特有栏目:未解答问题输出
$strWhere = " where pass=1 and is_answer=0";
$strOrder = " ORDER BY topflag DESC,recommendflag DESC,submit_date DESC";
$intStartID = 0;
$intListNum = 5;
$strField = "id,type_id,title,submit_date";
$arrData = "";
$blCount = true;
$blComplex = false;
$arrNoAnswer['datas'] = $objWebInit->getInfoList($strWhere, $strOrder, $intStartID, $intListNum, $strField, $arrData, $blcount, $blComplex);
//print_r($arrNoAnswer);
//有问必答特有栏目:已解答问题输出
$strWhere = " where pass=1 and is_answer=1";
$strOrder = " ORDER BY topflag DESC,recommendflag DESC,submit_date DESC";
$intStartID = 0;
$intListNum = 5;
$strField = "id,type_id,title,submit_date";
$arrData = "";
$blCount = true;
$blComplex = false;
$arrHaveAnswer['datas'] = $objWebInit->getInfoList($strWhere, $strOrder, $intStartID, $intListNum, $strField, $arrData, $blcount, $blComplex);
//print_r($arrHaveAnswer);
// 输出到模板
$arrMOutput["smarty_assign"]['arrNoAnswer'] = $arrNoAnswer;
$arrMOutput["smarty_assign"]['arrHaveAnswer'] = $arrHaveAnswer;