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(); $arrTemp['photo'] = $objWebInit->uploadInfoImage($_FILES['Filedata' . $num], $num, $objWebInit->arrGPic['FileListPicSize'], $objWebInit->arrGPic['FileSourPicSize']); $arrTemp['photo_narrate'] = $_POST['photo_narrate' . $num]; $_POST['photo'][$num] = $arrTemp; } }
} if (is_file($strOldFile)) { // 缩略图删除 unlink($strOldFile); } if (!empty($_POST['savephoto'][$num])) { $strOldFile = $arrGPic['FileSavePath'] . 'b/' . $_POST['savephoto'][$num]; } else { $strOldFile = ''; } if (is_file($strOldFile)) { // 原文件删除 unlink($strOldFile); } $arrTemp = array(); $arrTemp['photo'] = $objWebInit->uploadInfoImage($_FILES['Filedata' . $num], $num, $objWebInit->arrGPic['FileListPicSize'], $objWebInit->arrGPic['FileSourPicSize'], $_POST['id']); if (!empty($_POST['photo_narrate' . $num])) { $arrTemp['photo_narrate'] = $_POST['photo_narrate' . $num]; } $_POST['photo'][$num] = $arrTemp; } } //还原视频数组 $_POST['video'] = array(); if (!empty($_POST['savevideo'])) { foreach ($_POST['savevideo'] as $key => $val) { $_POST['video'][$key] = array('video' => $val, 'videopic' => $_POST['savevideopic'][$key], 'video_narrate' => $_POST['video_narrate' . $key], 'video_title' => $_POST['video_title' . $key], 'video_time' => $_POST['video_time' . $key]); } } //删除旧视频 if (!empty($_POST['delvideo'])) {
//smarty参数 $objWebInit->arrGSmarty = $arrGSmarty; //图片上传参数 $objWebInit->arrGPic = $arrGPic; $objWebInit->db(); //访问权限检查 if (!$objWebInit->checkPopedomG($_SESSION['user_id'])) { check::AlertExit('对不起:您没有权限访问此页', -1); } if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST['title']) || empty($_POST['intro']) || empty($_POST['type_id'])) { check::AlertExit("错误:加*号的为必填项!", -1); } //新图上传 if ($_FILES['Filedata']['name'] != "") { $_POST['photo'] = $objWebInit->uploadInfoImage($_FILES['Filedata'], '', $_POST['FileListPicSize'], $objWebInit->arrGPic['FileSourPicSize']); } else { $_POST['photo'] = ''; } if (strpos($_POST['type_id'], '|') !== false) { $arrTemp = explode('|', $_POST['type_id']); $_POST['type_id'] = $arrTemp[0]; $_POST['type_roue_id'] = $arrTemp[1]; } else { $_POST['type_roue_id'] = ':' . $_POST['type_id'] . ':'; } if ($_POST['summary'] == '') { $_POST['summary'] = check::csubstr(trim(str_replace(" ", " ", str_replace("\r\n", "", strip_tags($_POST['intro'])))), 0, $arrGWeb['db_summary_len']); } if ($_POST['title'] != '') { $_POST['title_md5'] = md5($_POST['title']);