| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 图集发布 | * 图集发布 | ||||
| * | * | ||||
| @@ -13,9 +12,7 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_New,a_AccNew'); | CheckPurview('a_New,a_AccNew'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| @@ -30,11 +27,9 @@ if ($dopost != 'save') { | |||||
| } else { | } else { | ||||
| if ($channelid == 0) $channelid = 2; | if ($channelid == 0) $channelid = 2; | ||||
| } | } | ||||
| //获得频道模型信息 | //获得频道模型信息 | ||||
| $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $channelid = $cInfos['id']; | $channelid = $cInfos['id']; | ||||
| //获取文章最大id以确定当前权重 | //获取文章最大id以确定当前权重 | ||||
| $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM #@__archives"); | $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM #@__archives"); | ||||
| include DedeInclude("templets/album_add.htm"); | include DedeInclude("templets/album_add.htm"); | ||||
| @@ -42,14 +37,13 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if (!isset($typeid2)) $typeid2 = 0; | if (!isset($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| @@ -61,23 +55,21 @@ function __save(){ } | |||||
| if (!isset($albums)) $albums = ""; | if (!isset($albums)) $albums = ""; | ||||
| if (!isset($delzip)) $delzip = 0; | if (!isset($delzip)) $delzip = 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_New')) { | if (!TestPurview('a_New')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限"); | |||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| if (empty($source)) $source = '未知'; | if (empty($source)) $source = '未知'; | ||||
| @@ -101,11 +93,9 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | // 处理新的缩略图上传 | ||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| @@ -114,24 +104,19 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,因此无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $imgurls = "{dede:pagestyle maxwidth='$maxwidth' pagepicnum='$pagepicnum' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n"; | $imgurls = "{dede:pagestyle maxwidth='$maxwidth' pagepicnum='$pagepicnum' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n"; | ||||
| $hasone = FALSE; | $hasone = FALSE; | ||||
| //处理并保存从网上复制的图片 | //处理并保存从网上复制的图片 | ||||
| /*--------------------- | /*--------------------- | ||||
| function _getformhtml() | function _getformhtml() | ||||
| @@ -172,7 +157,6 @@ function __save(){ } | |||||
| $imgfile = $cfg_basedir.$iurl; | $imgfile = $cfg_basedir.$iurl; | ||||
| copy($imgold, $imgfile); | copy($imgold, $imgfile); | ||||
| unlink($imgold); | unlink($imgold); | ||||
| if (is_file($imgfile)) { | if (is_file($imgfile)) { | ||||
| $litpicname = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl; | $litpicname = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl; | ||||
| //指定了提取第一张为缩略图的情况强制使用第一张缩略图 | //指定了提取第一张为缩略图的情况强制使用第一张缩略图 | ||||
| @@ -184,18 +168,14 @@ function __save(){ } | |||||
| $info = ''; | $info = ''; | ||||
| $imginfos = GetImageSize($imgfile, $info); | $imginfos = GetImageSize($imgfile, $info); | ||||
| $imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | $imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | ||||
| //把图片信息保存到媒体文档管理档案中 | //把图片信息保存到媒体文档管理档案中 | ||||
| $inquery = " | $inquery = " | ||||
| INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,mid) | INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,mid) | ||||
| VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminid'); | |||||
| "; | |||||
| VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminid');"; | |||||
| $dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
| $fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
| AddMyAddon($fid, $iurl); | AddMyAddon($fid, $iurl); | ||||
| WaterImg($imgfile, 'up'); | WaterImg($imgfile, 'up'); | ||||
| if (!$hasone && $ddisfirst == 1 && $litpic == '') { | if (!$hasone && $ddisfirst == 1 && $litpic == '') { | ||||
| if (empty($litpicname)) { | if (empty($litpicname)) { | ||||
| $litpicname = $iurl; | $litpicname = $iurl; | ||||
| @@ -210,10 +190,8 @@ function __save(){ } | |||||
| $fm->RmDirFiles($tmpzipdir); | $fm->RmDirFiles($tmpzipdir); | ||||
| } | } | ||||
| } | } | ||||
| if ($albums !== "") { | if ($albums !== "") { | ||||
| $albumsArr = json_decode(stripslashes($albums), true); | $albumsArr = json_decode(stripslashes($albums), true); | ||||
| for ($i = 0; $i <= count($albumsArr) - 1; $i++) { | for ($i = 0; $i <= count($albumsArr) - 1; $i++) { | ||||
| $album = $albumsArr[$i]; | $album = $albumsArr[$i]; | ||||
| $data = explode(',', $album['img']); | $data = explode(',', $album['img']); | ||||
| @@ -222,7 +200,6 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| $info = ''; | $info = ''; | ||||
| $imginfos = GetImageSize($cfg_basedir.$fullUrl, $info); | $imginfos = GetImageSize($cfg_basedir.$fullUrl, $info); | ||||
| @@ -234,12 +211,9 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $imgurls = addslashes($imgurls); | $imgurls = addslashes($imgurls); | ||||
| //处理body字段自动摘要、自动提取缩略图等 | //处理body字段自动摘要、自动提取缩略图等 | ||||
| $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -269,7 +243,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -277,7 +250,6 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //加入主档案表 | //加入主档案表 | ||||
| @@ -288,17 +260,16 @@ function __save(){ } | |||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery(" DELETE FROM `#@__arctiny` WHERE id='$arcID' "); | $dsql->ExecuteNoneQuery(" DELETE FROM `#@__arctiny` WHERE id='$arcID' "); | ||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //加入附加表 | //加入附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if (empty($addtable)) { | if (empty($addtable)) { | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作!。", "javascript:;"); | |||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作。", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $useip = GetIP(); | $useip = GetIP(); | ||||
| @@ -308,10 +279,9 @@ function __save(){ } | |||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
| $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | ||||
| @@ -319,8 +289,7 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -331,27 +300,15 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布图片</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改图集</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>预览文档</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布图片管理</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $msg = "请选择你的后续操作:<a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布图片</a> <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改图集</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>预览文档</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布图片管理</a> $backurl"; | |||||
| $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | ||||
| $wintitle = "成功发布一个图集!"; | |||||
| $wintitle = "成功发布一个图集"; | |||||
| $wecome_info = "文章管理::发布图集"; | $wecome_info = "文章管理::发布图集"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功发布一个图集:"); | $win->AddTitle("成功发布一个图集:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", FALSE); | $winform = $win->GetWindow("hand", " ", FALSE); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 图集编辑 | * 图集编辑 | ||||
| * | * | ||||
| @@ -13,15 +12,12 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $aid = intval($aid); | $aid = intval($aid); | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | ||||
| FROM `#@__archives` arc | FROM `#@__archives` arc | ||||
| @@ -58,10 +54,10 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($typeid2)) $typeid2 = 0; | if (empty($typeid2)) $typeid2 = 0; | ||||
| @@ -74,27 +70,25 @@ function __save(){ } | |||||
| if (!isset($formzip)) $formzip = 0; | if (!isset($formzip)) $formzip = 0; | ||||
| if (!isset($ddisfirst)) $ddisfirst = 0; | if (!isset($ddisfirst)) $ddisfirst = 0; | ||||
| if (!isset($delzip)) $delzip = 0; | if (!isset($delzip)) $delzip = 0; | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_Edit')) { | if (!TestPurview('a_Edit')) { | ||||
| if (TestPurview('a_AccEdit')) { | if (TestPurview('a_AccEdit')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限"); | |||||
| } else { | } else { | ||||
| CheckArcAdmin($id, $cuserLogin->getUserID()); | CheckArcAdmin($id, $cuserLogin->getUserID()); | ||||
| } | } | ||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| @@ -113,7 +107,6 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| @@ -127,17 +120,13 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //分析body里的内容 | //分析body里的内容 | ||||
| $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -145,10 +134,8 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
| $query = " | $query = " | ||||
| UPDATE `#@__archives` SET | UPDATE `#@__archives` SET | ||||
| @@ -173,15 +160,12 @@ function __save(){ } | |||||
| filename='$filename', | filename='$filename', | ||||
| dutyadmin='$adminid' | dutyadmin='$adminid' | ||||
| WHERE id='$id'; "; | WHERE id='$id'; "; | ||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| ShowMsg("更新数据库archives表时出错,请检查!".$dsql->GetError(), "javascript:;"); | |||||
| ShowMsg("更新数据库archives表时出错,请检查".$dsql->GetError(), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $imgurls = "{dede:pagestyle maxwidth='$maxwidth' pagepicnum='$pagepicnum' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n"; | $imgurls = "{dede:pagestyle maxwidth='$maxwidth' pagepicnum='$pagepicnum' ddmaxwidth='$ddmaxwidth' row='$row' col='$col' value='$pagestyle'/}\r\n"; | ||||
| $hasone = false; | $hasone = false; | ||||
| //---------------------------------------- | //---------------------------------------- | ||||
| //检查旧的图片是否有更新,并保存 | //检查旧的图片是否有更新,并保存 | ||||
| //----------------------------------------- | //----------------------------------------- | ||||
| @@ -228,7 +212,6 @@ function __save(){ } | |||||
| $imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | $imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | ||||
| } | } | ||||
| } | } | ||||
| //---------------------------- | //---------------------------- | ||||
| //从HTML中获取新图片 | //从HTML中获取新图片 | ||||
| //---------------------------- | //---------------------------- | ||||
| @@ -251,7 +234,6 @@ function __save(){ } | |||||
| $tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | $tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| if (file_exists($zipfile)) { | if (file_exists($zipfile)) { | ||||
| @mkdir($tmpzipdir, $GLOBALS['cfg_dir_purview']); | @mkdir($tmpzipdir, $GLOBALS['cfg_dir_purview']); | ||||
| @chmod($tmpzipdir, $GLOBALS['cfg_dir_purview']); | @chmod($tmpzipdir, $GLOBALS['cfg_dir_purview']); | ||||
| $z = new zip(); | $z = new zip(); | ||||
| @@ -274,12 +256,10 @@ function __save(){ } | |||||
| $info = ''; | $info = ''; | ||||
| $imginfos = GetImageSize($imgfile, $info); | $imginfos = GetImageSize($imgfile, $info); | ||||
| $imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | $imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | ||||
| //把图片信息保存到媒体文档管理档案中 | //把图片信息保存到媒体文档管理档案中 | ||||
| $inquery = " | $inquery = " | ||||
| INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,mid) | INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,mid) | ||||
| VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminid'); | |||||
| "; | |||||
| VALUES ('{$title}','{$iurl}','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".$ntime."','$adminid');"; | |||||
| $dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
| if ( | if ( | ||||
| !$hasone && $ddisfirst == 1 | !$hasone && $ddisfirst == 1 | ||||
| @@ -298,12 +278,9 @@ function __save(){ } | |||||
| $fm->RmDirFiles($tmpzipdir); | $fm->RmDirFiles($tmpzipdir); | ||||
| } | } | ||||
| } | } | ||||
| if ($albums !== "") { | if ($albums !== "") { | ||||
| $albumsArr = json_decode(stripslashes($albums), true); | $albumsArr = json_decode(stripslashes($albums), true); | ||||
| // var_dump($albumsArr);exit; | // var_dump($albumsArr);exit; | ||||
| for ($i = 0; $i <= count($albumsArr) - 1; $i++) { | for ($i = 0; $i <= count($albumsArr) - 1; $i++) { | ||||
| $album = $albumsArr[$i]; | $album = $albumsArr[$i]; | ||||
| $data = explode(',', $album['img']); | $data = explode(',', $album['img']); | ||||
| @@ -312,7 +289,6 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| $info = ''; | $info = ''; | ||||
| $imginfos = GetImageSize($cfg_basedir.$fullUrl, $info); | $imginfos = GetImageSize($cfg_basedir.$fullUrl, $info); | ||||
| @@ -321,9 +297,7 @@ function __save(){ } | |||||
| $imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $v {/dede:img}\r\n"; | $imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $v {/dede:img}\r\n"; | ||||
| } | } | ||||
| } | } | ||||
| $imgurls = addslashes($imgurls); | $imgurls = addslashes($imgurls); | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -350,32 +324,30 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //更新附加表 | //更新附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if ($addtable != '') { | if ($addtable != '') { | ||||
| $useip = GetIP(); | $useip = GetIP(); | ||||
| $query = "Update `$addtable` | $query = "Update `$addtable` | ||||
| set typeid='$typeid', | |||||
| pagestyle='$pagestyle', | |||||
| set typeid='$typeid', | |||||
| pagestyle='$pagestyle', | |||||
| body='$body', | body='$body', | ||||
| maxwidth = '$maxwidth', | |||||
| ddmaxwidth = '$ddmaxwidth', | |||||
| pagepicnum = '$pagepicnum', | |||||
| imgurls='$imgurls', | |||||
| `row`='$row', | |||||
| col='$col', | |||||
| isrm='$isrm'{$inadd_f}, | |||||
| redirecturl='$redirecturl', | |||||
| userip = '$useip' | |||||
| maxwidth = '$maxwidth', | |||||
| ddmaxwidth = '$ddmaxwidth', | |||||
| pagepicnum = '$pagepicnum', | |||||
| imgurls='$imgurls', | |||||
| `row`='$row', | |||||
| col='$col', | |||||
| isrm='$isrm'{$inadd_f}, | |||||
| redirecturl='$redirecturl', | |||||
| userip = '$useip' | |||||
| WHERE aid='$id'; "; | WHERE aid='$id'; "; | ||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!".$dsql->GetError(), "javascript:;"); | |||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因".$dsql->GetError(), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
| $arcUrl = MakeArt($id, true, true, $isremote); | $arcUrl = MakeArt($id, true, true, $isremote); | ||||
| @@ -383,8 +355,7 @@ function __save(){ } | |||||
| $arcUrl = $cfg_phpurl."/view.php?aid=$id"; | $arcUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| } | } | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -395,26 +366,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = | |||||
| " 请选择你的后续操作: | |||||
| <a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布图片</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> | |||||
| | |||||
| <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>预览文档</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理已发布图片</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $wintitle = "成功更改图集!"; | |||||
| $msg = "请选择你的后续操作:<a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布图片</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>预览文档</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理已发布图片</a> $backurl"; | |||||
| $wintitle = "成功更改图集"; | |||||
| $wecome_info = "文章管理::更改图集"; | $wecome_info = "文章管理::更改图集"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功更改一个图集:"); | $win->AddTitle("成功更改一个图集:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", false); | $winform = $win->GetWindow("hand", " ", false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 文档发布 | * 文档发布 | ||||
| * | * | ||||
| @@ -13,27 +12,23 @@ require_once(dirname(__FILE__).'/config.php'); | |||||
| CheckPurview('a_New,a_AccNew'); | CheckPurview('a_New,a_AccNew'); | ||||
| require_once(DEDEINC.'/customfields.func.php'); | require_once(DEDEINC.'/customfields.func.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC.'/dedetag.class.php'); | require_once(DEDEINC.'/dedetag.class.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $channelid = empty($channelid) ? 0 : intval($channelid); | $channelid = empty($channelid) ? 0 : intval($channelid); | ||||
| $cid = empty($cid) ? 0 : intval($cid); | $cid = empty($cid) ? 0 : intval($cid); | ||||
| //获得频道模型ID | //获得频道模型ID | ||||
| if ($cid > 0 && $channelid == 0) { | if ($cid > 0 && $channelid == 0) { | ||||
| $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | ||||
| $channelid = $row['channeltype']; | $channelid = $row['channeltype']; | ||||
| } else { | } else { | ||||
| if ($channelid == 0) { | if ($channelid == 0) { | ||||
| ShowMsg('无法识别模型信息,因此无法操作!', '-1'); | |||||
| ShowMsg('无法识别模型信息,因此无法操作', '-1'); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //获得频道模型信息 | //获得频道模型信息 | ||||
| $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $channelid = $cInfos['id']; | $channelid = $cInfos['id']; | ||||
| @@ -44,38 +39,35 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if (empty($litpic_b64)) $litpic_b64 = ''; | if (empty($litpic_b64)) $litpic_b64 = ''; | ||||
| if (empty($typeid2)) $typeid2 = 0; | if (empty($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg('请指定文档的栏目!', '-1'); | |||||
| ShowMsg('请指定文档的栏目', '-1'); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg('文档为非指定的类型,请检查你发布内容的表单是否合法!', '-1'); | |||||
| ShowMsg('文档为非指定的类型,请检查你发布内容的表单是否合法', '-1'); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg('你所选择的栏目与当前模型不相符,请选择白色的选项!', '-1'); | |||||
| ShowMsg('你所选择的栏目与当前模型不相符,请选择白色的选项', '-1'); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_New')) { | if (!TestPurview('a_New')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限"); | |||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| if (empty($source)) $source = '未知'; | if (empty($source)) $source = '未知'; | ||||
| @@ -100,7 +92,6 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| @@ -114,22 +105,17 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,因此无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = $inadd_v = ''; | $inadd_f = $inadd_v = ''; | ||||
| if (!empty($dede_addonfields)) { | if (!empty($dede_addonfields)) { | ||||
| @@ -149,7 +135,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -157,22 +142,18 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //保存到主表 | //保存到主表 | ||||
| $query = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle, | |||||
| color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| $query = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle', | VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle', | ||||
| '$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','$voteid','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | '$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','$voteid','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | ||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //保存到附加表 | //保存到附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| @@ -183,11 +164,10 @@ color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywo | |||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
| $artUrl = MakeArt($arcID, true, true, $isremote); | $artUrl = MakeArt($arcID, true, true, $isremote); | ||||
| @@ -195,8 +175,7 @@ color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywo | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -207,26 +186,14 @@ color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywo | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " 请选择你的后续操作: | |||||
| <a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文档</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文档</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布文档管理</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $msg = "请选择你的后续操作:<a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文档</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文档</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布文档管理</a> $backurl"; | |||||
| $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | ||||
| $wintitle = '成功发布文档!'; | |||||
| $wintitle = '成功发布文档'; | |||||
| $wecome_info = '文档管理::发布文档'; | $wecome_info = '文档管理::发布文档'; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle('成功发布文档:'); | $win->AddTitle('成功发布文档:'); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow('hand', ' ', false); | $winform = $win->GetWindow('hand', ' ', false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 文档编辑 | * 文档编辑 | ||||
| * | * | ||||
| @@ -13,28 +12,22 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $aid = intval($aid); | $aid = intval($aid); | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | ||||
| FROM `#@__archives` arc | FROM `#@__archives` arc | ||||
| LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel | LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel | ||||
| LEFT JOIN `#@__arcrank` ar ON ar.rank=arc.arcrank WHERE arc.id='$aid' | |||||
| "; | |||||
| LEFT JOIN `#@__arcrank` ar ON ar.rank=arc.arcrank WHERE arc.id='$aid'"; | |||||
| $arcRow = $dsql->GetOne($arcQuery); | $arcRow = $dsql->GetOne($arcQuery); | ||||
| if (!is_array($arcRow)) { | if (!is_array($arcRow)) { | ||||
| ShowMsg("读取档案基本信息出错!", "-1"); | ShowMsg("读取档案基本信息出错!", "-1"); | ||||
| exit(); | exit(); | ||||
| } | } | ||||
| $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'"; | $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'"; | ||||
| $cInfos = $dsql->GetOne($query); | $cInfos = $dsql->GetOne($query); | ||||
| if (!is_array($cInfos)) { | if (!is_array($cInfos)) { | ||||
| @@ -50,40 +43,38 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($litpic_b64)) $litpic_b64 = ''; | if (empty($litpic_b64)) $litpic_b64 = ''; | ||||
| if (empty($typeid2)) $typeid2 = 0; | if (empty($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if (!isset($writer)) $writer = ''; | if (!isset($writer)) $writer = ''; | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_Edit')) { | if (!TestPurview('a_Edit')) { | ||||
| if (TestPurview('a_AccEdit')) { | if (TestPurview('a_AccEdit')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限"); | |||||
| } else { | } else { | ||||
| CheckArcAdmin($id, $cuserLogin->getUserID()); | CheckArcAdmin($id, $cuserLogin->getUserID()); | ||||
| } | } | ||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| @@ -99,15 +90,11 @@ function __save(){ } | |||||
| $isremote = 0; | $isremote = 0; | ||||
| $serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
| if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -115,14 +102,11 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -149,7 +133,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -157,7 +140,6 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
| @@ -185,21 +167,19 @@ function __save(){ } | |||||
| weight='$weight' | weight='$weight' | ||||
| WHERE id='$id'; "; | WHERE id='$id'; "; | ||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| ShowMsg("更新数据库archives表时出错,请检查!", "-1"); | |||||
| ShowMsg("更新数据库archives表时出错,请检查", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $cts = $dsql->GetOne("SELECT addtable From `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable From `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if ($addtable != '') { | if ($addtable != '') { | ||||
| $useip = GetIP(); | $useip = GetIP(); | ||||
| $iquery = "UPDATE `$addtable` SET typeid='$typeid'{$inadd_f},redirecturl='$redirecturl',userip='$useip' WHERE aid='$id' "; | $iquery = "UPDATE `$addtable` SET typeid='$typeid'{$inadd_f},redirecturl='$redirecturl',userip='$useip' WHERE aid='$id' "; | ||||
| if (!$dsql->ExecuteNoneQuery($iquery)) { | if (!$dsql->ExecuteNoneQuery($iquery)) { | ||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;"); | |||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
| $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | ||||
| @@ -207,8 +187,7 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$id"; | $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| } | } | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -219,26 +198,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文档</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理文档</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $wintitle = "成功更改文档!"; | |||||
| $msg = "请选择你的后续操作:<a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文档</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理文档</a> $backurl"; | |||||
| $wintitle = "成功更改文档"; | |||||
| $wecome_info = "文档管理::更改文档"; | $wecome_info = "文档管理::更改文档"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功更改文档:"); | $win->AddTitle("成功更改文档:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", false); | $winform = $win->GetWindow("hand", " ", false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 单表模型文档发布 | * 单表模型文档发布 | ||||
| * | * | ||||
| @@ -13,27 +12,23 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_New,a_AccNew'); | CheckPurview('a_New,a_AccNew'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $channelid = empty($channelid) ? 0 : intval($channelid); | $channelid = empty($channelid) ? 0 : intval($channelid); | ||||
| $cid = empty($cid) ? 0 : intval($cid); | $cid = empty($cid) ? 0 : intval($cid); | ||||
| //获得频道模型ID | //获得频道模型ID | ||||
| if ($cid > 0 && $channelid == 0) { | if ($cid > 0 && $channelid == 0) { | ||||
| $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | ||||
| $channelid = $row['channeltype']; | $channelid = $row['channeltype']; | ||||
| } else { | } else { | ||||
| if ($channelid == 0) { | if ($channelid == 0) { | ||||
| ShowMsg("无法识别模型信息,因此无法操作!", "-1"); | |||||
| ShowMsg("无法识别模型信息,因此无法操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //获得频道模型信息 | //获得频道模型信息 | ||||
| $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $channelid = $cInfos['id']; | $channelid = $cInfos['id']; | ||||
| @@ -42,24 +37,24 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_New')) { | if (!TestPurview('a_New')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限"); | |||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| @@ -72,14 +67,11 @@ function __save(){ } | |||||
| $isremote = 0; | $isremote = 0; | ||||
| $serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
| if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| $userip = GetIP(); | $userip = GetIP(); | ||||
| if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -87,21 +79,17 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | // 加水印 | ||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $senddate, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $senddate, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,因此无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -129,26 +117,23 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| } | } | ||||
| //保存到附加表 | //保存到附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if (!empty($addtable)) { | if (!empty($addtable)) { | ||||
| $query = "INSERT INTO `{$addtable}`(aid,typeid,channel,arcrank,mid,click,title,senddate,flag,litpic,userip{$inadd_f}) | $query = "INSERT INTO `{$addtable}`(aid,typeid,channel,arcrank,mid,click,title,senddate,flag,litpic,userip{$inadd_f}) | ||||
| VALUES('$arcID','$typeid','$channelid','$arcrank','$adminid','0','$title','$senddate','$flag','$litpic','$userip'{$inadd_v})"; | |||||
| VALUES('$arcID','$typeid','$channelid','$arcrank','$adminid','0','$title','$senddate','$flag','$litpic','$userip'{$inadd_v})"; | |||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | ||||
| if ($artUrl == '') { | if ($artUrl == '') { | ||||
| @@ -156,24 +141,12 @@ function __save(){ } | |||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文档</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文档</a> | |||||
| | |||||
| <a href='content_sg_list.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>已发布文档管理</a> | |||||
| | |||||
| <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a> | |||||
| "; | |||||
| $wintitle = "成功发布文档!"; | |||||
| $msg = "请选择你的后续操作:<a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文档</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文档</a> <a href='content_sg_list.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>已发布文档管理</a> <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>"; | |||||
| $wintitle = "成功发布文档"; | |||||
| $wecome_info = "文档管理::发布文档"; | $wecome_info = "文档管理::发布文档"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功发布文档:"); | $win->AddTitle("成功发布文档:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", false); | $winform = $win->GetWindow("hand", " ", false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 单表模型文档编辑 | * 单表模型文档编辑 | ||||
| * | * | ||||
| @@ -13,25 +12,20 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $aid = intval($aid); | $aid = intval($aid); | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $arcQuery = "SELECT ch.*,arc.* FROM `#@__arctiny` arc | $arcQuery = "SELECT ch.*,arc.* FROM `#@__arctiny` arc | ||||
| LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' "; | LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' "; | ||||
| $cInfos = $dsql->GetOne($arcQuery); | $cInfos = $dsql->GetOne($arcQuery); | ||||
| if (!is_array($cInfos)) { | if (!is_array($cInfos)) { | ||||
| ShowMsg("读频道模型信息出错!", "-1"); | |||||
| ShowMsg("读频道模型信息出错", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $addtable = $cInfos['addtable']; | $addtable = $cInfos['addtable']; | ||||
| $addRow = $dsql->GetOne("SELECT arc.*,ar.membername as rankname FROM `$addtable` arc LEFT JOIN `#@__arcrank` ar on ar.rank=arc.arcrank WHERE arc.aid='$aid'"); | $addRow = $dsql->GetOne("SELECT arc.*,ar.membername as rankname FROM `$addtable` arc LEFT JOIN `#@__arcrank` ar on ar.rank=arc.arcrank WHERE arc.aid='$aid'"); | ||||
| $channelid = $cInfos['channel']; | $channelid = $cInfos['channel']; | ||||
| @@ -41,24 +35,25 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_Edit')) { | if (!TestPurview('a_Edit')) { | ||||
| if (TestPurview('a_AccEdit')) { | if (TestPurview('a_AccEdit')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限"); | |||||
| } else { | } else { | ||||
| CheckArcAdmin($id, $cuserLogin->getUserID()); | CheckArcAdmin($id, $cuserLogin->getUserID()); | ||||
| } | } | ||||
| @@ -71,13 +66,11 @@ function __save(){ } | |||||
| $serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
| if (empty($litpic_b64)) $litpic_b64 = ''; | if (empty($litpic_b64)) $litpic_b64 = ''; | ||||
| if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -85,9 +78,7 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | // 加水印 | ||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| @@ -118,43 +109,27 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| } | } | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if ($addtable != '') { | if ($addtable != '') { | ||||
| $iquery = "UPDATE `$addtable` SET typeid='$typeid',arcrank='$arcrank',title='$title',flag='$flag',litpic='$litpic'{$inadd_f} WHERE aid='$id' "; | $iquery = "UPDATE `$addtable` SET typeid='$typeid',arcrank='$arcrank',title='$title',flag='$flag',litpic='$litpic'{$inadd_f} WHERE aid='$id' "; | ||||
| if (!$dsql->ExecuteNoneQuery($iquery)) { | if (!$dsql->ExecuteNoneQuery($iquery)) { | ||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;"); | |||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, ''); | UpIndexKey($id, $arcrank, $typeid, $sortrank, ''); | ||||
| $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | ||||
| if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$id"; | if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文档</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>管理文档</a> | |||||
| | |||||
| <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a> | |||||
| "; | |||||
| $wintitle = "成功更改文档!"; | |||||
| $msg = "请选择你的后续操作:<a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文档</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文档</a> <a href='catalog_do.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>管理文档</a> <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>"; | |||||
| $wintitle = "成功更改文档"; | |||||
| $wecome_info = "文档管理::更改文档"; | $wecome_info = "文档管理::更改文档"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功更改文档:"); | $win->AddTitle("成功更改文档:"); | ||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 文档发布 | * 文档发布 | ||||
| * | * | ||||
| @@ -17,7 +16,6 @@ if (file_exists(DEDEDATA.'/template.rand.php')) { | |||||
| require_once(DEDEDATA.'/template.rand.php'); | require_once(DEDEDATA.'/template.rand.php'); | ||||
| } | } | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| @@ -25,18 +23,14 @@ if ($dopost != 'save') { | |||||
| $channelid = empty($channelid) ? 0 : intval($channelid); | $channelid = empty($channelid) ? 0 : intval($channelid); | ||||
| $cid = empty($cid) ? 0 : intval($cid); | $cid = empty($cid) ? 0 : intval($cid); | ||||
| if (empty($litpic_b64)) $litpic_b64 = ''; | if (empty($litpic_b64)) $litpic_b64 = ''; | ||||
| if (empty($geturl)) $geturl = ''; | if (empty($geturl)) $geturl = ''; | ||||
| $keywords = $writer = $source = $body = $description = $title = ''; | $keywords = $writer = $source = $body = $description = $title = ''; | ||||
| //采集单个网页 | //采集单个网页 | ||||
| if (preg_match("#^http:\/\/#", $geturl)) { | if (preg_match("#^http:\/\/#", $geturl)) { | ||||
| require_once(DEDEADMIN."/inc/inc_coonepage.php"); | require_once(DEDEADMIN."/inc/inc_coonepage.php"); | ||||
| $redatas = CoOnePage($geturl); | $redatas = CoOnePage($geturl); | ||||
| extract($redatas); | extract($redatas); | ||||
| } | } | ||||
| //获得频道模型ID | //获得频道模型ID | ||||
| if ($cid > 0 && $channelid == 0) { | if ($cid > 0 && $channelid == 0) { | ||||
| $row = $dsql->GetOne("Select channeltype From `#@__arctype` where id='$cid'; "); | $row = $dsql->GetOne("Select channeltype From `#@__arctype` where id='$cid'; "); | ||||
| @@ -46,48 +40,43 @@ if ($dopost != 'save') { | |||||
| $channelid = 1; | $channelid = 1; | ||||
| } | } | ||||
| } | } | ||||
| //获得频道模型信息 | //获得频道模型信息 | ||||
| $cInfos = $dsql->GetOne(" Select * From `#@__channeltype` where id='$channelid' "); | $cInfos = $dsql->GetOne(" Select * From `#@__channeltype` where id='$channelid' "); | ||||
| //获取文章最大id以确定当前权重 | //获取文章最大id以确定当前权重 | ||||
| $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM `#@__archives`"); | $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM `#@__archives`"); | ||||
| include DedeInclude("templets/article_add.htm"); | include DedeInclude("templets/article_add.htm"); | ||||
| exit(); | exit(); | ||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($typeid2)) $typeid2 = ''; | if (empty($typeid2)) $typeid2 = ''; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if (empty($typeid)) { | if (empty($typeid)) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_New')) { | if (!TestPurview('a_New')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限"); | |||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| if (empty($source)) $source = '未知'; | if (empty($source)) $source = '未知'; | ||||
| @@ -107,19 +96,16 @@ function __save(){ } | |||||
| $userip = GetIP(); | $userip = GetIP(); | ||||
| $isremote = 0; | $isremote = 0; | ||||
| $serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
| if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) { | if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) { | ||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| } | } | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -127,34 +113,27 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,因此无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (trim($title) == '') { | if (trim($title) == '') { | ||||
| ShowMsg('标题不能为空', '-1'); | ShowMsg('标题不能为空', '-1'); | ||||
| exit(); | exit(); | ||||
| } | } | ||||
| //处理body字段自动摘要、自动提取缩略图等 | //处理body字段自动摘要、自动提取缩略图等 | ||||
| $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | ||||
| //自动分页 | //自动分页 | ||||
| if ($sptype == 'auto') { | if ($sptype == 'auto') { | ||||
| $body = SpLongBody($body, $spsize * 1024, "#p#分页标题#e#"); | $body = SpLongBody($body, $spsize * 1024, "#p#分页标题#e#"); | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = $inadd_v = ''; | $inadd_f = $inadd_v = ''; | ||||
| if (!empty($dede_addonfields)) { | if (!empty($dede_addonfields)) { | ||||
| @@ -174,7 +153,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -182,31 +160,24 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //保存到主表 | //保存到主表 | ||||
| $query = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle, | |||||
| color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money', | |||||
| '$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate', | |||||
| '$adminid','0','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | |||||
| $query = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','0','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | |||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //保存到附加表 | //保存到附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if (empty($addtable)) { | if (empty($addtable)) { | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作!。", "javascript:;"); | |||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作。", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $useip = GetIP(); | $useip = GetIP(); | ||||
| @@ -216,7 +187,7 @@ function __save(){ } | |||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("Delete From `#@__archives` where id='$arcID'"); | $dsql->ExecuteNoneQuery("Delete From `#@__archives` where id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("Delete From `#@__arctiny` where id='$arcID'"); | $dsql->ExecuteNoneQuery("Delete From `#@__arctiny` where id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| @@ -240,8 +211,7 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -252,25 +222,14 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " 请选择你的后续操作: | |||||
| <a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文章</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文章</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文章</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布文章管理</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $msg = "请选择你的后续操作:<a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布文章</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文章</a> <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改文章</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布文章管理</a> $backurl"; | |||||
| $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | ||||
| $wintitle = "成功发布文章!"; | |||||
| $wintitle = "成功发布文章"; | |||||
| $wecome_info = "文章管理::发布文章"; | $wecome_info = "文章管理::发布文章"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功发布文章:"); | $win->AddTitle("成功发布文章:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", false); | $winform = $win->GetWindow("hand", " ", false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 文档编辑 | * 文档编辑 | ||||
| * | * | ||||
| @@ -17,14 +16,11 @@ if (file_exists(DEDEDATA.'/template.rand.php')) { | |||||
| require_once(DEDEDATA.'/template.rand.php'); | require_once(DEDEDATA.'/template.rand.php'); | ||||
| } | } | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $query = "SELECT ch.typename AS channelname,ar.membername AS rankname,arc.* | $query = "SELECT ch.typename AS channelname,ar.membername AS rankname,arc.* | ||||
| FROM `#@__archives` arc | FROM `#@__archives` arc | ||||
| @@ -32,19 +28,19 @@ if ($dopost != 'save') { | |||||
| LEFT JOIN `#@__arcrank` ar ON ar.rank=arc.arcrank WHERE arc.id='$aid' "; | LEFT JOIN `#@__arcrank` ar ON ar.rank=arc.arcrank WHERE arc.id='$aid' "; | ||||
| $arcRow = $dsql->GetOne($query); | $arcRow = $dsql->GetOne($query); | ||||
| if (!is_array($arcRow)) { | if (!is_array($arcRow)) { | ||||
| ShowMsg("读取档案基本信息出错!", "-1"); | |||||
| ShowMsg("读取档案基本信息出错", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'"; | $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'"; | ||||
| $cInfos = $dsql->GetOne($query); | $cInfos = $dsql->GetOne($query); | ||||
| if (!is_array($cInfos)) { | if (!is_array($cInfos)) { | ||||
| ShowMsg("读取频道配置信息出错!", "javascript:;"); | |||||
| ShowMsg("读取频道配置信息出错", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $addtable = $cInfos['addtable']; | $addtable = $cInfos['addtable']; | ||||
| $addRow = $dsql->GetOne("SELECT * FROM `$addtable` WHERE aid='$aid'"); | $addRow = $dsql->GetOne("SELECT * FROM `$addtable` WHERE aid='$aid'"); | ||||
| if (!is_array($addRow)) { | if (!is_array($addRow)) { | ||||
| ShowMsg("读取附加信息出错!", "javascript:;"); | |||||
| ShowMsg("读取附加信息出错", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $channelid = $arcRow['channel']; | $channelid = $arcRow['channel']; | ||||
| @@ -54,40 +50,37 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($typeid2)) $typeid2 = 0; | if (empty($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if (empty($litpic_b64)) $litpic_b64 = ''; | if (empty($litpic_b64)) $litpic_b64 = ''; | ||||
| if (empty($typeid)) { | if (empty($typeid)) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_Edit')) { | if (!TestPurview('a_Edit')) { | ||||
| if (TestPurview('a_AccEdit')) { | if (TestPurview('a_AccEdit')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限"); | |||||
| } else { | } else { | ||||
| CheckArcAdmin($id, $cuserLogin->getUserID()); | CheckArcAdmin($id, $cuserLogin->getUserID()); | ||||
| } | } | ||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| @@ -107,16 +100,13 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| } | } | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| //分析body里的内容 | //分析body里的内容 | ||||
| $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -143,8 +133,7 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -152,14 +141,11 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match("#p#", $flag)) { | if ($litpic != '' && !preg_match("#p#", $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -167,7 +153,6 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match("#j#", $flag)) { | if ($redirecturl != '' && !preg_match("#j#", $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
| //更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
| @@ -194,12 +179,10 @@ function __save(){ } | |||||
| dutyadmin='$adminid', | dutyadmin='$adminid', | ||||
| weight='$weight' | weight='$weight' | ||||
| WHERE id='$id'; "; | WHERE id='$id'; "; | ||||
| if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
| ShowMsg('更新数据库archives表时出错,请检查', -1); | ShowMsg('更新数据库archives表时出错,请检查', -1); | ||||
| exit(); | exit(); | ||||
| } | } | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if ($addtable != '') { | if ($addtable != '') { | ||||
| @@ -207,11 +190,10 @@ function __save(){ } | |||||
| $templet = empty($templet) ? '' : $templet; | $templet = empty($templet) ? '' : $templet; | ||||
| $iquery = "UPDATE `$addtable` SET typeid='$typeid',body='$body'{$inadd_f},redirecturl='$redirecturl',templet='$templet',userip='$useip' WHERE aid='$id'"; | $iquery = "UPDATE `$addtable` SET typeid='$typeid',body='$body'{$inadd_f},redirecturl='$redirecturl',templet='$templet',userip='$useip' WHERE aid='$id'"; | ||||
| if (!$dsql->ExecuteNoneQuery($iquery)) { | if (!$dsql->ExecuteNoneQuery($iquery)) { | ||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;"); | |||||
| ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
| $artUrl = MakeArt($id, true, true, $isremote); | $artUrl = MakeArt($id, true, true, $isremote); | ||||
| @@ -219,8 +201,7 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$id"; | $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| } | } | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -233,24 +214,12 @@ function __save(){ } | |||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文章</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文章</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理文章</a> | |||||
| | |||||
| $backurl | |||||
| "; | |||||
| $wintitle = "成功更改文章!"; | |||||
| $msg = "请选择你的后续操作:<a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新文章</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看文章</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>管理文章</a> $backurl"; | |||||
| $wintitle = "成功更改文章"; | |||||
| $wecome_info = "文章管理::更改文章"; | $wecome_info = "文章管理::更改文章"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功更改文章:"); | $win->AddTitle("成功更改文章:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", false); | $winform = $win->GetWindow("hand", " ", false); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 软件发布 | * 软件发布 | ||||
| * | * | ||||
| @@ -14,14 +13,12 @@ CheckPurview('a_New,a_AccNew'); | |||||
| require_once(DEDEINC.'/customfields.func.php'); | require_once(DEDEINC.'/customfields.func.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC.'/dedetag.class.php'); | require_once(DEDEINC.'/dedetag.class.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $channelid = empty($channelid) ? 0 : intval($channelid); | $channelid = empty($channelid) ? 0 : intval($channelid); | ||||
| $cid = empty($cid) ? 0 : intval($cid); | $cid = empty($cid) ? 0 : intval($cid); | ||||
| //获得频道模型ID | //获得频道模型ID | ||||
| if ($cid > 0 && $channelid == 0) { | if ($cid > 0 && $channelid == 0) { | ||||
| $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | $row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; "); | ||||
| @@ -29,12 +26,10 @@ if ($dopost != 'save') { | |||||
| } else { | } else { | ||||
| if ($channelid == 0) $channelid = 1; | if ($channelid == 0) $channelid = 1; | ||||
| } | } | ||||
| $softconfig = $dsql->GetOne("SELECT * FROM `#@__softconfig` "); | $softconfig = $dsql->GetOne("SELECT * FROM `#@__softconfig` "); | ||||
| //获得频道模型信息 | //获得频道模型信息 | ||||
| $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | $cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $channelid = $cInfos['id']; | $channelid = $cInfos['id']; | ||||
| //获取文章最大id以确定当前权重 | //获取文章最大id以确定当前权重 | ||||
| $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM #@__archives"); | $maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM #@__archives"); | ||||
| include DedeInclude("templets/soft_add.htm"); | include DedeInclude("templets/soft_add.htm"); | ||||
| @@ -42,48 +37,42 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| if (!isset($typeid2)) $typeid2 = 0; | if (!isset($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_New')) { | if (!TestPurview('a_New')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限"); | |||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| if (empty($source)) $source = '未知'; | if (empty($source)) $source = '未知'; | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $senddate = time(); | $senddate = time(); | ||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| if ($ishtml == 0) $ismake = -1; | if ($ishtml == 0) $ismake = -1; | ||||
| else $ismake = 0; | else $ismake = 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| $title = preg_replace('#"#', '"', $title); | $title = preg_replace('#"#', '"', $title); | ||||
| $title = cn_substrR($title, $cfg_title_maxlen); | $title = cn_substrR($title, $cfg_title_maxlen); | ||||
| $shorttitle = cn_substrR($shorttitle, 36); | $shorttitle = cn_substrR($shorttitle, 36); | ||||
| @@ -100,7 +89,6 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| @@ -114,24 +102,19 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,因此无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //处理body字段自动摘要、自动提取缩略图等 | //处理body字段自动摘要、自动提取缩略图等 | ||||
| $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -161,7 +144,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match('#p#', $flag)) { | if ($litpic != '' && !preg_match('#p#', $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -169,24 +151,19 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match('#j#', $flag)) { | if ($redirecturl != '' && !preg_match('#j#', $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match('#j#', $flag)) $ismake = -1; | if (preg_match('#j#', $flag)) $ismake = -1; | ||||
| //保存到主表 | //保存到主表 | ||||
| $inQuery = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle, | |||||
| color,writer,source,litpic,pubdate,senddate,mid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle', | |||||
| '$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | |||||
| $inQuery = "INSERT INTO `#@__archives`(id,typeid,typeid2,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,notpost,description,keywords,filename,dutyadmin,weight) | |||||
| VALUES ('$arcID','$typeid','$typeid2','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','$notpost','$description','$keywords','$filename','$adminid','$weight');"; | |||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //软件链接列表 | //软件链接列表 | ||||
| $urls = ''; | $urls = ''; | ||||
| //本地链接处理 | //本地链接处理 | ||||
| $softurl1 = stripslashes($softurl1); | $softurl1 = stripslashes($softurl1); | ||||
| $nsoftsize = ''; | $nsoftsize = ''; | ||||
| @@ -202,12 +179,10 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //软件大小 | //软件大小 | ||||
| if (!empty($nsoftsize)) $softsize = $nsoftsize; | if (!empty($nsoftsize)) $softsize = $nsoftsize; | ||||
| else if (empty($softsize)) $softsize = '未知'; | else if (empty($softsize)) $softsize = '未知'; | ||||
| else $softsize = $softsize.' '.$unit; | else $softsize = $softsize.' '.$unit; | ||||
| //其它链接处理 | //其它链接处理 | ||||
| for ($i = 2; $i <= 30; $i++) { | for ($i = 2; $i <= 30; $i++) { | ||||
| if (!empty(${'softurl'.$i})) { | if (!empty(${'softurl'.$i})) { | ||||
| @@ -230,14 +205,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| $urls = addslashes($urls); | $urls = addslashes($urls); | ||||
| //保存到附加表 | //保存到附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if (empty($addtable)) { | if (empty($addtable)) { | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作!。", "javascript:;"); | |||||
| ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作。", "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| $daccess = isset($daccess) && is_numeric($daccess) ? $daccess : 0; | $daccess = isset($daccess) && is_numeric($daccess) ? $daccess : 0; | ||||
| @@ -250,10 +224,9 @@ function __save(){ } | |||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
| $arcUrl = MakeArt($arcID, TRUE, TRUE, 0); | $arcUrl = MakeArt($arcID, TRUE, TRUE, 0); | ||||
| @@ -261,8 +234,7 @@ function __save(){ } | |||||
| $arcUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $arcUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -273,27 +245,14 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='soft_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布软件</a> | |||||
| | |||||
| <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>查看软件</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改软件</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布软件管理</a> | |||||
| | |||||
| <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a> | |||||
| "; | |||||
| $msg = "请选择你的后续操作:<a href='soft_add.php?cid=$typeid' class='btn btn-success btn-sm'>继续发布软件</a> <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>查看软件</a> <a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>更改软件</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布软件管理</a> <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>"; | |||||
| $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | $msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest(); | ||||
| $wintitle = "成功发布一个软件!"; | |||||
| $wintitle = "成功发布一个软件"; | |||||
| $wecome_info = "文章管理::发布软件"; | $wecome_info = "文章管理::发布软件"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功发布软件:"); | $win->AddTitle("成功发布软件:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", FALSE); | $winform = $win->GetWindow("hand", " ", FALSE); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 软件编辑 | * 软件编辑 | ||||
| * | * | ||||
| @@ -14,14 +13,12 @@ CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $aid = preg_replace("#[^0-9]#", '', $aid); | $aid = preg_replace("#[^0-9]#", '', $aid); | ||||
| $channelid = "3"; | $channelid = "3"; | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $arcQuery = "SELECT | $arcQuery = "SELECT | ||||
| #@__channeltype.typename as channelname, | #@__channeltype.typename as channelname, | ||||
| @@ -79,39 +76,36 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($typeid2)) $typeid2 = 0; | if (empty($typeid2)) $typeid2 = 0; | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| if ($typeid == 0) { | if ($typeid == 0) { | ||||
| ShowMsg("请指定文档的栏目!", "-1"); | |||||
| ShowMsg("请指定文档的栏目", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (empty($channelid)) { | if (empty($channelid)) { | ||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1"); | |||||
| ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1"); | |||||
| ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| if (!TestPurview('a_Edit')) { | if (!TestPurview('a_Edit')) { | ||||
| if (TestPurview('a_AccEdit')) { | if (TestPurview('a_AccEdit')) { | ||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!"); | |||||
| CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限"); | |||||
| } else { | } else { | ||||
| CheckArcAdmin($id, $cuserLogin->getUserID()); | CheckArcAdmin($id, $cuserLogin->getUserID()); | ||||
| } | } | ||||
| } | } | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $senddate = time(); | $senddate = time(); | ||||
| @@ -135,13 +129,12 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| } | } | ||||
| $litpic = GetDDImage('litpic', $picname, $ddisremote); | $litpic = GetDDImage('litpic', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -149,14 +142,11 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -183,7 +173,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match('#p#', $flag)) { | if ($litpic != '' && !preg_match('#p#', $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -191,7 +180,6 @@ function __save(){ } | |||||
| if ($redirecturl != '' && !preg_match('#j#', $flag)) { | if ($redirecturl != '' && !preg_match('#j#', $flag)) { | ||||
| $flag = ($flag == '' ? 'j' : $flag.',j'); | $flag = ($flag == '' ? 'j' : $flag.',j'); | ||||
| } | } | ||||
| //跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
| if (preg_match('#j#', $flag)) $ismake = -1; | if (preg_match('#j#', $flag)) $ismake = -1; | ||||
| //更改主档案表 | //更改主档案表 | ||||
| @@ -219,20 +207,17 @@ function __save(){ } | |||||
| weight='$weight' | weight='$weight' | ||||
| WHERE id='$id'; "; | WHERE id='$id'; "; | ||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| ShowMsg("更新数据库archives表时出错,请检查!", "-1"); | |||||
| ShowMsg("更新数据库archives表时出错,请检查", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //软件链接列表 | //软件链接列表 | ||||
| $urls = ''; | $urls = ''; | ||||
| for ($i = 1; $i <= 30; $i++) { | for ($i = 1; $i <= 30; $i++) { | ||||
| if (!empty(${'softurl'.$i})) { | if (!empty(${'softurl'.$i})) { | ||||
| $islocal = empty(${'islocal'.$i}) ? '' : 1; | $islocal = empty(${'islocal'.$i}) ? '' : 1; | ||||
| $isneed = empty(${'del'.$i}) ? true : false; | $isneed = empty(${'del'.$i}) ? true : false; | ||||
| $servermsg = str_replace("'", '', stripslashes(${'servermsg'.$i})); | $servermsg = str_replace("'", '', stripslashes(${'servermsg'.$i})); | ||||
| $softurl = stripslashes(${'softurl'.$i}); | $softurl = stripslashes(${'softurl'.$i}); | ||||
| if ($servermsg == '') { | if ($servermsg == '') { | ||||
| $servermsg = '下载地址'.$i; | $servermsg = '下载地址'.$i; | ||||
| } | } | ||||
| @@ -244,47 +229,43 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| $urls = addslashes($urls); | $urls = addslashes($urls); | ||||
| //更新附加表 | //更新附加表 | ||||
| $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | $cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | ||||
| $addtable = trim($cts['addtable']); | $addtable = trim($cts['addtable']); | ||||
| if ($addtable != '') { | if ($addtable != '') { | ||||
| $useip = GetIP(); | $useip = GetIP(); | ||||
| $inQuery = "UPDATE `$addtable` | $inQuery = "UPDATE `$addtable` | ||||
| SET typeid ='$typeid', | |||||
| filetype ='$filetype', | |||||
| language ='$language', | |||||
| softtype ='$softtype', | |||||
| accredit ='$accredit', | |||||
| os ='$os', | |||||
| softrank ='$softrank', | |||||
| officialUrl ='$officialUrl', | |||||
| officialDemo ='$officialDemo', | |||||
| softsize ='$softsize', | |||||
| softlinks ='$urls', | |||||
| redirecturl='$redirecturl', | |||||
| userip = '$useip', | |||||
| daccess = '$daccess', | |||||
| needmoney = '$needmoney', | |||||
| introduce='$body' | |||||
| {$inadd_f} | |||||
| WHERE aid='$id';"; | |||||
| SET typeid ='$typeid', | |||||
| filetype ='$filetype', | |||||
| language ='$language', | |||||
| softtype ='$softtype', | |||||
| accredit ='$accredit', | |||||
| os ='$os', | |||||
| softrank ='$softrank', | |||||
| officialUrl ='$officialUrl', | |||||
| officialDemo ='$officialDemo', | |||||
| softsize ='$softsize', | |||||
| softlinks ='$urls', | |||||
| redirecturl='$redirecturl', | |||||
| userip = '$useip', | |||||
| daccess = '$daccess', | |||||
| needmoney = '$needmoney', | |||||
| introduce='$body' | |||||
| {$inadd_f} | |||||
| WHERE aid='$id';"; | |||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| ShowMsg("更新数据库附加表 addonsoft 时出错,请检查原因!", "-1"); | |||||
| ShowMsg("更新数据库附加表 addonsoft 时出错,请检查原因", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
| $arcUrl = MakeArt($id, TRUE, TRUE, $isremote); | $arcUrl = MakeArt($id, TRUE, TRUE, $isremote); | ||||
| if ($arcUrl == "") { | if ($arcUrl == "") { | ||||
| $arcUrl = $cfg_phpurl."/view.php?aid=$id"; | $arcUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| } | } | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -295,25 +276,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='soft_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新软件</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>继续修改</a> | |||||
| | |||||
| <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>查看软件</a> | |||||
| | |||||
| <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布软件管理</a> | |||||
| | |||||
| <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a> | |||||
| "; | |||||
| $wintitle = "成功修改一个软件!"; | |||||
| $msg = "请选择你的后续操作:<a href='soft_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新软件</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>继续修改</a> <a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>查看软件</a> <a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>已发布软件管理</a> <a href='catalog_main.php' class='btn btn-success btn-sm'>网站栏目管理</a>"; | |||||
| $wintitle = "成功修改一个软件"; | |||||
| $wecome_info = "文章管理::修改软件"; | $wecome_info = "文章管理::修改软件"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功修改软件:"); | $win->AddTitle("成功修改软件:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", FALSE); | $winform = $win->GetWindow("hand", " ", FALSE); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 专题添加 | * 专题添加 | ||||
| * | * | ||||
| @@ -14,7 +13,6 @@ CheckPurview('a_New,a_AccNew'); | |||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC.'/dedetag.class.php'); | require_once(DEDEINC.'/dedetag.class.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | ||||
| @@ -29,23 +27,21 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click); | ||||
| $channelid = -1; | $channelid = -1; | ||||
| $money = 0; | $money = 0; | ||||
| if (!isset($tags)) $tags = ''; | if (!isset($tags)) $tags = ''; | ||||
| //处理自定义字段会用到这些变量 | //处理自定义字段会用到这些变量 | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| if (empty($writer)) $writer = $cuserLogin->getUserName(); | if (empty($writer)) $writer = $cuserLogin->getUserName(); | ||||
| if (empty($source)) $source = '未知'; | if (empty($source)) $source = '未知'; | ||||
| @@ -54,7 +50,6 @@ function __save(){ } | |||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| if ($ishtml == 0) $ismake = -1; | if ($ishtml == 0) $ismake = -1; | ||||
| else $ismake = 0; | else $ismake = 0; | ||||
| $title = preg_replace('#"#', '"', $title); | $title = preg_replace('#"#', '"', $title); | ||||
| $title = cn_substrR($title, $cfg_title_maxlen); | $title = cn_substrR($title, $cfg_title_maxlen); | ||||
| $shorttitle = cn_substrR($shorttitle, 36); | $shorttitle = cn_substrR($shorttitle, 36); | ||||
| @@ -68,13 +63,12 @@ function __save(){ } | |||||
| $serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
| if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| } | } | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -82,34 +76,27 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //生成文档ID | //生成文档ID | ||||
| $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); | ||||
| if (empty($arcID)) { | if (empty($arcID)) { | ||||
| ShowMsg("无法获得主键,无法进行后续操作!", "-1"); | |||||
| ShowMsg("无法获得主键,无法进行后续操作", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //保存到主表 | //保存到主表 | ||||
| $inQuery = "INSERT INTO `#@__archives`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle, | |||||
| color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename) | |||||
| VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle', | |||||
| '$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','0','$notpost','$description','$keywords','$filename');"; | |||||
| $inQuery = "INSERT INTO `#@__archives`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,color,writer,source,litpic,pubdate,senddate,mid,voteid,notpost,description,keywords,filename) | |||||
| VALUES ('$arcID','$typeid','$sortrank','$flag','$ismake','$channelid','$arcrank','$click','$money','$title','$shorttitle','$color','$writer','$source','$litpic','$pubdate','$senddate','$adminid','0','$notpost','$description','$keywords','$filename');"; | |||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| echo $inQuery; | echo $inQuery; | ||||
| $gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"', '', $gerr), "javascript:;"); | |||||
| ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //专题节点列表 | //专题节点列表 | ||||
| $arcids = array(); | $arcids = array(); | ||||
| $notelist = ''; | $notelist = ''; | ||||
| @@ -154,7 +141,6 @@ function __save(){ } | |||||
| {/dede:specnote}\r\n"; | {/dede:specnote}\r\n"; | ||||
| } | } | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -182,7 +168,6 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match('#p#', $flag)) { | if ($litpic != '' && !preg_match('#p#', $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| @@ -193,10 +178,9 @@ function __save(){ } | |||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | ||||
| $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'"); | ||||
| ShowMsg("把数据保存到数据库附加表 addonspec 时出错,请检查原因!", "-1"); | |||||
| ShowMsg("把数据保存到数据库附加表 addonspec 时出错,请检查原因", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
| $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | $artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | ||||
| @@ -204,8 +188,7 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
| } | } | ||||
| ClearMyAddon($arcID, $title); | ClearMyAddon($arcID, $title); | ||||
| // 自动更新关联内容 | |||||
| //自动更新关联内容 | |||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| if (isset(${$key}) && !empty(${$key})) { | if (isset(${$key}) && !empty(${$key})) { | ||||
| @@ -216,21 +199,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " | |||||
| 请选择你的后续操作: | |||||
| <a href='spec_add.php?cid=$typeid' class='btn btn-success btn-sm'>创建新专题</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看专题</a> | |||||
| | |||||
| <a href='content_s_list.php' class='btn btn-success btn-sm'>已发布专题管理</a> | |||||
| "; | |||||
| $wintitle = "成功创建专题!"; | |||||
| $msg = "请选择你的后续操作:<a href='spec_add.php?cid=$typeid' class='btn btn-success btn-sm'>创建新专题</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看专题</a> <a href='content_s_list.php' class='btn btn-success btn-sm'>已发布专题管理</a>"; | |||||
| $wintitle = "成功创建专题"; | |||||
| $wecome_info = "文章管理::发布专题"; | $wecome_info = "文章管理::发布专题"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功创建专题:"); | $win->AddTitle("成功创建专题:"); | ||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", FALSE); | $winform = $win->GetWindow("hand", " ", FALSE); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||
| @@ -1,5 +1,4 @@ | |||||
| <?php | <?php | ||||
| /** | /** | ||||
| * 专题编辑 | * 专题编辑 | ||||
| * | * | ||||
| @@ -20,7 +19,6 @@ if ($dopost != 'save') { | |||||
| ClearMyAddon(); | ClearMyAddon(); | ||||
| $aid = intval($aid); | $aid = intval($aid); | ||||
| $channelid = -1; | $channelid = -1; | ||||
| //读取归档信息 | //读取归档信息 | ||||
| $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* | ||||
| FROM `#@__archives` arc | FROM `#@__archives` arc | ||||
| @@ -43,27 +41,24 @@ if ($dopost != 'save') { | |||||
| } | } | ||||
| /*-------------------------------- | /*-------------------------------- | ||||
| function __save(){ } | function __save(){ } | ||||
| -------------------------------*/ else if ($dopost == 'save') { | |||||
| -------------------------------*/ | |||||
| else if ($dopost == 'save') { | |||||
| require_once(DEDEINC.'/image.func.php'); | require_once(DEDEINC.'/image.func.php'); | ||||
| require_once(DEDEINC.'/oxwindow.class.php'); | require_once(DEDEINC.'/oxwindow.class.php'); | ||||
| $flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
| $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | $notpost = isset($notpost) && $notpost == 1 ? 1 : 0; | ||||
| if (!isset($tags)) $tags = ''; | if (!isset($tags)) $tags = ''; | ||||
| $channelid = -1; | $channelid = -1; | ||||
| //处理自定义字段会用到这些变量 | //处理自定义字段会用到这些变量 | ||||
| if (!isset($autokey)) $autokey = 0; | if (!isset($autokey)) $autokey = 0; | ||||
| if (!isset($remote)) $remote = 0; | if (!isset($remote)) $remote = 0; | ||||
| if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
| if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
| //对保存的内容进行处理 | //对保存的内容进行处理 | ||||
| $pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
| $sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
| if ($ishtml == 0) $ismake = -1; | if ($ishtml == 0) $ismake = -1; | ||||
| else $ismake = 0; | else $ismake = 0; | ||||
| $title = cn_substrR($title, $cfg_title_maxlen); | $title = cn_substrR($title, $cfg_title_maxlen); | ||||
| $shorttitle = cn_substrR($shorttitle, 36); | $shorttitle = cn_substrR($shorttitle, 36); | ||||
| $color = cn_substrR($color, 7); | $color = cn_substrR($color, 7); | ||||
| @@ -78,13 +73,12 @@ function __save(){ } | |||||
| $arcrank = -1; | $arcrank = -1; | ||||
| } | } | ||||
| $adminid = $cuserLogin->getUserID(); | $adminid = $cuserLogin->getUserID(); | ||||
| //处理上传的缩略图 | //处理上传的缩略图 | ||||
| if (empty($ddisremote)) { | if (empty($ddisremote)) { | ||||
| $ddisremote = 0; | $ddisremote = 0; | ||||
| } | } | ||||
| $litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
| // 处理新的缩略图上传 | |||||
| //处理新的缩略图上传 | |||||
| if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
| $data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
| $ntime = time(); | $ntime = time(); | ||||
| @@ -92,14 +86,11 @@ function __save(){ } | |||||
| CreateDir($savepath); | CreateDir($savepath); | ||||
| $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); | ||||
| $fullUrl = $fullUrl.".png"; | $fullUrl = $fullUrl.".png"; | ||||
| file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
| // 加水印 | |||||
| //加水印 | |||||
| WaterImg($cfg_basedir.$fullUrl, 'up'); | WaterImg($cfg_basedir.$fullUrl, 'up'); | ||||
| $litpic = $fullUrl; | $litpic = $fullUrl; | ||||
| } | } | ||||
| //分析处理附加表数据 | //分析处理附加表数据 | ||||
| $inadd_f = ''; | $inadd_f = ''; | ||||
| $inadd_v = ''; | $inadd_v = ''; | ||||
| @@ -126,35 +117,33 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //处理图片文档的自定义属性 | //处理图片文档的自定义属性 | ||||
| if ($litpic != '' && !preg_match('#p#', $flag)) { | if ($litpic != '' && !preg_match('#p#', $flag)) { | ||||
| $flag = ($flag == '' ? 'p' : $flag.',p'); | $flag = ($flag == '' ? 'p' : $flag.',p'); | ||||
| } | } | ||||
| $inQuery = "UPDATE `#@__archives` SET | $inQuery = "UPDATE `#@__archives` SET | ||||
| typeid='$typeid', | |||||
| sortrank='$sortrank', | |||||
| flag='$flag', | |||||
| ismake='$ismake', | |||||
| arcrank='$arcrank', | |||||
| click='$click', | |||||
| title='$title', | |||||
| color='$color', | |||||
| writer='$writer', | |||||
| source='$source', | |||||
| litpic='$litpic', | |||||
| pubdate='$pubdate', | |||||
| notpost='$notpost', | |||||
| description='$description', | |||||
| keywords='$keywords', | |||||
| shorttitle='$shorttitle', | |||||
| filename='$filename' | |||||
| WHERE id='$id'; "; | |||||
| typeid='$typeid', | |||||
| sortrank='$sortrank', | |||||
| flag='$flag', | |||||
| ismake='$ismake', | |||||
| arcrank='$arcrank', | |||||
| click='$click', | |||||
| title='$title', | |||||
| color='$color', | |||||
| writer='$writer', | |||||
| source='$source', | |||||
| litpic='$litpic', | |||||
| pubdate='$pubdate', | |||||
| notpost='$notpost', | |||||
| description='$description', | |||||
| keywords='$keywords', | |||||
| shorttitle='$shorttitle', | |||||
| filename='$filename' | |||||
| WHERE id='$id'; "; | |||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| ShowMsg("更新数据库archives表时出错,请检查!", "-1"); | |||||
| ShowMsg("更新数据库archives表时出错,请检查", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //专题节点列表 | //专题节点列表 | ||||
| $arcids = array(); | $arcids = array(); | ||||
| $notelist = ''; | $notelist = ''; | ||||
| @@ -218,14 +207,12 @@ function __save(){ } | |||||
| {/dede:specnote}\r\n"; | {/dede:specnote}\r\n"; | ||||
| } | } | ||||
| } | } | ||||
| //更新附加表 | //更新附加表 | ||||
| $inQuery = "UPDATE `#@__addonspec` SET typeid ='$typeid',note='$notelist'{$inadd_f},templet='$templet' WHERE aid='$id';"; | $inQuery = "UPDATE `#@__addonspec` SET typeid ='$typeid',note='$notelist'{$inadd_f},templet='$templet' WHERE aid='$id';"; | ||||
| if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
| ShowMsg("更新数据库附加表 addonspec 时出错,请检查原因!", "-1"); | |||||
| ShowMsg("更新数据库附加表 addonspec 时出错,请检查原因", "-1"); | |||||
| exit(); | exit(); | ||||
| } | } | ||||
| //生成HTML | //生成HTML | ||||
| UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
| $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | $artUrl = MakeArt($id, TRUE, TRUE, $isremote); | ||||
| @@ -233,7 +220,6 @@ function __save(){ } | |||||
| $artUrl = $cfg_phpurl."/view.php?aid=$id"; | $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
| } | } | ||||
| ClearMyAddon($id, $title); | ClearMyAddon($id, $title); | ||||
| // 自动更新关联内容 | // 自动更新关联内容 | ||||
| if (is_array($automake)) { | if (is_array($automake)) { | ||||
| foreach ($automake as $key => $value) { | foreach ($automake as $key => $value) { | ||||
| @@ -245,21 +231,13 @@ function __save(){ } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| //返回成功信息 | //返回成功信息 | ||||
| $msg = " 请选择你的后续操作: | |||||
| <a href='spec_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新专题</a> | |||||
| | |||||
| <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> | |||||
| | |||||
| <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看专题</a> | |||||
| | |||||
| <a href='content_s_list.php' class='btn btn-success btn-sm'>已发布专题管理</a> "; | |||||
| $wintitle = "成功更改一个专题!"; | |||||
| $msg = "请选择你的后续操作:<a href='spec_add.php?cid=$typeid' class='btn btn-success btn-sm'>发布新专题</a> <a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>查看更改</a> <a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>查看专题</a> <a href='content_s_list.php' class='btn btn-success btn-sm'>已发布专题管理</a> "; | |||||
| $wintitle = "成功更改一个专题"; | |||||
| $wecome_info = "专题管理::更改专题"; | $wecome_info = "专题管理::更改专题"; | ||||
| $win = new OxWindow(); | $win = new OxWindow(); | ||||
| $win->AddTitle("成功更改专题!"); | |||||
| $win->AddTitle("成功更改专题"); | |||||
| $win->AddMsgItem($msg); | $win->AddMsgItem($msg); | ||||
| $winform = $win->GetWindow("hand", " ", FALSE); | $winform = $win->GetWindow("hand", " ", FALSE); | ||||
| $win->Display(); | $win->Display(); | ||||
| } | |||||
| } | |||||