*/ require_once 'config/config.inc.php'; require_once "class/Community_ad.class.php"; $objWebInit = new Community_ad(); //数据库连接参数 $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) { $arrTopCommunity_ad[$k] = array(); if (is_array($v)) { $arrTopCommunity_ad[$k]['type_title'] = $v['type_title']; $arrTopCommunity_ad[$k]['type_id'] = $v['type_id']; } else { $arrTopCommunity_ad[$k]['type_title'] = $v; $arrTopCommunity_ad[$k]['type_id'] = $k; } $arrTopCommunity_ad[$k]['datas'] = $objWebInit->getInfoList("where pass=1 and type_id=" . $arrTopCommunity_ad[$k]['type_id'], " ORDER BY recommendflag DESC,clicktimes DESC,submit_date DESC", 0, 12, true, '', false); } // 输出到模板 $arrMOutput["smarty_assign"]['arrTopCommunity_ad'] = $arrTopCommunity_ad; $arrMOutput["smarty_assign"]['arrMType'] = $arrMType; $arrMOutput["smarty_assign"]['MAIN'] = $arrGSmarty['main_dir'] . 'index.html'; $objWebInit->output($arrMOutput);
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) {
* @copyright (c) 2006 by bizeway.com * @version $Id$ * @package ArthurXF * @subpackage Community_ad */ if (is_object($objWebInit)) { if (!isset($objCommunity_ad)) { include_once __WEB_ROOT . "/Community_ad/class/Community_ad.class.php"; include_once __WEB_ROOT . "/Community_ad/config/var.inc.php"; $objCommunity_ad = new Community_ad(); $objCommunity_ad->setDBG($arrGPdoDB); if (is_object($objWebInit->db)) { $objCommunity_ad->db = $objWebInit->db; } else { $objCommunity_ad->db(); } } $arrTopCommunity_ad1 = array(); $arrTopCommunity_ad1[0] = $objCommunity_ad->getInfoList("where type_id=1 and pass=1", " ORDER BY recommendflag DESC,submit_date DESC", 0, 1); unset($arrTopCommunity_ad1[0]['COUNT_ROWS']); $arrTopCommunity_ad1[1] = $objCommunity_ad->getInfoList("where type_id=2 and pass=1", " ORDER BY recommendflag DESC,submit_date DESC", 0, 10); unset($arrTopCommunity_ad1[1]['COUNT_ROWS']); $arrTopCommunity_ad1[2] = $objCommunity_ad->getInfoList("where type_id=3 and pass=1", " ORDER BY recommendflag DESC,submit_date DESC", 0, 10); unset($arrTopCommunity_ad1[2]['COUNT_ROWS']); $arrTopCommunity_ad1[3] = $objCommunity_ad->getInfoList("where type_id=4 and pass=1", " ORDER BY recommendflag DESC,submit_date DESC", 0, 10); unset($arrTopCommunity_ad1[3]['COUNT_ROWS']); $arrTopCommunity_ad1['FileCallPath'] = $arrGPic['FileCallPath']; //print_r($arrTopCommunity_ad1); // 输出到模板 $arrMOutput["smarty_assign"]['arrTopCommunity_ad1'] = $arrTopCommunity_ad1; }
} $_SESSION['arrWhere'] = $arrWhere; $_SESSION['strKeywords'] = $strKeywords; } $arrLink[] = 'keywords=' . urlencode($strKeywords); } else { if (empty($_REQUEST['keywords']) && $isGo) { check::AlertExit("错误:关键词必须填写!", -1); } else { $arrWhere = $_SESSION['arrWhere']; $strKeywords = $_SESSION['strKeywords']; } } $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']); $intRows = $arrInfoList['COUNT_ROWS']; unset($arrInfoList['COUNT_ROWS']); //翻页跳转link $strPage = $objWebInit->makeInfoListPage($intRows, $strLink, $link_type = $arrGWeb['URL_static']); // 输出到模板 $arrMOutput["smarty_assign"]['FileCallPath'] = $arrGPic['FileCallPath']; $arrMOutput["smarty_assign"]['arrInfoList'] = $arrInfoList; $arrMOutput["smarty_assign"]['strPage'] = $strPage; $arrMOutput["smarty_assign"]['page'] = $intPage; $arrMOutput["smarty_assign"]['arrMType'] = $arrMType; $arrMOutput["smarty_assign"]['strKeywords'] = $strKeywords; $arrMOutput["smarty_assign"]['strSearchTitle'] = $strKeywords . "搜索结果"; $arrMOutput['smarty_assign']['Title'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name']; $arrMOutput['smarty_assign']['Description'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name']; $arrMOutput['smarty_assign']['Keywords'] = $strKeywords . '搜索结果 - ' . $arrGWeb['name'];
<?php /** * 最新新闻 列表文件 * * @author Arthur(ArthurXF@gmail.com) * @copyright (c) 2006 by bizeway.com * @version $Id$ * @package ArthurXF * @subpackage Community_ad */ if (is_object($objWebInit)) { if (!isset($objCommunity_ad)) { include_once __WEB_ROOT . "/Community_ad/class/Community_ad.class.php"; include_once __WEB_ROOT . "/Community_ad/config/var.inc.php"; $objCommunity_ad = new Community_ad(); $objCommunity_ad->setDBG($arrGPdoDB); if (is_object($objWebInit->db)) { $objCommunity_ad->db = $objWebInit->db; } else { $objCommunity_ad->db(); } } $arrNewest = array(); $arrNewest = $objCommunity_ad->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; }
//print_r($_POST);exit; 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']); } //新图上传 set_time_limit(0); foreach ($_FILES as $key => $val) { if (strrpos($key, 'Filedata') === false) { continue; } $num = substr($key, strlen('Filedata')); if (!empty($_FILES['Filedata' . $num]['name'])) { $arrTemp = array();
if (is_object($objWebInit)) { if (!isset($objCommunity_ad)) { include_once __WEB_ROOT . "/Community_ad/class/Community_ad.class.php"; include_once __WEB_ROOT . "/Community_ad/config/var.inc.php"; $objCommunity_ad = new Community_ad(); $objCommunity_ad->setDBG($arrGPdoDB); if (is_object($objWebInit->db)) { $objCommunity_ad->db = $objWebInit->db; } else { $objCommunity_ad->db(); } } $arrCommendCommunity_ad = array(); $intMax = $objCommunity_ad->getRecordsG($objCommunity_ad->tablename2, 'where pass=1 and recommendflag = 1'); if ($intMax < 1) { $intMax = $objCommunity_ad->getRecordsG($objCommunity_ad->tablename2, 'where pass=1 and recommendflag = 0'); if ($intMax > 10) { $intMax -= 10; } $arrCommendCommunity_ad = $objCommunity_ad->getInfoList('where pass=1 and recommendflag = 0', ' order by submit_date desc', rand(0, $intMax), 10); } else { if ($intMax > 10) { $intMax -= 10; } $arrCommendCommunity_ad = $objCommunity_ad->getInfoList('where pass=1 and recommendflag = 1', ' order by submit_date desc', rand(0, $intMax), 10); } unset($intMax); unset($arrCommendCommunity_ad['COUNT_ROWS']); // 输出到模板 $arrMOutput["smarty_assign"]['arrCommendCommunity_ad'] = $arrCommendCommunity_ad; }